Bitcoin Forum
May 23, 2024, 09:57:48 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Classic Dice Rule  (Read 89 times)
amoonaser (OP)
Newbie
*
Offline Offline

Activity: 25
Merit: 0


View Profile
February 09, 2021, 05:03:10 PM
 #1

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 ?
BrewMaster
Legendary
*
Offline Offline

Activity: 2114
Merit: 1292


There is trouble abrewing


View Profile
February 09, 2021, 05:13:22 PM
 #2

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.

There is a FOMO brewing...
amoonaser (OP)
Newbie
*
Offline Offline

Activity: 25
Merit: 0


View Profile
February 09, 2021, 05:45:05 PM
 #3

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.
coinableS
Legendary
*
Offline Offline

Activity: 1442
Merit: 1179



View Profile WWW
February 10, 2021, 04:48:50 AM
 #4

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

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!