Chapter 1 quiz

Ten questions to bring the chapter together.

Work from question 1 to 10. Edit your Python box, click Run Code, review the result, then click Submit attempt. Reference answers unlock after all ten attempts are submitted. This records completion, not correctness. Each box runs independently. Progress is saved in this browser.

Submitted: 0 / 10

Question 1

This cell imports math as m. Complete a valid call to find the square root of 144. In a comment, explain why sqrt(144) alone is not defined by this import.

Write your answer, then run it.

Question 2

From [42, 58, 28, 65], produce a new list containing a HK$5 discount only on prices at least 50. Print it and comment whether the original list changes.

Write your answer, then run it.

Question 3

Predict then print the two results below. Explain their different lengths in a comment.

Write your answer, then run it.

Question 4

Calculate counts [85, 110, 140] × bills [42, 58, 28]. Create a Series labelled Wonton, Char Siu, Milk Tea. Print the total and the label with the largest value.

Write your answer, then run it.

Question 5

Two classmates obtain different standard deviations from these same observations. Print both library defaults to three decimals, then change the NumPy call to match pandas. Explain in a comment.

Write your answer, then run it.

Question 6

Print the first value by position and the value labelled 10 from this Series. Explain why a label is not automatically its position.

Write your answer, then run it.

Question 7

Choose a chart for unordered dish revenues [3570, 6380, 3920]. Draw it with labels and units, then print the highest-revenue dish. State in a comment one reason this does not establish which dish is most profitable.

Write your answer, then run it.

Question 8

Assume normal delivery times with mean 28 and sd 6 minutes. Calculate the chance of exceeding 40 minutes. Print a two-decimal percentage and state the assumption in a comment.

Write your answer, then run it.

Question 9

For normal mean 28 and sd 6, find the cutoff containing 95% of times below it, then verify its cumulative probability. Print cutoff to two decimals with units, then probability to four decimals.

Write your answer, then run it.

Question 10

For observed times [20, 25, 28, 32, 45], print (1) the proportion above 40, (2) the sample 95th percentile, and (3) the normal-model 95th percentile for mean 28 and sd 6. Use two decimals. Explain why the last two need not match and why neither guarantees every delivery.

Write your answer, then run it.

Reference answers are locked until all 10 attempts are submitted.