GB-BT-CTD Flashcards
Trailing Zeros - How many trailing zeros are there in 100!
Easy problem. Think of prime number decomposition. There are far more 5 than 2, whose combination makes 10 hence adding a zero. 100 = 100 x 99 x …1, there are 20 fives and 4 five squared, which add up to 24. Hence total frequency of 5 is 24.
Screwy Pirates - Five Pirates loots 100 gold coins -they are democratic pirates. Most senior pirate suggests the distribution of coins and all pirates vote (including the senior pirate). At least 50% of pirates have to approve the proposal or the most senior member will be fed to shark.
If 1 pirate, Sen. Pirate keeps it all. If 2 pirates, then the Sen. Pirate will keep it all (thanks to his one vote). If three pirates, Sen. Pirate keeps 99 and gives 1 to Pirate 1 (if they decide to kill the Sen. Pirate then the Pirate 2 will keep it all). For 4 Pirates, senior pirate will keep 99 and give one to Pirate 2 or the 2nd pirate won’t get anything. For 5 pirates, (think in above Pirate 3 and Pirate 1 didn’t get anything), hence Sen. Pirate keeps 98 and give one to both Pirate 1 & Pirate 3.
For each odd, 2n+1 pirates, he will offer coins to pirate 1, 3, 5…2n-1 and keeps the rest to himself
100 Tigers, 1 Sheep. Magical Island. If a tiger eats the sheep then it will become a sheep. Would the sheep survive?
If there is one tiger, he would eat the sheep. If there are two tigers, then sheep won’t be eaten since one of the tigers will be eaten after it becomes the sheep. They both are rational. Hence - if there are even number of tigers then the sheep won’t be eaten while for odd number of tigers, sheep will be eaten.
ABCD need to cross the bridge. Bridge’s weight limit can allow only 2 people to cross at a time. There is only one torch and it’s dark. A takes 10 mins, B takes 5 mins, C takes 2 mins, and D takes 1 min to cross the bridge. What is the least amount it would take to cross the bridge?
Key is to realize that A & B should go together. Let C and D go first (2 mins, 2), D comes back (1 min, 3), A & B cross together (10 mins, 13 mins), C comes back (2 mins, 15 mins), now C and D cross together (17 mins).
You and your colleague know that the boss’s birthday can be on: 3/4, 3/5, 3/8, 6/4, 6/7, 9/1, 9/5, 12/1,12/2, or 12/8. You first say you don’t know his birthday and your colleague doesn’t know either. I was told the month while my colleague was told the day. But now both of you declared you don’t know, all of a sudden you know the birthday. What is the birthday?
Days - {1, 2, 4, 5, 7, 8} and Months - { 3, 6,9, 12}.
Frequency - (1-2, 2-1, 4 -2, 5-2, 7-1, 8-2)
Dates can’t be 2 or 7, otherwise my colleague would have known the birthday due to uniqueness of this number. Since C doesn’t know the birthday, I should be convinced that the month is not 6 or 12, because why would the boss say 2 or 7 (rationality assumption). Now months have to be 3 or 9. Since C knows that month can be either 3 or 9, he deduces that the day must be unique otherwise I would have figured it out. If it was March 4 or March 8, they both have the same month and he won’t be able to deduce what his birthday would have been. That only leaves the one option - March 1st. 9/1
Normal deck of 52 cards. We turn over two cards at each time. For each pair of Black, they go to dealers pile and each pair of Red, they go to my pile. If cards follow BL or LB then they both are discarded. If I have more cards then the dealer then I win $100, or (including ties) dealer win. If casino is willing to negotiate the price, how much would you want to bet?
Zero!
Think - Probability of me winning is 50%. Every time cards are discarded, the probability remains the same. Hence the dealer will always win.
12 Balls, 1 is defective, either heavy or light. We don’t know. How do we find out?
Split balls into three groups of four. Measure two groups, if equal the H or L must be in the 3rd group. Now make two groups, 2 balls from the initial 3rd group and 1B from 3rd and 1B from equal group. Measure and make the next move.
If heavy or light, make two groups of three. In which, group 1 should consist of 2B from initial group 1, 1 from initial group 2, and New Group 2 will consist of 1 EACH from group 1 and 2, and one good ball from group 3.
There are 25 horses. 5 Lanes. How many races do we need to determine three fastest horses
Separate each horses into five groups. 1-5, 6-10,11-15,16-20,21-25. Race them (5 races). Let’s assume 1,6,11,16,21 wins. Race them (5+1 = 6 races). Assume they all come in this order, 1,6,11,16,21. Eliminate 16/21 hence group 4 & 5 are not feasible. There can by only horse from group 3 (b/c of 11). There can be only horse from group 2 (let’s say 7 came 2nd from our earlier race). There can be only 2 horses from group 1 (let’s say 2 and 3 from our early race results). Hence race, 2, 3, 6, 7, 11 and determine the two more fastest horses since we already know that 1 is already IN.
Infinite sequence: If x^x^x^x… = 2, what is x?
x^x^x^x = x^(x^x^x^x..)
2 = x^(2)
Solve for x and we get sqrt(2). Bingo!
Can you pack 53 bricks of dimensions 1x1x4 into a 6x6x6 Box?
No. It is alluring to know that volume of 6x6x6 = 216 is smaller than 53x4 = 212. However - if you work out the problem, this is not feasible. Divide the cube into 2x2x2 box, there are 27 such cubes. Since each 1x1x4 cube require at least such 2x2x2 cubes, we cannot fit them all in one 6x6x6 cube. Similar to a problem where there is a chess board and both Black boxes are taken
Calendar Cubes - Get two dices with six sides. I can put any number in it, what number should I put in each dice such that I can arrange any possible dates such that I can figure out the current day of the month?
“Constrain is that there is 11, 22, hence both dices will need to contain these numbers. We can arrange a combination such that
0 | 1 | 2 | 6 | 7 | 8
0 | 1 | 2 | 3 | 4 | 5
Trick is that we can show six as nine. Think outside of the box”
Door to Offer - Truthteller and a liar. One of them is standing in front of a door that has the job offer. What question should we ask him/her in order to get the job?
“This is a binary problem. Question we need to ask is that ““Would the other guy say that job offer is behind your door?””
Two possible Scenarios:
(1) Truth teller guards the door to offer, Liar guards the door to exit
(2) Truth teller guards the door to exit, Liar guards the door to offer.
If Truthteller is holding the job offer door: (1) Asked a truthteller - ““NO”” (2) Asked a liar - ““Yes””
If liar is holding the job offer door: (1) Asked a TT - ““Yes”” (2) Asked a liar - ““NO””
If you hear the answer ““Yes”” then choose the opposite door, if ““No”” then choose that door. “
Message Delivery - I am trying to mail a secret service to a colleague of mine in a remote location. Cannot trust the messanger service. There is a padlock box, you can lock the box but there can be ONLY one key. How do we solve the problem?
Put the message in the padlock box, lock it and send it off. Ask your colleague to lock the box with a new lock again and send back the box to you. Now you have the box, unlock your lock and re-ship again to your colleague who has the key to his own second lock.
Last Ball - 20 Blue balls and 14 Balls. You remove two balls in one draw and do not put these balls back. If both balls are the same color, you add one blue ball. If both balls have different colors, then you add back the red ball. What would be the color of the last ball?
“Let’s follow the rule based system:
(1) [B, B] = [B-1, R]
(2) [B,R] = [B+1,R]
(3) [R,R ] = [B+1,R-2]
Let’s observe two things. R never become an odd number given there are 14 Red balls and R always decreases or stays the same versus B that can go up as well as down. “
Last Switch - 4 switches and one bulb. Close the door, how do we know which switch turns on the light?
“Turn switches 1 and 2 on for quite a while. Now turn off switch 1 and turn on swith 3. Run inside the room and deduce based on:
(1) On and hot bulb = Switch 2
(2) Off and hot bulb = Switch 1
(3) On and Cold bulb = Switch 3
(4) Off and cold bulb = Switch 4”