Friday, October 11, 2013

Solution to Probability: Catch the train

There are many ways to solve this problems including the ones using graphs or integral calculus. Although I've always got good grades for it, I hate advanced mathematics. At least I do not like it when I am at leisure, trying to solve really nice puzzles while stretching on a couch! So, the solution that I would offer would not include any calculus or graphs.

The answer to this puzzle is 7/8

The solution that I used is as follows. Let us find the probability of the man missing the train. Let us divide the total time interval in equal intervals of 5 minutes each:
09:55 to 10:00 T1
10:00 to 10:05 T2
10:05 to 10:10 T2
The man misses the train if he arrives within T2, and the train too leaves within T2, and the train leaves before the man arrives.
The probability of the man arriving within T2 is 1/2. Similarly, the probability of the train leaving within T2 is 1/2.
Now, we need the probability of the train leaving before the man arrives. Now, since the train's departure and the man's arrival are two independent events (with uniformly distributed probabilities), by symmetry it is equally probable that one event occurs before or after the other. Hence the probability of the train leaving before the man arrives (within T2) is 1/2.

So, the probability of the man missing the train is (1/2)*(1/2)*(1/2) = 1/8

The probability that he catches the train, hence, is 7/8.

Friday, June 21, 2013

Solution to the Centrifuge Problem

This is the solution to the problem discussed at http://ankit-mathur.blogspot.com/2013/06/physics-centrifuge-problem.html

We basically need to find out the system which has more kinetic energy.

Both in system 1 and system 2, the disk rotates at the same angular velocity. Now, since the coin is also rotating in the first case, it would have additional kinetic energy. The kinetic energy of the first system is equal to the the sum of the kinetic energy of the second system and the kinetic energy of the coin rotating on its own axis. Hence, the first system has more energy.

Hence we will require more electricity to start the first system from rest.

Sunday, June 17, 2012

Water level problem

This is the solution to the water level problem discussed in my blog ankit-mathur.blogspot.in (alternatively ankitmathur.in).

The box is accelerating in the direction BA, creating a pressure differential between two ends of the box. Since the acceleration is constant, the ratio of pressure at the front and rear end of the box is constant, and so is the ratio between the heights in the tubes.

In simpler words, if the box is accelerating in direction BA then there is a pseudo force acting on the water in the direction AB, which is pushing water in B tube higher.

Wednesday, June 13, 2012

The 8 Ants Problem - The Time Dimension


This one's about the 8 ants problem i discussed in my earlier post. It has just grown more interesting! You had to prove that each ant meets every other ant at least once. A friend of mine just got another witty solution to it. Probably the 'elegant' solution that the friend who first put this puzzle to me talked about.

Consider a three dimensional space with time as the third dimension. The plane in which the ants are moving would be the x-y plane. Now, let us imagine, how the path of the ants looks like - many skew straight lines in the 3-D space. The z coordinate of these lines represents time. Now, if two of the ants meet anywhere at any point in time, their corresponding lines will intersect somewhere: somewhere in the 3-D space, and the z-coordinate of the intersection point would represent the time when the meeting occurred. Now, let lines A and B represent the ants which meet all other ants. These two lines together define a plane (statement 1). Any other line which intersects these two lines has to be coplanar with A and B (statement 2). It means all lines are coplanar. And since all coplanar lines intersect (unless they are parallel) (statement 3), we can say that all ants meet at some point of time (statement 4). Hence proved.

Give some thought to this before you read further.

Being unarguably a more interesting solution than the one I suggested, this one has some terrible flaws. If you can visualize quickly in 3-D, the first flaw would manifest itself quite clearly - what if one of these lines is not coplanar, but meets lines A and B at their point of intersection (i.e. the three lines intersect at the same point)? Now, this partcular line meets A and B and does not necessarily meet other lines. Hence, our solution breaks at this point. However, we can make minor alterations in the problem statement itself, to prevent thee ants from meeting at the same point, or something of that sort.

What really breaks this solution down is this: some of the lines intersect below the t=0 (or z=0) plane. So these meetings, in a sense, are virtual. Since these lines never met in t >= 0 space, the ants never actually met. Any meeting before t=0 cannot be considered as a real meeting.

Hence, the solution breaks down here. A nice thought, though!

Saturday, September 12, 2009

The 8 ants problem

Here's the solution to the 8 ants problem:

Let all ants have different velocities. Since each ant is moving with some constant velocity, the relative velocity between any two ants (V1-V2) will always be constant. Constant velocity means straight line displacement. Hence,

(1) Relative displacement of any ant with respect to any other ant will be a straight ine.

Meaning, if ant A1 looks at ant A3, it will see A3 as moving in a straight line (relative to A1). Now, let A1 and A2 be those ants about which it is given that they meet all others. Let us see from the frame of reference of A1 (A1 is stationary at origin in this frame). A1 will see all ants moving at different velocities along straight lines. But since A1 meets all ants at least once,

(2) The straight line paths of all ants must pass through the origin.

Also, it is true that:
(3) Two straight lines can intersect only once.

Now we know that the locus of all ants are straight lines passing through the origin. Also, if any ant has to meet any other ant, it can do so only at the origin (by (3)). Now, since ant A2 meets all other ants, we can be sure that the meeting happens only at the origin. It is only possible if all the ants reach the origin at the same time. I means that each ant meets every other ant at origin. Hence Proved.

Now, there is a small issue. Not with the solution, but with the problem itself. It is not valid when all the ants are moving in one straight line. (because then, postulate 3 won't hold). I can give you one simple example to show that. Suppose A2 ... A8 are moving in the same direction in a straight line. V2>V3=V4=V5=V6=V7=V8. A2 is lagging all others at this point in time. And A1 is moving in the opposite direction towards all others. Hence, A1 will meet all ants. Also, A2 will meet all ants, as its velocity is greater than all others. But V3..V8 will never meet as they are moving with the same speed along the same line. Hence all ants do not meet.

Saturday, February 23, 2008

The prisoners and the warden puzzle (survival instinct) solution

Following is the solution of one of the most intriguing of the puzzles I've ever come across, the Survival Instinct puzzle, which I discussed earlier in this blog.

The team nominates a leader. The group agrees upon the following rules:

The leader is the only person who will announce that everyone has visited the switch room. All the prisoners (except for the leader) will flip the first switch up at their very first opportunity, and again on the second opportunity. If the first switch is already up, or they have already flipped the first switch up two times, they will then flip the second switch. Only the leader may flip the first switch down, if the first switch is already down, then the leader will flip the second switch. The leader remembers how many times he has flipped the first switch down. Once the leader has flipped the first switch down 44 times, he announces that all have visited the room.

It does not matter how many times a prisoner has visited the room, in which order the prisoners were sent or even if the first switch was initially up. Once the leader has flipped the switch down 44 times then the leader knows everyone has visited the room. If the switch was initially down, then all 22 prisoners will flip the switch up twice. If the switch was initially up, then there will be one prisoner who only flips the switch up once and the rest will flip it up twice.

Tuesday, August 14, 2007

Soln to the Bridge and the Juggler Problem



London bridge is falling down; because a less intelligent juggler is trying his feat over the fragile bridge. This is about the juggler story (Where does the weight go?) which was posted earlier in this blog.

So, we had a classical riddle of a man crossing a bridge juggling all the way thereby reducing the effective weight acting on the bridge. We had to find a way to mathematically disprove this solution.

Note that when the man applies some force on a ball (to throw it up), the ball applies an equal and opposite force on him (downwards). This force gets transferred to the bridge as there is no acceleration of the man in the vertical direction. So, the total force acting on the bridge is the sum of the weight force of the man and the force applied by the ball.

( Let < signify "less than or equal to" and > signify "more than or equal to")

Let T be the time for which a ball remains in air. And let t be the time for which the ball remains in the hands of the man. Since the man has to handle 9 more balls before the first ball returns in his hands,
T > 9t

Let v be the velocity with which the ball leaves the man's hands. This is also the maximum velocity of the ball. Time required for the ball to reach the highest point is T/2. Hence,

v=gT/2


Let the man apply a constant force F on the ball in his hand for a period t while throwing it up. The ball comes down with a velocity v downwards and is thrown back up with a velocity v upwards. Hence the change in momentum of the ball is m(2v), where m is the mass of the ball. Hence,

F = 2.m.v/t + mg

=> 2mv = (F - mg).t



by the inequality of t,


(F - mg).T/9 > 2.m.v

Substituting the value of v,

(F - mg).T/9 > 2.m.(gT/2)

(F - mg)/9 > mg

F - mg > 9 mg

F > 10 mg

It implies that the force applied by each ball on the man would be greater than or equal to the weight of all ten balls. If one juggles, he is effectively putting more force on the bridge than he would otherwise have. Hence, juggling does no good. The strength of the bridge has to be at least 70.9 kg for that man to pass through with those balls; and even with that strength, it's not prudent to juggle.


:) crazy solution: The man might jog around for a couple of weeks and lose some weight :-)

.

Wednesday, June 6, 2007

Solution for "Where does the weight go?"

WE HAD a classical riddle of a man crossing a bridge juggling all the way thereby reducing the effective weight acting on the bridge. We had to find a way to mathematically disprove this solution.

Note that when the man applies some force on a ball (to throw it up), the ball applies an equal and opposite force on him (downwards). This force gets transferred to the bridge as there is no acceleration of the man in the vertical direction. So, the total force acting on the bridge is the sum of the weight force of the man and the force applied by the ball.

( Let < signify "less than or equal to" and > signify "more than or equal to")

Let T be the time for which a ball remains in air. And let t be the time for which the ball remains in the hands of the man. Since the man has to handle 9 more balls before the first ball returns in his hands,
T > 9t

Let v be the velocity with which the ball leaves the man's hands. This is also the maximum velocity of the ball. Time required for the ball to reach the highest point is T/2. Hence,
v=gT/2


Let the man applies a constant force F on the ball in his hand for a period t while throwing it up. The ball comes down with a velocity v downwards and is thrown back up with a velocity v upwards. Hence the change in momentum of the ball is m(2v), where m is the mass of the ball. Hence,

F = 2.m.v/t + mg

=> 2mv = (F - mg).t



by the inequality of t,


(F - mg).T/9 > 2.m.v

Substituting the value of v,

(F - mg).T/9 > 2.m.(gT/2)

(F - mg)/9 > mg

F - mg > 9 mg

F > 10 mg

It implies that the force applied by each ball on the man would be greater than or equal to the weight of all ten balls. If one juggles, he is effectively putting more force on the bridge than he would otherwise have. Hence, juggling does no good. The strength of the bridge has to be at least 70.9 kg for that man to pass through with those balls; and even with that strength, it's not prudent to juggle.

Wednesday, April 18, 2007

Solution to The Clocks' Problem

Problem:

A photograph
is all you've got. It shows two clocks. Two digital clocks. Here's how it shows:

Clock 1
February 29, 2:07 pm

Clock 2
February 29, 2:09 pm

If you're asked, "By how much is the second clock faster than the first?", what would you say?

Solution:

There can be two extreme cases. In one of the cases, when the photograph is taken the time in the first clock is 2pm+7minutes+0.000 seconds (or delta1 seconds) and that in the second clock is 2pm+9minutes+59.999 seconds (or 10 minutes minus delta2 seconds). In this case, the time difference between the clocks becomes 2 minutes and 59.999 seconds : Or 3 minutes minus [delta1+delta2] seconds. As time is continuous, delta1 and delta2 may be infinitesimally small. So 3 minutes is the maximum possible time difference between the clocks.

In the other case, the time in the first clock may be 2pm+7minutes+59.999 seconds (or 8 minutes minus delta1 seconds) and that in the seconds clock may be 2pm+9minutes+0.000 seconds (or delta2 seconds). In this case, similarly, the time difference between the clocks is 1 minute and 0.0001 seconds : Or 1 minute plus [delta1+delta2] seconds. Again, delta1 and delta2 are infinitesimally small in the limiting case. So 1 minute is the minimum possible time difference between the clocks.

The time difference between the clocks, hence, can be equal to any value in the open interval (1 minute, 3 minute). Boundary values are excluded. So if you're asked that by how much is the second clock ahead of the first, you should say it's between one to three minutes.

Tuesday, March 27, 2007

Solution to the 12 coin problem

N.B. : Do not see the solution unless you have given enough time to the problem. If you can't solve the problem it is recommended that you think over it at least for one day before before looking at the solution. Now, the 'close' button is on the top right hand side of the window - close this page and start thinking over this problem. Good Luck. .............. Return to the problem.


The following plan can be followed, let us number the coins from 1 to 12. For the first weighing let us put on the left pan coins 1,2,3,4 and on the right pan coins 5,6,7,8.

There are two possibilities. Either they balance, or they don't. Suppose after the first weighing that the set 1,2,3,4 balances with 5,6,7,8.

Now weigh 9,10,11 against 1,2,3. If they balance, then coin 12 is the unequal coin. Weigh coin 12 against coin 1 to determine whether coin 12 is heavier or lighter.

If instead the set 9,10,11 is *heavier* than 1,2,3, then any one of coins 9,10,11 could be heavier. Weigh coin 9 against coin 10; if they balance, then coin 11 is heavier. If they do not balance, then the coin that weighs more is the heavier coin. If the set 9,10,11 is *lighter* than 1,2,3, then any one of coins 9,10,11

could be lighter. Weigh coin 9 against coin 10; if they balance, then coin 11 is lighter. If they do not balance, then the coin that weighs less is the lighter coin.


That was the easy part.

What if the first weighing 1,2,3,4 vs 5,6,7,8 does not balance? Then any one of these coins could be the different coin. Now, in order to proceed, we must keep track of which side is heavy for each of the following weighings.

Suppose that 5,6,7,8 is the heavy side. We now weigh 1,5,6 against 2,7,8. If they balance, then the different coin is either 3 or 4. Weigh 4 against 9, a known good coin. If they balance then the different coin is 3, otherwise it is 4.

Now, if 1,5,6 vs 2,7,8 does not balance, and 2,7,8 is the heavy side, then either 7 or 8 is a different, heavy coin, or 1 is a different, light coin.

For the third weighing, weigh 7 against 8. Whichever side is heavy is the different coin. If they balance, then 1 is the different coin. Should the weighing of 1,5, 6 vs 2,7,8 show 1,5,6 to be the heavy side, then either 5 or 6 is a different heavy coin or 2 is a light different coin. Weigh 5 against 6. The heavier one is the different coin. If they balance, then 2 is a different light coin.

Thursday, March 22, 2007

Pirates and the Gold Coins

Problem:

There are 5 pirates on a boat, conveniently named 1, 2,3,4,5. These 5 pirates have just dug up a long lost treasure of 100 gold pieces. They now need to split the gold amongst themselves, and they agree to do it in the following way:

Pirate 5 will suggest a distribution of the coins. All 5 pirates will vote on his proposal. If an absolute majority approves the plan, then they proceed according to the plan. If he fails to pass his proposal by an absolute majority, then pirate 5 would be killed, and it becomes 4's turn to propose a distribution of the coins among the remaining 4 pirates. They continue this way until either a) a plan has been approved, or b) only pirate 1is still alive (in which case he keeps the whole treasure).

Can you tell how the treasure would be distributed? How many equilibrium states are possible here? The following points must be noted:

  • Pirates are very smart (rational). They always think ahead.
  • Above all else, a pirate must look out for his own life. No pirate wants to die.
  • After life itself, there is nothing a pirate values more than gold.
  • A pirate doesn't derive any pleasure from killing any of his fellows. Nor does he have any interest in keeping him alive as far as his own payoff is the same. He would take his decision randomly if his payoff is the same.
  • Exactly 50% votes in favour does not constitute absolute majority.


 

Solution:

Pirate 1 would love if all other pirates are dead and he takes away all the treasure.

Suppose 5,4,3 are dead and only 1 and 2 are alive. So it's pirate 2's turn. 1 will vote against 2 and keep all the money. So, 2 doesn't want 3 to die. 1 wants 3 to die.

If there are 1,2,3 left, 2 will vote for 3 and 1 votes against him. So, 3 dies. 2 doesn't want this to happen. So, 2 doesn't want 4 to die. Also, 3 doesn't want 4 to die. 1 wants 4 to die.

So, if 1,2,3,4 are left, it's a good chance for 4. He can keep all the money to himself. Still, fearing for their own life, 2,3 will vote in his favour. In this case, 4 gets 100 coins and 1,2,3 get nothing. So, 4 wants 5 to die.

Now suppose 5 keeps all the money to him. 4 will vote against him. Now, whether 5 dies or not, 1,2,3 still get the same amount. As we have assumed, the pirates don't derive any pleasure from killing their fellows. Nor do they have any interest in saving their lives as far as their own payoff is the same. Pirates may take their decision randomly if their payoff is the same. Now, what if 5 keeps all the money to himself, 1,2,3 may or may not vote for him. Their payoff would in any case be zero and their lives would be safe. But if any one of the three pirates (1,2,3) votes against 5, 5 will have to die as he would have two of the four votes against him.

5 knows this. He won't take this risk. He has to win only 3 votes as he knows 4 will never vote for him. He gives 1 coin each to 1,2,3 and keeps 97 coins with himself. Now, 1,2,3 will vote for him and 4 will vote against him. This is the only possible equilibrium.

Please do bother me if you want any clarifications. Post a comment.

Tuesday, March 13, 2007

Masters of Logic ........ Real Puzzles

Q.1 There are 10 coin making machines. 9 out of them make coins weighing 1 gm each. One (unknown) machine is faulty and makes coins 100 mg heavier. You have an electronic weighing machine (single pan). Can you tell which machine is faulty by using the weighing machine only once?

Q.2 This one's not for kids. There are 12 coins. One of them is slightly heavier or lighter than the others. You have a classical balance with two pans (which only indicates which pan is heavier/lighter). You are allowed to weigh only three times. Can you find out the coin which is different, and also whether it's heavier or lighter?

For solutions, mail me or post a comment.

Masters of Logic : Virtue

Are you interested in ciphers? If each letter is substituted by some other random letter, how would you know the correct letters with no other hints given? There is a particular method of solving this type of problems and generally it involves a lot of guesswork. The longer the text of cipher you have, the easier it is to solve. Some ciphers don't even contain spaces and punctuation marks, making it all the more difficult to break them.

But the one given here is a nice one. It's a poem. I have not deleted spaces and punctuations, and it's long enough. And what's more, it's rhyming too !

Ybffu cst, yv ivvn, yv isnp, yv lejwku,

Ukf lejcsn vh ukf fseuk sgc yqt,

Ukf cfb yksnn bffo ukt hsnn uvgjwku;

Hve ukvx pxyu cjf.


Ybffu evyf, bkvyf kxf sgwet sgc lesrf

Ljcy ukf esyk wszfe bjof kjy ftf,

Ukt evvu jy frfe jg juy wesrf,

Sgc ukvx pxyu cjf.


Ybffu yoejgw, hxnn vh ybffu csty sgc evyfy,

S lva bkfef ybffuy ivposiufc njf,

Pt pxyji ykvby tf ksrf tvxe invyfy,

Sgc snn pxyu cjf.


Vgnt s ybffu sgc rjeuxvxy yvxn,

Njqf yfsyvgfc ujplfe, gfrfe wjrfy;

Lxu ukvxwk ukf bkvnf bvenc uxeg uv ivsn,

Ukfg ikjfhnt njrfy.


You could crack it using machines. But I suggest you use the one installed over your ears. If you crack it, let me know. Post it in the comments.


HINTS


This type of ciphers are known as monosubstitution ciphers. Some of the monosubstitution ciphers have a keyword with which the whole text can be decoded. This one is slightly more difficult as it has no keyword. Each letter in the alphabet has been randomly assigned some other letter. Suppose if 'a' stands for 'g' somewhere, then it is true for the whole text. Now let us see how to find that out.

We should use the letter frequency method. Letter 'E' is most frequently used in English, followed by T, A, O, H, N, I ans S respectively. This knowledge may be used to identify some of the letters in the code. Next, notice the two-letter words. Most frequently used two-letter words n English are 'of', 'to', 'in', 'it', 'is', 'be', 'as' in this order. (source : _http://deafandblind.com/word_frequency.htm)

The letter frequency distribution for this code is as follows:


A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
1 14 17 0 21 54 15 6 8 21 25 7 0 21 4 8 2 8 25 12 32 30 8 15 37 1



Hint for this problem : 'u' in the cipher stands for 't'.


Monday, March 12, 2007

Test

This is a test post

Test post


Thursday, March 8, 2007

Can I find a trick recalling pi easily?

Now how do these lines make sense to you?

  • Now I want a drink, alcoholic of course, after the heavy chapters involving quantum mechanics.
  • Can I have a large container of coffee?

These are what are known as mnemonics. They help you remember certain numbers and relations. The number of letters in each word of these sentences represents a digit in ...(yes, you guessed right).......Pi.

So, the first sentence gives:
3.14159265358979
which is the value of pi upto 14 digits after decimal.

The following mnemonic I had memorized long ago. It gives the value of pi up to 31 decimal places. (For the 32nd place you could just remember my first name "ankit")

Now I, even I, would celebrate
in rhymes unapt, the great
immortal syracusan, rivaled nevermore,
who in his wondrous lore,
passed on before,
left men his guidance,
how to circles mensurate.

I should have given proper credit to the creator but unfortunately I do not remember the name. (Strange memory I've got ! )

The following mnemonic is still better:

Man, I can't, I shant
formulate an anthem where the words comprise mnemonics
dreaded mnemonics for pi
The numerals just bother me, always
even the dry anterior
try to request something lower (zero)
in numerary aptitude, even I, pantaloon gallant
I cannot actualize the requested mnemonics
the leading fifty, I...

It gives the value of Pi up to the first fifty digits (i.e. 49 digits after decimal). And it's singable too !

An approximate value of pi is:

3.1415926535897932384626433832795028841971693993751058209749445923078164062

862089986280348253421170679821480865132823066470938446095505822317253594081

284811174502841027019385211055596446229489549303820

Some other pi-mnemonics are:
  • Pie. I wish I could determine pi. "Eureka!" cried the great inventor. "Christmas pudding, Christmas pie, is the problem's very center!"
  • For a girl I loved contrived; by nature tough, her heart survived.
  • How I wish I could calculate pi faster.
  • But I must a while endeavour to reckon right the ratio.
And if you haven't already guessed it, the title of this post itself is a pi-mnemonic.

Monday, March 5, 2007

Masters of LOGIC

I was just thinking about cd's and magnetic tapes when a quirky problem came to my mind. How much physical space do we really need to store a particular amount of information? Maybe CS/IT guys have a straightforward answer for this.

Anyways, how would you store, say a three page letter on a metre stick? (A one metre long thin cylindrical metal stick). Write on it? Of course you can write in very small size letters. But is there any other method? Make some marks or something. What is the most bizarre method? Suppose matter is continuous and you have technology to achieve any level of precision you want. Suppose we have machines that can read (and make) the minutest of marks with infinite degree of precision.

Now can you encode an entire book on that rod (in a retrievable format, of course) by making a single mark on it?

A book on a metre stick

Here is one of the solutions of the above problem. The problem is that we have to encode some large amount of information on a stick of one metre size using only one mark on the stick.

Let's see how we can do it. There are 26 letters from A to Z, 10 numbers, many special characters. Assign a two digit number to each of the letters, numerals, 'space' and special characters. (As they do in ASCII. Or else use a three digit number instead of two)

Now for the entire text we have a series of numbers and putting them together we get a very large number (say b). Now put a mark on the stick such that it divides the stick into the ratio a/b, where 'a' is a pre-decided number (say 10^1000000) and b is the large number we have got.

Now if have an infinite degree of precision in reading, we can always retrieve that text again!

Of course, some of the assumptions are highly chimerical - but anyways it was just a thought exercise !