MathB.in
New
Demo
Tutorial
About
*Five distinct numbers are chosen randomly from $\{10,11,.\dots,99\}$. What is the probability that there are at least two among the chosen numbers whose difference is 1?* ([@CutTheKnotMath](https://twitter.com/CutTheKnotMath/status/1013410648552890368)) Solution by [@jordancurve](http://twitter.com/jordancurve): The answer is $1 - {86 \choose 5}/{90 \choose 5} \approx 0.2076$. The hard part of the question is counting the number of ways to choose 5 non-adjacent numbers from 10 through 99. For simplicity, it is helpful to first subtract 9 from each number, so they range from 1 through 90. There are $86 \choose 5$ ways to choose 5 non-adjacent numbers from 1 through 90. To see this, first choose 5 non-adjacent numbers from 1 through 86 and write them as a bit string in which 0 represents an unchosen number and 1 represents a chosen number. For example, the choice {2,3,6,8,86} would look like this: $$0110010100\dots001 \mathrm{\ (86\ bits)}$$ Now add a zero between each pair of ones. This will be four additional zeros. The string becomes: $$0101000100100...001 \mathrm{\ (90\ bits)}$$ By construction, the second string represents 5 numbers chosen from 1 through 90 with no adjacent numbers. To convert any such string to a selection of numbers from 1 through 86, remove a zero between each pair of ones.
ERROR: JavaScript must be enabled to render input!
Sun, 01 Jul 2018 15:46 GMT