---
# System prepended metadata

title: UnFound Interview Answer

---

# UnFound Interview Answer
Karan Shah
Friday July 24, 2020

$P(O)$ and $P(H)$ denotes the probability of finding the file in office and at home respectively.
$P(O) =\frac{2}{3}$, $P(H) =\frac{1}{3}$
Let $X$ be the event that he opened $x$ folders and they were all empty.

We need to find $x$ for which $P(O|X)=0.5$

Using Bayes rule, $P(O|X) = \frac{P(X|O)P(O)}{P(X)}$

$P(X) = \frac{2}{3}\frac{\binom{5}{x}}{\binom{6}{x}} + \frac{1}{3}$, where $\binom{n}{k}$ denotes $k$-combination with n elements.  
As a sanity check, we see when that we put $x=6$, we find the first term becomes 0. The probability that all 6 folders are empty is indeed $\frac{1}{3}$ (when the file is at home).

$P(O|X) = \frac{\binom{5}{x}}{\binom{6}{x}}$

We have
$\frac{ \frac{2}{3}\frac{\binom{5}{x}}{\binom{6}{x}}}{\frac{2}{3}\frac{\binom{5}{x}}{\binom{6}{x}} + \frac{1}{3}} = 0.5$

Solving for $x$,
We get ==$x=3$==