Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Shue a standard 52-card deck of cards and select one card. (a) What is the proba

ID: 3783139 • Letter: S

Question

Shue a standard 52-card deck of cards and select one card.
(a) What is the probability of getting at least one ace or one face card? A face card is a king (K), queen (Q), or jack (J) in any of the four suits: , , , or .

P(a) = 16/52 = 4/13 = 0.3077

(b) What is the probability of getting jack, queen, or king of a red suit (hearts or diamonds)?

P(b) = 6/26 = 3/13 = 0.2308

(c) Since MATLAB can repeat experiments very quickly, it can verify (via relative frequency) various probabilities. Using at least 10^5 trials each, use MATLAB to verify the two probabilities you computed earlier in this problem.

This is where i am stuck (part c). I am not familiar with matlab and would like help on how to run this experiment of drawing the selected cards 10^5 times to see if the results from the experiment replicate the calculated results. Thanks

Explanation / Answer

% Let Cards are Numbered like this
% Hearts-Ace (H-A)=1 , Heart-1 (H-1)=2,Heart-2 (H-2)=3, .....,Heart-JACK
% (H-J)=11, Heart-QUEEN (H-Q)=12, Heart-KING (H-K)=13
% Spades-Ace (S-A)=14 , Spades-1 (S-1)=15,Spades-2 (S-2)=16, .....,Spades-JACK
% (S-J)=24, Spades-QUEEN (S-Q)=25, Spades-KING (S-K)=26
% Diamonds-Ace (D-A)=27 , Diamonds-1 (D-1)=28,Diamonds-2 (D-2)=29, .....,Diamonds-JACK
% (D-J)=37, Diamonds-QUEEN (D-Q)=38, Diamonds-KING (D-K)=39
% Clubs-Ace (C-A)=40 , Clubs-1 (C-1)=41,Clubs-2 (C-2)=42, .....,Clubs-JACK
% (C-J)=50, Clubs-QUEEN (C-Q)=51, Clubs-KING (C-K)=52
clc;
clear all;
total_samples=10000000;
% Choose a random number in between 1 and 52 selecting a card radomly
card_value = ceil(0.5 + (52-0.5).*rand(total_samples,1));
%%%%%%%%%%%%%%%%%%%%% Case 1 Face Cards=
%{{1,11,12,13},{14,24,25,26},{27,37,38,39},{40,50,51,52}}
case_1=0;
for i=1:total_samples
if(mod(card_value(i),13)==1 | mod(card_value(i),13)==11 | mod(card_value(i),13)==12 | mod(card_value(i),13)==0)
case_1=case_1+1;
end
end
Prob_fc=case_1/total_samples; % Probability of a face card
%%%%%%%%%%%%%%%%%%%%% Case 2 Red Color Queen or King or Jack=
%{{11,12,13},{37,38,39}}
case_2=0;
total_red=0;
for i=1:total_samples
if(mod(card_value(i),26)>=1 & mod(card_value(i),26)<=13)
total_red=total_red+1;
end
if(mod(card_value(i),26)==11 | mod(card_value(i),26)==12 | mod(card_value(i),26)==13)
case_2=case_2+1;
end
end
Prob_rfc=case_2/total_red; % Probability of a Red face card except ACE
fprintf('Probability of a Randomly Choosen Card is Face Card : %.3f ',Prob_fc);
fprintf('Probability of a Randomly Choosen Card is Red Card (Jack, Queen, King) : %.3f ',Prob_rfc);

%%%%%%Result

Probability of a Randomly Choosen Card is Face Card : 0.301
Probability of a Randomly Choosen Card is Red Card (Jack, Queen, King) : 0.235
>>

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote