Question 6.
Compute the chance that the monkey types the letter
"e"
at least once in the 11
strikes. Call it
e_chance
. Use algebra and type in an arithmetic equation that Python can evalute.
BEGIN QUESTION
name: q2_6
manual: false
[16]:
e_chance
= 1 
(
25/26
)
**11
#SOLUTION
e_chance
[16]:
0.35041906843673165
5
Question 7.
Do you think that a computer simulation is more or less effective to estimate
e_chance
compared to when we tried to estimate
datascience_chance
this way? Why or why not? (You
don’t need to write a simulation, but it is an interesting exercise.)
BEGIN QUESTION
name: q2_7
manual: true
1.3
3. Sampling Basketball Players
This exercise uses salary data and game statistics for basketball players from the 20142015 NBA
season. The data was collected from
BasketballReference
and
Spotrac
.
Run the next cell to load the two datasets.
Question 1.
We would like to relate players’ game statistics to their salaries. Compute a table
called
full_data
that includes one row for each player who is listed in both
player_data
and
salary_data
. It should include all the columns from
player_data
and
salary_data
, except the
"PlayerName"
column.
BEGIN QUESTION
name: q3_1
manual: false
[3]:
full_data
=
player_data
.
join(
'Name'
, salary_data,
'PlayerName'
)
#SOLUTION
full_data
[3]:
Name
 Age
 Team  Games  Rebounds  Assists  Steals  Blocks 
Turnovers  Points  Salary
A.J. Price
 28
 TOT
 26
 32
 46
 7
 0

14
 133
 62552
Aaron Brooks
 30
 CHI
 82
 166
 261
 54
 15

157
 954
 1145685
Aaron Gordon
 19
 ORL
 47
 169
 33
 21
 22

6
38
 243
 3992040
Adreian Payne
 23
 TOT
 32
 162
 30
 19
 9

44
 213
 1855320
Al Horford
 28
 ATL
 76
 544
 244
 68
 98

100
 1156
 12000000
Al Jefferson
 30
 CHO
 65
 548
 113
 47
 84

68
 1082
 13666667
AlFarouq Aminu  24
 DAL
 74
 342
 59
 70
 62

55
 412
 1100602
Alan Anderson
 32
 BRK
 74
 204
 83
 56
 5

60
 545
 1276061
Alec Burks
 23
 UTA
 27
 114
 82
 17
 5

52
 374
 3034356
Alex Kirk
 23
 CLE
 5
 1
 1
 0
 0
 0
 4
 507336
… (482 rows omitted)
Basketball team managers would like to hire players who perform well but don’t command high
salaries. From this perspective, a very crude measure of a player’s
value
to their team is the number
of points the player scored in a season for every
$1000 of salary
(
Note
: the
Salary
column is in
dollars, not thousands of dollars). For example, Al Horford scored 1156 points and has a salary of
$12 million.
This is equivalent to 12,000 thousands of dollars, so his value is
1156
12000
.