4. Earthquakes
The next cell loads a table containing information about
every earthquake with a magnitude above 4.5
in 2017, compiled by the US Geological
Survey. (source:
()
)
In [4]:
earthquakes
=
Table()
.
read_table(
'earthquakes_2017.csv'
)
.
select([
'time'
,
'mag'
,
'place'
])
earthquakes
There are a several earthquakes that occurred in 2017 that we're interested in, and generally, we won't have access to this large population. Instead, if
we sample correctly, we can take a small subsample of earthquakes in this year to get an idea about the distribution of magnitudes throughout the
year!
Out[4]:
time
mag
place
2017-12-31T23:48:50.980Z
4.8
30km SSE of Pagan, Northern Mariana Islands
2017-12-31T20:59:02.500Z
5.1
Southern East Pacific Rise
2017-12-31T20:27:49.450Z
5.2
Chagos Archipelago region
2017-12-31T19:42:41.250Z
4.6
18km NE of Hasaki, Japan
2017-12-31T16:02:59.920Z
4.5
Western Xizang
2017-12-31T15:50:22.510Z
4.5
156km SSE of Longyearbyen, Svalbard and Jan Mayen
2017-12-31T14:53:32.590Z
5.1
41km S of Daliao, Philippines
2017-12-31T14:51:58.200Z
5.1
132km SSW of Lata, Solomon Islands
2017-12-31T12:24:13.150Z
4.6
79km SSW of Hirara, Japan
2017-12-31T04:02:18.500Z
4.8
10km W of Korini, Greece
... (6350 rows omitted)

3/18/2021
hw06
Question 4.1.
In the following lines of code, we take two different samples from the earthquake table, and calculate the mean of the magnitudes of
these earthquakes. Are these samples representative of the population of earthquakes in the original table (that is, the should we expect the mean to
be close to the population mean)?
Hint:
Consider the ordering of the
earthquakes
table.
))
))
))
))

12/17
Question 4.3.
Suppose we want to figure out what the biggest magnitude earthquake was in 2017, but we are tasked with doing this only with a
sample of 500 from the earthquakes table.
To determine whether trying to find the biggest magnitude from a sample is a plausible idea, write code that simulates the maximum of a random
sample of size 500 from the
earthquakes
table 5000 times. Assign your array of maximums to
maximums
.

Question 4.2.
Write code producing a sample that should represent the population of size 500 then take the mean of the magnitudes of the
earthquakes in this sample. Assign these to
representative_sample
and
representative_mean
respectively.
Hint:
In class, what sort of samples can properly represent the population?
))
))