283 Final
283 Final
283 Final
Student
Ethan Yountz
Total Points
70.1 / 83 pts
Question 1
Count trues 7 / 7 pts
+ 1 pt one correct
+ 1 pt one correct
+ 1 pt one correct
1.4 g 1 / 1 pt
+ 0 pts Incorrect
Question 2
Negation 3 / 3 pts
+ 3 pts Correct: ∀N∈N+ ∀c1 ,c2 ∈R+ ∃n≥N (0 > c 1 g (n)) ∨ (c 1 g (n) > f(n)) ∨ (f(n) > c 2 g (n))
Feedback comments
+ 0 pts You are using a logical negation operation; use de Morgan for quantifiers and logic to push those down.
+ 0 pts You didn't flip all your quantifiers or you changed the nesting of ∀ and ∃.
− 0.5 pts You have dropped some parts out of the inequalities for checking if f(n) ∈ Θ(g(n)).
− 0.5 pts You still have a logical negation operation like an overbar or ∄, even though you tried to negate under it. So
your expression is not equivalent to f(n) ∈ / Θ(g(n)).
3.1 a 1 / 1 pt
3.2 b 1 / 1 pt
3.3 c 2 / 2 pts
+ 1 pt 2/4 correct
3.4 d 2 / 2 pts
+ 1 pt 2/4 correct
+ 1 pt 2/4 correct
3.6 f 2 / 2 pts
+ 1 pt 2/4 correct
3.7 g 2 / 2 pts
+ 1 pt 2/4 correct
3.8 h 1 / 2 pts
+ 1 pt 2/4 correct
4.1 a 1 / 1 pt
+ 1 pt Correct: 4 12
+ 0.5 pts 12! would put 12 different items into order with no repeates. That is too high.
+ 0 pts In this problem the key numbers are the 4 different bases {A,T,C,G} and the 12 bases that make up a
strand. You are told that order matters and repeats are allowed.
4.2 b 2 / 2 pts
+ 2 pts Correct: 5 ⋅ 4 4 : the block can have 0 to 4 bases before it begins (so it can start in position 1-5. Then
there are four bases to be filled in independently.
+ 1.7 pts 4 ⋅ 4 4 is close. But you can have 0 to 4 bases before the block, so that is 5 options.
+ 1 pt 4 4 counts the ways to choose the 4 remaining bases, but you have overcounted the number of ways to
place the block.
+ 1 pt 5! is too low because we have 5 places to put the block, but then choose any of the for bases for the
other positions. Nothing says the bases must be different.
remaining 7 bases independently. This counts each strand as many times as it has ACTAG blocks.
Note that ACTAG blocks can't overlap since they start with A and end with a single G. But we do have
strands with two ACTAG blocks and 2 independently chosen bases, so we subtract their number:
We choose 2 positions out of 4 for the ACTAG blocks, and fill in the two bases.
+ 1.7 pts 4 ⋅ 4 4 is close. But you can have 0 to 4 bases before the block, so that is 5 options.
+ 1.7 pts Your answer is close; you choose 4 positions, but you also have to choose A/T and C/G at all positions.
+ 1 pt You define a set of subsets, but enforce only one of the two conditions that k is the size or k is the min.
+ 0.5 pts You complete Sn,k = with a set of subsets of [1..n], or elements from Sn .
+ 0.2 pts You are defining a number, you should define a set of sets.
+ 0.5 pts At least your number is the number of elements that should be in Sn,k .
+ 0.2 pts You are defining a logical condition; you should define a set of sets.
+ 0.2 pts Your attempt is mixing types or is incomplete and will not evaluate.
Feedback comments
− 0.2 pts Since Sn is a set of sets, you want to take an element of Sn , not a subset or an element of its power set.
+ 0 pts You are restricting S ⊆ [1..k], when you need k and k − 1 numbers from (k..n].
+ 0 pts Your definition of Sn,k refers to Sn,k , which is not yet defined.
+ 0 pts You are using two different variable names, often Sn and S , as if they refer to the same thing.
Sn is already
6.1 n 1 / 1 pt
+ 1 pt Correct: n
6.2 1 1 / 1 pt
6.4 n>1 1 / 1 pt
+ 1 pt Correct: n > 1 , since bars with a single square were handfled in the base case.
+ 1 pt Correct: 1 ≤k<n
+ 0.5 pts 1 < k < n does not include the assumption about the base case, which you need anytime you break
off a single square.
+ 0.5 pts 0 ≤ k < n includes a base case that we don't prove. (and can't, since we can't have -1 breaks.)
+ 0.35 pts 1 ≤ k ≤ n Assumes that what you are proving in S7 is already known to be true.
6.7 n-1 1 / 1 pt
+ 1 pt Correct: n − 1 breaks, since we are back to bar C with n squares that we were given in S4.
+ 0.35 pts Remember that k has no value outside S5 unless we assign it one. So k − 1 is not correct.
+ 0.75 pts Correct: m − 1 breaks, since breaking gave bar A with m squares. (Note 1 ≤ m < n so the IH
applies.)
+ 0.75 pts Correct: n − m − 1 breaks, since breaking also gave bar B with n − m squares. (Note 1 ≤ n −
m < n so the IH applies.)
+ 0.75 pts Correct: m − 1 breaks, since breaking gave bar A with m squares. (Note 1 ≤ m < n so the IH
applies.)
+ 0.5 pts Used n-m-1 here and m-1 in the next. This doesn't match the line above, so is harder to verify, but
does earn partial credit.
+ 0.75 pts Correct: n − m − 1 breaks, since breaking also gave bar B with n − m squares. (Note 1 ≤ n −
m < n so the IH applies.)
+ 0.5 pts Used m-1 her and n-m-1 in the previous. This doesn't match the line above, so is harder to verify, but
does earn partial credit.
Question 7
Nim IH 1.5 / 2 pts
− 0.5 pts The first, second, and 6th do not apply. Since players may take blocks from only one stack we don't wind up
with both stacks being smaller, only one.
+ 1 pt One correct
+ 0 pts n and m are the sizes of the stacks given in S4. The IH must make assumptions about smaller stacks, but not
about them.
Question 8
M(n) IH 0 / 1 pt
+ 1 pt Correct: We assume, for all 1 ≤ k < n that M (k) ≤ ck lg k + dk + e. This will use using values for c > 0 ,
d , and e that are chosen outside the induction proof "for all n ≥ 1 .
+ 0 pts The first is the definition of M, which is not what we are trying to prove by induction.
+ 0 pts Induction proves "for all" so we need to get specific values for c > 0 , d , and e before the induction begins,
and are not allowed to have them change during the induction.
+ 0.5 pts Did select the correct one, but also one incorrect.
Question 9
Competition 16.1 / 20 pts
+ 1.25 pts Partial Credit: your answer assumes the tournament is round robin
would be correct
+ 1 pt Typo: you need to draw x, y from the set T of teams. (The set, B , contains pairs, so you could write
∀(x,y)∈B xBy → yBx in this case, but it is better to quantify over the teams.
+ 0.75 pts Partial Credit: your answer assumes the tournament is round robin and doesn't take into account
that teams don't play themselves
+ 0.5 pts Partial credit: Saying ∀x,y∈T x = y ∧ ((xBy ∨ yBx) ⊕ (xBy ∧ yBx )) is not quite correct. Having
x= y ∧ ... makes the statement false whenever T has more than one team. Also, the ⊕ statement
should not be included because it makes the assumption that all teams play each other, which is not
part of the definition of tieless
+ 0.5 pts Partial Credit: {∀x,y∈T ∣xBy ⊕ yBx} is not correct because set builder notation shouldn't have a
forall on the left hand side. If you wrote this without the set builder notation and just had
∀x,y∈T xBy ⊕ yBx it would be pretty close but still not quite right because it assumes the
tournament is round robin
+ 0.5 pts Partial Credit: ∀x,y∈T (x = y) ∧ (xRy) ⊕ (yRx) is not quite correct. The x =
y should be in the
subscript of the ∀ so that the statement isn't automatically false for T with more than 1 team. The R
's should be B 's. The ⊕ assumes that the tournament is round robin
+ 0 pts Incorrect. Saying ∀x,y∈T xBy ∨ yBx doesn't tell you that teams don't tie, and it doesn't account for the
case where x = y
+ 0 pts Incorrect. Saying ∀x,y∈T xBy ∧ yBx means that no one wins
+ 0 pts Incorrect: Saying ∀x,y∈T (xBy ∧ yBx) ⟹ (x y) isn't what you want because that statement is
=
+ 0 pts Incorrect
+ 0 pts blank
9.2 round robin 2 / 2 pts
+ 1.25 pts Partial Credit: ∀x,y∈T xBy ∨ yBx doesn't account for the x = y case
+ 1 pt Typo: ∀t,x∈T (tBv ∧ vBt) ⟹ (t = v) would be correct except you define an x in your quantifier, not
the v that you are using
+ 1 pt Partial Credit: Saying ∀x,y∈T (x = y) ⟹ (xBy ∨ xBy ) is not quite correct. Changing the xBy to
(x =
y)∧ and instead put x =
y in the subscript of the ∀ and also changed the R's to B 's it would
be correct.
+ 0.75 pts Partial Credit: ∀t,u∈T (t = u) ∨ (tRu ⊕ uRt) is not quite correct. The R's should be B 's. Having
the ⊕ makes it so no two teams can both beat each other, which is not part of the definition of round
robin.
+ 0.5 pts Partial Credit / Typo: ∀x,y∈U xBy ∨ yBx is not quite correct. You are drawing from the set U instead
of T . You are also not accounting for the case where x = y
+ 0.5 pts Partial credit: Saying ∀x,y∈T x = y ∧ ((xBy ∨ yBx) ⊕ (xBy ∧ yBx)) is not quite correct. Having
x= y ∧ ... makes the statement false whenever T has more than one team. Also, the ⊕ statement
should not be included because it makes the assumption that no two teams beat each other, which is
not part of the definition of round robin
+ 0.5 pts Partial Credit: {∀x,y∈T ∣xBy ∨ yBx} is not correct because set builder notation shouldn't have a
forall on the left hand side. If you wrote this without the set builder notation and just had
∀x,y∈T xBy ∨ yBx it would be pretty close but still not quite right because it doesn't account for the
case where x = y
+ 0 pts Incorrect: Saying ∀x,y∈T (xBy ∧ yBx) means that every team beats every other team.
+ 0 pts Incorrect: The statement ∀x,y∈T (xBy ⟹ yBx) is true if no teams play each other, but that isn't
what you want. If there are teams in T , but none of them play each other, you shouldn't call that a round
robin tournament.
+ 0 pts Blank
+ 0 pts Incorrect
9.3 r bijection 0.3 / 2 pts
+ 2 pts Correct: Since we have a function r : T → [1..n] where we know ∣T ∣ = ∣[1..n], it is enough to test
either that
+ 0.75 pts Your answer is addressing the next question, and not the question being asked here.
+ 0.4 pts Your expression answers a different question than the one that was asked.
+ 0.3 pts Your expression does not involve the function r , so cannot test if r is a bijection.
+ 0.2 pts Incomplete or type error means that this cannot be evaluated.
+ 0 pts I'm lookng for a quantified logic expression about the function r.
Feedback comments
− 0.3 pts The function is r : T → N , but you are using undefined notation: f , or misusing T or B .
+ 0 pts Much clearer to use function notation, r(x) = y, than relation notation, xry, though it is possible.
+ 0 pts This question involves the ranking function r : T → [1..n] only. It does not involve the B relation.
+ 0 pts You are using undefined variables or functions. (Often because quantifiers are missing.)
+ 0 pts We are told that r is a function. Your expressions assert that r is not. Thus they clearly don't say that r
is a bijection.
+ 0 pts We are told that r is a function. Your expression just restates that.
To show that r is a bijection, you want to show that the inverse relation, which includes a pair (y, x) iff
r(x) = y, is a function.
+ 2 pts Correct: Function r : T → N is a ranking for B iff ∀x,y∈T xBy → (r(x) < r(y)).
+ 2 pts Correct: Using that B is round-robin, tieless, and comparability, it will also work to test
∀x,y∈T xBy ↔ (r(x) < r(y)) or ∀x,y∈T (r(x) < r(y)) → xBy.
+ 1.2 pts This could be made correct if the quantifiers were all "For all." (and maybe some ∧s change to → s.)
+ 1 pt Your expression is testing whether the relation B is transitive. This is a necessary condition for it to have
a ranking, but does not test whether a given r is a ranking.
+ 1 pt Partial credit for having a valid quantified statement about B and r that does evaluate to true or false.
(Even if it may be always true or always false.)
+ 0.5 pts You have a statement that does not involvethe function r .
+ 0.5 pts You have a statement that does not involve the beats relation, B .
+ 0.2 pts Incomplete or type error means that this cannot be evaluated.
Feedback comments
− 0.2 pts The function is r : T → N , but you are using undefined notation: f , indexed values r x , or crazier
− 0.1 pts Rank is defined so that, for example, the rank 1 team beats all the rest. Your expression has high rank
numbers beating lower rank numbers.
+ 0 pts The ranking function r goes from teams to numbers, not the reverse.
+ 0 pts You are comparing teams with <, but that is not defined. You can check for teams x, y ∈ T if xBy or
compare ranks r(x) < r(y). The task is to show these comparisons are consistent.
+ 0 pts You are using undefined variables (often because quantifiers are missing) or sets (often R or A) or
functions/relations (often R or T().)
+ 0 pts Using AND with forall means that this is always false.
+ 1.8 pts Mostly Correct: ∀x∈T tBx ∨ ∃y∈T tBy ∧ yBx doesn't account for the case where x = t
+ 1.7 pts ∀x∈T tBx ∨ (xBt → (∃y∈T tBy ∧ yBx )) is correct if the competition is tieless and round-robin.
However it also consider t to top any teams it hasn't played.
+ 1.5 pts close: your solution is ∀x∈T ∃u∈T xBt ∨ (tBu ∧ uBt ∧ u x). Changing it to ∀x∈T ∃u∈T tBx ∨
=
Your expression would be correct/mostly correct if you addressed the following mistakes
− 0.3 pts Either correct or mostly correct but you define a variable such as x and treat it as the top team rather
than using the t you were given
− 0.3 pts Either correct or mostly correct but you use (x = t)∧. Your expression becomes false whenever x is
t. So you should move that to the subscript of the quantifier where you define x .
− 1 pt You could alter your solution to use a ∀ for one variable and a ∃ for the other to make it correct or
mostly correct
+ 0 pts Because you use (x = t)∧, your expression becomes false whenever x is t. So you should move that
+ 0 pts Blank
Expression Feedback
+ 0 pts Incorrect: your expression says some t beats everything / your expression says everything loses to
someone
− 0.5 pts Incorrect: As we saw in the final review slides, ∀u,x (u = t) ∨ (tBu) ∨ (xBu → tBx) can be false
when there does exist a top team in the tournament
9.6 irreflexive 1 / 1 pt
+ 1 pt Correct: b If teams never play themselves or beat or tie themselves, then we have, ∀x∈T , so the
xBx
beats relation B is irreflexive.
9.7 Antisymmetric 1 / 1 pt
B is anti-symmetric.
+ 0.1 pts Symmetric is almost the opposite of tieless. It says that whenever two teams play they tie. (It is not
the real opposite, because neither forces two teams to play -- that is the next condition.)
+ 1 pt Correct: C When tieless round-robin means ∀x,y∈T (x = y) ∨ (xBy ∨ yBx), so the beats relation B
is a Comparability relation.
+ 0.45 pts Anti-symmetric is true, but we learn that from "tieless", not from adding "round-robin".
+ 0.4 pts Transitive was a common answer, but that would require that ∀x,y,z∈T
(xBy ∧ yBz) → xBz . That
is, we can have no cycles where xBy ∧ yBz ∧ zBx . These are the tournaments with a ranking
function.
+ 0.35 pts If a tournament is not round robin (like the single or even double elimination tournaments for most
college championships), then not every pair of teams have to play each other. So learning it is round
robin does add information.
+ 0.3 pts Partial order would require transitive to also be added, but we don't have that assurance.
+ 0.9 pts ∑ 1≤i≤ (n − i) = ∑ 0≤i<n i is correct, but the closed form of (n2) is preferred. (For one thing, the
+ 0.6 pts This is asking only for the number of games, not their possible outcomes or possibe relations with
n
specific properties (which are the next two questions.) Some credit that ( 2 ) = n(n − 1)/2 appears
in your answer.
+ 0.4 pts P (n, 2) = n(n − 1) counts tuples (a, b) and (b, a) as different, so is double-counting. n2 also
includes (a, a) . That is why we want to count not permutations or tuples but sets, with no repeats and
where order does not matter.
+ 0.4 pts n − 1 is the maximum for one team, but you were asked for "the maximum number of games in a
competition with n teams"
+ 0.3 pts Factorials or exponentials give answers that are far too large.
Feedback comments
+ 0.2 pts Your answer does not depend on the number of teams, n.
− 0.4 pts sum error: Using n as the summation variable overwrites the value for n given as input.
− 0.3 pts sum error: Your summation range is too large, giving an incorrect result.
− 0.2 pts sum error: You are double counting by summing over n − 1 rather than n − i or i. Once a game is
counted for the first team, it should not be counted for the second team.
+ 2 pts (n) = 2 n(n−1) different relations that are irreflexive. Each one is a possible
Correct: There are 4 2
competition outcome.
2 2
+ 1.8 pts 2n = 4n /2 would be correct to count the number of relations, but in a competition, no team plays
itself.
+ 1.7 pts Your answer is incorrect because it is based on your answer to (e). This would be correct if you did
the same transformation to a correct answer to (e).
+ 1.5 pts
3 (2) counts the irreflexive, anti-symmetric relations, which is what we would have if we added
n
"tieless".
2 n 3 (2) counts the anti-symmetric relations.
n
+ 0.6 pts 2P (n, 2) = 2n(n − 1) would be adding the choices instead of multiplying: that corresponds to
picking on e pair and making the choice of one of the 4 outcomes. We need to make simultaneous,
independent choices, so the product rule applies.
+ 0.5 pts The count 4 n is too low. We decide for each pair of teams, not for each team. 2 n is even lower.
Feedback comments
+ 0.2 pts Your answer does not depend on the number of teams, n.
+ 2 pts (n)
Correct: There are 2 2 = 2 n(n−1)/2 different relations that can come from tieless, round-robin
competitions (FYI: They are irreflexive, anti-symmetric, comparability relations.).
2 2
+ 1.5 pts 2n = 4n /2 would be correct to count the number of relations, so overcounts here.
+ 1.7 pts Your answer is incorrect because it is based on your answer to (e). This would be correct if you did
the same transformation to a correct answer to (e).
+ 1.5 pts
3 (2) counts the irreflexive, anti-symmetric relations, which is what we would have if we added
n
"tieless".
2 n 3 (2) counts the anti-symmetric relations.
n
+ 0.6 pts P (n, 2) = n(n − 1) would be adding the choices instead of multiplying: that corresponds to picking
on e pair and making the choice of one of the 2 outcomes. We need to make simultaneous,
independent choices, so the product rule applies.
+ 0.5 pts The count 2 n is too low. We decide for each pair of teams, not for each team.
+ 0.5 pts n! would answer the next question, when we add the restriction that top ranked teams beat teams
that have worse rankings. Here you can have upsets, so n! is too small.
Feedback comments
+ 0.2 pts Your answer does not depend on the number of teams, n.
+ 2 pts Correct: There are n! bijections that can be ranking function r : T → [1..n]. Each ranking gives a
different competition.
+ 1 pt
2 (2) = 2 n(n−1)/2 is the total number of tieless, round -robin competitions. The number that have
n
Feedback comments
+ 0.3 pts Your answer does not depend on the number of teams, n.
+ 0.2 pts Your notation is incomplete or mixing types and not producing a number.
10.1 S_1=2 1 / 1 pt
+ 0 pts You were asked to draw the ways to line up 1 head and one tail; there should be two ways in your
picture.
+ 0.3 pts You seem to assumed that the coins can be distinguished, which would be P (2n, n) not (2n).
n
Sn−1 counts the ways to line up n − 1 dull heads and n − 1 dull tails.
+ 1.5 pts Pretty complete answer, but doesn't explain why a specific value it mentions, like 2n − 1 , is used
instead of, say, 2(n − 1).
+ 0.7 pts Relevant facts about the product rule, but does not explain why the 2 and why the 2n − 1 .
+ 0.7 pts Did algebra to show that n(2n) = 2(2n − 1)(2(n−1)). The question is asking for a combinatorial
n n−1
proof by showing that both expressions count the same set of coin line-ups.
+ 0 pts You have an = sign between two expressions that are not equal.
+ 3 pts Correct: When x < 1.1 , the search will return a Wrong index: 1 when it should return 0, because the
initial invariant x ∈ [A[lo], A[hi]) will not hold.
For all other x everything works.
+ 1.5 pts Correct that the problem is Wrong index, but that can happen only when the value of x < 1.1
+ 1 pt Correct that the problematic values are x < 1.1 . All others will return correctly.
+ 0.5 pts Attempted, but the search will actually work correctly for your value of x .
+ 0.5 pts Didn't specify an input value for x , and the outcome you did specify cannot happen.
+ 3 pts Correct: Because lo < hi is an invariant, no matter what the value of x , this test will always be true.
This while loop is an Infinite loop.
+ 2 pts Correct that the problem is an infinite loop. You didn't specify a value, but in fact any value works.
+ 1 pt All the invariants are satisfied; this function just will never return.
+ 0.5 pts Didn't specify an input value for x , and the outcome you did specify cannot happen.
+ 3 pts Correct: When x = 3.3 or x = 5.5 , the search will return a Wrong index, 2 or 4, respectively. It
should return 3 or 6, as those are the indices satisfying A[i] ≤ x < A[i + 1] for those values.
For all other x everything works.
+ 1.5 pts Correct that the problem is Wrong index, but that can happen only when the value of x ∈ {3.3, 5.5}
because those are not only repeated, but the search first looks at an early occurrence rather than the
last occurrence.
+ 1 pt Correct that the problematic values are x ∈ {3.3, 5.5} . All others will return correctly.
+ 0.5 pts Attempted, but the search will actually work correctly for your value of x .
+ 0.5 pts Didn't specify an input value for x , and the outcome you did specify cannot happen.
+ 3 pts Correct: When x is any of the values in the array A, the search will reach x = A[mid] and will stop
updating lo or hi. This will be an Infinite loop.
+ 1.5 pts Correct that the problem is an infinite loop, but that can happen only when the value of x is in the
array A. The search will return the correct result for any x not in A.
+ 1 pt Correct that the problematic values for x are the numbers in A. For these it will never return.
+ 0.5 pts Attempted, but the search will actually work correctly for your value of x .
+ 0.5 pts Didn't specify an input value for x , and the outcome you did specify cannot happen.
Question 12
HC pledge 0 / 0 pts
+ 0 pts Acknowledged