Bitcoin Forum

Other => Off-topic => Topic started by: amoonaser on February 09, 2021, 05:03:10 PM



Title: Classic Dice Rule
Post by: amoonaser on February 09, 2021, 05:03:10 PM
Hello

I want to know classic dice rule. so i maked a simple example for this.

There is 3 field:

Code:
Roll Under:
<input type="text" id="roll" value="50.00">

Win Chance:
<input type="text" id="chance" value="50.0000">

Multiplier (Payout):
<input type="text" id="multiplier" value="1.9800">

And Range:

Code:
<input type="range" id="range" value="50">

And javascript code:

Code:
$('#range').change(function(e){

   let val = parseFloat($(this).val());
  
  $('#roll').val(val.toFixed(2));
  $('#chance').val(val.toFixed(4));
  $('#multiplier').val('How can calculate');

})

multiplier field have a formula. How can calculate this field ?


Title: Re: Classic Dice Rule
Post by: BrewMaster on February 09, 2021, 05:13:22 PM
multiplier does 2 things.
1. decide how much the user wins in case they win. for example 2x multiplier means user receives the same amount they put in (1 satoshi : wins 1 satoshi), 3x means they receive 2 times more (1 satoshi wins 2 satoshi).

2. decides the chance by splitting the number range into a smaller range. for example 2x would split it into half meaning if the roll is from 0 to 100 then low would be from 0 to 50 and high would be from 50 to 100. 3x splits it to 3 parts and use 1/3 (0 to 33, 66 to 100). anything in between is loss.
you should also add the house edge which turns 0 to 50 into 0 to 47 for example depending on the edge.


Title: Re: Classic Dice Rule
Post by: amoonaser on February 09, 2021, 05:45:05 PM
Thanks for this.

I understand what you mean.

But when i make this, the result is the opposite. This is exactly what I have to solve.


Title: Re: Classic Dice Rule
Post by: coinableS on February 10, 2021, 04:48:50 AM
Roll Under:

Code:
        $betAmt = 200; //example user input of bet amount
$probability = 30; //example user input percentage chance of a win
$multi = 100 / $probability; // this is your multiplier
$multi2 = $multi - 0.02; // this is your house edge
$grossProfit = $betAmt * $multi2;
$netProfit = $grossProfit - $betAmt;
        $target = 100 / $multi; // target to roll under (same as probability)


Roll Over:

Code:
        $betAmt = 200; //example user input of bet amount
$probability = 30; //example user input percentage chance of a win
        $multi = 100 / $probability; // this is your multiplier
$multi2 = $multi - 0.02;  //house edge
$grossProfit = $betAmt * $multi2;
$netProfit = $grossProfit - $betAmt;
        $target = 100 - $probability; //target to roll over