Devise a DFSA that accepts the language of strings over f0; 1g with an odd number of 1s and and even number of 0s. ('*' = '>')
Empty String --> A
A + 0 ---> C
A + 1 ---> E
E + 1 ---> D
D + 1 ---> E
C + 0 ---> D
D + 0 ---> C
E + 0 ---> B
B + 0 ---> E
C + 1 ---->B
B + 1 ---> C
(sorry i couldn't draw a picture.. I tried to make one text based and it turned out disgusting)
A -> empty string only
B-> odd # of 1's, odd # of 0
C-> even # of 1's, odd # of 0
D-> even # of 1's, even # of 0
E-> odd # of 1's, even # of 0
Wednesday, 28 November 2012
Saturday, 17 November 2012
P to the E to the Y
I just had a conversation with an upper year student who just finished is PEY and is pursuing a Specialist in Physics and Computer Science. Many interesting things popped up during the conversation, but one of them stood out from the rest; summer research.
It seems that the majority of us are just planning to finish a bachelors in Com. Sci and head out into the working force, and there is absolutely nothing wrong with that! Everyone knows that the demand for computer scientists are growing dramatically and that there will be a ton of jobs available (especially since we graduated from U of T). But there will be a point where you will be fighting to get that promotion, or that salary raise in you job. This is where your past experiences come into play. Experience indicates that you have been exposed to ___ (whatever this topic is) and worked on it to a fair degree. You instantly become more trustworthy and responsible in the eyes of whomever you're working for. This is why PEY is very important. You are basically given a change to leave your studies for a year and go into the practical applications, while being paid around 40 thousand. Not only that, you become close with your co-workers and boss', which also give amazing recommendation letters. According to the com. sci website, over 50% of the students land a permanent job at the end of PEY (whether they take it or not is not the point). In general, I feel like PEY is something everyone should try. Though I haven't given it a shot, I'm pretty confident that it is something I will not regret.
It seems that the majority of us are just planning to finish a bachelors in Com. Sci and head out into the working force, and there is absolutely nothing wrong with that! Everyone knows that the demand for computer scientists are growing dramatically and that there will be a ton of jobs available (especially since we graduated from U of T). But there will be a point where you will be fighting to get that promotion, or that salary raise in you job. This is where your past experiences come into play. Experience indicates that you have been exposed to ___ (whatever this topic is) and worked on it to a fair degree. You instantly become more trustworthy and responsible in the eyes of whomever you're working for. This is why PEY is very important. You are basically given a change to leave your studies for a year and go into the practical applications, while being paid around 40 thousand. Not only that, you become close with your co-workers and boss', which also give amazing recommendation letters. According to the com. sci website, over 50% of the students land a permanent job at the end of PEY (whether they take it or not is not the point). In general, I feel like PEY is something everyone should try. Though I haven't given it a shot, I'm pretty confident that it is something I will not regret.
Saturday, 10 November 2012
CSC236 Fall 2012 Quiz #5 (My solution)
BinSearch(A, first, last)
if A[first] == A[last] ---------------------1
return A[first] ---------------------2
mid = floor((first+last)/2) ---------------------3
if A[mid] > A[mid + 1] ---------------------4
return BinSearch(A,first,mid) ---------------------5
else
return BinSearch[A,mid,last] ---------------------6
Lines 1-4 will execute once, so it will be of theta(1) at max.
The rest of the code approximately runs around half times the length of n,
so we will write that as the ceiling of n/2, as we dont' want to lost any iterations
by using the floor value.
This creates
T {theta(1) n = 1
theta(ceil(n/2)) n>1
}
Then T(n) = theta(1) + Theta(ceil(n/2))
Then a = 1
Then b = 2
Then d = 0
if A[first] == A[last] ---------------------1
return A[first] ---------------------2
mid = floor((first+last)/2) ---------------------3
if A[mid] > A[mid + 1] ---------------------4
return BinSearch(A,first,mid) ---------------------5
else
return BinSearch[A,mid,last] ---------------------6
Lines 1-4 will execute once, so it will be of theta(1) at max.
The rest of the code approximately runs around half times the length of n,
so we will write that as the ceiling of n/2, as we dont' want to lost any iterations
by using the floor value.
This creates
T {theta(1) n = 1
theta(ceil(n/2)) n>1
}
Then T(n) = theta(1) + Theta(ceil(n/2))
Then a = 1
Then b = 2
Then d = 0
Saturday, 3 November 2012
Team Project Hustling
Most of us are taking CSC207 at the same time as this course. And to all of those who are, we are aware of this 4 man group project which is due within a week's time. This to me feels like the first REAL group project I had in university. Our task was to make a "program" that takes user inputs which are in the form of commands, and execute it. It's tricky, since everyones code is dependant on the others and you cannot finnish this assignment without cooperating with the others. From what I remember in High School, there is usually one person who does the majority of the work the night before the project is due and the other group members just "hang around" to ensure that the project is finished on time. Thing with this is that the TA's can check when you did work and when you updated your last entry, so essentially your TA will know if you did everything in the last minute, and who in the group did what.
I personally like this setting because it feels very much like what I would expect real group projects in the real world to be. Also, everyone in the group is actually working. It isn't one of those groups where one person is the "leader" and tells everyone else what to do. Everyone in here has a say in what's going on because everyone is at the same level. I hope most, if not all of our group projects follow this trend.
I personally like this setting because it feels very much like what I would expect real group projects in the real world to be. Also, everyone in the group is actually working. It isn't one of those groups where one person is the "leader" and tells everyone else what to do. Everyone in here has a say in what's going on because everyone is at the same level. I hope most, if not all of our group projects follow this trend.
Subscribe to:
Posts (Atom)