How to resolve the algorithm 100 prisoners step by step in the Maple programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm 100 prisoners step by step in the Maple programming language

Table of Contents

Problem Statement

Show and compare the computed probabilities of success for the two strategies, here, on this page.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm 100 prisoners step by step in the Maple programming language

Source code in the maple programming language

p:=simplify(1-product(1-1/(2*n-k),k=0..n-1));
# p=1/2

p^100;
evalf(%);

# 1/1267650600228229401496703205376
# 7.888609052e-31

a:=[seq(max(GroupTheory[PermCycleType](Perm(Statistics[Shuffle]([$1..100])))),i=1..100000)]:
nops(select(n->n<=50,a))/nops(a);
evalf(%);
# 31239/100000
# 0.3123900000

1-(harmonic(100)-harmonic(50));
evalf(%);

# 21740752665556690246055199895649405434183/69720375229712477164533808935312303556800
# 0.3118278207

  

You may also check:How to resolve the algorithm Abundant odd numbers step by step in the MiniScript programming language
You may also check:How to resolve the algorithm Power set step by step in the Quackery programming language
You may also check:How to resolve the algorithm Tokenize a string step by step in the Phixmonti programming language
You may also check:How to resolve the algorithm Bitwise operations step by step in the XPL0 programming language
You may also check:How to resolve the algorithm Fork step by step in the Clojure programming language