GB-BT-CTD Flashcards
(38 cards)
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”
Quant Salary - There is a group of us we want to determine our average salary without anyone finding it out.
Quant 1 - Pick a random number and pass the paper. Have quant 2 add his/her salary and pass that number to Quant 3. Each member should add the number and pass it around. In the end, it comes back to Quant 1, he can subtract his random number and add his salary. Divide the final number by number of quants - there we have it.
There are 1000 coins - you are told that 980 have tails up, and 20 have heads up. You cannot feel and determine head/tail. You can flip the coin as many time as you want to change the head to tail and vice versa. How do you split these coins into 2 piles such that they both have the exact number of heads?
(1) Pile one has n coins, hence pile two has 1000-n coins (2) Now pile one has m coins with heads, hence pile two has 20-m coins with heads. (3) In pile one there are n-m tails, turn them all over. Hence there are n-m heads in pile one. (4) Observe: Pile one heads = n-m and Pile two heads = 20-m. Solve for n and we have n = 20. Moral of the story, when you devide the pile, make sure you have twenty coins in pile one, and flip them all. This will assure exact number of heads in both piles.
Mis-labeled Bags. There are three bags, Apples, oranges and MIX. If ALL bags are mislabeled, what is your strategy to correct the problem by minimizing the number of either or apples taken out from each bag?
Take out one fruit from the MIX bag. If it is oranges, then the Mix bag has oranges, Oranges has apples, and apple bag is mixed.
Wise Men - Sultan caputred 50 wise men. He has a glass standing bottom down. Sultan will call each wise man randomly (for infinite amount times), if a wise man speaks up and says that each wise men is called then they all will be set free or they all will go back to prison. Wise men are allowed to communicate only once before they get imprisoned. What can you do to save them?
Select a leader. Each time, a NEW wise man is called by a sultan, this character will make sure that the glass bottom is up. W1 will turn the bottom up, if W2 comes and observe this, he does not do anything. Untill Leader shows up and he turns the glass bottom down. The leader must keep a tally, and when his count hits 49, then he knows that the sultan has called everyone.
Series Summation - 1 to 100
[ n * (n * 1) ] / 2 = (100 * 101)/ 2 = 5050
Clock pieces. Clock falls and breaks into three pieces. Ironically - sum of each piece is equal. What are the numbers on each piece?
12*(12 +1)/2 = 78. 78/3 = 26. Sum of each group should add upto 26. Key is to realize that 12+1 = 11+2 = 10 + 3 ..= 13. Hence create such a group that adds up to 26.
Counterfeit Coins 1 - 10 bags with 100 identical bags in each coin. Each counterfeit coin can weight either 9 or 11 grams. Determine a strategy which bag has a counterfeit coins?
Pick 1 coin from bag 1, Pick 2 coins from bag 2….Pick 10 coins from bag 10. Sum of the weight should (10 * (10+1))/ 2 = 55. 55 x 10 = 550 grams. If the weight is 539 or 541, bag 1 has counterfeit coins, 538 or 542 - bag 2 has counterfeit coins.
Glass Ball. We have two glass balls and a 100 story building. If a ball is thrown out of the window, it will not break if the floor number is less than X. What is the strategy that will minimize the number of drops for the worst case scenario?
Since we are trying to minimize the number of throws: let’s say, we have a strategy with a maximum of N throws. Try the Nth floor, if the ball breaks then start from the 1st floor and go to N-1. Here we will meet our criteria of max of N throws.
However, If the ball does not break at the Nth floor, then we can only increase the number of floors by N-1, since for the 2nd ball we will only have N-2 throws left. Using such Logic we can derive that N(N+1)/2 >= 100. Hence N = 14. Since 210 > 200. 14 will be the maximum number of throws, no matter what.
Matching Socks. 2 Red socks, 20 Yellow Socks, 31 Blue socks. How many socks do I need to guarantee that I at least have one matching pair?
3 + 1 = 4 Socks