Saturday, March 01, 2008

Two puzzles

I was counting a bunch of cash recently (Arvind will know why) and I got this puzzle idea. I've noticed that I'm really bad at counting cash (or other things), there is some way or the other that my mind gets distracted and I end up never knowing whether I counted correctly or not. So: is there a foolproof method of counting ? Point is -- it can be contrived and laborious, but it should not depend on your concentration, so that at the end you *know* whether you counted right or not. Like a checksum !!!!
One example solution would be to count in batches of 5 and then number the 5*n the note clearly. That way even a ADD-ed person like me would like get the individual bunches right and you even have a numbering to help you recount if you have to. Not a clean or elegant solution but might help you to get my point. Any more solutions ?

The other puzzle is a really cool one I saw at the Vishweshwareya Museum in Bangalore, which despite being a little decreipt, is actually pretty world-class. This is a maths puzzle. Its a board game with 20 positions arranged in a circle. Two people play the game. You have a marker which you can move 1 or 2 steps, and then the other person moves the marker. The person who reaches the 20th square is the winner of the game. The question is: is there a winning strategy to this game ? This is like tic-tac-toe, where there is a strategy where the starting person always wins. This one's strategy is a lot tougher, but I think I cracked it. There was an even tougher version of the game, where I was completely at sea, but I forgot the game so can't mention it here.

5 Comments:

Anonymous Anonymous said...

For the second puzzle the first person can win with the following strategy

( a ) Playing at 19 or 18 is a winning position.
( b ) Playing at 17 is a losing position because you can only leave the opponent at 18 or 19.
( c ) Playing at 16 or 15 is a winning position because you can play 1 (on 16) or 2 (on 15) and leave the opponent on 17 which is a losing position.
( d ) the losing positions are 17, 14, 11, 8, 5, 2.
So first player plays 2. There after he plays so that the sum of his move and the opponents is 3.

So after the first players first move to 2, suppose the second player plays 2 bringing the total to 4, the first player plays 1 and brings the total to 5 which is a losing position.

Let me think about your counting problem. Its a bit vague so requires more thought.

Arvind

7:20 AM  
Anonymous Anonymous said...

Assuming you have problem counting but not in doing mechanical operations heres what you can do.

Form two piles by placing notes first in column 1 and then in column 2. Keep count of the notes in column 1 only. If you finish on column 2 do nothing, else place the last note on column 1 perpendicular to the pile to signify that you have an odd number of notes to start with. Suppose column 1 has 23 notes and the last note was placed on column 1 we should expect column 2 to have 22 notes. If the last note was placed on column 2, we should expect column 2 to have 23 notes.

We can simplify the check sum by taking column two and repeating the procedure above to form another two columns 2_1 and 2_2. Again we keep track of column 2_1. If we were expecting 23 notes in column 2 then column 2_1 should count to 12. If we were expecting 22 then it should count to 11.

So in my procedure we count half the notes first in column 1 and a quarter of the notes in column 2_1 to form the check.

Of course, I could say form 5 piles instead of 2, but you get the point.

Arvind


So far we have not counted

8:07 AM  
Anonymous Anonymous said...

Hey, I think I have an elegant way of solving your first puzzle. This is an extension of the above method that leaves us with no counting at al, just one summation. This is a recursive procedure.

1. Place cards into two piles starting with column 1 and then column two. If there are an odd number of cards place the last card on column 1 and place this card perpendicular to the rest of the cards in column 1.

2. Take column 2 and again split into 2 more columns using the procedure in 1. Call these columns 2 and 3 and place the additional card on column 2, perpendicular to the rest of the cards.

3. Keep doing the above until we are finally left with a column with just 1 card.

4. Now the last column will have 1 card. The last but one column will have 1 card plus another if there is a perpendicular card at the top. With a little bit of reflection you will see that say the 5th column will contain the sum of all the cards from columns 1 through 4 plus one more card if there is a perpendicular card on the 5th column. So sum of all columns from 1 through 5 = 2*sum of all columns from 1 through 4 plus 1 if there is a perpendicular card. This is a simple recursive sum that can be done with not much error.



Arvind

10:40 AM  
Anonymous Anonymous said...

Hey:

I tried calling your sister. Can you check if she got the Fedex?

Arvind

3:20 PM  
Anonymous Anonymous said...

BTW, the checksums in the algorithm are built in. Since we know that the kth column from the right should have the same number of notes or cards (except if there is a perpendicular) as the sum of the first k-1 columns from the right, we can use that as a check.

Of course we implement the check elegantly. We take the kth column, except for any perpendicular card, and apply the same algorithm. We should expect to see the same pattern as the k+1th columnb on to the end.

The advantage of this approach is that that you have only order of log(n) columns. So 2^10 = 1024 notes requires only 10 columns. This is better than having a fixed column size of say 10 cards, and then 102 columns + 4 extra cards should we have 1024 notes. For this not so efficient algorithm we have to count the number of columns carefully (102) and be careful in counting each column. However, in the proposed approach we are not counting any of the columns, just being careful in splitting any column of notes into two. Which is a whole lot easier.

Arvind

3:48 PM  

Post a Comment

<< Home