Homework 0
Q1 Probabilistic Inference
Your box of cereal may be a contest winner! It's rattling, which 100% of winning boxes do. Of course, 1% of all boxes rattle, and only one box in a million is a winner. What is the probability that your box is a winner?
Note on answer formatting: Please specify your answer as a decimal probability (i.e. .05 rather than 5%). Do not include zeros before the decimal. To receive credit, your answer must match ours exactly.
1/10000
Q2 Events
You are playing a solitaire game in which you are dealt three cards without replacement from a simplified deck of 10 cards (marked 1 through 10). You win if one of your cards is a 10 or if all of your cards are odd.
How many winning hands are there if different orders are different hands?
10 in the hand
# 10 in each one
a = 3 * 9 * 8
# all odd cards
b = 5 * 4 * 3
# total
a + b
c = 10 * 9 * 8
# prob
(a + b) / c
What is your chance of winning? (round your answer to 3 decimal places). Do not include zeros before the decimal.
0.383
Q3 Expectations
Someone rolls a fair six-sided die, and you win points equal to the number shown.
What is the expected number of points after one roll?
3.5
After 2 rolls?
7
After 100 rolls?
350
Q4 Conditional Probabilities
Select all of the following statements that are true for all joint distributions over XX and YY.
The following checkbox options contain math elements, so you may need to read them in your screen reader's “reading” or “browse” mode instead of “forms” or “focus” mode.
Choice 1 of 6:P(x,y)=P(x)P(y)P(x,y)=P(x)P(y)
==Choice 2 of 6:P(x,y)=P(x∣y)P(y)P(x,y)=P(x∣y)P(y)==
Choice 3 of 6:P(x,y)=P(x∣y)P(y∣x)P(x,y)=P(x∣y)P(y∣x)
Choice 4 of 6:P(x)=∑yP(x∣y)P(x)=∑yP(x∣y)
==Choice 5 of 6:P(x)=∑yP(x,y)P(x)=∑yP(x,y)==
Choice 6 of 6:None of the above.
Q5 Linear Equations
14 Points
Grading comment:
You know that x=(12)y+(12)(x+1)x=(21)y+(21)(x+1) and y=(13)y+(13)(x+2)y=(31)y+(31)(x+2).
x = 0.5y + 0.5x + 0.5 y = 1/3 y + 1/3 x + 2/3
What is x?
What is y?
Q6 Logarithms
13 Points
Grading comment:
Select all of the the following statements that are true.
The following checkbox options contain math elements, so you may need to read them in your screen reader's “reading” or “browse” mode instead of “forms” or “focus” mode.
Choice 1 of 7:2(x∗y)=2x2y2(x∗y)=2x2y
Choice 2 of 7:2(x+y)=2x2y2(x+y)=2x2y
Choice 3 of 7:2(x+y)=2x+2y2(x+y)=2x+2y
Choice 4 of 7:log(3x)=log(3)log(x)log(3x)=log(3)log(x)
Choice 5 of 7:log(3x)=xlog(3)log(3x)=xlog(3)
Choice 6 of 7:log(3x)=3xlog(3x)=3x
Choice 7 of 7:None of the above.
Save Answer
Question 6: Logarithms
Q7 Hashing
18 Points
Question 7.1
Q7.1
6 Points
Grading comment:
Which critical operation is generally faster in a hash table than in a linked list?
Choice 1 of 2:inserting an element into the data structureChoice 2 of 2:testing for the membership of an element in the data structure
Save Answer
Question 7.1:
Question 7.2
Q7.2
6 Points
Grading comment:
On average, how fast is this operation in a hash table?
The following multiple-choice options contain math elements, so you may need to read them in your screen reader's “reading” or “browse” mode instead of “forms” or “focus” mode.
Choice 1 of 5:O(1)O(1)Choice 2 of 5:O(n)O(n)Choice 3 of 5:O(logn)O(logn)Choice 4 of 5:O(n2)O(n2)Choice 5 of 5:None of the above.
Save Answer
Question 7.2:
Question 7.3
Q7.3
6 Points
Grading comment:
On average, how fast is this operation in a linked list?
The following multiple-choice options contain math elements, so you may need to read them in your screen reader's “reading” or “browse” mode instead of “forms” or “focus” mode.
Choice 1 of 5:O(1)O(1)Choice 2 of 5:O(n)O(n)Choice 3 of 5:O(logn)O(logn)Choice 4 of 5:O(n2)O(n2)Choice 5 of 5:None of the above.