Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In the following MATLAB program, I am trying to find how many times that a face card is drawn from a deck of 52 poker

In the following MATLAB program, I am trying to find how many times that a face card is drawn from a deck of 52 poker cards when I draw a card, replace it, and reshuffle the deck 1000 times.

For some reason the output is always 12 cards, but I count alot more for 1000 draws. I think the Cards Matched variable is wrong.

MATLAB FILE

% Define face cards. clc faceCards = [11,12,13, 24,25,26, 37,38,39, 50,51,52] ; % Shuffle the deck and get the first two cards. s = RandStream('mlfg6331_64'); cardsDrawn = datasample(s,1:52,1000); %Draws 1000 times % See if any of these cards is a face card ia = ismember(cardsDrawn, faceCards) CardsMatched = sum(ismember(faceCards,cardsDrawn)) %%% Gives the amount of matches RatioMatch = CardsMatched/1000 PercentageMatch = RatioMatch * 100

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Systems Analysis And Synthesis Bridging Computer Science And Information Technology

Authors: Barry Dwyer

1st Edition

0128054492, 9780128054499

More Books

Students also viewed these Databases questions

Question

Be familiar with the integrative servicescape model.

Answered: 1 week ago

Question

Determine the roles of spatial layout and functionality.

Answered: 1 week ago