Question: Create a plotting program using pylab called lab 2 _ cards.py to show the distribution of two - card hands. It should include these functions:

Create a plotting program using pylab called lab2_cards.py to show the distribution of two-card hands. It should include these functions:
Defines function graph_two_cards(num_trials)--Produces a graph of two-card hand frequencies with some statistical annotations.
Defines function calc_stats(data)-- Calculates mean and standard deviation from a dictionary of observation counts.
Defines function deal_two(deck)-- Shuffles the deck, deals two cards, and returns the sum of their rank values.
Calls graph_two_cards(100000)
Plot must also include:
title (must include the actual number of trials performed)
labels and annotations as shown (annotations for mean and must be at the right spots)
gray dashed vertical bars for mean and -2,-1,+1, and +2 standard deviations
End result should look similar to the attached picture. The graph produced by calling graph_two_cards should look like this:
Figure 1
Create a plotting program using pylab called lab

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!