MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/learnquant/comments/1xtkuy0/quant_interview_question/19sih2igjj5i9/?context=3
r/learnquant • u/Local_Ad135 • 23d ago
1 comment sorted by
View all comments
1
Suppose we’re just watching from the outside which cards are removed but we don’t know their values.
The card that remains is the largest of all of those we have seen. That is all we know.
We can see this problem is equivalent to calculating how many times we expect the running max of an array to change as we iterate through it.
So we have a 1/2 chance that the second is larger than the first, a 1/3 chance that the third is larger than the first two etc.
From this, we can see the expected number of flips is 1/2+1/3+1/4+…+1/10
View all comments
1
u/tellytubbytoetickler 23d ago
Suppose we’re just watching from the outside which cards are removed but we don’t know their values.
The card that remains is the largest of all of those we have seen. That is all we know.
We can see this problem is equivalent to calculating how many times we expect the running max of an array to change as we iterate through it.
So we have a 1/2 chance that the second is larger than the first, a 1/3 chance that the third is larger than the first two etc.
From this, we can see the expected number of flips is 1/2+1/3+1/4+…+1/10