Anyone have the way to calculate the chances of 1. the same word appearing twice anywhere in any random 24 secret words, and 2. the same word appearing twice in direct sequence (at any position, but consequtively) within the random 24 secret words? It'd be very interesting to know. When testing wallets extensively over the past 6 months, i've seen 1. a few times, and 2. once. I don't know how many total mnemonics there are, if we know that, maybe someone knows how to calculate.

Sep 4, 2022, 10:57 AM
2048 words total
Sep 4, 2022, 11:08 AM
Mathematicians! What formula would we use to calculate possibility 1 and 2?
Sep 4, 2022, 11:10 AM
The probability of certain word to appear in passphrase is 24/2048 (24 is count of words in passphrase and 2048 is all words count) which is ~1.17%
The probability of 2 certain words to appear in passphrase in any place is 24/2048 * 23/2048 which is ~0.013%
So there is nothing incredible that you saw this:)
Sep 4, 2022, 11:41 AM
You can run the real mnemonic generation algorithm and just measure how often this will happen. This will give you real life results.
Sep 4, 2022, 11:42 AM
The probability of the two same words appearing CONSECUTIVELY?
I mean statistically. The same word twice one after the other. There will be a formula to calculate that probability. It will be a lot less again. Perhaps Daniil can provide. My mathematics is unfortunately very rusty!
Sep 4, 2022, 11:44 AM
I'm not sure if there any restrictions about same words appearing, but if there are NO any restrictions in code, the probability will be 23/2048 = ~1.12%
Sep 4, 2022, 11:46 AM
No the same words can appear and I’ve seen it few times in manual testing. But the same word directly after one another for example in position 12 and 13 you have “rice” not in a position with some other word in between. How would you calculate that? Or were you saying that’s 0.013% in which case I misunderstood the previous answer.
Sep 4, 2022, 11:48 AM
There are no restrictions, each word is selected randomly.
Sep 4, 2022, 11:48 AM
Yes in theory there could be 24 same words the same and that would be one in trillions I guess. But just twice in succession would be good to know as it’s still quite rare and a young enthusiastic newcomer to Ton has such a situation. Nice to tell him exactly how lucky he is. ))
Sep 4, 2022, 11:50 AM
Probability is ~1.12% for two same words to appear in adjacent positions

Probability is ~0.013% is when you say IN THE NEXT RANDOMLY GENERATED MNEMONIC THERE WILL BE TWO WORDS: A and B (in any positions)
Sep 4, 2022, 11:51 AM
The thing is that not every mnemonic will satisfy the additional conditions, so the probability will be lower I guess.
Sep 4, 2022, 11:56 AM
I don’t think so. 1.12% is probability of any single word appearing anywhere. But the same word appearing twice adjacent to each other in the same wallet that’s not 0.013% I don’t think but never mind it’s a bit off topic and not of any security importance of course.
Sep 4, 2022, 11:56 AM
If you roll two fair six-sided dice, what is the probability that the dice show the same number?
https://www.cuemath.com/questions/if-you-roll-two-fair-six-sided-dice-what-is-the-probability-that-the-dice-show-the-same-number/
Sep 4, 2022, 12:01 PM
Yes this would be the correct way to calculate based on a 23 sided dice. Well done!
Sep 4, 2022, 12:02 PM
2048 sided dice :)
Sep 4, 2022, 12:03 PM
Yes I just realized hahaha indeed
I don’t want to physically try 😂
Sep 4, 2022, 12:03 PM
So the probability will be 1/2048 = 0.048%
Not considering the fact that additional conditions take place.
Sep 4, 2022, 12:04 PM
Easy when you think about it! Thank you!
Sep 4, 2022, 12:04 PM
This is the probability that 2 adjacent words in a list of 24 words will be the same?
Aren’t the two 2048-sided dice rolled like… 24 times or something like this?
Sep 4, 2022, 12:06 PM
Not quite, it's a probability that two words will be the same. I'm not sure how to extrapolate this considering that we have 24 words :)
Sep 4, 2022, 12:08 PM
Ahhhh ok so it sounds like you’re talking about scenario 1
Not scenario 2
Ok but this is not the equivalent scenario. In that case we are rolling 2 dice. In our scenario, we’re rolling 24 dice. Unless I’m misunderstanding
Sep 4, 2022, 12:11 PM
No, you are right.
Sep 4, 2022, 12:14 PM
I thought we are rolling one dice with 2,048 sides, and we are looking for the same number twice in a row. So, we can say any number, even number 1000, and what is the probability of 1000 being rolled on the next roll, it is 1 in 2,048? So I thought it is this simple ))
Sep 4, 2022, 12:16 PM
I’m going to very cautiously submit this as maybe my best guess for what the probability of 2 words in a list of 24 words will be the same, assuming each word is sampled from a list of 2,048 words haha (https://www.omnicalculator.com/statistics/dice)
maybe there’s another calculator here https://www.omnicalculator.com/statistics that can be used to figure out the probability for scenario 2
Sep 4, 2022, 12:17 PM
Wow, so now i wonder which way it the dice being rolled for our 24 words? 😂
You make a very interesting point Matt, I did not think that correctly I think 😂think think
Sep 4, 2022, 12:18 PM
yes, but if you don’t get 1000 on the next roll, you have another chance to roll again. and you can do this 23 times in total
Sep 4, 2022, 12:18 PM
Yes for scenario 1 (same word twice in the 23 words) but for scenario 2 you can only roll it once.
Sep 4, 2022, 12:19 PM
ah ok so we’re talking about scenario 2?
Sep 4, 2022, 12:19 PM
yes
Sep 4, 2022, 12:19 PM
ok well… don’t you still have like 24 chances to get 2 words in a row to be the same?
(it’s not exactly 24 i don’t think, but it’s a number larger than 10 for sure from what i think…. haha)
Sep 4, 2022, 12:20 PM
2,048 words, and you want same word twice in a row, seemed it should be 1/2048 but you threw a different light on things
Sep 4, 2022, 12:20 PM
you want the same word twice in a row in a list that has 23 pairs or something like this
Sep 4, 2022, 12:21 PM
yes exactly
23 single words, not pairs
Sep 4, 2022, 12:21 PM
so is the probability like…. 1/2048 * 23 or something like this?
Sep 4, 2022, 12:22 PM
each time probability is 1 in 2048
Sep 4, 2022, 12:22 PM
you have 23 chances to get 2 words in a row to be the same
(don’t quote me on 23, it might be slightly off from 23 haha)
Sep 4, 2022, 12:22 PM
that's true yes
Sep 4, 2022, 12:22 PM
Looks like it )
Sep 4, 2022, 12:22 PM
yes i think we can agree on that 1/2048 * 22 even, since now one slot was consumed.
Sep 4, 2022, 12:23 PM
statistics and probability man. 😂 i’m glad i never had to take that class lol
don’t include me in the list of people who agree. i’m not confident enough in my ability with statistics lol
Sep 4, 2022, 12:23 PM
i love it, my life shows so many times that it cannot all be about statistics and probabilities 😂
Sep 4, 2022, 12:23 PM
* 23 (there are 24 words in total)
Sep 4, 2022, 12:24 PM
No, because you count mnemonics where are two same words, and after them again two same words twice
still the error should not be big
Sep 4, 2022, 12:25 PM
I'm confident enough in my recklessness lol as it was just an academic interest as i helped a kid create a wallet and never saw it yet twice consecutively, so wondered how rare it is, i have seen same word twice maybe 3 times in 50, which isn't scientific))
no, just two same words adjacent, out of 24 total words minus 1 assuming it is for CRC check
Sep 4, 2022, 12:26 PM
Are we talking about TON or Ethereum? )
Sep 4, 2022, 12:27 PM
TON
Sep 4, 2022, 12:27 PM
All 24 words in TON are random.
Sep 4, 2022, 12:27 PM
https://github.com/toncenter/tonweb-mnemonic/blob/master/src/functions/generate-mnemonic.ts
Sep 4, 2022, 12:27 PM
oh i see
just someone mentioned check sum so fine 24, makes it easier ))
Sep 4, 2022, 12:27 PM
So in real life this is ~1% chance for TON.
That's for Ethereum.
https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki#generating-the-mnemonic
Sep 4, 2022, 12:32 PM
So Daniil answer was right after all 👏
Sep 4, 2022, 12:37 PM
Yep, it's 23 * 1/2048.
Sep 4, 2022, 12:39 PM
100% logical, after all that ))
Sep 4, 2022, 12:40 PM
Not considering the additional conditions of course.
Sep 4, 2022, 12:40 PM
and real life ))
so ~ 23 * 1/2048 looks good!
Sep 4, 2022, 12:41 PM
^ for scenario 2, to be clear, ya?
Sep 4, 2022, 12:41 PM
yes, scenario 2.
Sep 4, 2022, 12:41 PM
Yeah, a good practical introduction to the probability theory. I should've studied it better in my student years :)
By the way I can't generate the three consecutive words :)
Sep 4, 2022, 12:43 PM
for scenario one, hmm... now i'm confused again Matt. 1. any of 2,048 words appearing twice anywhere among 24 words, and 2. any of 2,048 words appearing twice in direct succession. You destroyed my clear vision again ))
haha that's nice to know, must be very difficult
Sep 4, 2022, 12:44 PM
And I'm using 4 cores :)
Sep 4, 2022, 12:44 PM
so we know if we see 3 words in a row, that's very very very rare!!!! and highly unlikely to see lol
Sep 4, 2022, 12:44 PM
yaaaaaaa haha lol. not sure about scenario 1 yet either
Sep 4, 2022, 12:46 PM
now i'm not either sadly, brain isn't in good shape at this AGE and late in the evening ))
Sep 4, 2022, 12:46 PM
😛
Sep 4, 2022, 12:46 PM
Slava opened my eyes and i saw it CLEARLY now you threw doubt again 😂
so i'll tell the kid, please DYOR!!! 😂
Sep 4, 2022, 12:47 PM

© 2024 Draquery.com All rights reserved.