Lukeidiot Posted May 24, 2016 Share Posted May 24, 2016 Hello Math Gods of phpfreaks. I am in need of a .... formula.... Let's inspect the outcomes.. As we can see, we have the BET SIZE (5), PREDICTION (88) which gives us our profits 40.01818 and 0.62727 So my question is: how do we get the Roll High Profits(40.01818), and Roll Low Profits(0.62727) from BET SIZE and PREDICTION? Anyone got a php function/formula for this? Or just a general math formula? (for a live example visit: https://rollin.io) Link to comment https://forums.phpfreaks.com/topic/301246-i-ask-for-the-presence-of-a-math-god/ Share on other sites More sharing options...
requinix Posted May 24, 2016 Share Posted May 24, 2016 Those aren't the numbers I'm seeing. It should be basic gambling math: expected profit = bet * odds of losing / odds of winning. Link to comment https://forums.phpfreaks.com/topic/301246-i-ask-for-the-presence-of-a-math-god/#findComment-1533195 Share on other sites More sharing options...
Lukeidiot Posted May 24, 2016 Author Share Posted May 24, 2016 Those aren't the numbers I'm seeing. It should be basic gambling math: expected profit = bet * odds of losing / odds of winning. Yes, my head hurts after using lots of math, but here lies to key: namespace("Rollin.Casino.Dice.Stats", function() { var t, e; return t = namespace.use("Rollin.Casino.Dice.Dice"), e = function() { function e(t, e) { this.number = t, this.dice = e } return e.prototype.decimal = 5, e.prototype.getData = function(e, n, r) { var i, o, s, a, u; switch (r > t.MAX_NUMBER - 1 && (r = t.MAX_NUMBER - 1), r < t.MIN_NUMBER + 1 && (r = t.MIN_NUMBER + 1), i = this.dice.getFee(),n) { case t.PREDICTION_BIGGER: o = (100 - i) / (t.MAX_NUMBER - r), s = t.MAX_NUMBER - r; break; default: o = (100 - i) / r, s = r } return a = e * o, u = a - e, a > 99999 && (a = 99999), u > 99999 && (u = 99999), a = this.number.floorDecimal(a, this.decimal), u= this.number.floorDecimal(u, this.decimal), this.number.isNaN(a) && (a = 0), this.number.isNaN(u) && (u = 0), { multiplier: o, odds: s, payout: a, profit: u } }, e }() }), Full code: http://paste.ubuntu.com/16651803/ I just can't seem to quite figure out the correct formula Link to comment https://forums.phpfreaks.com/topic/301246-i-ask-for-the-presence-of-a-math-god/#findComment-1533196 Share on other sites More sharing options...
requinix Posted May 24, 2016 Share Posted May 24, 2016 (edited) I just can't seem to quite figure out the correct formulaWell then, good luck. I'm sure you'll eventually arrive at the formula I told you. [edit] Maybe you're getting thrown off because your numbers are wrong? When I enter 5/88 on their site I get 40/0.625. Not the 40.01818/0.62727 in your screenshot. I don't know how you got those but they're wrong. It's also possible you didn't notice that the random number range is 0-99 and your choice must be 1-98; that's where the house advantage comes in. [edit 2] And one more thing: the odds of winning/losing in the formula do not include the... I don't know what it's called, but they don't include the number that you automatically lose with. Since you always lose only on your own number, odds of winning + odds of losing = 99%. Yeah, math. Edited May 24, 2016 by requinix Link to comment https://forums.phpfreaks.com/topic/301246-i-ask-for-the-presence-of-a-math-god/#findComment-1533199 Share on other sites More sharing options...
Lukeidiot Posted May 24, 2016 Author Share Posted May 24, 2016 Well then, good luck. I'm sure you'll eventually arrive at the formula I told you. [edit] Maybe you're getting thrown off because your numbers are wrong? When I enter 5/88 on their site I get 40/0.625. Not the 40.01818/0.62727 in your screenshot. I don't know how you got those but they're wrong. It's also possible you didn't notice that the random number range is 0-99 and your choice must be 1-98; that's where the house advantage comes in. [edit 2] And one more thing: the odds of winning/losing in the formula do not include the... I don't know what it's called, but they don't include the number that you automatically lose with. Since you always lose only on your own number, odds of winning + odds of losing = 99%. Yeah, math. I think our numbers are different because there are "levels" based on how much you have wagered. For instance I am level 3, and my house edge is only 0.96%. I believe level 1 (your level) house edge is 0.99%. Link to comment https://forums.phpfreaks.com/topic/301246-i-ask-for-the-presence-of-a-math-god/#findComment-1533222 Share on other sites More sharing options...
Recommended Posts