Puzzles Difficult Part 1

10
Quant, Math & Computer Science Puzzles for Interview Preparation & Brain Teasing A collection of ~225 Puzzles with Solutions (classified by difficulty and topic) CSE Blog - quant, math, computer science puzzles CSE Blog - quant, math, computer science puzzles Aug 26, 2013 You might also like Most popular Puzzle Books for Technical / Quant Finance Interviews Find Fixed Point (x[i]=i) in an Array Original Puzzle: Pattern Lock - Combinatorics Puzzle - Number of Possible Passwords Determinant of Binary Matrix Recommended by Number of Paths in Rectangular Grid Source: Solved it during Algorithms Course under Prof Diwan, and discussed with Nikhil Jain (IT BHU 2008 Alumnus, Product Manager at AskLaila) Problem: 1. (Easy) Consider a n x m rectangular grid. The problem is to find the number of shortest (or monotonic in this case) paths along the edges of the cell that start at (0,0) and end at (n,m). A monotonic path is a path always moving towards the goal, i.e. consists of moving up or right but not down or left. Figure 1 illustrates such a path for a grid of size 5 x 3. 2. (Difficult) Now we need to print all monotonic paths that do not go above the diagonal y = x. Figure 2 shows such a path. Note that the path in figure 1 goes above the diagonal, hence not desirable in this case. How many such paths exist for n x m grid (n >= m)? Disclaimer: The first problem is too simple, and the second is very challenging. Have fun :-) 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 Sanchit Jain, Barun Kumar Kejriwal 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,865 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 1 of 10 Friday 27 September 2013 01:47 AM

description

Difficult puzzles part 1

Transcript of Puzzles Difficult Part 1

Page 1: Puzzles Difficult Part 1

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

A u g 2 6 , 2 0 1 3

You might also like

Most popular Puzzle Books for Technical / Quant Finance Interviews

Find Fixed Point (x[i]=i) in an Array

Original Puzzle: Pattern Lock - Combinatorics Puzzle - Number of Possible Passwords

Determinant of Binary Matrix

Recommended by

Number of Paths in Rectangular Grid

Source: Solved it during Algorithms Course under Prof Diwan, and discussed with Nikhil Jain (ITBHU 2008 Alumnus, Product Manager at AskLaila)

Problem:

1. (Easy)

Consider a n x m rectangular grid. The problem is to find the number of shortest (or monotonic in this case)

paths along the edges of the cell that start at (0,0) and end at (n,m).

A monotonic path is a path always moving towards the goal, i.e. consists of moving up or right but not down or

left. Figure 1 illustrates such a path for a grid of size 5 x 3.

2. (Difficult)

Now we need to print all monotonic paths that do not go above the diagonal y = x. Figure 2 shows such a path.

Note that the path in figure 1 goes above the diagonal, hence not desirable in this case. How many such paths

exist for n x m grid (n >= m)?

Disclaimer:The first problem is too simple, and the second is very challenging. Have fun :-)

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

Sanchit Jain, Barun Kumar

Kejriwal 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,865

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

1 of 10 Friday 27 September 2013 01:47 AM

Page 2: Puzzles Difficult Part 1

14 comments:

Labels: Algorithm-DataStructures, DifficultPuzzles, Discrete-Mathematics, Puzzles, UnsolvedPuzzles+1 Recommend this on Google

A u g 1 7 , 2 0 1 3

3 comments:

Labels: Algorithm-DataStructures, Brain-Teasers, DifficultPuzzles, Innovate, OpenEndedPuzzles, Puzzles,

UnsolvedPuzzles

Walking Ant Problem - Part 2

Source: Original problem adapted from the "Ants Problem" at "CMU ACM Programming Contest". Extension to the 4 year old problem on CSE Blog - Walking Ants Puzzle

Problem:

You have a bunch of ants on a meter stick, each walking 1cm/s in some direction. If an ant hitsthe end of the stick, it falls off. If two ants collide, they both reverse direction.

Walking Ants Puzzle earlier essentially asked: Given the starting positions and directions of allthe ants, how long until the last ant falls off?

The new problem is :Given the starting positions and directions of all the ants, which ant(s) are the last to fall off?

Disclaimer: I do not have the solution to the problem. It just looks like an interesting problem tosolve.

( Readers Please ignore: Technorati claim: 6QVZ8YSY6XSD )

+1 Recommend this on Google

J u l 2 8 , 2 0 1 3

3 comments:

Labels: Brain-Teasers, DifficultPuzzles, Puzzles, UnsolvedPuzzles

Self Referential Problem - from "What would Martin Gardner Tweet"

Source: The Math Factor (contains spoilers) - also tweeted on What Would Martin Gardner Tweet

Problem:The number of 1′s in this paragraph is ___; the number of 2′s is ___; the number of 3′s is ____; andthe number of 4′s is ___.

Bonus Research Follow-up Problem:The number of 1′s in this paragraph is ___; the number of 2′s is ___; …..(and so on) and thenumber of N’s is ___.For N=2 or 3, there are no solutions (Asking that all the numbers we fill in are between 1 and N);for N=4 there are two. For N=5 there is just one, for N=6 there are none and beyond that thereis just one.Prove it.

+1 Recommend this on Google

J a n 2 6 , 2 0 1 3

Determinant of Binary Matrix

Source: Introduced to me by Sudeep Kamath (PhD Student, UC at Berkeley, EE IITB Alumnus

▼ 2013 (34)

► Sep 2013 (1)

▼ Aug 2013 (10)

Chess 5 Piece Puzzle

Number of Paths in Rectangular Grid

Divisibility Problem

Most popular Puzzle Books for Technical /Quant Fi...

Find Fixed Point (x[i]=i) in an Array

Walking Ant Problem - Part 2

Guide to Wall Street Quant Jobs for IITians

Minimum Point in a Rotated Sorted Array

Probability Puzzle: Expected Number ofExpression ...

Combinatorics + Game Theory Puzzle

► Jul 2013 (4)

► Jun 2013 (2)

► May 2013 (3)

► Apr 2013 (5)

► Mar 2013 (3)

► Feb 2013 (3)

► Jan 2013 (3)

► 2012 (39)

► 2011 (43)

► 2010 (80)

► 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

2 of 10 Friday 27 September 2013 01:47 AM

Page 3: Puzzles Difficult Part 1

8 comments:

Labels: DifficultPuzzles, Discrete-Mathematics, Engineering-Mathematics, Number-Theory, Puzzles

2008)

Problem:

An N by N matrix M has entries in {0,1} such that all the 1's in a row appear consecutively. Showthat determinant of M is -1 or 0 or 1.

Disclaimer:I could not solve it but I have an awesome solution sent by Pritish Kamath (MSR ResearchAssistant, CSE IITB Alumnus 2012)

Update (2/4/2013):Solution posted by Amol Sahasrabudhe (IITB 2004 Alumnus, Ex-Morgan Stanley Quant Associate,Deutsche Bank Quant Associate) and Piyush Sao (EE IITM Alumnus, Georgia Tech Grad Student)in comments! Thanks a ton. I have posted the solution provided by Pritish Kamath (MSRResearch Assistant, CSE IITB Alumnus 2012). All three solutions are essentially the same.

+1 Recommend this on Google

D e c 3 1 , 2 0 1 2

1 comment:

Labels: Algorithm-DataStructures, DifficultPuzzles, Discrete-Mathematics, Puzzles, UnsolvedPuzzles

Romanian Informatics Olympiad - Modified Huffman Encoding

Source: (Romanian Informatics Olympiad ONI'03, extended team selection)

( ^ Representative diagram of Huffman Encoding. No relevance in the problem)

Problem:A telegraph machine can transmit only lines and dots; it takes 2 seconds to transmit a line, butonly 1 second to transmit a dot. We generally want to transmit texts containing letters of theEnglish alphabet, and digits (so we have N<=36 symbols in total). Therefore, a prefix-freeencoding using lines and dots is needed. Given the frequencies of the N symbols in a large text,find the minimum time it takes to transmit the text using a suitable encoding. The solutionshould run in O(N^4) time, and use O(N^3) space.

+2 Recommend this on Google

D e c 3 0 , 2 0 1 2

Coin Puzzle: Predict the Other's Coin

Source: Puzzle collection by Raphael Reischuk

Problem:Assume the following 3-player game consisting of several rounds. Players A and B build a team,they have one fair coin each, and may initially talk to each other. Before starting the first round,however, no more communication between them is allowed until the end of the game. (Imagine

CSE Blog - quant, math, computer science puzzles: DifficultPu... http://www.cseblog.com/search/label/DifficultPuzzles

3 of 10 Friday 27 September 2013 01:47 AM

Page 4: Puzzles Difficult Part 1

17 comments:

Labels: DifficultPuzzles, Probability, Puzzles, Strategy-Puzzles

they are separated in different places without any communication infrastructure.)

A round of the game consists of the following steps: (1) the team gives one dollar to player C. (2) Both A and B toss their coins independently. (3) Both A and B try to predict the other's coin by telling the guess to C. (No communication: Adoes not know the outcome of B's coin toss, and vice versa, nor the guess). (4) If C verifies that both A and B guess the other's coin correctly, then C has to give 3 dollarsback to the team.

Should C play this game?

Previously Asked Coin Puzzles:Coin BalancingCoins PuzzleConsecutive HeadsFive Thieves and Bounty

Update:Discussion on Hacker News: http://news.ycombinator.com/item?id=4985537

Update: (29 Jan 2013)Correct solution by: Takaki, Andre, Felix, JDGM in comments!Correct strategy (but not so correct calculation) by Joshua, Shubham Mittal in comments!If you are just looking for the solution, Perfect solution by Andre. Thanks

+2 Recommend this on Google

D e c 1 3 , 2 0 1 2

11 comments:

Labels: DifficultPuzzles, Engineering-Mathematics, Geometry, Puzzles, UnsolvedPuzzles

Geometry Contruction - Bisect Areas of 2 Triangles

Source: Asked to me by Sankeerth Rao (EE IITB 4th year Student)

Problem:Given any two triangles in a plane construct a line which bisects both their areas.

Background:In fact the existence of such a line is true in a very general setting - for any two polygons in aplane there exists a line which bisects both their areas. In fact its true for any two Jordanmeasurable sets in a plane. Further generalized version is called the Ham Sandwich Theoremand is proved using Borsuk Ulam Theorem.

+2 Recommend this on Google

N o v 1 0 , 2 0 1 2

Sam Loyd Puzzle Solvability

Source: 15 Puzzle

Problem: The 15-puzzle (also called Gem Puzzle, Boss Puzzle, Game of Fifteen, Mystic Square and many

others) is a sliding puzzle that consists of a frame of numbered square tiles in random order with one tile missing.

The object of the puzzle is to place the tiles in order (from figure at left to figure at right) by making sliding moves

that use the empty space. Prove that the 15 puzzle in the configuration as shown on the left is not solvable.

Related Links:

CSE Blog - quant, math, computer science puzzles: DifficultPu... http://www.cseblog.com/search/label/DifficultPuzzles

4 of 10 Friday 27 September 2013 01:47 AM

Page 5: Puzzles Difficult Part 1

2 comments:

Labels: DifficultPuzzles, Discrete-Mathematics, Puzzles

I made this fb game yesterday night - 9 Puzzle over Movie Posters - Movie Sliding PuzzleSam Loyd published some great puzzles in his time. One book that gets recommended a lot is"Sam Loyd's Cyclopedia of 5000 Puzzles tricks and Conundrums" (Amazon , Flipkart)

Update: (24/12/2012)Solution provided by Raghuram Kowdeed (IIT Kanpur) in comments!

Update: (24/12/2012)Same solution posted by Sai Teja Pratap (IIT Bombay CSE Final Year Student) and EeshaanMalhotra (IIT Bombay) on Quora Board.

+3 Recommend this on Google

O c t 1 8 , 2 0 1 2

8 comments:

Labels: DifficultPuzzles, Discrete-Mathematics, Puzzles, Strategy-Puzzles, UnsolvedPuzzles

Strategy Game - Similar to Nim

Source: Posted at "Post a Question"

Problem:

Two players compete in the following game: There is a pile containing n chips; the first playerremoves any number of chips except that he cannot take the whole pile. From then on, theplayers alternate moves, each person removing one or more chips but not more than twice asmany chips as the preceding player has taken. The player who removes the last chip wins. (Forexample, suppose that n = 11; player A removes 3 chips; player B may remove up to 6 chips,and he takes 1. There remain 7 chips; player A may take 1 or 2 chips, and he takes 2; player Bmay remove up to 4, and he picks up 1. There remain 4 chips; player A now takes 1; player Bmust take at least one chip and player A wins in the his next chance.

What is the best move for the first player to ensure his win if possible if there are initially nchips?

+1 Recommend this on Google

S e p 2 5 , 2 0 1 2

8 comments:

Labels: DifficultPuzzles, Discrete-Mathematics, Number-Theory, Puzzles

USA Maths Olympiad Problem - 200th Puzzle

200th Puzzle of the CSE Blog

Source:I got hold of the super awesome book I read 6 years back: "A Path to Combinatorics forUndergraduates: Counting Strategies". A must have for any math/olympiad enthusiast (Flipkartlink to Imported Edition and Indian Edition) - Example 5.8 - USAMO 1990

Problem:Let n be a positive integer. Find the number of positive integers whose base n representationconsists of distinct digits with the property that except for the leftmost digit, every digit differsby +1 or -1 from some digit further to the left.

Update (26/12/2012):No correct solution provided. Solution posted by me in comments!

+3 Recommend this on Google

A p r 8 , 2 0 1 2

Original Puzzle: Pattern Lock - Combinatorics Puzzle - Number ofPossible Passwords

CSE Blog - quant, math, computer science puzzles: DifficultPu... http://www.cseblog.com/search/label/DifficultPuzzles

5 of 10 Friday 27 September 2013 01:47 AM

Page 6: Puzzles Difficult Part 1

5 comments:

Labels: DifficultPuzzles, Discrete-Mathematics, OpenEndedPuzzles, Puzzles

Source: Discussion with Ankush Jain (CSE IITB 2011 Alumnus, Morgan Stanley Analyst) a fewmonths back. Discussion revived by Sangram Raje (CSE IITB 2008 Alumnus, Tower ResearchAnalyst) today.

Problem:Ever seen a pattern lock in Galaxy S2? Password is a series of connected line strokes. How manypossible password combinations can you have?

Some description about the problem:1) Assuming the dots on the screen are like (1, 2, 3 in the first row), (4, 5, 6 in the second row)and (7, 8, 9 in the third row), you cannot go to 8 from 2, without going through 5. So, a passwordlike * * 8 2 * * is not possible.2) You cannot move over two lines twice You can move to a used point, but you cannot move toanother used point from a used point

I do not see a simple way to solve this. But even coding this looks very difficult to me. Anytakers?

Update: (19-07-2012)This is essentially an open ended question

+3 Recommend this on Google

O c t 3 1 , 2 0 1 1

8 comments:

Labels: DifficultPuzzles, Probability, Puzzles, UnsolvedPuzzles

Sphagetti Breakfast

Source: Very standard problem in Quant interviews (Taken from quantnet, xkcd forums)

Problem:A bowl of spaghetti contains n strands. Thor picks two ends at random and joins them together.He does this until no ends remain.

What is thea) expected number of spaghetti loops in the bowl?b) expected average length of the loops? (in strands)c) expected number of k-hoops? ( a k-hoop is a loop made from k strands)

+1 Recommend this on Google

S e p 4 , 2 0 1 1

Arrange in a Sequence

Source:Asked to me by Amol Sahasrabudhe (IITB 2004 Alumnus, Worked at Morgan Stanley QuantDivision, Deutsche Bank)

Problem:You are given 2n numbers ( 1 to n and 1 to n ). You have to arrange these numbers in asequence such that between any two i`s , there exists exactly i-1 numbers. Is it possible for alln? If no, what are the values of n for which this is possible?

CSE Blog - quant, math, computer science puzzles: DifficultPu... http://www.cseblog.com/search/label/DifficultPuzzles

6 of 10 Friday 27 September 2013 01:47 AM

Page 7: Puzzles Difficult Part 1

7 comments:

Labels: DifficultPuzzles, Discrete-Mathematics, Engineering-Mathematics, Puzzles, Strategy-Puzzles

Disclaimer:I have not been able to solve it. Sudhanshu Tungare (IITB 2008 EE Alumnus, Morgan Stanley)claims to have a solution. Cheers!

Update (November 1, 2011):Part solution posted by Nishant Totla (CSE IITB Senior Undergraduate), Richie and Sarat incomments! Complete solution posted by Siddhant Agarwal (EE IITB Alumnus, CMI Grad student)in comments! Thanks a ton.

Recommend this on Google

A u g 1 7 , 2 0 1 1

3 comments:

Labels: DifficultPuzzles, Discrete-Mathematics, Number-Theory, Puzzles

Sacred Right Pan - IMO 2011 Problem

Source: IMO 2011 Problem (sent to me by Dinesh Dharme, CSE IITB 2011 Alumnus, CreditSuisse Analyst)

Problem:Let n > 0 be an integer. We are given a balance and n weights of weight 2^0, 2^1, . . . ,2^(n−1). We are to place each of the n weights on the balance, one after another, in such a waythat the right pan is never heavier than the left pan. At each step we choose one of the weightsthat has not yet been placed on the balance, and place it on either the left pan or the right pan,until all of the weights have been placed.

Determine the number of ways in which this can be done.

Disclaimer:As expected from an IMO problem, very difficult! But interesting solutions atwww.math.leidenuniv.nl/~desmit/pop/2011_imo_final6.pdf

Update (25 Aug 2011):I did not write in clearly in the post. One of the solutions provided in the pdf is an oral 3 linesolution to the problem. It cannot get smaller than this :P. Even if you have solved the problem,do have a look at the pdf

Recommend this on Google

J u l 6 , 2 0 1 1

1 comment:

Labels: DifficultPuzzles, Discrete-Mathematics, Probability, Puzzles, UnsolvedPuzzles

Expectation of Max Frequency

Source: Sent to me by Nikhil Garg (CSE Senior Undergrad, IITD) - who got this from RudradevBasak

Problem:There are K balls in a sack numbered 1 to K. Bob chooses a ball at random notes down itsnumber and puts it back in sack. He does this process for N times. What is the expected value ofthe frequency of the most frequent element ?

Best of Luck! I do not have the solution. So, tell me if you get one. Thanks.

Recommend this on Google

F e b 2 5 , 2 0 1 1

Coin Toss Bankruptcy

CSE Blog - quant, math, computer science puzzles: DifficultPu... http://www.cseblog.com/search/label/DifficultPuzzles

7 of 10 Friday 27 September 2013 01:47 AM

Page 8: Puzzles Difficult Part 1

8 comments:

Labels: DifficultPuzzles, Engineering-Mathematics, Probability, Puzzles

Source: Mailed to me by Sudeep Kamath (EECS PhD Student, UC Berkeley, EE IITB 2008Alumnus)

Problem: Three people start with integer amounts a,b and c. In each round, each one tosses afair coin. If not all faces are the same, the person with the different face gets a rupee from eachof the other two. If all faces are the same, no money is exchanged. This process is repeated tillone of them gets bankrupt. What is the expected number of rounds till the game ends?

Related Problems:http://pratikpoddarcse.blogspot.com/2009/10/lets-say-keep-tossing-fair-coin-until.htmlhttp://pratikpoddarcse.blogspot.com/2010/11/source-credit-suisse-placement-test-at.htmlhttp://pratikpoddarcse.blogspot.com/2011/02/equal-heads-and-tail.html

Update (15/03/2011):Hint: Given away by Sudeep. (* Define a martingale of the formY_n=A_n*B_n*C_n + some other term (where A_n,B_n,C_n are the fortunesof the three players at time n). *)Solution: Posted by chera (Gaurav Sinha, IITK 1996 Graduate, Indian Revenue Service) incomments!

Recommend this on Google

F e b 6 , 2 0 1 1

15 comments:

Labels: DifficultPuzzles, Discrete-Mathematics, Probability, Puzzles

Equal Heads and Tail

Source: Posted by chera (Gaurav Sinha, IITK 1996 Graduate, Indian Revenue Service) incomments on Consecutive Heads Problem

Problem:Suppose you have a fair coin and you toss it until you have got equal number of heads and tails.What is the expected number of tosses? Note that probability that the game stops in oddnumber of tosses is 0. The probability that the game stops in 2 tosses = 0.5

Solution:Different solutions posted by Kalyan Parhi (EE IITB Alumnus), Abhash, Siva, Gaurav Sinha (CSEIITK 1996 Alumnus, Indian Revenue Service), Dinesh Krithivasan (IITM Alumnus, Phd University ofMichigan, Senior Qualcomm Engineer) in comments!

Recommend this on Google

J a n 2 7 , 2 0 1 1

10 comments:

Labels: DifficultPuzzles, Discrete-Mathematics, Number-Theory, Probability, Puzzles

Expectation of 2^(Cycle Length)

Source: Mailed to me by Sudeep Kamath (EECS PhD Student, UC Berkeley, EE IITB 2008Alumnus), Taken from Anand Sarwate (Postdoc at UC San Diego, PhD from UC Berkeley)

Problem:Given a permutation p of length n, let c(p) be the number of cycles in p. Suppose p is drawnuniformly from the set of all permutations. Show thatExpectation of 2 raised to the power of number of cycles is n+1, i.e E[2^c(p)]=(n+1)

Hint:1) There is no high funda group theory/number theory involved. I could solve this in 15 minutes\m/ \m/2) After you are done, you might want to read this (*Spoiler Alert*)

Solution:Hint posted by Nikhil Garg (CSE, IIT Delhi third year undergraduate student) in comments!Solution posted by Kalyan in comments! Kalyan's comment explained in detail by me incomments! A simpler solution posted by Gaurav Sinha (chera) (CSE IITK 1996 Alumnus, IndianRevenue Service) in comments!

Recommend this on Google

J a n 2 0 , 2 0 1 1

CSE Blog - quant, math, computer science puzzles: DifficultPu... http://www.cseblog.com/search/label/DifficultPuzzles

8 of 10 Friday 27 September 2013 01:47 AM

Page 9: Puzzles Difficult Part 1

Older PostsHome

Subscribe to: Posts (Atom)

You might also like

Coins Puzzle

Break the sticks

Homo paradox

Ants on a Cube

Recommended by

2 comments:

Labels: DifficultPuzzles, Geometry, Probability, Puzzles

CMU Puzzle Toad: Abduction

Source: CMU Puzzle Toad

Problem: Farmer Brown is standing in the middle of his perfectly circular field feeling verycontent. It is midnight and there is no moon and unknown to the farmer, Martian zoologists arelanding randomly at points on the circumference of his field. They land at one minute intervals,starting at midnight. As soon as there are martians at points A,B,C such that triangle ABCcontains the center of the field, Farmer Brown will be teleported to the waiting space-ship andtransported to spend the rest of his life as an exhibit in a Martian zoo. What is the expected timeuntil he is abducted?

Related Problem: http://pratikpoddarcse.blogspot.com/2009/10/semi-circle-covering-n-points-puzzle.html

Solution: Posted on CMU Puzzle Toad (http://www.cs.cmu.edu/puzzle/solution33.pdf). Check myname in the acknowledgments \m/ \m/

Recommend this on Google

D e c 8 , 2 0 1 0

You might also like

Guide to Wall Street Quant Jobs for IITians

Walking Ant Problem - Part 2

Math Olympiad Problem : Overlapping Coins

Odd Even Algorithm Puzzle

Recommended by

10 comments:

Labels: Algorithm-DataStructures, DifficultPuzzles, Discrete-Mathematics, Puzzles

Locks and Switches

There is a lock which is an N by N grid of switches. Each switch can be in one of two states(on/off). The lock is unlocked if all the switches are on. The lock is built in such a way that, if youtoggle some switch, all the switches in its row and its column toggle too

Give an algorithm which, given N and a configuration of the N^2 switches, will tell you whetherthe lock can be unlocked by a sequence of switch toggles

Note 1: Can be done in O(N^2) time and O(1) space.Note 2: You just need to tell if a sequence which unlocks the lock exists (and not the actualsequence)

Update (Dec 20, 2010):Complete solution posted jointly by Siddhant Agarwal (EE, Final year student, IITB) and GauravSinha (IITK 1996 CSE Alumnus, IRS Officer). Thanks a lot

+1 Recommend this on Google

CSE Blog - quant, math, computer science puzzles: DifficultPu... http://www.cseblog.com/search/label/DifficultPuzzles

9 of 10 Friday 27 September 2013 01:47 AM

Page 10: Puzzles Difficult Part 1

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

10 of 10 Friday 27 September 2013 01:47 AM