More puzzles…

Some of these are from Heard on the Street – a book of interview questions for Quants I’m trying to get through. Well worth a read if you’re into this sort of thing…

1. Two ropes of different lengths, and you know that if you were to light either of them at one end it burns through in an hour. How can use use them to measure 45 mins?

Light the first of them at both ends, and at the same time the second at one end. When both lit ends of the first meet (after 30 mins), light the second end of the second rope (which should take another 15mins to meet the other lit end).

Bonus points on this one: is it a condition for this approach to work that the ropes burn at a constant rate?

2. Two identical jugs, one with water, one with vodka. You pour a bit of vodka into the water, mix it, then pour the mix back to get the jugs to their original volumes. What’s the relationship between the new concentration of vodka in the vodka jug and water in the water jug?

Like a lot of these, getting straight into the algebra is not a good idea. The key here is that the volume of vodka and water remains the same. Any that displacement of (say) vodka from the vodka jug must have been replaced by an identical amount of water – so in effect same amounts of vodka and water have just swapped places, and the concentrations are the same.

3. Imagine you’re an ant (you can walk on walls but not fly) and you want to get from a bottom corner of a cubic room (1*1*1) to the extreme opposite corner (farthest from you). What’s your shortest path to get there?

If you said walk diagonally along the floor to the opposite floor corner, then up the joint in the walls to the ceiling corner – a distance of 1 + sqrt(2), think again. Think of the room as a box that’s been laid flat, with the sides out so it’s like the cross on the swiss flag. The distance between the two corners in question is sqrt(5).

4. Let’s say you have a bunch of 1*1*1 mini-cubes that you’ve assembled into a 10*10*10 big cube. Now let’s say the whole outer layer of the big cube becomes damaged and has to be replaced – how many new mini-cubes do you need?

Two ways of doing this – the Plodders way and then a smart way. A Plodder would say you need a top and bottom layer (10*10 + 10*10 = 200) and 8 ring layers (8 * (10+10+8+8) = 288). Total 488.

The smart way is to think about the inner cube that’s left, which is 8*8*8, or 8^3. So your answer is 10^3 – 8^3. You should be able to do this in your head: 10^3 is 1000. 8^3 is the same as (2^3)^3, or 2^9. Everyone knows 2^10 which is 1024. 2^9 is half that, 512. 1000-512 is 488.

5. Say there are 100 lights with switches (initially off), and 100 people. The first person goes through and flips every switch (so all the lights are on). The second person flips every second switch, so at this point half the lights are off again. The third person every third switch, and so on. By the time the 100th person goes through he just flips switch #100. At the end, how many light bulbs are turned on?

The trick here is to understand that the number of times a switch gets flipped depends on the number of factors that switch number has. So for example switch #6 has an even number of factors – 1,2,3 and 6 – so it ends up off. You’ll see that most numbers have an even number of factors because they have product pairs (for example, 1 and 6, and 2 and 3). Which numbers don’t have product pairs? Well, they all have product pairs, but in some cases both numbers in the product pair are the same – when the number has an integer square root. So for example the product pairs for 9 are 1 and 9, and 3 and 3. So the people who flip the #9 switch are 1, 3 and 9 – an odd number that leaves the light turned on. So the lights left on are these “perfect squares” of 1, 4, 9, 16, 25, 36, 49, 64, 81 and 100.

This entry was posted in puzzles and tagged , , . Bookmark the permalink.

2 Responses to More puzzles…

  1. benkster says:

    Am I a sqrt(quant) if I got the 10^3-8^3 immediately, and then decided that the ‘plodders’ way was easier math?

  2. porksauce says:

    The ropes do not have to burn at a constant rate, because you’re burning all of both ropes.

    My initial solution was to fold one rope in half and the other in quarters. That would require a constant burn rate.

Leave a Reply

Your email address will not be published. Required fields are marked *