Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Deck .csv is the following face,suit 2,H 3,H 4,H 5,H 6,H 7,H 8,H 9,H 10,H J,H Q,H K,H A,H 2,S 3,S 4,S 5,S 6,S 7,S
Deck .csv is the following
"face","suit"
"2","H"
"3","H"
"4","H"
"5","H"
"6","H"
"7","H"
"8","H"
"9","H"
"10","H"
"J","H"
"Q","H"
"K","H"
"A","H"
"2","S"
"3","S"
"4","S"
"5","S"
"6","S"
"7","S"
"8","S"
"9","S"
"10","S"
"J","S"
"Q","S"
"K","S"
"A","S"
"2","C"
"3","C"
"4","C"
"5","C"
"6","C"
"7","C"
"8","C"
"9","C"
"10","C"
"J","C"
"Q","C"
"K","C"
"A","C"
"2","D"
"3","D"
"4","D"
"5","D"
"6","D"
"7","D"
"8","D"
"9","D"
"10","D"
"J","D"
"Q","D"
"K","D"
"A","D"
3. Read in the file "deck.csv", which we will use to simulate drawing cards from a deck. (check the demonstration file for a related erample) (a) Simulate drawing two cards (without replacement) 5 times and print out the hand each (b) Simulate drawing a hand of twords 100,000 times to estimate the probability of drawing a pair (two cards with the same face) (c) Simulate drawing a hand of five cards (without replacement) 100,000 times to estimate the probability of drawing a flush (all suits are the same to measure the number of different suits in hand). (Hint: use length(unique (handSsuit))Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started