All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Probability
Sneaky Joe's Craps (Posted on 2004-04-17) Difficulty: 4 of 5
Sneaky Joe has just invited you as a VIP to his new casino. You know this is probably an attempt steal your money, for he always find ways to swindle people. However, you go anyway.

When you get there, he says, "Come over here and join me in a game of craps." You become slightly suspicious, but agree to come anyway. When you go over, he says, "OK, here's how we play craps in this casino, 'cause it's different here than other casinos. You have 3 dice, 2 of them are 12-sided dice and another is a 40-sided die. I will roll the 2 12-sided dice. Then you roll the 40-sided one. If your number is between (y^2-x) and (x^2-y) inclusively, being that x=the number I got from the first roll and y=the number I got on the second, you will win $10. Otherwise, you will lose $10."

"Ok," you think, "I'm pretty sure that the odds are against me, especially if it's a game that Joe made himself. But I need $30, and I only have $10." So, what's the probability of you winning $30 (as in $30 in the black, without any debt, which included the original $10 paid) from this game?

(NOTE: It can be done WITHOUT trial and error, and it is my request, though you do not have do it, that you solve this without trial and error.)

No Solution Yet Submitted by Victor Zapana    
Rating: 4.0000 (3 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
re: Solution | Comment 3 of 11 |
(In reply to Solution by Penny)

I did write a trial-and-error Visual Basic console application program, not to solve the puzzle, but to test my solution after the fact. The program very strongly supports an answer of 0.078 out of 1.000 as the correct answer. (My posted solution gave the value as 0.07 out of 1.00) 
 
The program:
 
Imports System
Imports System.Runtime.InteropServices
Imports System.Math
Module Module1
    Dim dblRoll1 As Double
    Dim dblRoll2 As Double
    Dim dblRoll3 As Double
    Dim dblVar1 As Double
    Dim dblVar2 As Double
    Dim dblWinCount As Double
    Dim dblLoseCount As Double
    Dim dblMoney As Double
    Dim dblNumberOfGames As Double
    Dim dblIntRsltsCount As Double
    Dim dblRunningCount As Double
    Dim dblTotalCount As Double
    Dim dblWinningOdds As Double
    Sub Main()
        Randomize()
        dblNumberOfGames = 0
        dblTotalCount = 0
        dblRunningCount = 0
        dblIntRsltsCount = 0
        While dblNumberOfGames = 0
            Console.WriteLine("How many times shall we play ?")
            dblNumberOfGames = Int(Console.ReadLine())
        End While
        While ((dblIntRsltsCount = 0) Or _
            (dblIntRsltsCount >= dblNumberOfGames))
            Console.WriteLine("After how many game series do you want intermediate" _
            & " results ?")
            dblIntRsltsCount = Int(Console.ReadLine())
        End While
        dblWinCount = 0
        dblLoseCount = 0
        For Index1 As Integer = 1 To dblNumberOfGames
            dblMoney = 10
            dblTotalCount += 1
            dblRunningCount += 1
            If dblRunningCount >= dblIntRsltsCount Then
                dblRunningCount = 0
                Console.WriteLine("Number of game series so far = " & _
                 Str(dblTotalCount))
                dblWinningOdds = dblWinCount / dblTotalCount
                Console.WriteLine("We won " & Str(dblWinCount) & "  times and lost " & _
                            Str(dblLoseCount) & " times")
                Console.WriteLine("Winning odds were " & Str(dblWinningOdds))
            End If
            While dblMoney > 0
                dblRoll1 = Int(((12 - 1 + 1) * Rnd()) + 1)
                dblRoll2 = Int(((12 - 1 + 1) * Rnd()) + 1)
                dblRoll3 = Int(((40 - 1 + 1) * Rnd()) + 1)
                dblVar1 = (dblRoll1 * dblRoll1) - dblRoll2
                dblVar2 = (dblRoll2 * dblRoll2) - dblRoll1
                If dblVar1 >= dblRoll3 And _
                    dblVar2 <= dblRoll3 Then
                    dblMoney += 10
                    If dblMoney = 30 Then
                        dblWinCount += 1
                        Exit While
                    End If
                Else
                    dblMoney -= 10
                    If dblMoney = 0 Then
                        dblLoseCount += 1
                        Exit While
                    End If
                End If
            End While
        Next
        Console.WriteLine("  ")
        dblWinningOdds = dblWinCount / dblNumberOfGames
        Console.WriteLine("Final Results:")
        Console.WriteLine("We won " & Str(dblWinCount) & "  times and lost " & _
                    Str(dblLoseCount) & " times")
        Console.WriteLine("Winning odds were " & Str(dblWinningOdds))
        Console.WriteLine("Press Enter to terminate program")
        Console.ReadLine()
    End Sub
End Module

Edited on April 18, 2004, 12:05 am
  Posted by Penny on 2004-04-17 22:28:07

Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (3)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2017 by Animus Pactum Consulting. All rights reserved. Privacy Information