Question: Random Card In Deck - Procedure

Hi

I want to simulate taking a card from to decks at the same time, and by doing it sufficiently many times, show that the probability is 1-(1/e).

I've implemented this in Python, but i'm new to maple. Here is what I've done so far.

 

randomDeck:=proc(n::integer)

  local deck:= [seq(1..52)];
local randomDeck:=[];
local i; local succes:=0;

for i from 1 to n do;
randomDeck:=Statistics[Shuffle](deck);

for i from 1 to nops(deck) do;
if deck[i] = randomDeck[i] then;
succes:= succes + 1; break;

end if;
end do;
end do;
return succesend proc:

What am I doing wrong ?

Please Wait...