Thursday, 4 April 2013

SLOG Assignment


You are sitting in front of two drawers. The left drawer contains 64 pennies, the right drawer contains
nothing. Can you arrange things so that one of the drawers has 48 pennies, using combinations of the
following two operations, l and r?

L: If the left drawer has an even number of pennies, you may transfer half of them to the right drawer. If the left drawer has an odd number of pennies, operation l is disallowed.

R: If the right drawer has an even number of pennies, you may transfer half of them to the left drawer. 

If the right drawer has an odd number of pennies, operation r is disallowed.

Choose another number in the range [0,64]. Starting from the same initial position, can you arrange
things so that one of the drawers has that number of pennies? Are there any numbers in that range that
are impossible to achieve? What about starting with a different number of pennies in the left drawer?


Understand the problem.
- There are two drawers - Right and Left
- There are 64 pennies
- These 64 pennies are in the Left drawer.
- There are no pennies in the Right drawer
- You have to arrange the pennies in a way so that there are 48 pennies in one drawer.

Devise a plan.
- Start off with the 64 pennies being in the Left drawer.
- Divide the number of pennies in half and carry it over to the other drawer
- Continue this until you have 48 pennies in one of the drawers
- Create a flow chart to better understand the steps of this process.

Carry out the plan.
- The Left drawer has 64 pennies and the Right has none,
- Since 64 is a even number, 32 of it will be transferred to the Right drawer
- Assuming the the drawers will take alternative turns in making the transfer, this time the transfer of half the pennies will be made by the Right drawer.
- At this point, both drawers have 32 pennies
- Right transfers half which is 16 to the Left drawer
- Now, Right has 16 pennies and the Left has 48 ( 32 from the previous step + the 16)
- This goes on until we reach the combination 43 -21 which is when neither of the operations are allowed.

Extra 

- There are no other numbers other than 64 from 0-64 that you can start with in order to have 48 in one drawer other than when you start with 48 in one and 0 in the other. This is assuming that you always start with 0 pennies in one drawer and the multiples of 2 in the other drawer.
- If you try other combinations, since one of the drawers must always have an even number of pennies to make sure that they can be equally divided, the other drawer automatically ends up having another even number of pennies . As shown below.

 64-0, 62-2,60-4 , 58-6, 56-8, 54-10, 52-12, 50-14, 48-16, 46-18, 44-20, 42-22, 40-24, 38-26, 36-22, 34-30, 32-32, 30-34 .......

You can see a pattern here: Both numbers are always even. why ? Because in order to make one drawer even, to make at least one operation allowed, you end up taking away an even number of pennies from 64 all the time. And when you take away even numbers from bigger even numbers, you only end up with more even number since all even numbers are multiples of two!


Look back, figure out when and how you're stuck.
- I was stuck in the very beginning while thinking about how the drawers will alternative in the exchange, if they will.Then I realized that it does not matter since the requirement is that any one of the  drawer contains 48 pennies.

Wednesday, 3 April 2013

Week 11

No tutorial !! :O yay ! no offense to the TAs .. we love you very much !

This week was about work. Work hours and how computers has changed the nature of work. We can now get things done faster and more efficiently, we work without even being at the workplace, we have machines to do the hard labor etc. All in all  whether computers have made the work environment a better place (utopia) or a not so better place (dystopia).

Week 10

This week we learned about operating systems and network ! The more interesting thing this week was however the recursion ! It was just the Sierpinski triangles where you had a condition but this was way more interesting since this time we learned to make it do so many cooler things !

Moving on... This week was also when part three  of the Wikipedia was due. Although I had picked 4-5 pages to edit in the first stage of the project, I later realized that despite the fact that these pages were marked as needing copy edits, when I read through them, they seemed to not be needing any. So I ended up editng only 3 of them.  I added more information to one page that was on a film, one on the new Indian rupee symbol and one on a sports stadium in Asia. I actually received feedback from one editor asking me to make sure I completed the edit summary and also gave me few other tips. I have to admit , I found this project very engaging and rewarding when I found out that the new wikipedia pages for the ones I edited contains my contributions especially because I knew a couple other people who were complaining about their work being deleted , Overall I really enjoyed this wikipedia assignment and I think that I really did contribute to that community which was the purpose of this assignment in the first place.