Wednesday, March 6, 2013

A day in the life of a Computer Science student.

So today I impersonated a Computer Science student, and attended CSE 340, a class that Dr. Bazzi teaches. It was very interesting, and quite different from my current Computer Science class at BASIS. First of all, at the 340 level, the students are assumed to know how to program, so the course is not teaching students to program. Instead, it is much more abstract and theoretical, like the difference between learning Calculus and learning Calculus-based Physics. It is already assumed that you know Calculus when you enter a Calculus-based Physics class. For example, in my current CS class we learned about variable types and their significance. In CSE 340, we learned about what makes data types equivalent and to what extent can we allow them to be equivalent. Let me explain.

Equivalence Types:

There are two basic forms of equivalency, name equivalency and structural equivalency.

According to name equivalency, we can say that two types are equivalent if they are declared to be of the same built-in types or the same programmer-named type. This is a simple definition, created by the syntax and semantics of specific programming languages, but why are they defined this way? What are the underlying reasons for name equivalency? That's where structural equivalency comes into play.

Structural equivalency is where the definitions get much more complicated. When we got to this point in Dr. Bazzi's class, he projected a sheet of information onto the board that looked more to me like Math than Computer Science. I quickly copied down five definitions of structural equivalency.

The following are the limitations that Computer languages must follow when defining their variable's equivalency rules, called permissive structural equivalency.


We can say T1 and T2 are structurally equivalent if
1. T1 and T2 are the same basic type
 
2. T1 = pointer to t1
     T2 = pointer to t2
 
3. T1 = struct {
a : t1;
a2 : t2
}
     T2 = struct {
         a : t1
 a2 : t2
    }
    and ti is tructurally equivalent to t'i for i'=1 to k
 
4. T1 is array range1 of t1
     T2 is array range2 of t2
     AND
  a) range1 and range2 have
 (1) the same number of dimensions and (2) the same number of entries in each dimension
  b) t1 and t2 are structurally equivalent 
5. T1 = fuction of (t1, t2, ... tk) returns t
     T2 = function of (t'1, t'2, ... t'l) returns t'
 AND
  a) is structurally equivalent to t'i and
  b) t is structurally equivalent to t'

It's amazing how much Computer Science is similar to Math. As Dr. Bazzi told me in our first meeting, "Math is very important. Computer Science is just another way to write Math."

I enjoyed getting a glimpse into the world of a Computer Science student at ASU, and I hope you enjoyed reading about it. Stay tuned!

-Jeff

1 comment:

  1. That is very interesting to know the term of permissive structural equivalency.
    Math might be very helpful in improving algorithm.

    ReplyDelete