12.05.2024 Exploring the Math Behind Crash | Roobet Cryptocurrency Casino Game

� � 
LIVE � �  � � 


The first regulated online Bitcoin. Casino appeared in 2014 and since then. billions of dollars worth of bitcoin. have been wagered online. these casinos have all sorts of games. such as roulette slots Blackjack but one. of the more popular ones I've been. seeing recently is this game of crash. for those of you who aren't familiar. with crash here's a brief overview of. how the game works. players have a couple of seconds to. place their bets before the multiplier. Begins the multiplier starts at one and. begins to increase and players are. allowed to cash out at any point. multiplying their bet by the amount on. the screen. however if the player Waits too long to. cash out and the multiplier crashes then. they lose everything that they just bet. this multiplier can immediately crash at. one and all players lose their bets but.

It can also go into the thousands and. even the hundreds of thousands in some. cases. now I've seen a couple videos and posts. on strategies to try to prop it off of. this game which unfortunately is just. not possible a lot of these casinos. actually post the code behind their. games so I thought it'd be cool to take. a look at this code and see. mathematically why this game is just not. possible to be in the long term. the two functions we're going to look at. are this generate hash function which. links the games together and then also. this crash point from hash function. which calculates the multiplier for each. gain. so we can see if you click on the. results of any game there's this hash. that's associated with it. so I've replicated these two functions. in Python and we can see that if we plug. this game hash that we just found into.

The get result function we get this 1.34. which was the result of the game that we. just saw now when we plug the hash of. the game into this get previous game. function we get this new hash and if we. look we can see that this hash actually. turns out to be the hash of the game. that came just before the one we are. looking at. so this casino actually gives us the. hash of the very first game so we can. keep using this get previous game. function as well as the get result. function and we can find the results of. every game that has ever been played. so here we have the hash of the very. first game and basically what we're. going to do is we're going to take the. hash of the game that just happened and. continue to get the hash of the previous. games until we end up with this hash of. the very first game and as we go along.

We're going to keep track of the results. so that we end up with the results of. every game that has ever happened. so after running this code we can see. that there's been almost 620 000 games. and now we have the results for each one. of these games as well we also see that. the minimum result is one and the. maximum result is this 658 000 that we. saw from earlier. so here's the distribution of these 620. 000 games and this tail over here. actually goes a lot further but the bins. are just too small to be able to see. so let's take a closer look at the math. behind this get result function we can. see that we're passing in this game hash. and with these first couple of blinds do. right here is basically create a new. hash out of this hash that we pass in. and hashes are really just hexadecimal. numbers so we're taking this new hash.

And we're checking if it's divisible by. 33 and if it is that's when the function. returns one and all players immediately. lose their bets. this means that about three percent of. the time the game will instantly crash. when the number isn't divisible by 33. the multiplier is calculated using this. function here. so here's the derivation of this formula. to put it into a form that's easier to. manage and it basically turns into this. one over a uniform zero to one. distribution which is just one over a. random decimal from zero to one. and a cool property about this. distribution is that for any multiplier. the probability that this multiplier is. less than some value X is actually about. one minus one over X so the probability. that the multiplier is less than two is. about one half the probability that it's. less than 10 is about 90 percent and so.

On. so I actually simplified a little bit. going from this step here to going to. the next step they're not completely. equal and I found that using this. formula here was actually off by a. couple decimal places so I'm going to. use the above formula instead just so we. can get more accurate results. so now that we have these two cases. figured out we can find the overall. probability that a multiplier is less. than or equal to a certain amount so we. have this three percent chance that the. game crashes instantly and then we have. this 97 chance that we use this formula. up here so you can see that we just. copied it right over we have the 0.01. and then we have this 0.99 here and. lastly since we found this property for. one over the uniform zero one. distribution we can just plug this 1. minus 1 over X in right here so I've.

Coded our final formula into python here. and we're going to test it against the. Real Results that we saw to see if we. have an accurate formula so let's try it. with a multiplier of two and we can see. that the Real Results had 52 percent of. results less than two and now when we. use our formula we get 52 as well so we. could try it with a higher number such. as 10 and we can see that about 90.4. percent of results were less than 10 and. we get the same thing from our formula. now we'll try it for a hundred and we. can see that that matches and now we'll. try a small number like 1.01 and we can. see that should be about 4.9 percent and. it looks like that matches as well so. now we can calculate the expected value. of a one dollar bet on multiplier X so. all we really need to do is take the. probability of losing and multiply it by.

The negative one dollar that we would be. losing and then we take the probability. of winning which is just one minus the. probability of losing and we're going to. multiply this by the multiplier minus. one for example if our multiplier is 2. we would be winning one dollar. so now let's see how accurate our. expected value formula is we can see. that with a multiplier of 2 here the. expected loss per game is about three. and a half cents and based on the. results from the actual games we get. about three and a half cents as well. so now let's change this multiplier to. something smaller like 1.05. so now we're getting a loss of about 3.1. cents and when we look at the results. from the actual games we also get a loss. of about 3.1 cents. so here I've plotted the expected value. by multiplier and the blue line is the.

Theoretical expected value based off of. our formula and the orange line is. actually based on the results of the. games that we collected so we can see. that they follow each other pretty well. and we can also see that everything is. in this range of losing about three to. four percent of the bet we can also see. that the expected loss is less when. we're betting lower multipliers around. one to two and we're only losing about. three percent but as the multiplier. starts to increase that's when the loss. goes to about four percent so this graph. here kind of shows why it's not going to. be possible to beat this game in the. long term because there's just no way to. turn these negative expected value bets. into something that has a positive. expected value so one way that people. try to beat this game is using what's.

Known as the Martingale strategy and. this is basically doubling your bet. every time you lose to try to make up. for that money or in this case doubling. your bet every time it crashes below too. and we can see the total bets here. increasing each time that the multiplier. crashes below 2 and it eventually. reaches fifteen hundred so it looks like. people are using the strategy and it. would work if you had an infinite. bankroll but unfortunately there's a Max. profit of 10 000 on most of these. websites. so I found the probability of losing. each amount of games in a row and I put. them all into this spreadsheet so. starting with the two dollar bet you can. see here we're doubling it each time. that we would lose and the total wagered. is just the sum of all the bets so far. and each time you can see that the.

Potential win is exactly two dollars. more than the total amount that we've. wagered and here we have the probability. of losing this many games in a row. so to calculate the expected value we. want to take negative 1 times the total. amount that we've wagered and we want to. multiply this by the probability of. losing our total wager and then we want. to add the total profit and we want to. multiply by 1 minus the probability of. losing and this will give us our. expected value we can see that they are. all going to be negative. so this strategy has a high probability. of winning a small amount of money and a. low probability of losing a large amount. of money and the loss actually outweighs. the gain in this case. so this pretty much sums up the video. and explains why this game is just. always going to be in the casino's.

favorite. this was actually the first YouTube. video I've ever made and I really. enjoyed making it and I want to make. more videos in the future about. probability and money so if you think. you'd be interested in these future. videos please subscribe or leave a like. or comment on this video it would just. let me know that there's people that are. interested in topics like these. so yeah thanks for watching and. hopefully I will see you in the next. video

All Devices iOS Android Chromecast