Puzzles Difficult Part 2
-
Upload
anurag-verma -
Category
Documents
-
view
103 -
download
5
description
Transcript of Puzzles Difficult Part 2
Quant, Math & Computer Science Puzzles for Interview Preparation & Brain TeasingA collection of ~225 Puzzles with Solutions (classified by difficulty and topic)
CSE Blog - quant, math, computer science puzzlesCSE Blog - quant, math, computer science puzzles
D e c 4 , 2 0 1 0
You might also like
Baseball Party
Math Olympiad Problem : Overlapping Coins
Senators and Graph Theory
Equal Heads and Tail
Recommended by
4 comments:
Labels: DifficultPuzzles, Discrete-Mathematics, Probability, Puzzles
Probability of Grade A or B
Source: Homepage of Tejaswi Navilarekallu, Post Doctoral Fellow, Vrije Universiteit, Amsterdam
Problem:
A professor decides the following grading scheme in his class. After the final exam is graded, hekeeps all the papers upside down on his table in a random order so that no student canrecognize his own paper. Each student during his turn can overturn at most n/2 of these papers(where n is the total number of students in the class) and guess whether he received an A or a Bon the final (there are only two grades given). Obviously the student doesn't know which paperis his, so it is not guaranteed that he will find his own score by looking at n/2 scores. The papersare then turned back and kept in the original order. The students cannot pass any information toothers. All the students pass the course if "everyone" guesses their grade correctly, and they failotherwise. Come up with a strategy that the students can decide on beforehand, so that theprobability that they all will pass is more than a positive constant independent of n.
Solution: The solution discussed in a problem before at http://pratikpoddarcse.blogspot.com/2009/10/find-your-number.html
Recommend this on Google
O c t 2 0 , 2 0 1 0
You might also like
Guide to Wall Street Quant Jobs for IITians
Walking Ant Problem - Part 2
Odd Even Algorithm Puzzle
Weird Number Sequence
Recommended by
11 comments:
Number of Rounds of Derangements
Source: Asked to me by Sudeep Kamath (Third year PhD Student, UC at Berkeley, EE IITBAlumnus)
Problem:There are n men, n hats, one hat belonging to each person. A random permutation of hats ispicked by the men, whoever gets their own hat, takes it and leaves and a random permutationof the remaining hats is picked and so on. What is the expected number of rounds it takes foreveryone toleave?
Hint: Answer is n
Update (21 Oct 2010):Solution posted by Siddhant Agarwal (Senior Undergraduate, EE, IITB), and a more detailedexplanation posted by me in comments!
Recommend this on Google
DifficultPuzzles (64)
EasyPuzzles (87)
MediumPuzzles (93)
Labels by Difficulty
Algorithm-DataStructures (38)
Brain-Teasers (73)
Discrete-Mathematics (98)
Engineering-Mathematics (19)
Geometry (25)
Number-Theory (31)
Probability (79)
Strategy-Puzzles (50)
Labels by Topic
Social
Like
Arjun Attam, Nitin Garg and
2,544 others like this.
Buy me Coffee / Beer via Paypal
Home
Books/Study Material
Social Pages
Post a Question
About Author
Disclaimer
Pages
483,868
Hits (All Time)
Blog Archive
Showing posts with label DifficultPuzzles. Show all posts
CSE Blog - quant, math, computer science puzzles: DifficultPu... http://www.cseblog.com/search/label/DifficultPuzzles?updat...
1 of 8 Friday 27 September 2013 01:48 AM
Labels: Brain-Teasers, DifficultPuzzles, Probability, Puzzles
O c t 1 4 , 2 0 1 0
You might also like
Homo paradox
Ants on a Cube
Lets Call 50
Find Fixed Point (x[i]=i) in an Array
Recommended by
13 comments:
Labels: DifficultPuzzles, Discrete-Mathematics, Probability, Puzzles, UnsolvedPuzzles
Painting Coloured Balls
Source: Asked to me by Sudeep Kamath (Third year PhD Student, UC at Berkeley, EE IITBAlumnus)
Problem: A box contains n balls coloured 1 to n. Each time you pick two balls from the bin - thefirst ball and the second ball, both uniformly at random and you paint the second ball with thecolour of the first. Then, you put both balls back into the box. What is the expected number oftimes this needs to be done so that all balls in the box have the same colour?
Recommend this on Google
O c t 1 0 , 2 0 1 0
15 comments:
Labels: DifficultPuzzles, Discrete-Mathematics, Puzzles, UnsolvedPuzzles
Senators and Graph Theory
Source: Asked to me by Sai Teja Pratap (Sophomore Undergraduate, CSE, IITB)
Problem: There are 51 senators in a senate. The senate needs to be divided into n committeessuch that each senator is on exactly one committee. Each senator hates exactly three othersenators. (If senator A hates senator B, then senator B does 'not' necessarily hate senator A.)Find the smallest n such that it is always possible to arrange the committees so that no senatorhates another senator on his or her committee.
Recommend this on Google
4 comments:
Labels: DifficultPuzzles, Discrete-Mathematics, Puzzles, Strategy-Puzzles
Coin Balancing
Source: Asked to me by Vivek Jha (Senior Undergraduate, EE, IITB)
Problem: Among 10 given coins, some may be real and some may be fake. All real coins weighthe same. All fake coins weigh the same, but have a different weight than real coins. Can youprove or disprove that all ten coins weigh the same in three weighings on a balance scale?
BTW, List of previously asked Coin related puzzles on the blog:Russian CoinsCoin Weighing ProblemAnother Coin ProblemCoins PuzzleConsecutive HeadsFive Thieves and Bounty
Update (Oct 12, 2010)Solution posted by Gaurav Sinha (chera) (CSE IITK 1996 Graduate, Now working at IndianRevenue Service) in comments! Reposted by me removing typo.
Recommend this on Google
A u g 2 7 , 2 0 1 0
Conway's Soldiers (CheckerBoard Unreachable Line)
Source: Asked to me by Amol Sahasrabudhe (Morgan Stanley Quant Associate)
Problem:An infinite checkerboard is divided by a horizontal line that extends indefinitely. Above the lineare empty cells and below the line are an arbitrary number of game pieces, or "soldiers". A move
► 2013 (34)
► 2012 (39)
► 2011 (43)
▼ 2010 (80)
▼ Dec 2010 (7)
Water Jug Problem
Equal zeroes and ones
Locks and Switches
Order of cards
Stick Broken Into Three Pieces
The Social Network (2010) - FaceMashAlgorithm
Probability of Grade A or B
► Nov 2010 (3)
► Oct 2010 (10)
► Sep 2010 (3)
► Aug 2010 (4)
► Jul 2010 (3)
► Jun 2010 (6)
► May 2010 (2)
► Apr 2010 (3)
► Mar 2010 (7)
► Feb 2010 (8)
► Jan 2010 (24)
► 2009 (63)
► 2008 (4)
Puzzles (251)
UnsolvedPuzzles (45)
Innovate (9)
PopularArticles (9)
Coding (8)
UnsolvedCoding (4)
OpenEndedPuzzles (3)
Open Source (2)
Labels
Integer Points
Lion in a Circular Cage Puzzle
Geometry Puzzle: Center of Square in Circle
Coin Puzzle: Predict the Other's Coin
Asking a girl out
Consecutive Heads
Pizza Distribution Puzzle
Coins Puzzle
Sphagetti Breakfast
Math Game of Zero String
Popular Posts
Follow by Email!
Submit
CSE Blog - quant, math, computer science puzzles: DifficultPu... http://www.cseblog.com/search/label/DifficultPuzzles?updat...
2 of 8 Friday 27 September 2013 01:48 AM
10 comments:
Labels: DifficultPuzzles, Discrete-Mathematics, Puzzles, Strategy-Puzzles
consists of one soldier jumping over an adjacent soldier into an empty cell, vertically orhorizontally (but not diagonally), and removing the soldier which was jumped over. The goal ofthe puzzle is to place a soldier as far above the horizontal line as possible.
Prove that there is no finite series of moves that will allow a soldier to advance more than fourrows above the horizontal line.
I could get the correct direction in 5 min. Spent enough time on the problem but could not solveit. :( Give it a go! \m/
Update: Sep 07, 2010Solution: Posted by Siddhant Agarwal (Senior Undergraduate, Elec IITB) in comments!!
Recommend this on Google
A u g 2 1 , 2 0 1 0
8 comments:
Labels: DifficultPuzzles, Discrete-Mathematics, Probability, Puzzles
Magic Money Machine
Source: CMU Puzzle Toad
Problem: The wizards at Wall Street are up to it again. The Silverbags investment bank hasinvented the following machine. The machine consists of 6 boxes numbered 1 to 6. When youfirst get the machine, it contains 6 tokens, one in each box. You have two buttons A, B on themachine and you can press them as many times as you like and in any order.
Button A Choose a number i from 1 to 5 and then take one token from box i and magically twotokens will be added to box i + 1.Button B Choose a number i from 1 to 4 and then take one token from box i and then thecontents of boxes i + 1 and i + 2 will be interchanged.
The machine sells for one trillion dollars. The contract says that you can take the machine backto the bank at any time and then the bank will give you one dollar for each token in themachine. Is the machine worth buying?
Update (Nov 10, 2010):This problem is an IMO 2010 Problem. Solution available at artofproblemsolving linkSolution posted by Siddhant Agarwal (EE Senior Undergraduate, IIT Bombay) who gave credits toNaval Chopra (CSE Senior Undergraduate, IIT Bombay) in comments!
Recommend this on Google
J u l 2 5 , 2 0 1 0
5 comments:
Labels: DifficultPuzzles, Discrete-Mathematics, Puzzles, Strategy-Puzzles
Coin conundrum
Source: Australian Mathematical Society Gazette Puzzle Corner
Problem: There are coins of various sizes on a table, with some touching others. As often as youwish, you may choose a coin, then turn it over, along with every other coin that it touches. If allcoins start out showing heads, is it always possible to change them to all tails using thesemoves?
Update (Nov 15, 2010):Solution: Solution from the gazette author posted by me in comments! Interesting linearalgebra solution posted by Siddhant Agarwal (EE, Senior Undergraduate, IITB) in comments!
Recommend this on Google
Differing views
Source: Australian Mathematical Society Gazette Puzzle Corner
Problem: An optimist and a pessimist are examining a sequence of numbers. The optimistremarks, ‘Oh jolly! The sum of any eight consecutive terms is positive!’ But the pessimistinterjects, ‘Not so fast, the sum of any five consecutive terms is negative.’ Can they both beright? How long can this sequence of numbers be?
CSE Blog - quant, math, computer science puzzles: DifficultPu... http://www.cseblog.com/search/label/DifficultPuzzles?updat...
3 of 8 Friday 27 September 2013 01:48 AM
5 comments:
Labels: DifficultPuzzles, Discrete-Mathematics, Number-Theory, Puzzles
Incentive: Treat at H8 Canteen/Sodexho Cafeteria for the first person to solve it :P
Update (27/07/10): Solution: Posted in comments by Varun Jog (Berkeley Grad Student, EE IITBAlumnus) and Siddhant Agarwal (EE Senior Undergraduate, IITB)
Recommend this on Google
J u n 2 0 , 2 0 1 0
6 comments:
Labels: DifficultPuzzles, Geometry, Probability, Puzzles
Cube in a sphere
Source: CMU Spring 2010 Course on Great Theoretical Ideas in Computer Science
Problem: 10% of the surface of a sphere is colored green, and the rest is colored blue. Showthat no matter how the colors are arranged, it is possible to inscribe a cube in the sphere so thatall of its vertices are blue.
Hint: Use probabilistic analysis. Consider a random cube and calculate the expected number ofvertices that are blue.
(Update 23/06/10):Solution: Posted by connect2ppl - Giridhar Addepalli (CSE, IITK alumnus and Yahoo! Sr. SoftwareEngineer) in comments!
Recommend this on Google
M a y 3 0 , 2 0 1 0
1 comment:
Labels: Algorithm-DataStructures, DifficultPuzzles, Discrete-Mathematics, Puzzles, UnsolvedPuzzles
Veit Elser’s Formidable 14
Source: CMU Spring 2010 Course on Great Theoretical Ideas in Computer Science Lecture01.Course pointed to me by Aaditya Ramdas (To be CMU Grad Student & CSE-IITB Alumnus)
Problem:Fit disks of the following diameters into a circular cavity of size 12.000:2.150 2.250 2.308 2.348 2.586 2.684 2.6842.964 2.986 3.194 3.320 3.414 3.670 3.736
Write a program or give a general algorithm to solve a general case.
Disclaimer: Did not spend a lot of time on the problem but I have not been able to solve it.Clearly sum of the squares of the smaller radii is less than the square of the larger radiisuggesting that it might be possible to fit disks. I am not able to make any more comments!
Recommend this on Google
M a y 7 , 2 0 1 0
Another Hat Problem
Source: Very interesting puzzle from http://forums.xkcd.com/
Problem:
There are 7 people standing in a circle, and each has either a red or a blue hat. The colors of thehats are chosen uniformly at random (although the problem is much the same if they're chosenadversarially). The people can't see their own hats, but can see each others'. Everyone is given astrip of paper and a pen, and simultaneously writes "red", "blue", or "abstain". Nobody can seewhat the other people are writing, or convey information in any other way. They win if somebodyguesses his own hat color, and nobody guesses wrong.
Find a strategy (which they agree on ahead of time) that maximizes probability of winning.Obviously, it is impossible to make a strategy that wins every time, because somebody mustguess and that person has no information.
To make it easier, try it first with three people.
Disclaimer: I posted this problem (in different words) 4 months back here but did not get anysolution. Then I did not have a solution of my own and the solution on the source was too
CSE Blog - quant, math, computer science puzzles: DifficultPu... http://www.cseblog.com/search/label/DifficultPuzzles?updat...
4 of 8 Friday 27 September 2013 01:48 AM
5 comments:
Labels: DifficultPuzzles, Probability, Puzzles, Strategy-Puzzles
"non-intuitive". Try it again. Its very interesting and trying to solve it gives u a kick :P
Recommend this on Google
A p r 2 5 , 2 0 1 0
8 comments:
Labels: Brain-Teasers, DifficultPuzzles, Puzzles
Oleg Kryzhanovsky’s Problem - Coin Sequence
Source: http://blog.tanyakhovanova.com/
Problem: You have 6 coins weighing 1, 2, 3, 4, 5 and 6 grams that look the same, except fortheir labels. The number (1, 2, 3, 4, 5, 6) on the top of each coin should correspond to its weight.How can you determine whether all the numbers are correct, using the balance scale only twice?
Disclaimer: It is a difficult problem
Hint: (Highlight from * to * to see the hint) *Some people post wrong solutions and believe they have solved it. For example, they wouldstart by putting the coins labeled 1 and 2 on the left cup of the scale and 3 on the right cup. Ifthese coins balanced, the person assumes that the coins on the left weighed 1 and 2 grams andthat the coin on the right weighed 3 grams. But they’d get the same result if they had 1 and 4on the left, for example, and 5 on the right.
I propose the following sequence a(n). Suppose we have a set of n coins of different weightsweighing exactly an integer number of grams from 1 to n. The coins are labeled from 1 to n. Thesequence a(n) is the minimum number of weighings we need on a balance scale to confirm thatthe labels are correct. The original Oleg Kryzhanovsky’s problem asks to prove that a(6)=2. It iseasy to see that a(1)=0, a(2)=1, a(3)=2. Its fun proving that a(4) = a(5) =2.*
Recommend this on Google
A p r 1 4 , 2 0 1 0
40 comments:
Labels: DifficultPuzzles, Puzzles, Strategy-Puzzles, UnsolvedPuzzles
Weighing Piles of Coins
Source: Asked to me by Ankush Agarwal (Sophomore, CSE, IITB)
Problem: There are two kinds of coins, genuine and counterfeit. A genuine coin weighs Xgrams and a counterfeit coin weighs X+delta grams, where X is a positive integer and delta is anon-zero real number strictly between -5 and +5. You are presented with 13 piles of 4 coinseach. All of the coins are genuine, except for one pile, in which all 4 coins are counterfeit. Youare given a precise scale (say, a digital scale capable of displaying any real number). You are todetermine three things: X, delta, and which pile contains the counterfeit coins. But you're onlyallowed to use the scale twice!
Prize: Treat at H8 canteen to the first person who solves it!!
Recommend this on Google
M a r 4 , 2 0 1 0
Traffic Jam
You have N cars that are all traveling the same direction on an infinitely long one-lane highway.Unfortunately, they are all going different speeds, and cannot pass each other. Eventually thecars will clump up in one or more traffic jams. In terms of N, what is the expected number ofclumps of cars?
CSE Blog - quant, math, computer science puzzles: DifficultPu... http://www.cseblog.com/search/label/DifficultPuzzles?updat...
5 of 8 Friday 27 September 2013 01:48 AM
10 comments:
Labels: DifficultPuzzles, Probability, Puzzles
Update (05/03/2010):Solution: Posted by me in comments!! Thanx to Asad (EE, IITB Alumnus) and Siddhant Agarwal(EE, IITB 3rd year student) for their participation in discussion in comments!!
Update (29/01/2011)Very simple and clear solution posted by wonderwice in comments! Thanks a ton!
Recommend this on Google
M a r 2 , 2 0 1 0
17 comments:
Labels: Algorithm-DataStructures, DifficultPuzzles, Number-Theory, Puzzles
Perfect Powers
Source: Appeared in 1977 High School Programming Contest. Takenfrom http://www.ocf.berkeley.edu/~wwu/riddles/cs.shtml
Problem:
Write a fast program that prints perfect powers (integers of the form mn, with m,n>1) inincreasing numerical order.
So the first few outputs should be 4, 8, 9, 16, 25, 27, 32, ...
Find an algorithm that prints all perfect powers less than equal to N.
Update (05/03/2010):Solution:Nikhil Garg (CSE, IITD Sophomore) posted a solution which takes O(N) space and O(log N*sqrt N)time. Printing takes time O(N) though.I posted a solution which takes O((sqrt N)*(log N)) space and O((sqrt N)*(log N)*(log N)) time.Rajendran Thirupugalsamy (Research Assistant, Stony Brook University) posted a solution whichtakes O(log(N)) space and O(sqrt N * log N * log(log(N))) time. {Analysis done by Ramdas}Aaditya Ramdas (CSE IITB Alumnus and working at Tower Research Capital) posted a solutionwhich takes O(sqrt N) space and O((sqrt N)*(log N)*(log N)) time.
Interesting discussion and all solutions in comments!!
Recommend this on Google
F e b 1 5 , 2 0 1 0
Coin Weighing Problem
Yet another coin problem. Read this today in "Heard from the Street". Found it interesting.
Problem: You are given a set of scales and 90 coins. The scales are of the old balance variety,that is a small dish hangs from each end of the rod that is balanced in the middle. You must pay100$ every time you use the scales.
The 90 coins appear to be identical. In fact, 89 of them are identical and one is of a differentweight. Your task is to identify the unusual coin and to discard it while minimizing the maximumpossible cost of weighing. What is your algorithm to complete this task?
Note that the unusual coin may be heavier than the others or it may be lighter. You are asked toboth identify it and determine whether it is heavy or light.
Previously asked coin puzzles:Another Coin ProblemCoins Puzzle
CSE Blog - quant, math, computer science puzzles: DifficultPu... http://www.cseblog.com/search/label/DifficultPuzzles?updat...
6 of 8 Friday 27 September 2013 01:48 AM
6 comments:
Labels: Brain-Teasers, DifficultPuzzles, Puzzles
Consecutive HeadsFive Thieves and Bounty
Update (18/02/10): Solution posted by me in comments!! A non-optimal but simpler solutionposted by Bhanu (M.Tech Student, CSE, IITB). Another solution posted by Suman in comments!!Thanx
Recommend this on Google
F e b 9 , 2 0 1 0
2 comments:
Labels: DifficultPuzzles, Discrete-Mathematics, Puzzles, Strategy-Puzzles
Checkers Problem
Source: Nikhil Garg (Sophomore, IITD) mailed them to me.
Problem 1:A checker starts at point (1,1). You can move checker using following moves :
1) if it is at (x,y) take it to (2x ,y ) or (x,2y)2) if it is at (x,y) & x>y take it to (x-y,y)3) if it is at (x,y) & x<y take it to (x,y-x)
Characterise all lattice points which can be reached.
Problem 2:You have a checker at (0,0) , (0,1) , (1,0), (2,0), (0,2), (1,1) each. You can make a move asfollows:
if(x,y) is filled & (x+1,y) and (x,y+1) both are empty, remove checker from (x,y) & put one ateach of (x+1,y) and (x,y+1)
Prove that under this move , you can not remove checker from all the six initial points.
Solution:Update (02/03/10): Solution posted by Nikhil Garg in comments!
Recommend this on Google
J a n 2 9 , 2 0 1 0
10 comments:
Labels: DifficultPuzzles, Discrete-Mathematics, Probability, Puzzles
Red vs Black cards - Expected payoff
This is a variation of the problem discussed some time back: Don't roll More. Just published thesolution to the earlier problem. Thought it would be interesting to solve this problem taken onceagain from the book "Heard on The Street".
Problem: You have 52 playing cards (26 black and 26 red). You draw cards one by one. A redcard pays you a dollar. A black card costs you a dollar. You can stop any point you want. Cardsare not returned to the deck after being drawn. What is the optimal stopping rule in terms ofmaximizing expected payoff? Also, what is the expected payoff following the optimal rule?
Hint: Try the problem with 4 cards (2 red, 2 black) :)
Update(29/01/10): Question was incomplete. Added more information.
Solution: (Update (05/02/10)) Idea posted by Aman in comments!! Solution posted by me incomments!!The problem/solution is very difficult and not so beautiful. Its not very mathematical though. Dothis only if you have time and you are humble enough to accept defeat :P
Recommend this on Google
J a n 2 8 , 2 0 1 0
Three NOT Gates from Two NOT Gates
Problem:
Design a 3-input 3-output logic circuit that negates the 3 signals. You have an infinite supply of AND and OR gates but only two NOT gates
CSE Blog - quant, math, computer science puzzles: DifficultPu... http://www.cseblog.com/search/label/DifficultPuzzles?updat...
7 of 8 Friday 27 September 2013 01:48 AM
Newer Posts Older PostsHome
Subscribe to: Posts (Atom)
11 comments:
Labels: DifficultPuzzles, Discrete-Mathematics, Engineering-Mathematics, Puzzles
I have read and solved many problems like these. Can people post some similar interesting problems using gates. I was asked one such
question in my Deutsche Bank Interview which I was not able to answer.
Update(09/02/10):
Solution: Solution posted by Sid in comments!!
Recommend this on Google
Banner
amit upadhyay
Pratik Poddar
Contributors
"CSE Blog - Quant, Math & Computer Science Puzzles for InterviewPreparation & Brain Teasing" is a collection of ~225 Puzzles with Solutions.The problems are divided into three sections: (Easy, Medium and Difficult)
About CSE Blog
CSE Blog - quant, math, computer science puzzles. Simple template. Powered by Blogger.
CSE Blog - quant, math, computer science puzzles: DifficultPu... http://www.cseblog.com/search/label/DifficultPuzzles?updat...
8 of 8 Friday 27 September 2013 01:48 AM