Medium | Probability |

A line of 100 airline passengers is waiting to board a plane. They each hold a ticket to one of the 100 seats on that flight. For convenience, let's say that the nth passenger in line has a ticket for the seat number 'n'. Being drunk, the first person in line picks a random seat (equally likely for each seat). All of the other passengers are sober, and will go to their proper seats unless it is already occupied; If it is occupied, they will then find a free seat to sit in, at random.

What is the probability that the last (100th) person to board the plane will sit in their proper seat (#100)?

What is the probability that the last (100th) person to board the plane will sit in their proper seat (#100)?

Hint

Can last passenger arrive at any other seat than 1 or 100?

Answer

1/2

Solution

Notice that the last passenger can only take seat #1 or #100. If any passenger takes seat #1, the cycle stops, and all the subsequent passengers take their own seats (including last). Otherwise, if #100 seat is taken before #1, the cycle is paused, i.e., the subsequent passengers do take their own seats, but the last passenger would take seat #1. Now for any passenger from 1st to 99th, who is picking random vacancy, will choose between #1, #100 or any other seat equally likely. Thus, by symmetry, #1 or #100, any one will be taken first - with equal probability. Hence last person ends up at his seat with probability 0.5

Medium | Probability |

A stick is broken into 3 parts, by choosing 2 points randomly along its length. With what probability can it form a triangle?

Hint

All three broken parts must satisfy the triangle inequality. Or rather, each of the broken part must be less than half of stick's length.

Answer

1/4

Solution

All 3 sides have to have lengths less than half the length of the stick. the conditions are min{ x.y}<= 0.5; max{x,y}>=0.5; |x-y|<=0.5 . looking at the unit square, and dividing into 8 congruent triangles by lines parallel to the axes and y=x line, its easy to see 2 of the 8 triangles satisfy the condition. so the answer is 1/4

Source: Quant Interview

Enable Like and Comment Medium | Discrete Maths |

A rabbit sits at the bottom of a staircase with n stairs. The rabbit can hop up only one or two stairs at a time. What kind of sequence is depicted by the different ways possible for the rabbit to ascend to the top of the stairs of length n=1,2,3...?

Hint

Recursion

Answer

Fibonacci Sequence.

Solution

Suppose f(n) are the number of ways to reach nth stair. Notice that the final hop is either a single jump or double jump, i.e. its from (n-1)th stair or (n-2)th. Thus f(n) = f(n-1) + f(n-2), where f(0)=f(1)=1. This is Fibonacci sequence.

Medium | Discrete Maths |

A. B & C live together and share everything equally. One day A brings home 5 logs of wood, B brings 3 logs and C brings none. Then they use the wood to cook together and share the food. Since C did not bring any wood, he gives $8 instead. How much to A and how much to B?

Hint

Its not 5 & 3

Solution

Since each person consumed 8/3 woods. A gave 5-8/3 = 7/3 woods to C and B gave 3-8/3 = 1/3 woods to C.

So, Out of the 8 dollars, A gets 7 and B gets 1

So, Out of the 8 dollars, A gets 7 and B gets 1

Source: CSEblog

Enable Like and Comment Medium | Strategy |

Suppose you have a hotel which has one floor with infinite number of rooms in a row and all of them are occupied.

1) A new customer wants to check in, how will you accommodate her?

2) What if infinite number of people want to check in, how will you accommodate them?

3) Suppose infinite number of buses arrive at the hotel, each having infinite number of people, how will you accommodate them?

1) A new customer wants to check in, how will you accommodate her?

2) What if infinite number of people want to check in, how will you accommodate them?

3) Suppose infinite number of buses arrive at the hotel, each having infinite number of people, how will you accommodate them?

Hint

Define Infinity ;)

Solution

1) Since there are infinite number of rooms and infinite+1= infinite

Just ask person in room k to move to k+1, thus making the first room vacant. :)

2) In the other case, since infinite+infinite = infinite

asking person in room k to move to 2k solves the problem.

3) Since NxN is countable set. We can get a 1-1 mapping from N to NxN

Hence, we can accommodate (infinite people X infinite buses) in the hotel.

Relevant article:

http://en.wikipedia.org/wiki/Cantor_pairing_function

Just ask person in room k to move to k+1, thus making the first room vacant. :)

2) In the other case, since infinite+infinite = infinite

asking person in room k to move to 2k solves the problem.

3) Since NxN is countable set. We can get a 1-1 mapping from N to NxN

Hence, we can accommodate (infinite people X infinite buses) in the hotel.

Relevant article:

http://en.wikipedia.org/wiki/Cantor_pairing_function

Source: CSEblog

Enable Like and Comment Latest solved Puzzles

Color Switches Weird Sequences Intersecting Pillars Consecutive sums Scaling a Square Difficulty Level

© BRAINSTELLAR |