0% found this document useful (0 votes)
15 views7 pages

Where Does This - Dynamic - House Edge Come From in Crash (Betting) - R - Learnmath

The document discusses the concept of the 'dynamic' house edge in the Crash betting game, where players risk their money on a multiplier that can crash at any moment. The author analyzes the mathematical functions and hashing mechanisms that determine the game's outcomes, expressing confusion over how the house edge appears to increase with higher multipliers despite their understanding of the underlying code. The author seeks clarification on their calculations and the randomness of the cryptographic hashing process used in the game.

Uploaded by

Thomas Wondwosen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views7 pages

Where Does This - Dynamic - House Edge Come From in Crash (Betting) - R - Learnmath

The document discusses the concept of the 'dynamic' house edge in the Crash betting game, where players risk their money on a multiplier that can crash at any moment. The author analyzes the mathematical functions and hashing mechanisms that determine the game's outcomes, expressing confusion over how the house edge appears to increase with higher multipliers despite their understanding of the underlying code. The author seeks clarification on their calculations and the randomness of the cryptographic hashing process used in the game.

Uploaded by

Thomas Wondwosen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

12/14/24, 3:18 PM Where does this "dynamic" house edge come from in Crash (betting)?

: r/learnmath

Skip to main content r/learnmath Search in r/learnmath Log In

r/learnmath • 3 yr. ago


AndrewBarth

Where does this "dynamic" house edge come from in Crash (betting)?
First of all, I'm not condoning gambling. I have been looking at online gambling sites and have been interested in
their open-source code to show house edges, but there's some results I struggle to understand. I'll show all of my
math so it'll be a bit lengthy.

The whole breakdown is in my reddit post here, but I'll recap in this post as well. Basically you put in money and it
gets multiplied more and more until the game stops or "crashes", and if you don't cash out before this moment you
lose all your money. Sometimes the game can insta-crash, and this frequency of insta-crashes is considered the
house edge.

This is provably fair because of using SHA-256 hash functions. I won't go too much into detail about this as it's
unnecessary, but just know it's producing a 64-length hexadecimal hash that we assume is random. The code is
open source and the website calculates their multipliers for when the game crashes as shown:
https://imgur.com/4BVIAkI

In the comments of my reddit post, someone points out that after a billion trials, the house edge increases as the
multiplier you wager on increases (~5% house edge for 1.01x, ~6% house edge for 1000x), but I fail to see why
that is. After a bunch of that user's vague answers and smiley faces, I'm reaching out to this subreddit.

The divisible function converts the hexadecimal hash into decimal, then modulates it by 20. This function is then
used to determine insta-crashes by seeing if the hash is divisible by 20, so you can expect to insta-crash about
1/20th of the time by this method. I understand there can be modulus bias, but as I understand it, this will only
increase the frequency of small remainders, meaning we will generally see a little over 1/20th of all hashes insta-
crashing (since divisibility checks for the remainder to be 0). I don't see how changing your betting multiplier will
affect this, as the range of hashes is fixed.

Next comes the inside of the Math.floor code. I'll simply copy and paste my results from my comment:

(100*2^52-h)/(2^52-h) where h~[0,2^52)


= (99*2^52+2^52-h)/(2^52-h) = (99*2^52)/(2^52-h) + 1
= (99*2^52)/h2 + 1 where h2~(0,2^52]
= 99/h3 + 1 where h3~(0, 1]
= 99/(1-h4) + 1 where h4~[0,1)

The code takes the first 13 hexa-digits (I guess they're called?) of the hash and converts it to decimal, then puts it
into the Math.floor equation, which can take on values 0 to 2^(52)-1, pseudo-randomly. The equation creates a
multiplier where the game will crash, and anything strictly less than 101 (note that these values are later divided by
100, where 1.00x is the insta-crash multiplier) is considered an insta-crash, which occurs 1/100th of the time:

100 <= (100*2^52-h)/(2^52-h) < 101


Solving for h leads to

https://www.reddit.com/r/learnmath/comments/qt4gca/where_does_this_dynamic_house_edge_come_from_in/?rdt=40228 1/7
12/14/24, 3:18 PM Where does this "dynamic" house edge come from in Crash (betting)? : r/learnmath
0 <= h < 2^52/100 <-- Since range of h is [0,2^52), this is 1/100th of the range
Skip to main content
Log In

The rest of the multipliers are uniformly determined. Using the simplified version of the formula, I understand this
to be an inverse uniform distribution with a cdf evaluated to 1-1/m for some multiplier m > 1 (I found this definition
on Wikipedia). Because of this uniformity, I do not see where the house edge may increase for higher multipliers.

While it may not be relevant, I have also calculated expected value for continuous $1 bets for any multiplier m and
the result is a fixed -1/20:

E(x) = (-1)*[1/20+19/20*(1-1/m)] + (m-1)*[19/20*(1/m)]


= (-m - 19m + 19 + 19m - 19)/20m = -1/20

The divisibility function and this floor function are all the calculations in the code. If my math for these two
scenarios are correct, I don't understand this "dynamic" house edge for increasing multipliers. I've suggested that
repeated hashing of SHA-256 might cause statistical bias with the hashes, but I have very little knowledge in this
subject, and I'd like to believe this hashing process is sufficiently random.

If anyone knows where my math is wrong it'd be greatly appreciated. Also, if anyone understands cryptographic
hashing, it would be cool to understand a breakdown of how truly random this hashing process is. I don't pretend
to be great with statistics or cryptography or whatever else I've used in this post, so please let me where I've went
wrong.

4 6 Share

SASSoftware_Official • Promoted

Built for developers and modelers, Viya Workbench is a self-service, on-demand


environment for analytical development, including building AI and ML!

Learn More sas.com

Add a comment

Sort by: Best Search Comments

yes_its_him • 3y ago •

The guy that told you about the house edge told you where to look. Try to focus there.

1 Reply

AndrewBarth OP • 3y ago •
https://www.reddit.com/r/learnmath/comments/qt4gca/where_does_this_dynamic_house_edge_come_from_in/?rdt=40228 2/7
12/14/24, 3:18 PM Where does this "dynamic" house edge come from in Crash (betting)? : r/learnmath

Skip to main content


Log In
If you saw the comment where he told me where to look, surely you saw my comment stating I did look at
that. I'm sorry but this doesn't help me get any further to an answer.

1 Reply

yes_its_him • 3y ago •

My observation was just that you are looking for something specific, and have advice from someone
who seems familiar with the issue, even if less than forthcoming.

Focusing on the suggested area in more detail is probably the best way forward at this point, vs. e.g.
looking at hash functions or other possibilities.

1 Reply

AndrewBarth OP • 3y ago •

Forgive me if I sound annoyed, but your comment makes it out as if I've been given advice and
stubbornly refused to believe the answer resides there. Yes my comment briefly mentions a
possible hash bias, but then goes into the comparison of v2 code with the v1 code as user
RHavar recommends.

Bear in mind that the v2 code is only 27 lines long, with 12 lines being comments or blank. 4 lines
are relevant to the hashing functionality of SHA-256, and 6 lines are related to the math involved.
The rest is variable declaration. The v1 code isn't much longer. In other words, there's not much
to compare to begin with. The code that I can compare I did so with a good amount of
computation and analysis. The entire post his comment resides in also picks apart the code piece
by piece.

The key differences are the equations, which I show in my comment and this post you're
commenting on are actually analogous to each other, and the divisible function, which I deduce
has no bias relating to changing what multiplier you wager.

With the library the v2 code uses, it's taking hours to simulate a billion samples, but by doing a
million I've found the exact same dynamic pattern within the v2 code, which RHavar claims is a
static house edge (experimental value becomes -0.0099 for 1.01x, -0.012 for 2.00x, and -0.026
for 1000x). So now I it seems the bias resides in both codes, so I should actually compare the
similarities and not the differences. I don't believe it to be the equation, as it looks to be a
standard inverse uniform distribution.

It's not that I haven't looked at the suggested area, it's that I've exhausted every angle of that
area that telling me to keep doing so is telling me to keep beating a dead horse. If I'm wrong
somewhere, by all means tell me, that's what I've been constantly asking. If I'm not, there's some
other part that's causing the bias, and that's where I assert that the only other angle I can think of
is the hash functions not accurately simulating pure randomness.

1 Reply

1 more reply

https://www.reddit.com/r/learnmath/comments/qt4gca/where_does_this_dynamic_house_edge_come_from_in/?rdt=40228 3/7
12/14/24, 3:18 PM Where does this "dynamic" house edge come from in Crash (betting)? : r/learnmath
RobertFuego • 3y ago •
Skip to main content
Log Inhave time
If you don't get any other responses, know that I am interested in this question, but do not currently
to look into it thoroughly. If this changes in the near future I will provide what response I can.

1 Reply

r/onlinegambling • 1 yr. ago

What was the biggest multiplier you ever cashed out at in a crypto crash game?
1 upvote · 15 comments

r/learnmath • 9 days ago

Why does x^x start increasing when x=0.36788?


225 upvotes · 53 comments

r/gtaonline • 6 mo. ago

PC Issue-Casino wheel spin crashing game/causing it to bug out.


18 upvotes · 26 comments

r/stakeus • 9 mo. ago

Crash
5 upvotes · 22 comments

r/BlockchainStartups • 5 mo. ago

Launch an aviator crash betting game and earn millions!


1 upvote · 3 comments

r/learnmath • 11 days ago

How do we know what pi is?


114 upvotes · 70 comments

r/fabricmc • 1 mo. ago

Why did it crash?


1 upvote · 9 comments

r/Roobet • 4 yr. ago

2.5% House Advantage My Fat Ass (And I weight 352.2lbs)


8 upvotes · 18 comments

r/fabricmc • 4 mo. ago

https://www.reddit.com/r/learnmath/comments/qt4gca/where_does_this_dynamic_house_edge_come_from_in/?rdt=40228 4/7
12/14/24, 3:18 PM Where does this "dynamic" house edge come from in Crash (betting)? : r/learnmath

my game crashes when launching whenever the line "[21:17:51] [Render thread/INFO]: Hash changed to
Skip to main content
B3239954E29CDC280BAF871F5F22905D" comes up in the log Log In

1 upvote · 3 comments

r/JSdev • 3 yr. ago

What do you make of Edge's "Super Duper Secure Mode"?


5 upvotes · 3 comments

r/gambling • 4 yr. ago

So about this crash game...


15 upvotes · 32 comments

r/blackjack • 4 yr. ago

Does house have a bigger advantage on "Infinite Blackjack" mode like on Roobet?
12 upvotes · 12 comments

r/learnprogramming • 3 yr. ago

How are hash functions used to make gambling sites fair?


1 upvote · 10 comments

r/gambling • 1 yr. ago

gambling strats for crash


2 upvotes · 23 comments

r/EnglishLearning • 3 yr. ago

what does "on the edge" mean here?


2 upvotes · 5 comments

r/Advice • 5 yr. ago

Can anyone ever win gambling games like crash in the long run?
1 upvote · 2 comments

r/gaming • 7 yr. ago

Possibly my worst crash ever. Just put a 200 cap bet on a number in roulette and won!!

4.8K upvotes · 160 comments

r/Roobet • 4 yr. ago

https://www.reddit.com/r/learnmath/comments/qt4gca/where_does_this_dynamic_house_edge_come_from_in/?rdt=40228 5/7
12/14/24, 3:18 PM Where does this "dynamic" house edge come from in Crash (betting)? : r/learnmath

Game with
Skip to least
main House Edge
content
Log In
1 upvote · 2 comments

r/Bitcoin • 5 yr. ago

Bitcoin Crash gambling game


20 comments

r/todayilearned • 14 yr. ago

TIL Alien Ant Farm was arrested for crashing the BET Awards to film the music video for the
song "These Days" youtube

137 upvotes · 58 comments

r/learnpython • 4 yr. ago

Need help creating a very simplistic version of the gambling game CRASH.
1 upvote · 2 comments

r/learnmath • 27 days ago

Is dy/dx a fraction?
179 upvotes · 130 comments

r/Roobet • 4 yr. ago

Winning crash strategy


99 upvotes · 110 comments

r/onlinegambling • 4 yr. ago

Roobet Crash - Statistical Analysis & Strategy


33 upvotes · 9 comments

r/learnmath • 1 mo. ago

Could someone please explain to me why exactly anything to the power of 0 is 1?


93 upvotes · 107 comments

TOP POSTS

Reddit

reReddit: Top posts of November 13, 2021

Reddit
https://www.reddit.com/r/learnmath/comments/qt4gca/where_does_this_dynamic_house_edge_come_from_in/?rdt=40228 6/7
12/14/24, 3:18 PM Where does this "dynamic" house edge come from in Crash (betting)? : r/learnmath

reReddit: Top posts of November 2021


Log In
Reddit

reReddit: Top posts of 2021

https://www.reddit.com/r/learnmath/comments/qt4gca/where_does_this_dynamic_house_edge_come_from_in/?rdt=40228 7/7

You might also like