Professional Documents
Culture Documents
Ishan Kakkar PHD2105 PT Assignment
Ishan Kakkar PHD2105 PT Assignment
4lmn
μ =
3(l + m − n − 2)
For the given assumption of l ≤ m ≤ n for any $p the expected tosses for loser ejection or ruin becomes:
1
μ =
3p(1 − p)
Incorporating both these conditions the Ruin Part of the Monte Carlo Function in R is as follows:
toss_count <- 0
while(!any(counter==0)){
if( sum(trial) == 2 ) {
} else if (sum(trial)==1){
toss_count
Iteration 1 Simulations:
User Defined Value of l :
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
The Simulation Part of the Monte Carlo Function in R for a sequence of 100000 tosses is as follows:
set.seed(1)
knitr::opts_chunk$set(eval = FALSE)
p_prob = p)
})
results_main = results
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
The Simulation Part of the Monte Carlo Function in R for a sequence of 100000 tosses is as follows:
set.seed(1)
knitr::opts_chunk$set(eval = FALSE)
p_prob = p)
})
Appending the results of l , m, n, p in the second iteration to the table initialized previously
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
The Simulation Part of the Monte Carlo Function in R for a sequence of 100000 tosses is as follows:
set.seed(1)
knitr::opts_chunk$set(eval = FALSE)
p_prob = p)
})
Appending the results of l , m, n, p in the second iteration to the table initialized previously
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
The Simulation Part of the Monte Carlo Function in R for a sequence of 100000 tosses is as follows:
set.seed(1)
knitr::opts_chunk$set(eval = FALSE)
p_prob = p)
})
Appending the results of l , m, n, p in the second iteration to the table initialized previously
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
The Simulation Part of the Monte Carlo Function in R for a sequence of 100000 tosses is as follows:
set.seed(1)
knitr::opts_chunk$set(eval = FALSE)
p_prob = p)
})
Appending the results of l , m, n, p in the second iteration to the table initialized previously
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
The Simulation Part of the Monte Carlo Function in R for a sequence of 100000 tosses is as follows:
set.seed(1)
knitr::opts_chunk$set(eval = FALSE)
p_prob = p)
})
Appending the results of l , m, n, p in the second iteration to the table initialized previously
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
The Simulation Part of the Monte Carlo Function in R for a sequence of 100000 tosses is as follows:
set.seed(1)
knitr::opts_chunk$set(eval = FALSE)
p_prob = p)
})
Appending the results of l , m, n, p in the second iteration to the table initialized previously
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
The Simulation Part of the Monte Carlo Function in R for a sequence of 100000 tosses is as follows:
set.seed(1)
knitr::opts_chunk$set(eval = FALSE)
p_prob = p)
})
Appending the results of l , m, n, p in the second iteration to the table initialized previously
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
knitr::opts_chunk$set(eval = FALSE)
The Simulation Part of the Monte Carlo Function in R for a sequence of 100000 tosses is as follows:
set.seed(1)
knitr::opts_chunk$set(eval = FALSE)
p_prob = p)
})
Appending the results of l , m, n, p in the second iteration to the table initialized previously
knitr::opts_chunk$set(eval = FALSE)
View(results_main)
1
Hence out of all possible values for p, for p = , the game comes to end quicky. For p → 0 or p → ∞ , it
2
becomes more and more likely that all three coins will show the same face on a toss. Since such an outcome
results in no coins changing hands, this raises the number of tosses we expect to see before one of the men is
ruined.