Problem 1260. RISK board game battle simulation
Can you double check your values, Jeremy? I've run your sims against a couple of on-line Risk calculators, and they're coming up with different values for some of your test cases. For example, the one at http://recreationalmath.com/Risk/ using 10 attackers and 10 defenders comes up with 0.47993525647768026, which doesn't meet your error criteria.
Thanks, James, you were right - I generated the values myself with a Matlab script. Unfortunately I did not do enough simulations - 10000 doesn't always get within 1% accuracy. Have updated them all now and rescored all solutions too.
Your solution is now the leading solution btw :)
I didn't submit a solution yet...mainly because I couldn't match up your test values and wanted to make sure that the problem wasn't on my end. (Most of the time, it is! :-)
I've got a working submission now, but you'll need to check the high end of the size chart for it. As usual, Richard and Alfnie are far more clever than I.
James, you give me too much credit. The next ot best solution was a very minor tweak to Jeremy's random solver. My larger solutions, 250, find the exact solution recursively.
Solution CommentsShow comments
Problem Recent Solvers28
Convert a vector into a number
Create a Multiplication table matrix...
Create matrix of replicated elements
More from this Author7
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!