1
$\begingroup$

I was linked a youtube video where the first two characters were underscores, how could I calculate the probability of that happening? 64 possible characters, 11 character long string, and only two underscores appearing twice at the beginning. Is this possible?

$\endgroup$
1
  • 3
    $\begingroup$ Probability under what distribution? It’d be impossible in a language that doesn't use it, and quite likely if it's a Morse code written using “.” and “_”. $\endgroup$
    – Tim
    Commented Mar 1, 2023 at 7:30

1 Answer 1

1
$\begingroup$

If you assume that all characters are equally likely to appear at any position (not likely for any "real" language, but probably a reasonable assumption for auto-generated URLs), then the probability for an underscore at any particular position is $\frac{1}{64}$.

If you also assume that characters are independent (again see above), then the probability for two underscores is $\frac{1}{64}\times\frac{1}{64}\approx 0.0002$.

$\endgroup$
3
  • $\begingroup$ This assumption alone does not determine your answer. You are implicitly assuming the characters are drawn independently. For a common application where the characters meet your initial assumption but are not independent, see any of our threads about Scrabble. $\endgroup$
    – whuber
    Commented Mar 1, 2023 at 15:49
  • $\begingroup$ @whuber: I write in my second paragraph that if we can assume independence, the result follows. Where is my error? $\endgroup$ Commented Mar 1, 2023 at 16:06
  • $\begingroup$ Sorry -- I was looking for assumptions at the outset and overlooked your clearly stated assumption in the second paragraph! +1. $\endgroup$
    – whuber
    Commented Mar 1, 2023 at 17:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.