Jump to content

How do I show the odds?


Monkuar

Recommended Posts

$card1 = rand(1,3);
$card2 = rand(1,3);

/// check money win ////////
if($card1 == "1" && $card2 == "1" ){
echo "You won 100$?";
exit;
mysql_query("UPDATE card SET money='$win_money' WHERE name='$name'");
}

 

My code works wonderfully

 

prob tho

how can I show the odds of winning out of 100 to my suer?

Link to comment
Share on other sites

If you have 3 picks from a pool of 36 numbers, and none of the numbers can repeat, the chances are 36*(36-1)*(36-2), or 1 in 42840. How to calculate the chances if the order of the numbers picked is required to match the order of the numbers drawn, I don't know.

Link to comment
Share on other sites

Im still confused

 

$card1 = rand(1,4);
$card2 = rand(1,4);
if ($ibforums->input['id'] == "1"){
if($card1 == "1" && $card2 == "1"){

 

if my stuff is 1 in 4 chances

 

and it both has to equal the same "1"

 

that would be 25% divided by 2

 

which is

12.5% of winning right?

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.