Tuesday, November 5, 2013

Those damn cards...

We are quickly approaching the end of the combo interview question bank series. So far we have discussed a variety of coin and dice problems. Yet another popular theme would be card games, specifically with poker decks. As compared to coins and dice, a poker deck contains two colours and four suits, giving rise to some interesting and complicated games and problems.

CF01
A deck consists of 3 red and 3 black cards. They are turned over one by one, and at any point you can make the call of the following card being red. If it turns out to be the case, you win. What is the optimal strategy?

CF01- Answer:
This is closely related to option pricing with binomial tree. Being able to call 'red' as you wish is equivalent to early exercise. It's trivial to show that without early exercise, the probability tree reads:
0.5000
0.3125  0.6875
0.1250 0.5000 0.8750
0.0000 0.2500 0.7500 1.0000
0.0000 0.5000 1.0000
1.0000 0.0000
corresponding to #Black card shown : #Red card shown
0:0
0:1  1:0
0:2  1:1  2:0
0:3  1:2  2:1  3:0
1:3  2:2  3:1
2:3  3:2
Remember, this is when there is no early exercise, meaning that you can only passively look at cards being flipped open and wait to see if the last card is red. To take early exercise into account, some nodes on the probability tree will be over-ridden, depending on the numbers of remaining cards on the node. Take the (1:2) node as an example. When 1 Black card and 2 Red cards are already shown, there are 2 Black cards and 1 Red card remaining in the deck. Hence the winning probability of early calling at this point is 1/3 = 0.333..., which is greater than 0.25. Hence the optimal strategy would require early calling at this node. Similar argument can be made regarding other nodes on the tree.

CF02
You draw a card from a deck and player B draws another. You win only if your draw has a higher number. What is the probability that you will win?

CF02- Answer:
P(numbers equal) = 3/51 = 1/17. Due to symmetry, the two parties have the same winning probability. Hence P(you win) = (1 - 1/17) / 2 = 8/17

See here for more interview questions/brainteasers

No comments:

Post a Comment