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

Home > Probability
Playing With Marbles II (Posted on 2014-08-29) Difficulty: 3 of 5
Contents of three identical looking bags are as follows:

Bag 1: Five black marbles, three red marbles and one white marble.
Bag 2: Five red marbles, three white marbles and one black marble.
Bag 3: Five white marbles, three black marbles and one red marble.

You choose one of the three identical looking bags at random.
After choosing a bag you draw two marbles out at random. You notice that the first one is black, and the second one is white.

You then put the two marbles back in the bag they came from and draw two marbles out of the same bag at random.

What is the probability that the first marble drawn is black and the second marble drawn is white?

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
simulation verification Comment 2 of 2 |
(In reply to solution by Charlie)

DefDbl A-Z
Dim crlf$, c$(2)


Private Sub Form_Load()
 ChDir "C:\Program Files (x86)\DevStudio\VB\projects\flooble"
 Text1.Text = ""
 crlf$ = Chr(13) + Chr(10)
 Form1.Visible = True
 DoEvents
 
 Randomize Timer
 For trial = 1 To 16560
   Do
     bag = Int(3 * Rnd(1) + 1)
     m = 0
     For chce = 1 To 2
        Do
         marble = Int(9 * Rnd(1) + 1)
        Loop Until marble <> m
        m = marble
        Select Case bag
         Case 1
          Select Case marble
            Case Is <= 5
              c$(chce) = "b"
            Case 6 To 8
              c$(chce) = "r"
            Case Else
              c$(chce) = "w"
          End Select
         
         Case 2
          Select Case marble
            Case Is <= 5
              c$(chce) = "r"
            Case 6 To 8
              c$(chce) = "w"
            Case Else
              c$(chce) = "b"
          End Select
          
         Case 3
          Select Case marble
            Case Is <= 5
              c$(chce) = "w"
            Case 6 To 8
              c$(chce) = "b"
            Case Else
              c$(chce) = "r"
          End Select
        End Select
     Next chce
   Loop Until c$(1) = "b" And c$(2) = "w"
   m = 0
   For chce = 1 To 2
       Do
         marble = Int(9 * Rnd(1) + 1)
       Loop Until marble <> m
       m = marble
       Select Case bag
        Case 1
         Select Case marble
           Case Is <= 5
             c$(chce) = "b"
           Case 6 To 8
             c$(chce) = "r"
           Case Else
             c$(chce) = "w"
         End Select
        
        Case 2
         Select Case marble
           Case Is <= 5
             c$(chce) = "r"
           Case 6 To 8
             c$(chce) = "w"
           Case Else
             c$(chce) = "b"
         End Select
         
        Case 3
         Select Case marble
           Case Is <= 5
             c$(chce) = "w"
           Case 6 To 8
             c$(chce) = "b"
           Case Else
             c$(chce) = "r"
         End Select
       End Select
   Next chce
   If c$(1) = "b" And c$(2) = "w" Then hits = hits + 1
   If trial Mod 1656 = 0 Then
     Text1.Text = Text1.Text & Str(hits) & Str(trial) & Str(hits / trial) & crlf
   End If
 Next

 Text1.Text = Text1.Text & crlf & " done"
End Sub

One run finds 2599 out of 16560 trials; the next, 2554 out of 16560.

  Posted by Charlie on 2014-08-29 12:16:17
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


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

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