MathB.in
New
Demo
Tutorial
About
Let X be a random variable that denotes the position of the character where COVFEFE occurs for the first time. For example, if COVFEFE are the first seven characters typed then X would be 7. If F is the probability mass function of X, we may write F as: $F(x) = 0; \quad 0 \le x < 7$, as COVFEFE cannot appear until 7 characters are typed $F(7) = k, \quad where \: k= 1/26^7$, all characters are chosen randomly from 26 characters $F(x) = (1- (F(0)+F(1)+ ... + F(x-7)))*k, \quad x\ge7$, COVFEFE shouldn't appear at any position until x-7 and the next 7 letters should match exactly. All events are mutually exclusive so their probability may be added. This can be re-written as: $F(x) = F(x-1) - k*F(x-7); \quad x\ge8$, using the above two statements Now, the question asks for expected value of X. \[ E[X] = \sum_{x=0}^\infty xF(x) = \sum_{x=7}^\infty xF(x) \\ \implies E[X] = 7F(7) + \sum_{x=8}^\infty xF(x) \\ \implies E[X] = 7k + \sum_{x=8}^\infty x(F(x-1) - kF(x-7)) \\ \implies E[X] = 7k + \sum_{x=8}^\infty xF(x-1) - k\sum_{x=8}^\infty xF(x-7) \\ \implies E[X] = 7k + \sum_{x=8}^\infty (x-1+1)F(x-1) - k\sum_{x=8}^\infty (x-7+7)F(x-7) \\ \implies E[X] = 7k + \sum_{x=8}^\infty (x-1)F(x-1) + \sum_{x=8}^\infty F(x-1) - k\sum_{x=8}^\infty (x-7)F(x-7) - 7k\sum_{x=8}^\infty F(x-7) \\ \implies E[X] = 7k + \sum_{x=7}^\infty xF(x) + \sum_{x=7}^\infty F(x) - k\sum_{x=1}^\infty xF(x) - 7k\sum_{x=1}^\infty F(x) \\ \implies E[X] = 7k + E[X] + \sum_{x=7}^\infty F(x) - kE[X] - 7k\sum_{x=1}^\infty F(x) \\ \implies kE[X] = 7k + \sum_{x=0}^\infty F(x) - 7k\sum_{x=0}^\infty F(x) \\ \implies kE[X] = 7k + (1-7k)\sum_{x=0}^\infty F(x) \] Clearly F being a probability mass function, $\Sigma_{x=0}^\infty F(x) = 1 $ \[ \implies kE[X] = 7k + 1 - 7k \\ \implies kE[X] = 1 \\ \implies E[X] = 1/k = 26^7 \]
ERROR: JavaScript must be enabled to render input!
Sun, 03 Dec 2017 12:58 GMT