Serving the Quantitative Finance Community

 
User avatar
atorch
Topic Author
Posts: 0
Joined: September 28th, 2014, 8:08 pm

Android probability / stats puzzle app, good for interview practice

October 22nd, 2014, 11:21 am

Hi everyone,I've made an android app that should be interesting to people here: https://play.google.com/store/apps/deta ... atspuzzles. Some of these puzzles are from an undergrad stats class I took at Stanford, others are based on interview questions I've been asked over the years... enjoy! Comments and suggestions are welcome.Best,Adrian
 
User avatar
atorch
Topic Author
Posts: 0
Joined: September 28th, 2014, 8:08 pm

Android probability / stats puzzle app, good for interview practice

October 23rd, 2014, 9:04 am

For those who don't have android:For the purposes of this puzzle, a "string" means a sequences of zeros and ones, e.g. 1011.Consider all the different strings of length eight -- a good first step would be to figure out how many of these exist.If you pick a length-eight string uniformly at random, what\'s the probability that it contains two (or more) consecutive 1s?
 
User avatar
atorch
Topic Author
Posts: 0
Joined: September 28th, 2014, 8:08 pm

Android probability / stats puzzle app, good for interview practice

December 3rd, 2014, 1:04 pm

QuoteOriginally posted by: outrun1 - ( (8+2)th Fibonacci number / 2^8), which is 201/256and for generic strings of length [$]n[$]$$ 1 - \frac{(1+\sqrt{5})^{n+2} - (1-\sqrt{5})^{n+2}}{ 2^n \sqrt{5}} $$Nice! Your first line is correct (201/256), but I think there's a typo in your general formula:$$ p(n) \equiv 1 - \frac{(1+\sqrt{5})^{n+2} - (1-\sqrt{5})^{n+2}}{ 2^{2n + 2} \sqrt{5}} $$i.e. [$]2^{2n+2}[$] instead of [$]2^n[$] in the denominator.You then get p(1) = 0, p(2) = 1/4 and p(8) = 201/256.
Last edited by atorch on December 2nd, 2014, 11:00 pm, edited 1 time in total.
 
User avatar
atorch
Topic Author
Posts: 0
Joined: September 28th, 2014, 8:08 pm

Android probability / stats puzzle app, good for interview practice

December 3rd, 2014, 1:24 pm

For those who have android, I have 35 puzzles at https://play.google.com/store/apps/deta ... les.Here's a little puzzle which I haven't yet added to the app:Four hundred and forty passengers are waiting to board a large plane containing exactly that many seats. The first passenger has misplaced his boarding pass -- but he's feeling lucky, and chooses a seat uniformly at random.The remaining passengers all have their boarding passes. If their assigned seat is not yet taken, they sit there; otherwise, they choose an available seat uniformly at random.When the last passenger finally gets to his assigned spot, what's the probability that he finds someone else sitting there?
 
User avatar
Vanubis1
Posts: 1
Joined: February 21st, 2011, 7:41 am

Android probability / stats puzzle app, good for interview practice

December 4th, 2014, 3:48 pm

I think the answer is 50% because the problem is over if someone seats at the place of the first or the last passenger.
 
User avatar
Traden4Alpha
Posts: 3300
Joined: September 20th, 2002, 8:30 pm

Android probability / stats puzzle app, good for interview practice

December 4th, 2014, 6:08 pm

QuoteOriginally posted by: Vanubis1I think the answer is 50% because the problem is over if someone seats at the place of the first or the last passenger.Brilliant! Although the first and last passengers are extremely asymmetric given the sequential boarding process, their seats are symmetric. At any stage of the boarding process, if a passenger cannot sit in their own seat, they have a 50:50 chance of picking either the first or last passenger's seat. And once either of those two seats is occupied, the outcome is certain.