Timeline for Retry method for generating unique code
Current License: CC BY-SA 3.0
9 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 22, 2014 at 20:25 | vote | accept | Stonetip | ||
| Dec 22, 2014 at 18:11 | comment | added | thepacker | Not at all, it is the chance to fail even with 5 tries. 100*(0.5^5) is the percent vale of the chance to fail. | |
| Dec 22, 2014 at 18:07 | comment | added | Stonetip | No, I just meant that my assumption of .5^5 was bad. I see that going to 7 retries gets me to just over 99% certainty of success and 10 to 99.9% | |
| Dec 22, 2014 at 18:04 | comment | added | thepacker | Do i need to elaborate more on the 96 percent thing? If so i will add it to my answer. - my fault 3,25 should be 3,125% and the 96,75 wasnt that correct, i should have used a calculator. | |
| Dec 22, 2014 at 17:56 | comment | added | Stonetip | I am bad enough at math to be dangerous. | |
| Dec 22, 2014 at 17:50 | comment | added | thepacker | 5 retries means a 50 percent chance to fail, if you fail, another 50 percent chance on 50 percent the cases to fail again (Bernoulli experiment) (you only need to succeed once) - this means your success in five tries near the 50 percent boundary is round about 50% + 25% + 12,5% + 6,25% + 3,25% = 96,75 %. If you need more certaincy you will need to extend the number of tries - regardless of the algorithm you use. | |
| Dec 22, 2014 at 17:38 | comment | added | Stonetip | Thanks for the math info and the reason for possibly needing to increase the retry count if the table is approaching the sqrt. My actual sqrt is only 19683 (27 char set). If I'm correct, 5 tries will mean ~ 1 in 3200 chance (.5^5) of the user failing to get a code IF the table already has that many values. Seems adequate, given the project requirements. | |
| Dec 22, 2014 at 17:12 | history | edited | thepacker | CC BY-SA 3.0 |
added 143 characters in body
|
| Dec 22, 2014 at 17:01 | history | answered | thepacker | CC BY-SA 3.0 |