Bitcoin Forum
May 12, 2024, 08:29:31 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Math behind crash game multiplier generation  (Read 165 times)
GrahamMopar (OP)
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile
August 14, 2019, 06:12:29 PM
 #1

Code:

exports.crashPointFromHash = function(serverSeed) { // TODO: check the probablity of instant crash everywhere
    var hash = crypto.createHmac('sha256', serverSeed).update(clientSeed).digest('hex');
 
    // In 1 of 101 games the game crashes instantly.
    if (divisible(hash, 101))
        return 0;
 
    // Use the most significant 52-bit from the hash to calculate the crash point
    var h = parseInt(hash.slice(0,52/4),16);
    var e = Math.pow(2,52);
 
    return Math.floor((100 * e - h) / (e - h));
};

Ignore all the hash related code, all it does is generate h such that h is uniform in [ 0 , 2^52 - 1]
e is 2^52


How would I find the expected value from this algorithm?
What is the probability density function?
How would I change the house edge?
Is it only " if (divisible(hash, 101)) return 0;" that gives the house an advantage?

Initially I thought it would be exponentially distributed but it's not

When doing simulations it seems that the edge is around 2% but even when removing the divisible by 101 code, the edge is around 1% and I don't understand where it comes from

Can somebody provide a deeper math insight in this? How did they come up with this way of generating crash points?
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!