Sunday, 21 October 2012

Week 6: Algorithm Questions


Algorithm Questions

         Before this week's lecture, I attempted to solve the problem of folding paper, but I failed. After the lecture, I tried it again, and applied what our professor taught us in lecture. I created a plan, and I was ready to accept that it would be wrong. To my surprise, it works. I checked this way several times to make sure it is correct. However, if you find I am wrong, please leave me a comment to inform me that. Here is my way of solving this problem. (It is a little bit long.)
         First of all, I want to know how many creases the paper contains corresponding to how many times I fold it. I made a table for these numbers.
         #Time #Creases
   1       1
         2       3
         3       8
         4       15
         Then I found that the number of creases is (2^n)-1, where n is the nth time of folding the paper.
         So
         #Time #Creases
   1       2^1-1=1
         2       2^2-1=3
         3       2^3-1=8
         4       2^4-1=15

         Secondly, I want to find the pattern of creases. I made another table.
         #Time #Pattern
         1       D
         2       uDd
         3       uudDudd
         4       uuduuddDuuddudd
         Each row of characters is symmetrically opposite due to the way of folding the paper (Every time you fold the paper from left to right). Each row has a central character which must be D. The last character of each row must be d. Besides that, I discovered that the right side of nth row's D is exactly the entire row of n-1.
         I applied the rules which I discovered to find the 5th row.
         It should be (uuduudduuuddudd D uuduuddduuddudd).

Thursday, 11 October 2012

Week 5: Term Test

During week five's class, we wrote our first term test. The test today consisted of computer history, binary, Dr.Racket codes, and more. After last week's studying, I found binary problems are quit easy. However, because I didn't pay much attention in class, I found computer history part is hard. I predict I will receive very little mark for question one. Fortunately the rest of the test was alright. 

After finishing the test, I though to myself, I will definitely attend each lecture and pay attention to the professor. Not only that, I will for sure study for the test next time!

Friday, 5 October 2012

Week 4: Multiplying & Adding Binary Numbers



Week four focused on multiplication and addition of binary numbers. We focused in class on adding non-negative integers. The lecture was hard, and I was finding it tough to understand. However, when I went back and reviewed the notes, it became easier. I found the tutorial videos are really helpful. 

The key here is to understand that there can only be two variables, "1" and "0"... as well as the fact that it is basic mathematics. The specific rules within multiplying and adding, such as carrying 1's and shifting. Also, know how to convert from binary to decimal is an easy way to ensure your answers are correct.