I have a very important file, so I've saved a copy on 10 of my 20 harddrives. However, N of these harddrives will be corrupted, where N is equally likely to be 0, 1, 2,..., 20. What is the probability that my file will be safe?
For n=0 to 9, the file will definitely be safe in at least one of the drives.
If 10 drives are corrupted, the probability that all 10 copies are lost is 10/20 * 9/19 * ... * 1/11.
If 11 drives are corrupted, the probability that all 10 copies are lost is 11/20 * 10/19 * ... * 2/11.
In general if more than 9 drives are corrupted, the probability that all copies are lost is n! / (n10)! / (20! / 10!)
The overall probability that the file is lost is the sum of these probabilities divided by 21. Then, when that quotient is subtracted from 1, you get the probability the file is safe somewhere on a good hard drive.
n probability
of loss
10 1/184756
11 1/16796
12 3/8398
13 1/646
14 7/1292
15 21/1292
16 14/323
17 2/19
18 9/38
19 1/2
20 1
The total when divided by 21 adds up to an overall probability of loss as 1/11, so the probability the file is safe is 10/11.
5 kill "crptfile.txt":open "crptfile.txt" for output as #2
10 for N=10 to 20
20 P=!(N)//!(N10):P=P*!(10)//!(20)
21 Tot=Tot+P
30 print N,P:print #2,N,P
40 next
60 print Tot//21:print #2,Tot//21
70 close #2

Posted by Charlie
on 20190307 13:08:51 