Fall 2023 Midterm Exam
pdf
keyboard_arrow_up
School
University of California, San Diego *
*We aren’t endorsed by this school
Course
10
Subject
Statistics
Date
Feb 20, 2024
Type
Pages
13
Uploaded by BaronJackal4036
24. 2. 12. 오전
8:16
Fall 2023 Midterm Exam
https://practice.dsc10.com/fa23-midterm/index.html
1/13
living_cost
living_cost
living_cost
"family_type"
"2a1c"
"1a0c"
"1a1c"
"1a2c"
"1a3c"
"1a4c"
"2a0c"
"2a1c"
"2a2c"
"2a3c"
"2a4c"
"state"
"county"
"family_type"
"state"
"CA"
"county"
"San Diego"
"family_type"
"family_type"
"2a1c"
"state"
"CA"
"county"
"San Diego"
"family_type"
"1a2c"
"state"
"county"
"family_type"
living_cost
"is_metro"
bool
True
False
"avg_housing_cost"
int
24. 2. 12. 오전
8:16
Fall 2023 Midterm Exam
https://practice.dsc10.com/fa23-midterm/index.html
2/13
"avg_childcare_cost"
int
"median_income"
int
import babypandas as bpd
import numpy as np
"avg_housing_cost"
"family_type"
result
"avg_childcare_cost"
"family_type"
"avg_housing_cost"
"avg_childcare_cost"
"family_type"
"avg_housing_cost"
"avg_housing_cost"
"family_type"
"avg_childcare_cost"
"avg_housing_cost"
"family_type"
"avg_childcare_cost"
families = living_cost.groupby("family_type").median()
sorted_families = families.sort_values(by="avg_housing_cost")
result = sorted_families.get("avg_childcare_cost").iloc[0]
24. 2. 12. 오전
8:16
Fall 2023 Midterm Exam
https://practice.dsc10.com/fa23-midterm/index.html
3/13
another_result
another_result
living_cost.groupby("family_type").min()
living_cost.groupby("family_type").sum()
living_cost.groupby("family_type").count()
three_columns
living_cost
three_columns
"CA San Diego County 1a2c"
living_cost
"family_type"
10
50
another_result = (living_cost.groupby("state").count()
.sort_values(by="median_income", ascending=False)
.get("median_income").index[0])
three_columns = (living_cost.get("state") + " " +
living_cost.get("county") + " " + living_cost.get("family_type"))
(living_cost.assign(geo_family=three_columns)
.groupby("geo_family").count()
.shape[0])
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
24. 2. 12. 오전
8:16
Fall 2023 Midterm Exam
https://practice.dsc10.com/fa23-midterm/index.html
4/13
"family_type"
living_cost
"family_size"
living_cost
500
3143
31430
J = living_cost.get("county") == "Benton County"
K = living_cost.get("state") == "IN"
L = living_cost.get("family_type") == "1a2c"
__(a)__.__(b)__.iloc[0]
__(c)__.__(d)__ / 10
24. 2. 12. 오전
8:16
Fall 2023 Midterm Exam
https://practice.dsc10.com/fa23-midterm/index.html
5/13
num_people
"family_size"
"midterm"[0]
"m"
"midterm"[1]
"i"
living_cost = living_cost.assign(
family_size=living_cost.get("family_type").apply(num_people))
# Option 1
def num_people(fam): return int(fam[0]) + int(fam[2])
------------------------------------
# Option 2
def num_people(fam):
return int(fam[0] + fam[2])
------------------------------------
# Option 3
def num_people(fam):
x = int(fam[0] + fam[2])
return int(x / 10) + x % 10
------------------------------------
# Option 4
def num_people(fam):
x = fam.strip("c").split("a")
return int(x[0]) + int(x[1])
------------------------------------
# Option 5
def num_people(fam):
x = 0
for i in fam:
if i % 2 == 0:
x = x + 1
return x
------------------------------------
# Option 6
def num_people(fam):
x = 0
for i in np.arange(len(fam)):
if i % 2 == 0:
x = x + int(fam[i])
return x
24. 2. 12. 오전
8:16
Fall 2023 Midterm Exam
https://practice.dsc10.com/fa23-midterm/index.html
6/13
expensive
living_cost
"avg_childcare_cost"
"family_type"
"avg_childcare_cost"
expensive
"family_type"
"avg_childcare_cost"
"is_metro"
living_cost
expensive
"is_metro"
"is_metro"
True
"state"
"is_metro"
"is_metro"
expensive = living_cost[living_cost.get("avg_childcare_cost") >= 20000]
(expensive.groupby(____(a)____).max()
.reset_index()
.groupby(____(b)____).____(c)____)
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
24. 2. 12. 오전
8:16
Fall 2023 Midterm Exam
https://practice.dsc10.com/fa23-midterm/index.html
7/13
living_cost
"family_type"
"1a0c"
"median_income"
[50, 80)
[50, 70)
[70, 80)
h
1
[50, 70)
h
2
[70, 80)
h
2
[50, 70)
r
[70, 80)
,
h
2
h
1
r
1
24. 2. 12. 오전
8:16
Fall 2023 Midterm Exam
https://practice.dsc10.com/fa23-midterm/index.html
8/13
living_cost
"family_type"
state_merge
"MT"
state_merge("MT", "NV")
1050
"NV"
"1a4c"
"2a1c"
"2a3c"
"1a1c"
r
2
r
3
2
r
3
r
2
r
3
r
31430
3143
def state_merge(A, B):
state_A = living_cost[living_cost.get("state") == A]
state_B = living_cost[living_cost.get("state") == B]
return state_A.merge(state_B, on="family_type").shape[0]
24. 2. 12. 오전
8:16
Fall 2023 Midterm Exam
https://practice.dsc10.com/fa23-midterm/index.html
9/13
A
B
A
B
A
B
C
D
C
D
Y
C
D
p
=
4
1
p
5
1 −
p
5
1 − (1 −
p
)
5
(1 −
p
)
5
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
24. 2. 12. 오전
8:16
Fall 2023 Midterm Exam
https://practice.dsc10.com/fa23-midterm/index.html
10/13
p
⋅ (1 −
p
)
4
p
(1 −
4
p
)
p
5
1 −
p
5
1 − (1 −
p
)
5
(1 −
p
)
5
p
⋅ (1 −
p
)
4
p
(1 −
4
p
)
p
5
1 −
p
5
1 − (1 −
p
)
5
(1 −
p
)
5
p
⋅ (1 −
p
)
4
p
(1 −
4
p
)
24. 2. 12. 오전
8:16
Fall 2023 Midterm Exam
https://practice.dsc10.com/fa23-midterm/index.html
11/13
"2a3c"
"oldest"
"middle"
"youngest"
np.count_nonzero(outcomes == "Outcome Q") / repetitions
np.count_nonzero(outcomes == "Outcome R") / repetitions
np.count_nonzero(outcomes == "Outcome S") / repetitions
replace=True
replace=False
ages = np.array(["oldest", "middle", "youngest"])
outcomes = np.array([])
repetitions = 10000
for i in np.arange(repetitions):
fams = np.random.choice(np.arange(1, 11), 5, ____(a)____)
if ____(b)____:
children = np.random.choice(ages, 2, ____(c)____)
if not "middle" in children:
outcomes = np.append(outcomes, ____(d)____)
else:
outcomes = np.append(outcomes, ____(e)____)
else:
outcomes = np.append(outcomes, ____(f)____)
24. 2. 12. 오전
8:16
Fall 2023 Midterm Exam
https://practice.dsc10.com/fa23-midterm/index.html
12/13
replace=True
replace=False
"Outcome Q"
"Outcome R"
"Outcome S"
"Outcome Q"
"Outcome R"
"Outcome S"
"Outcome Q"
"Outcome R"
"Outcome S"
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
- Access to all documents
- Unlimited textbook solutions
- 24/7 expert homework help
24. 2. 12. 오전
8:16
Fall 2023 Midterm Exam
https://practice.dsc10.com/fa23-midterm/index.html
13/13
Related Questions
A "rotated" square is placed on a coordinate plane and two adjacent corners of the square are located at (- 5, – 8) and (1, – 2).
a. What is the side length of the square?
units
Preview
b. What is the area of the square?
square units
Preview
Box 1: Enter your answer as a number (like 5, -3, 2.2172) or as a calculation (like 5/3, 2^3, 5+4)
Enter DNE for Does Not Exist, oo for Infinity
Box 2: Enter your answer as a number (like 5, -3, 2.2172) or as a calculation (like 5/3, 2^3, 5+4)
Enter DNE for Does Not Exist, oo for Infinity
arrow_forward
questions 5 and 6 please
arrow_forward
The question and answers are in the screenshot.
arrow_forward
Find A^-1
arrow_forward
What type of relationship exists between the number of
pages printed on a printer and the amount of ink used by
that printer?
Jation
but
arrow_forward
During the test, the smallest 'volume per breath' is 0.7 liters, and this first happens for a breath that starts 2
seconds into the test. The largest volume per breath is 1.7 liters; this happens for a breath beginning 53
seconds into the test.
By creating a math model for this patient's breathing, doctors would have more information to decide
if abnormal breathing is happening for the patient during the test**.
Note: Let's assume that the patient's breath is steady: that the largest breath is equidistant from the first
small breath and the second small breath.
a) Find a formula for the function b(t) whose graph models the test data for this patient.
b(t)
b) If the patient begins a breath every 5 seconds, what are the breath volumes during the first 30 seconds of
the test? Hint: Your answer should be a list of numbers. Use the model from part (a) to find your answer(s),
and write answers to 2 decimal places.
liters
**and also, more information to decide if the patient's breathing is…
arrow_forward
The trendline is Y=0.918x+1.7355 and R^2 is 0.8237
If a student plugs the value 80 in the trendline for x, write a sentence explaning the 80 and what the answer means. Must show coversions.
arrow_forward
Hello. I can not seem to get the right answer. How would you do this. Thank you.
arrow_forward
Using a calculator, estimate the CRIME_RATE when PROP_CHANGE_INCOME=25% (note that in the dataset, the proportions are analyzed as numbers 0-100%).
Estimated Crime Rate for someone who has a 25% change in Household income over the past several years:
Estimated model: = y = 125.52814 - 1.94182(x)
y = 125.52814 - 1.94182= 76.98264
Write down both possible interpretations of your estimate.
arrow_forward
Chapter 2, Section 1, Exercise 001
This exercise provides information about data in a survey of students.The survey students consisted of 157 females and 160 males.Find p^, the proportion who are female.Round your answer to three decimal places.p^=Enter your answer in accordance to the question statement
arrow_forward
V7. VI1 = V
/7. V11
arrow_forward
House price y is estimated as a function of the square footage of a house x and a dummy variable d that equals 1 if the house has ocean views. The estimated house price, measured in $1,000s, is given by yˆy^ = 119.60 + 0.14x + 54.80d.
b-1 Compute the predicted price (in $1,000s) of a house without ocean views and square footage of 1,600. (Do not round intermediate calculations. Round your final answer to 2 decimal places.)
predicted price=
b-2. Compute the predicted price (in $1,000s) of a house without ocean views and square footage of 3,200.
predicted price=
arrow_forward
3/7 of the students in a school are in sixth grade.
How many sixth graders are there if the school has 70 students? Show your thinking.
\
arrow_forward
A model for the men’s 100-meter freestyle record times in seconds is given by
y=(38,504.4888 + 44.37530536x^2)/(1+x+x^2)
where x = 0 represents 1900. The model and the data points are shown in the graph below. Use this model to predict a reasonable record for a man to swim 100 meters in the year 2000. Explain how you determined your answer.
arrow_forward
A model for the men’s 100-meter freestyle record times in seconds is given by
y = (38,504.4888 + 44.37530536x^2)/(1 + x + x^2)
where x = 0 represents 1900. The model and the data points are shown in the graph below. Use this model to predict a reasonable record for a man to swim 100 meters in the year 2000. Explain how you determined your answer.
arrow_forward
Please see image attached. Thank you for the help. I am not sure if I'm right.
arrow_forward
Escalate - Show every mynute steps in DETAILED!
arrow_forward
according to the Florida agency for workplace the monthly average number of uneploment claims in a certain country is given by N (t)= 22.16t^2 - 238.5t + 2005 where t is the number of years after 1990.
A) During what year did the number of claims decrease?
b)Find the relative extrema and interpret it.
arrow_forward
Can you help me know how to solve for x and k? It’s number 9 in the photo…
arrow_forward
The equation T = 0.63 + 78

arrow_forward
The owner of an apple orchard has field of new trees that are growing and producing more apples each year. He wants to determine the average growth rate; percentage increase, of the amount of apples produced by these trees over time. The amount of growth varies each year; so he decides to find the geometric mean, or average The formula g = √a • √b is used to find the geometric mean of two numbers. Over two years, the growth rate was 2x^2% and 4x^8% . Find the average growth rate for these two years. Leave your answer in simplified radical form.
arrow_forward
SEE MORE QUESTIONS
Recommended textbooks for you
![Text book image](https://www.bartleby.com/isbn_cover_images/9781337798310/9781337798310_smallCoverImage.jpg)
Mathematics For Machine Technology
Advanced Math
ISBN:9781337798310
Author:Peterson, John.
Publisher:Cengage Learning,
Algebra & Trigonometry with Analytic Geometry
Algebra
ISBN:9781133382119
Author:Swokowski
Publisher:Cengage
Related Questions
- A "rotated" square is placed on a coordinate plane and two adjacent corners of the square are located at (- 5, – 8) and (1, – 2). a. What is the side length of the square? units Preview b. What is the area of the square? square units Preview Box 1: Enter your answer as a number (like 5, -3, 2.2172) or as a calculation (like 5/3, 2^3, 5+4) Enter DNE for Does Not Exist, oo for Infinity Box 2: Enter your answer as a number (like 5, -3, 2.2172) or as a calculation (like 5/3, 2^3, 5+4) Enter DNE for Does Not Exist, oo for Infinityarrow_forwardquestions 5 and 6 pleasearrow_forwardThe question and answers are in the screenshot.arrow_forward
- Find A^-1arrow_forwardWhat type of relationship exists between the number of pages printed on a printer and the amount of ink used by that printer? Jation butarrow_forwardDuring the test, the smallest 'volume per breath' is 0.7 liters, and this first happens for a breath that starts 2 seconds into the test. The largest volume per breath is 1.7 liters; this happens for a breath beginning 53 seconds into the test. By creating a math model for this patient's breathing, doctors would have more information to decide if abnormal breathing is happening for the patient during the test**. Note: Let's assume that the patient's breath is steady: that the largest breath is equidistant from the first small breath and the second small breath. a) Find a formula for the function b(t) whose graph models the test data for this patient. b(t) b) If the patient begins a breath every 5 seconds, what are the breath volumes during the first 30 seconds of the test? Hint: Your answer should be a list of numbers. Use the model from part (a) to find your answer(s), and write answers to 2 decimal places. liters **and also, more information to decide if the patient's breathing is…arrow_forward
- The trendline is Y=0.918x+1.7355 and R^2 is 0.8237 If a student plugs the value 80 in the trendline for x, write a sentence explaning the 80 and what the answer means. Must show coversions.arrow_forwardHello. I can not seem to get the right answer. How would you do this. Thank you.arrow_forwardUsing a calculator, estimate the CRIME_RATE when PROP_CHANGE_INCOME=25% (note that in the dataset, the proportions are analyzed as numbers 0-100%). Estimated Crime Rate for someone who has a 25% change in Household income over the past several years: Estimated model: = y = 125.52814 - 1.94182(x) y = 125.52814 - 1.94182= 76.98264 Write down both possible interpretations of your estimate.arrow_forward
- Chapter 2, Section 1, Exercise 001 This exercise provides information about data in a survey of students.The survey students consisted of 157 females and 160 males.Find p^, the proportion who are female.Round your answer to three decimal places.p^=Enter your answer in accordance to the question statementarrow_forwardV7. VI1 = V /7. V11arrow_forwardHouse price y is estimated as a function of the square footage of a house x and a dummy variable d that equals 1 if the house has ocean views. The estimated house price, measured in $1,000s, is given by yˆy^ = 119.60 + 0.14x + 54.80d. b-1 Compute the predicted price (in $1,000s) of a house without ocean views and square footage of 1,600. (Do not round intermediate calculations. Round your final answer to 2 decimal places.) predicted price= b-2. Compute the predicted price (in $1,000s) of a house without ocean views and square footage of 3,200. predicted price=arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Mathematics For Machine TechnologyAdvanced MathISBN:9781337798310Author:Peterson, John.Publisher:Cengage Learning,Algebra & Trigonometry with Analytic GeometryAlgebraISBN:9781133382119Author:SwokowskiPublisher:Cengage
![Text book image](https://www.bartleby.com/isbn_cover_images/9781337798310/9781337798310_smallCoverImage.jpg)
Mathematics For Machine Technology
Advanced Math
ISBN:9781337798310
Author:Peterson, John.
Publisher:Cengage Learning,
Algebra & Trigonometry with Analytic Geometry
Algebra
ISBN:9781133382119
Author:Swokowski
Publisher:Cengage