Math 1401 - Midterm
Which of the following will evaluate 2 raised to the forth power correctly?
- 2*2*2*2 - 2**4
Assume that US states can either be labeled by their names (Georgia, Alabama, Mississippi, etc.), or numbers (4, 22, 20, etc.). For example, Georgia was the 4th state to join the union. Which of the following values would be OK in a table with a column labeled "States" in Python?
- 4, 22, 20... - Georgia, Alabama, Mississippi...
In a randomized controlled experiment
- A random process is used to select which participants get assigned to the treatment and control groups. - The treatment and control groups are likely to be similar except for the treatment.
Which of the following are true about arrays?
- Arithmetic is applied to each element individually. - Arrays contain a sequence of values - Arrays must be the same size if you want to add them.
Selecting rows by condition. Which of the following lines of code will create a new table form the table 'nba' that contains only Atlanta Hawks players? Select all that apply.
- AtlPlayers = nba.where('TEAM', 'Atlanta Hawks') - AtlPlayers = nba.where('TEAM', are.equal_to('Atlanta Hawks'))
How do you run a cell of Python code in Jupyter Notebook? Select all items below that are correct.
- Select the cell and click on the "Run" button at the top of the page. - Select the cell and click on the Ctrl + Enter
Which of the following types of numbers are used in Python?
- int - float
Which of the following lines of code will create newTable by selecting the first 3 rows from OldTable? Select all that apply.
- newTable = oldTable.take(make_array(0,1,2)) - newTable = oldTable.take(np.arange(0,3))
The .sort method uses which of the following to determine how the table will be sorted?
.sort always sorts by the name of the desired column.
Python's .where method creates a new table with information only about the items we select. In the cones table below, if we restrict to "Flavor" and "Chocolate," how many rows will the table have?
0
Using code block like the following one, determine how many players were on the Miami Heat in the 2015-2016 season. nba.where('TEAM', are.containing('Heat'))
12
How many New York Knicks players are in the nba table?
13
How many Boston Celtics players are in the nba table?
15
What is the value of the following expression when executed in a Python code block? (9 + 3*2 + 1)**1.00 Round your answer to 2 decimal places.
16.00
What is Kyrie Erving's salary as listed in the nba table?
16.4075
How many Utah Jazz players are in the nba table?
17
What is Dwyane Wade's salary as listed in the nba table?
20
In the "movies" table, how much did the movie "Aladdin" gross?
217,350,219
What is the value of the following expression when executed in a Python code block? (5 + 3**2 + 1)*1.75 Round your answer to 2 decimal places.
26.25
In the video, the array "a" was created. what did max(a) return?
3
Python's .where method creates a new table with information only about the items we select. In the cones table below, if we restrict to "Flavor" and "chocolate," how many rows will the table have?
3
How many petals did the sunflower have?
34
If the initial value is 2566 and the changed value is is 2814, what is the growth rate?
9.7%
In the first chapter of Huck Finn, there are 7,026 characters total along with 66 periods. How many commas appear?
92
What does each dot in the scatter plot represent?
A chapter
What is the result of executing the following line(s) of code? flowers = Table().with_columns('Petals', np.arange(1,6))
A table named flowers is created with a single column named 'Petals'. It has 5 rows. the first row has the number 1 in it, the second row, the number 2 and so on.
If the chapter in a book similar to little women contained about 400 periods, how many characters would you guess to be in that chapter?
About 40,000
Data-driven decision making has already transformed a tremendous breadth of industries, including the which of the following? finance, advertising, manufacturing, and real estate.
All of these: Finance Advertising Manufacturing Real Estate Pretty much everything
Data science extends the field of statistics by taking full advantage of which of the following?
All: Computing Data visualization Machine learning Optimization Access to information
What is the result of executing the following line(s) of code? flowers = Table()
An empty table named flowers is created.
Which disease, described in the video, ravaged London in the mid to late 1800's?
Cholera
What was the treatment in the chocolate study?
Consuming Chocolate
What is the result of executing the following line(s) of code? newFlowers = flowers.with_columns('Color')
Error
Who were the individuals in the chocolate study?
European adults.
What was the crucial observation that john snow made about the treatment and control groups?
Except for the water, the households in the control groups were very similar. They had similar physical surroundings, financial status, etc.
If the table "flowers" has 3 columns, and you use select to make a table with two columns. the table "flowers" will now have two columns.
False
If the treatment and control groups are different apart from the treatment, then the differences in the outcomes between the two groups can be ascribed to the treatment.
False
In order to sort from largest to smallest, you must add "ascending = False" to the sort method.
False
The .select method is used to select rows of interest in a table.
False
The following code will change the name of the column 'City' in the table 'oldTable' to 'City Name'. newTable = oldTable.relabeled('City', 'City Name')
False
The scatter plot is not very useful for predicting the length of the chapters based on the number of periods.
False
We should all eat more chocolate because this study proved that eating more chocolate causes lower incidences of heart disease.
False
Huck Finn is the story of Jim and Huck rafting down the Mississippi River in search of freedom. Which word appears in Huck Finn the most: father, mother, sister?
Father
What is the result of this code block? type(3.0)
Float
Which of the following people believed diseases were spread by foul air? Select all that apply.
Florence Nightingale London's Commissioner of the board of health.
In Little Women, four minor characters are Daisy, Demi, Kate and Hannah. Which of those names appears the most often in the novel?
Hannah
What is the result of this code block? "I ate" + ' ' + str(1 + 1) + ' ' + 'much'
I ate 2 much
What is the result of this code block? "Mary's" + ' ' + 'little ' + ' ' + 'lambs'
Mary's little lambs
What is the result of this code block? 'hitchhiker'.replace('hi', 'ma')
Matchmaker
What was observed in the chocolate study?
People that ate more chocolate were about 5% less likely to die of heart disease.
How do you add a new code cell in Jupyter Notebook?
Select the "Insert" button at the top of the notebook and click on "Insert Cell Below"
In the blue-gold scatter plot, what does the slope of the trend line indicate?
Sentences in both books have about the same number of characters
Although researchers concluded that drinking coffee caused lung cancer, the real cause was most likely
Smoking
Which action saved many lives as a result of John Snow's investigations?
The municipal authorities removed the handle from the Broad Street Pump
In John Snow's experiment, what was the treatment for the treatment group?
The treatment group drank foul water.
John Snow's discovery that more people died that drank water from the Broad Street Pump meant that
The water from the pump was related to the deaths.
An assignment statement assigns the name to the left hand side of an equals sign to a value on the right hand side.
True
Computers have a limited amount of precision that can be used to represent a numerical value. This may result in unexpected results when using a computer for arithmetic.
True
Consider the following code block. some_evens = np.arange(2, 10, 2)1 / some_evens Question (T/F). The result will be an array with values
True
Learning the Python language is like learning to ride a bike.
True
Observational studies can be affected by confounding variables.
True
One way to create an array is to use the function make_array().
True
Single and double quotes can both be used to create strings: 'covfefe' and "covfefe" are identical expressions.
True
The following code will change the name of the column 'City' in the table 'oldTable' to 'City Name'. oldTable = oldTable.relabeled('City', 'City Name')
True
The scatter plot implies a linear relationship between the number of periods in a chapter and the length of the chapter.
True
If MyArray = [2, 4, 6], what is the result of myArray ** 2 ?
[4, 16, 36]
Rank the following from largest value to smallest value
__2__ 2 * 4 ** 10 __1__ (2 * 4) ** 10 __5__ 4 / 2 / 10 __3__ 4 * 2 **10 __4__ 4 / (2 / 10)
What is the result of this code block? some_evens = np.arange(2, 10, 2)some_evens * 2
array([ 4, 8, 12, 16])
What is the result of the following code block? np.arange(5)
array([0, 1, 2, 3, 4])
What is the result of the following code block? np.arange(1,5)
array([1, 2, 3, 4])
What is the result of this code block? np.arange(2, 4, 2)
array([2])
What is the result of this code block? make_array(1, 6, 2) + 2
array([3, 8, 4])
What is the result of this code block? make_array(1,5) + 2
array([3,7])
What is the result of this code block? some_evens = np.arange(4, 10, 2)/np.arange(2, 5)some_evens * 2
array([4., 4., 4.])
What is the result of this code block? type(max)
built_in_function_or_method
In the video, a table containing data about flowers was read into Python. What was the name of the table?
flowers
Which of the following would select the column "Name" from the table "flowers"?
flowers.select('Name')
What is the result of this code block? type(5 * 1)
int
What is the result of this code block? 'John's sandwich is' + ' ' + str(1 + 1) + ' ' + 'smelly'
invalid syntax
What is the result of this code block? 'Mary's' + ' ' + 'little ' + ' ' + 'lambs'
invalid syntax
What is the result of this code block? type('3')
str