. | |
⌊2⌋ + ⌊2.25⌋ + ⌊2.75⌋ = |
|
2 + 2 + 2 = 6
Aside: note the Unicode code points (character values) for the special symbols, which in HTML must be decimal values. To display them you also need to select a Unicode font, such as Arial Unicode. left ceiling h2308 ⌈ right ceiling h2309 &8969; left floor h2308 ⌊ right floor h230b ⌋ |
. | |
⌈2⌉ + ⌈2.25⌉ + ⌈2.75⌉ = |
|
2 + 3 + 3 = 8 |
. | |
Study this method:static int mystery (int input) { if (input > 2) { return 0; } return 1 + mystery(2 * input); } What is the value of mystery(0) ? (i.e., what value would be returned by a call to mystery(0)?) |
|
Each recursive call is the same: mystery(2*0) or mystery(0), so you get infinite recursion. |
. (2 pts., -1 for each error up to -2) | |
S = {w, x, y, z}, R = {(w,w), (x,x), (y,y), (z,z)}.
Is R an equivalence relation? Circle A, or as many of B through F as apply. |
|
A
An equivalence relation, by definition, is a relation which is reflexive, symmetric, and transitive. R has all three of these properties. Anti-symmetry, partial order, being a function -- these properties need not be considered in answering the question. Of course, for practice, you might want to determine which of those properties R does have. |
. (1 pt. each) | |
log327 = _____ log21024 = _____ | |
3; 10 |
. | |
With respect to Homework #2, name a class (if any) which extends JPanel: _______________ | |
DocumentViewer, SpellerViewer |
. (bonus question -- 1 free pt.) | |
What is Martin's First Rule for proving any
theorem?
|
|
"Convince yourself that what you're trying to prove is true." |