Selected Answers to Problem Set #
3. See an example of my day of the week script
here. It might be a bit complicated to follow, but notice the
compensations for dates before March 1st and how the @MonthOffset
array works. These might be of some use for you, especially with the
problem for next week - day of the week for the web.
4. Conversion between bases (a number with no base is base 10 by default).
For reference (not for this class per se) a number prefixed with 0b
indicates binary, 0 indicates octal, and 0x or $ indicates hexadecimal.
a) 76 = 64 + 8 + 4 = 26 + 23 + 22
= 1001100 base 2 (= 0b1001100 in computer terms)
b) 4321 base 8 (=04321 in computer terms)= 4*83 +
3*82 + 2*81 + 1*80 = 2048 + 192 + 16 +
1= 2257
5. If the players win at these percentages, then they do no win at one
minus these percentages. Simply take 0.7 * 0.8 * 0.75 to yield
0.42, or 42% of the time no one will win (or get a hit).
6.
GC - Guilty of Crime
IC - Innocent of Crime
GT - Guilty on Test
IT - Innocent on Test
P(GT|IC)P(IC)
P(IC|GT) = ---------------
P(GT)
P(GT|IC)P(IC)
= -------------------------------
P(GT|IC)G(IC) + P(GT|GC)P(GC)
(0.02)(88)
= -------------------------
(0.02)(88) + (0.90)(12)
= 1.76 / (1.76 + 10.80)
= 0.14 = 14%