Quant面试好题汇总

简单题

1

You can buy chicken nuggets in packs of 7 or 11. What is the maximum number of chicken nuggets you can not buy using only packs of 7 or 11?

使用鸡翅定理:两个互素整数不能表示的最大值是mn-m-n

2

Solve x x x . . . = 2 x^{x^{x...}} = 2 xxx...=2

2 = x x x . . . = x x x x . . . = x 2 , x = 2 2=x^{x^{x...}} = x^{x^{x^{x...}}}= x^2, x=\sqrt{2} 2=xxx...=xxxx...=x2,x=2

3

How many digits are in 99 to the 109th power?

9 9 109 = 10 0 109 ∗ 0.9 9 109 99^{109}= 100^{109}*0.99^{109} 99109=1001090.99109
0.9 9 109 = 0.9 9 9 ∗ ( 1 − 1 / 100 ) 100 ≈ 1 / e 0.99^{109} = 0.99^{9}*(1-1/100)^{100}\approx1/e 0.99109=0.999(11/100)1001/e
所以位数大约218

4

Throw a fair die with 6 faces, what is the expected number of times until two consecutive 6’s come out?

设期望值是x,那么 x = 1 / 6 ∗ 1 / 6 ∗ 2 + 5 / 6 ∗ ( x + 1 ) + 1 / 6 ∗ 5 / 6 ∗ ( x + 2 ) x=1/6*1/6*2+5/6*(x+1)+1/6*5/6 *(x+2) x=1/61/62+5/6(x+1)+1/65/6(x+2)
得到x=42

5

There are ‘b’ blue balls and ‘r’ red balls in an urn. What is the expected number of balls drawn before the first blue ball is selected?

你有r个红球,对每个红球来说,它比b个蓝球先抽到的概率是1/(b+1),同时球数加一,所以总和加起来是r/(b+1)

6

Chance of seeing star in 1 hour is 60%. What is the chance of seeing star in half an hour?

一个小时看不到星星的概率是0.4,设半个小时看不到星星的概率是x,那么 x 2 = 0.4 x^2=0.4 x2=0.4, 所以x=0.632,故半个小时看得到星星的概率是0.37

7

Two people play a game. The first person starts with the number 1 and can multiply 1 by any number from 2-9. Then, the second person multiplies this new number by any number from 2-9. The winner is the first person to get a million or more. Who wins the game with an optimal strategy?

回溯法
111111-1000000一定会赢
55556-111110一定会输
6173-55555一定赢
3087-6172一定输

10-18一定输
2-9一定赢
1一定输(第二个会赢)
规律就是用目标数除以18的n次方看最小的大于一的结果是什么,如果大于9那么第一个会输,小于9第二个会输
根本法:
如果目标值是18的n次方,那么第一个人会输,可以用数学归纳法证明。再用数学归纳法给证明所以如果目标值是 1 8 n ∗ r , 1 ≤ r < 18 18^n*r,1\le r<18 18nr,1r<18,那么当 1 ≤ r ≤ 9 1\le r \le 9 1r9第一个人赢,否则第二个人赢。归纳过程:如果 2 ≤ r ≤ 9 ∣ 1 < r < 2 2\le r \le 9|1<r<2 2r91<r<2, 前者的话第一个人第一次选择r,因为目标值除以r,得到18的n次方,第二个人输,后者的话第一次选2,留给第二个人的是 9 < r < 18 9<r<18 9<r<18, 根据归纳,第二个人会输。如果 9 < r < 18 9<r<18 9<r<18,第一个人无论怎么选择 2 ≤ k 1 ≤ 9 , 1 < r / k 1 < 9 2\le k_1\le 9,1<r/k_1<9 2k19,1<r/k1<9, 第二个人参见前面的情况赢。

8

A germ population begins with one germ. Then, after each period, the germ can divide into 1,2,3, or 0 germs with equal probability, where 0 signifies death of the germ. What is the approximate probability the population of germs will eventually die out?

用条件概率公式
p = 1 / 4 + 1 / 4 ∗ p + 1 / 4 ∗ p 2 + 1 / 4 ∗ p 3 p = 1/4 + 1/4*p + 1/4*p^2 + 1/4*p^3 p=1/4+1/4p+1/4p2+1/4p3
解得
p = 2 − 1 p=\sqrt{2} - 1 p=2 1

9

You have 100 dollars, and there is a dollar bill behind each door. You roll a 100 sided die 100 times, and you take the dollar behind the door on the die roll if the bill has not been taken already (e.g. you roll 16, then you take the dollar behind door 16 if you haven’t already taken it). What is your expected payoff?

A i A_i Ai为第i扇门至少打开一次
E X = ∑ i P r ( A i ) , P r ( A i ) = 1 − ( 99 / 100 ) 100 EX = \sum_iPr(A_i), Pr(A_i)=1-(99/100)^{100} EX=iPr(Ai),Pr(Ai)=1(99/100)100

10

Uma has 50 red and 50 blue balls. she has two bouls in such a way that none of the bouls are left empty if one were to choose one of the two ball at random and then randomly draw a Ball from it​

一个罐子只有一个红球,另一个罐子是所有的其他
这样的话,对于任意的策略,如果一个碗的红球比篮球多,他的概率一定小于等于1,另一个的红球一定比蓝球少,所以概率小于49/99(因为这是最接近1/2的数了)

11

一个木桶里面有M个白球,每分钟从桶中随机取出一个球涂成红色(无论白或红都涂红)再放回,问将桶中球全部涂红的期望时间是多少?

设E(i)为桶里有i个红球所要的时间
E(i)=i/M*(1 + E(i)) +(M-i)/M*(1 +E(i+1))
E(M)=0
E(0)=M/M + M/(M-1) + … + M/1 + 0

12

平均要取多少个(0,1)中的随机数才能让和超过1

容易归纳出来n个数字加起来大于1的概率为1-1/n!
所以刚好n个数字加起来大于1的概率为(n-1)/n!
所以求和 ∑ i = 2 ∞ 1 / ( n − 2 ) ! = ∑ i = 0 ∞ 1 / n ! = e \sum_{i=2}^{\infty}1/(n-2)! = \sum_{i=0}^{\infty}1/n!=e i=21/(n2)!=i=01/n!=e

13

You are given a die with 100 sides. One side has 1 dot, one has 2 dots and so on up until 100. You are given a chance to roll the die and, however many dots come up, you can choose to (a): take that many dollars, or (b): pay 1 and roll again. You can continue to reroll as many times as you see fit, but you only keep the money of the one roll that you choose to end with. What is the optimal strategy and expected value?

最优策略为摇到x或者以上就走人
那么期望的收益是(100+x)/2,每次摇筛子走人的概率为(100-x+1)/100因为包括x,由于服从几何分布,次数的期望为100/(101-x)-1因为第一次不需要钱。 m a x ( 100 + x ) / 2 − 100 / ( 101 − x ) + 1 max (100+x)/2-100/(101-x)+1 max(100+x)/2100/(101x)+1
得到x=87

14

Two people each bids a number before throwing a 30 faced die. Whoever gets closer to the number wins and wins the amount of money equal to the number they throw. e.g I bid 15 and you bid 16. the die lands on 10 then i win 10 from you. What’s the best strategy and the expected payoff.

Solution
Assume you choose T. So the best way of your oppenent is to choose T-1 ore T+1. For example if he choose R and R is smaller than T, so that he will win only when the outcome is smaller than T and closer to R. But if R = T-1, he will definitely win if outcome is smaller than T. Same as another direction. So your earning is min{T/30*(1 + T)/2 - (30-T)/30*(30+T+1)/2, (31-T)/30*(30+T)/2 - (T-1)/30*(1 + T-1)/2}. We max this earning and we choose 22.

15

只有一堆n个物品,两个人轮流从这堆物品中取物,规定每次至少取一个,最多取m个。最后取光者得胜。

显然,如果n=m+1,那么由于一次最多只能取m个,所以,无论先取者拿走多少个,后取者都能够一次拿走剩余的物品,后者取胜。因此我们发现了如何取胜的法则:如果n=(m+1)r+s,(r为任意自然数,s≤m),那么先取者要拿走s个物品,如果后取者拿走k(≤m)个,那么先取者再拿走m+1-k个,结果剩下(m+1)(r-1)个,以后保持这样的取法,那么先取者肯定获胜。总之,要保持给对手留下(m+1)的倍数,就能最后获胜。

16

时钟问题
hour hand: 0.5degree/minute
minutes hand: 6degree/minute

17

Imagine the corners of a cube. Each second you move to a random neighboring corner (with equal probability). What is the expected number of seconds before you reach the opposite corner?
Solution
Label the opposite corner to be 0, corner next to it to be 1, and so on. Our goal is to find the expectation of 3 to 0. We denote the expectation of each corner to 0 as E i E_i Ei.
E 3 = 1 + E 2 E 2 = 1 + 1 / 3 E 3 + 2 / 3 E 1 E 1 = 1 + 2 / 3 E 2 + 1 / 3 E 0 , E 0 = 0 E_3 = 1 + E_2\\ E_2 = 1 + 1/3E_3 + 2/3E_1\\ E_1 = 1 + 2/3E_2 + 1/3E_0,E_0=0 E3=1+E2E2=1+1/3E3+2/3E1E1=1+2/3E2+1/3E0,E0=0Finally we got E 3 = 10 E_3=10 E3=10
Cube

18

Select numbers uniformly distributed be­tween 0 and 1, one after the other, as long as they keep decreasing; i.e. stop selecting when you obtain a number that is greater than the previous one you selected.
(i) On average, how many numbers have you selected?
(ii) What is the average value of the smallest number you have selected?
Solution
(i) The probability that the first i selection are decreasing is 1/i!. Beacuse whatever they get, the overall permutation of i different number is i!. So stop in i-th selection is 1/(i-1)! - 1/i!
E = ∑ i = 2 ∞ i × i − 1 i ! = ∑ i = 0 ∞ 1 i ! = e E = \sum_{i=2}^{\infty} i\times \frac{i-1}{i!}\\ =\sum_{i=0}^{\infty} \frac{1}{i!}=e E=i=2i×i!i1=i=0i!1=e
(ii)We should first figure out the density of each number be the smallest number of the selection and then intergrate it over 0-1. The probability of x ∼ x + d x x\sim x+dx xx+dx(differential) be the last number equals to the probability of x ∼ x + d x x\sim x+dx xx+dx in the selection times the condition probability of it becomes the last one in this selection. The probability of x ∼ x + d x x\sim x+dx xx+dx in the selection defined as p ( x ) d x p(x)dx p(x)dx. It is equals to ∑ i = 1 ∞ p i ( x ) d x \sum_{i=1}^{\infty}p_i(x)dx i=1pi(x)dx, which p i ( x ) d x p_i(x)dx pi(x)dx represents it’s probability in i-th selection. p i ( x ) d x = ( 1 − x ) i − 1 ( i − 1 ) ! d x p ( x ) d x = ∑ i = 1 ∞ p i ( x ) d x = ∑ i = 0 ∞ ( 1 − x ) i i ! d x = e 1 − x d x p_i(x)dx = \frac{(1-x)^{i-1}}{(i-1)!}dx\\ p(x)dx=\sum_{i=1}^{\infty}p_i(x)dx\\ =\sum_{i=0}^{\infty}\frac{(1-x)^{i}}{i!}dx=e^{1-x}dx pi(x)dx=(i1)!(1x)i1dxp(x)dx=i=1pi(x)dx=i=0i!(1x)idx=e1xdx
The conditional probability that it is the last selection is the next selection larger than x which is 1-x. So the probability of x ∼ x + d x x\sim x+dx xx+dx(differential) be the last number is ( 1 − x ) e 1 − x d x (1-x)e^{1-x}dx (1x)e1xdx
E = ∫ 0 1 x ( 1 − x ) e 1 − x d x = ∫ 0 1 y e y ( 1 − y ) d y = 3 − e E = \int_0^1 x(1-x)e^{1-x}dx\\ =\int_0^1ye^y(1-y)dy=3-e E=01x(1x)e1xdx=01yey(1y)dy=3e

19

Two players A and B play a marble game. Each player has both a red and a blue marble. They present one marble to each other. If both present red, A wins $3. If both present blue, A wins $1 If the colors do not match, B wins $2. The winnings come from an external source. not from the other player.
Is it better to be A, or B, or does it matter?
Solution
This question is easy to find that those expectation are the same, but the variation of B is 1 and A is 1.5. So if you are a rism averse person, you may choose B.

20

How many different ways can you invest $20,000 into five funds in increments of $1,000? For example, one way to do it is ($0; $4,000; $1,000; $2,000; $13,000).
Solution
we denote 20,000 as 20 stars, add 4 stars stand for the split. so the final answer is choose 4 from 24

21

You will roll a fair die until the game stops. The game stops when you get a 4, 5, or 6. For every number 1, 2, or 3 you have thrown your score increases by + 1. If the game stops with a 4 or 5, you get paid the accumulated score. If the game stops with a 6 you get nothing. What is the expected payoff of this game?
Solution
Only compute the expected number of rolls until we got 4,5,6. EN = 1/21 + 1/2(1 + EN) We have EN = 2. So the expected payoff = 2/3*(2-1) = 2/3

22

A sultan has captured 50 wise men. He has a glass currently standing bottom down. Every minute he calls one of the wise men who can choose either to turn it over (set it upside down or bottom down) or to do nothing. The wise men will be called randomly, possibly for an infinite number of times. When someone called to the sultan correctly states that all wise men have already been called to the sultan at least once, everyone goes free. But if his statement is wrong, the sultan puts everyone to death. The wise men are allowed to communicate only once before they get imprisoned into separate rooms (one per room). Design a strategy that lets the wise men go free.
Solution
The spokesman should act differently with all other 49 men. One possible solution is the spokesman turn the glass bottem down if he find it is upside down. The other people will only turn the glass upside down if it is the they time they came and found it bottom down. So when the spkesma found it has been upside down 49 times, he can say to the sultan.

23

We are playing a game. You start with £100. I shall flip a fair coin. If the coin comes up heads, you add £1 to your previous sum of money. If it comes tails the sum you have gets inverted( i.e. you have £x, your sum becomes £(1/x). £100 goes to £0.01, £0.5 to £2 and so on). What is the expected amount of money you will end up with after 10 consecutive coin flips?
Solution: Use fibonacci to give approximation
There are two ways to end near 100, you either already have 100 and flip heads, or you have 100 and flip tails twice in a row, everything else will give you a messy fraction.
Let’s see how this plays out:
Flip 0: you have one 100.
Flip 1: the 100 becomes 101, you still have one.
Flip 2: the 101 becomes 102, the 100 from flip 0 has now flipped back and gave us 100, now we have two.
Flip 3: the 102 becomes 103, the 100 becomes 101, and the 101 from flip 1 flipped back and gave us 101, now we have three.
A familiar pattern is emerging. You can add the number of 100s from the turn before and the number of 100s from two turns before (the flip backs) to determine how many 100s you have now.
The sequence will goes 1, 1, 2, 3, 5, 8, 13, 21. Fibonacci!

24

Best strategy of shutting the box
Solution:
Any panels you close on a turn will, by rule, always have the same sum, so a given roll will always reduce your score by the same amount.

So all you can do is leave open as many possibilities as possible for future rolls. You do this by closing as few numbers as possible on each roll. Closing 5 is better than closing 2 and 3 because if you roll a 2 or a 3, the 5 won’t help you, but the 2 and 3 together can serve any purpose the 5 could serve.

25

You have all the clubs from a deck, 13 cards, and you can choose 2 from the deck and get paid their product, where all face cards are considered to be 0. You can pay $1 to reveal the difference of any two cards you choose, how much would you pay to play this game?
Solution
Max: 90
Minimum times to find 9 and 10: 11
Choose one card first: if it is 0 or not you can decide which is 10 or 9

26

You have a shuffled deck of 26 red and 26 black cards. You play a game by repeatedly looking at the top card and either discarding it or ending the game. At the end if the color of the next card matches that of the top card you win, otherwise you lose. What is the optimal strategy?
Solution
you should keep playing no matter what until only two face-down cards are left. Based on the cards you’ve seen so far, you should be able to determine if they’re the same color or different colors. Based on that:

If the two face-down cards are the same color, flip the next one of them over, and then stop, winning the game with probability 1.If the two face-down cards are opposite colors, stop: one of them will match the current top card and one won’t, so you win with probability 1/2.
The only difference from quasi’s strategy is that the Two-Card Strategy potentially stalls for a while if it gets into a situation where there are many cards left, all of one color. (In that case, we can win with probability 1 before getting down to two face-down cards.) But this doesn’t change the winning probability, since we win anyway in either case.

As a result, the two bottom cards of the deck are ultimately what determines the fate of this strategy.

Now consider any other strategy. If the other strategy also always waits until two face-down cards are left, it’s easy to see that it can’t beat the Two-Card Strategy. So suppose that the other strategy decides to stop at some point when more than two cards are left.

We’ll consider each of those early stopping points one by one. If, when the other strategy decides to stop, the top card is red (without loss of generality) and there are r red and b black cards left, the other strategy wins with probability r/r+b. We may assume b≥1; if b=0, then the other strategy definitely wins in this case, but so does the Two-Card strategy, because then the bottom two cards are definitely red.

If we decided to keep going and use the Two-Card Strategy instead, then:
在这里插入图片描述

27

imagine an infinite chess board. If the horse from 1 case, in how many cases can he possibly ends after 10 moves. You actually don’t have to give a number but a 95% confidence interval. pen and paper allowed
Solution
Each knight moves along the diagonal of a triangle with legs 1 and 2; in other words, the knight moves sqrt{5} away from the center with each move. So the spaces that the knight could land on would be roughly inside a circle of radius 10sqrt{5}, which has area about 1500. But the knight can only land on half of those squares because in an even number of moves he must land on a square that’s the same color as the square he started on. So your estimate would be 750, so take some reasonable interval around 750.

28

You have 2 clocks, that are x hours apart. What is the probability that at any given time, both clocks’ minute and hour hands form acute angles?
Solution
First, on the first clock, the relative angle between the hands, R, is uniformly distributed in [-180, 180]. You can see this because the minute hand has a constant velocity wrt to the hour hand and after 12 hours, they end up at the same place. In particular, the angle is acute only if the degree is within [-90, 90].

x hours represents (x/12) * 360 = 30x degrees.

Let y be the relative angle of the first clock. y and y+30x are both in [-90, 90] iff y is in [-90, 90-30x]. What percentage of the time is this? ((90 - 30x) - (-90)) / 360 = (180 - 30x) / 360 = (6-x) / 12

29

You and I each have $14. I flip a fair coin repeatedly. If it comes up heads, I give you a dollar, but if it comes up tails, you give me a dollar. What is the expected number of flips until one of us runs out of money?
Answer:
Let the final net win flips of me to be S N S_N SN. It is easy to find S N S_N SN and S N 2 − N S_N^2 - N SN2N are both martingales. Let p to be the probability of you win. Cleary it is 0.5. So E [ S N 2 − N ] = 1 4 2 − N = 0 , N = 196 E[S_N^2 - N] = 14^2 - N=0, N = 196 E[SN2N]=142N=0,N=196

30

Advanced version of 29.
From where he stands, one step toward the cliff would send the drunken man over the edge. He takes random steps, either toward or away from the cliff. At any step his probability of taking a step away is 2/3, of a step toward the cliff 1/3, What is his chance of escaping the cliff?
Answer:
在这里插入图片描述
Assume P i P_i Pi to be the probabililty that the drunk now stand at i and will be absorbed to cliff. P 1 = 1 − p + p × P 2 , P 2 = P ( ever reach to 1 ) × P 1 P_1 = 1-p + p\times P_2, P_2 = P(\text{ever reach to 1})\times P_1 P1=1p+p×P2,P2=P(ever reach to 1)×P1. We need to notice that P ( ever reach to 1 ) P(\text{ever reach to 1}) P(ever reach to 1) is P 1 P_1 P1. So we have P 1 = 1 − p + p × P 1 2 , P 1 = 1 , 1 − p p P_1 = 1-p + p\times P_1^2, P_1 = 1, \frac{1-p}{p} P1=1p+p×P12,P1=1,p1p. Obviously, when p is 1/2, the prob is 1, p is 0, prob is 1, p is 1, prob is 0. As the prob is continuously, we have. 在这里插入图片描述

31

Advanced version of 30
Player M has $1, and Player N has $2. Each play gives one of the players $1 from the other. Player M is enough better than Player N that he wins 2/3 of the plays. They play until one is bankrupt. What is the chance that Player M wins?
Answer:
Assume M has $m, N has infinty. If the M win rate is p, then his prob of losing is 1 if p <1/2, or ( 1 − p p ) m (\frac{1-p}{p})^m (p1p)m if p >= 1/2. So if we let N has $n and N’s win rate as Q. If p >= 1/2, we have Q = ( 1 − p p ) m − ( 1 − Q ) × ( 1 − p p ) m + n Q = (\frac{1-p}{p})^m - (1- Q)\times (\frac{1-p}{p})^{m+n} Q=(p1p)m(1Q)×(p1p)m+n. That’s because Q is the probability that M get absorbed before he reach m+n. That is M get absorbed when N is infinity minus the probability that M reached m+n first and then get absorbed, which is ( 1 − Q ) × ( 1 − p p ) m + n (1- Q)\times (\frac{1-p}{p})^{m+n} (1Q)×(p1p)m+n. So M’s win rate = 1 − ( q / p ) m 1 − ( q / p ) m + n , q = 1 − p \frac{1 - (q/p)^m}{1 - (q/p)^{m+n}}, q = 1-p 1(q/p)m+n1(q/p)m,q=1p. If p =1/2, this is m m + n \frac m{m+n} m+nm by Los’ pital principal. If p < 1/2, q > 1/2. So N’s win rate is 1 − ( p / q ) n 1 − ( p / q ) m + n \frac{1 - (p/q)^n}{1 - (p/q)^{m+n}} 1(p/q)m+n1(p/q)n. M’ s win rate is 1 − 1 − ( p / q ) n 1 − ( p / q ) m + n = 1 − ( q / p ) m 1 − ( q / p ) m + n 1 - \frac{1 - (p/q)^n}{1 - (p/q)^{m+n}} = \frac{1 - (q/p)^m}{1 - (q/p)^{m+n}} 11(p/q)m+n1(p/q)n=1(q/p)m+n1(q/p)m

32

You roll a dice until you get a 5. What is the expected value of the minimum value rolled?
Solution:
在这里插入图片描述
X can only be 1,2,3,4,5. P r ( X ≥ k ) = k − 1 ! k ! = 1 / k Pr(X\ge k) = \frac{k-1!}{k!} = 1/k Pr(Xk)=k!k1!=1/k. Sum them up and we have 137/60.

  • 3
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值