Sunday, November 23, 2014

HALT?!

    This past week we only had 2 lectures because of the fall break! We started looking at halting problems and computability of functions.

    All of this stuff makes no sense to me whatsoever... I have no idea what's going on so I think I should really look at the course notes on halting and computability and go over the lecture slides as well. And if I still don't understand it by then I should probably go to office hours to clear things up before the exam! I should probably start on assignment 3 as well... Hopefully I won't have that much trouble with assignment 3 as I did with assignment 2 when I just just starting to understand proofs.

Edit: So after reading a few SLOGS from other students, I found a SLOG that was able help me with understanding the basic concept of halt using a small diagram: click here to understand halt!

Monday, November 17, 2014

Problem Solving (Folding)

Earlier in the course we were presented with a problem. We had to take a strip of paper and fold it in half several times. We then had to unfold it to determine the sequence of the crease points (either up or down). We then had to predict the sequence for any number of folds.

We started by folding the strip of paper in half and unfolding it back to the original strip. We then recorded the crease point into a table. This was repeated 4 more times until we had the strip folded 5 times.


When we had the pattern recorded in a table like this, we started to see how the pattern of the creases repeats itself. We then decided to align the pattern so that all the middle creases line up.


After the alignment we saw how the pattern was symmetrical but the creases were flipped depending on which side they were on.

We also saw how the middle crease was always a down crease. We also saw that everything to the right of the middle crease was the previous pattern and everything to the left of the crease was the previous pattern but flipped (D turned into U and U turned into D).

We also observed how the number of creases increase with a pattern. The number of creases can be determined by taking the number of creases from the previous pattern/number of folds multiplying it by two and adding one. So, if the function C(p) gives us the number of creases based on the pattern, we can determine the number of creases of the next pattern by using this equation: 2 * C(p) + 1. This means that we don't even have to know the current pattern to determine the number of creases, we just need the previous pattern!

So with that being said, we can determine the number of creases if the strip of paper was folded 6 times.

# of creases with 6 folds = 2 * (31) + 1
                                        = 63 creases

And with some extra time on our hands, we can also determine the pattern for 6 folds based on our analysis.

UUDUUDDUUUDDUDDUUUDUUDDDUUDDUDDDUUDUUDDUUUDDUDDDUUDUUDDDUUDDUDD

Another student solved this problem and was able to determine the pattern for the first 10 folds using some code that he typed up in python! TAKE A LOOK AND SEE FOR YOURSELF!

Monday, November 10, 2014

Week 6-9

    Over these few weeks we continued with proofs. I found the proofs on assignment 2 to be quite challenging but it did help me with getting a better understanding of proofs and coming up with the 'body' for different proofs. Shortly before the second term test we started to learn about counting steps by determining the amount of iterations of loops or lines in the given code. We also starting to learn about Big O and Big Omega. And with that we can determine the upperbound and lowerbound of an algorithm's run-time in the worst case scenario.