Let a 52 deck of numbered cards be created as follows:
2 special cards: 0 and 1
25 powers of 2: 2, 4, 8, ..., 2^25
25 powers of 3: 3, 9, 27, ..., 3^25
Shuffle the deck and draw at random 3 cards. Evaluate the product of the 3 numbers, say P.
What is the probability of P=0?
What is the probability of P being a non zero integer square?
What is the probability of P being a 4-digit number?
(In reply to
Computer solution by Larry)
For some reason I got 6200 squares (variable goodCt) for probability 62/221 ~= 0.280542986425339 in my computer solution:
clearvars,clc
goodCt=0; ct4=0;
deck=[sym(0) sym(1)];
for p=1:25
deck(end+1)=sym(2)^p;
deck(end+1)=sym(3)^p;
end
c=combinator(52,3,'c');
for i=1:length(c)
hand=deck(c(i,:));
if length(find(hand==0))==0
p=prod(hand);
sr=sqrt(p);
if round(sr)^2==p
goodCt=goodCt+1;
end
if p>999 && p<10000
ct4=ct4+1;
disp([hand p])
end
end
end
disp([goodCt ct4 length(c)])
sym(goodCt/length(c))
sym(ct4/length(c))
|
Posted by Charlie
on 2023-03-29 09:54:38 |