Casio calculator and Roll Two Dice in Random
|
08-22-2020, 01:25 AM
Post: #4
|
|||
|
|||
RE: Casio calculator and Roll Two Dice in Random
(08-21-2020 11:53 AM)Albert Chan Wrote: Method 1: treat each digits as a throw, but eliminate bad cases (outside 1 to 6) I was curious, on average, how many RAN# do we need to get 2 valid dices ? Let p = probability of valid digits = 6/10 ; bad cases q = 1-p = 4/10 Probability distrubution = (p+q)³ = p³ + 3p²q + 3pq² + q³ = 0.216 + 0.432 + 0.288 + 0.064 = 1 Let a = 0.216 + 0.432 = 0.648 // 2+ valid dice from RAN# Let b = 0.288 // 1 valid dice from RAN# Let c = 0.064 // 0 valid dice from RAN# Let Rk = probability of finally getting 2+ valid dices for k-th RAN# R1 = a R2 = c·a + b·(1-c) R3 = c²a + 2bc·(1-c) R4 = c³a + 3bc²·(1-c) ... Expected RAN#'s to get 2+ valid dices = [R1,R2,R3,R4, ...] • [1,2,3,4, ...] = a*(1 + 2c + 3c² + 4c³ + ...) + 2b*(1-c)*(1*2/2 + 2*3/2*c + 3*4/2*c² + ...) = (a + 2b) / (1-c)² // see thread, Cut the Cards ≈ 1.39711 This matched simulation result Code: function test(n) lua> test(1e7), test(1e7), test(1e7), test(1e7), test(1e7) 1.3970112 1.397293 1.3971118 1.3968499 1.3971645 |
|||
« Next Oldest | Next Newest »
|
Messages In This Thread |
Casio calculator and Roll Two Dice in Random - Gamo - 08-21-2020, 02:00 AM
RE: Casio calculator and Roll Two Dice in Random - Albert Chan - 08-21-2020, 11:53 AM
RE: Casio calculator and Roll Two Dice in Random - Albert Chan - 08-22-2020 01:25 AM
RE: Casio calculator and Roll Two Dice in Random - pinkman - 08-21-2020, 09:16 PM
RE: Casio calculator and Roll Two Dice in Random - Joe Horn - 08-22-2020, 07:20 AM
RE: Casio calculator and Roll Two Dice in Random - pinkman - 08-22-2020, 03:24 PM
|
User(s) browsing this thread: 1 Guest(s)