Mathematics for Computer Science Mean Time to “Failure” MIT 6.042J/18.062J Flip a coin until a Head comes up Expected Time Pr[Head] = p to Failure F ::= #flips to 1 st Head E[F] ? Albert R Meyer, May 8, 2013 Albert R Meyer, May 8, 2013 ranvarfail.1 ranvarfail.3 Mean Time to “Failure” Mean Time to “Failure” Pr[F= 1] = Pr[H] Pr[F= 1] = p Pr[F= 1] = Pr[H] = p Pr[F= 2] = Pr[TH] = q ⋅ p Pr[F= 3] = Pr[TTH] = q 2 ⋅ p PDF F (n) = q n-1 p Geometric Distribution Albert R Meyer, May 8, 2013 Albert R Meyer, May 8, 2013 ranvarfail.4 ranvarfail.5 1
Mean Time to “Failure” Mean Time to “Failure” E[F] = ∑ n>0 n ⋅ Pr[F=n] E[F] = ∑ n>0 n ⋅ Pr[F=n] = ∑ n>0 n ⋅ q n-1 p = ∑ n>0 n ⋅ q n-1 p 1 = p ∑ n ≥ 0 (n+1)q n = p n q q n qq I (1 − q) 2 1 (1 − q) 2 Albert R Meyer, May 8, 2013 Albert R Meyer, May 8, 2013 ranvarfail.6 ranvarfail.7 Mean Time to “Failure” Mean Time to “Failure” E[F] = ∑ n>0 n ⋅ Pr[F=n] E[F] = ? = ∑ n>0 n ⋅ q n-1 p p q B p 2 = 1 1 p q H = p p q H p � H Albert R Meyer, May 8, 2013 Albert R Meyer, May 8, 2013 ranvarfail.8 ranvarfail.11 2
Mean Time to “Failure” Mean Time to “Failure” E[F] = ? E[F] = p q p q B B H H B B now use Total Expectation E[F |1 st is H] ⋅ p Albert R Meyer, May 8, 2013 Albert R Meyer, May 8, 2013 ranvarfail.12 ranvarfail.13 Mean Time to “Failure” Mean Time to “Failure” E[F] = E[F] = p q p q B B H H B B + (E[F] +1) p E[F |1 st is H] ⋅ p + E[F |1 st is T] ⋅ q ⋅ q now solve for E[F] 1 E[F+1] Albert R Meyer, May 8, 2013 Albert R Meyer, May 8, 2013 ranvarfail.14 ranvarfail.15 3
Mean Time to Failure Mean Time to “Failure” E[F] = application: if space station Mir 1 has 1/150,000 chance of destruction in any given hour, p how may hours expected until destruction? 150,000 hours ≈ 17 years Albert R Meyer, May 8, 2013 Albert R Meyer, May 8, 2013 ranvarfail.16 ranvarfail.17 Intuitive argument E[#fails in 1 try] = p E[#fails in n tries] = np E[#tries between fails] = n = 1 = # tries np p # fails Albert R Meyer, May 8, 2013 ranvarfail.18 4
MIT OpenCourseWare http://ocw.mit.edu 6.042J / 18.062J Mathematics for Computer Science Spring 20 15 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.
Recommend
More recommend