Friday, 5 April 2013

Last but not the least...

   Today is the last day of classes and I am going to certainly miss this course. Although, in the beginning I had a lot of complains about the timing of the course and the weather and blah blah blah, but now I am finally glad that at the end of the day, I have a positive feeling about this class. Due to this class, I got to spend some time with my friend, without whom the journey experienced in this class would have been incomplete. We got to learn about the history of computers and DrRacket, a programming language that was absolutely alien to me in the beginning.However, now I am familiar with the programming environment and able to make and understand program codes. Also, one thing I really like about DrRacket is it's syntax. Compared to other programming languages, it is simple and concise. I also enjoyed Professor Heap's teaching style. I am looking forward to taking some computer science courses in my future years of study. I just submitted the last project of this class. This project was a little easier compared to project 1, or maybe that's because we started early this time. We still have the exam left. I hope it is not too hard, and that we have enough time to complete the paper, unlike the term tests. Good Luck to y'all for your exams, study well

Thursday, 4 April 2013

Mathematical problem: Penny Piles


Reading thoroughly through the problems posted by professor Heap, the first one, "Penny Piles" drew my attention. The problem states that there are 64 pennies in the left drawer and 0 in the right one, and requires us to arrange the pennies in a way that one of the drawer ends up with 48 pennies. We are given the left and right operations. In both cases, if there are even number of pennies, half of those can be transferred to the other drawer(left, if in right or right, if in left), but this step will be omitted for odd number of pennies.

Understanding the problem 
  • Two drawers, the left one has 64 pennies and the right one has 0
  • Need to find a way in which one of the two drawers possess 48 pennies
  • Have to use left and right operations given(listed above)


Devise a plan
  • To begin with, one of the drawers should have even number of pennies
  • Use a visual representation to enhance the understanding of the problem. 
Carry out the plan
  •  The left drawer has 64 pennies, hence, we can proceed with the left operation by transferring half of the 64 pennies into the right drawer. 

  • Now, both drawers have 32 pennies, and we can repeat that operation. 

  • This results in the left one having 16 pennies and right 48, our desired amount of pennies. 
  • If you create a binary tree it will continue till there are odd numbers in both the drawers using both operations 
Looking back at the process: 
  • If we continue the tree from the last flow-chart displayed, it will be a tedious, lengthy chart until all the outputs in the left and right drawers are odd-till further proceedings become impossible. 
  • From the three hints provided, the tree is an easier and visual process that helps to see the solution instantly. Working backwards is also an essential method. 

  • Also, according to hint 2, we would get 24 after splitting 48-we would have 24 in left and 50 in right.We will get 12 when we split 24-where the left drawer would have 12 and the right would have 52. 
  • 64 is an ideal number, as it is the smallest even number with 7 divisors. Additionally, if we begin from the same initial position, we can arrange things in such a way that we can get any desired amount of pennies in a drawer in the range of [0,64], having 29 and 9 as they're only exception.
  • We can also start off from a different initial number in the left drawer, though, it can neither be a zero nor an odd number. 
  • Although, complexities may arise if it initially started with a different number, various mathematical and logical techniques can be used to solve the problem, just like discussed and illustrated above.