- Many of you seemed to have questions, which you didn't
ask. Ask me. You can ask in class. I have office hours. You can
email me for hints. I'm here to help -- really!
- Some of you aren't showing your work; aren't
explaining. Answers just magically appear. I need some
rationale -- if you think it's obvious, all the better
-- it should be easy to explain.
-
In this homework you were to actually begin writing some
algorithms (sometimes just short "functions").
- 1, p. 34:
- Pros:
- 12 has more divisors (1,2,3,4,6,12) than
10.
- with base 12 you can express most common
fractions without repeating decimals.
- useful when we are expressing time, eggs, months
- Babylonians like it.
- Cons:
- We only have 10 fingers.
- It would cost a lot of money and time to
change from one base to another.
- Requires two new digits. Suggestions?
- 3: the authors showed that terminating decimal expansions
(base 10) do not always have terminating binary
expansions (p. 35 -- 5.2 does not have a terminating
base 2 representation).
But because 2 divides 10.... Consider
terminating binary decimal
for
any integer
.
And because the sum of terminating decimals is terminating....
Patrick had the best reason I saw.
Some of you commented on other bases. It's possible, for
example, that a terminating decimal in base 3 will not
have a terminating decimal expansion in base 10. Can
you give an example?
- 8:
- You need to first interpret the fraction (and some of you had trouble with that).
- Then you'll need the geometric series (that is, the Taylor series for
).
- p. 42, #1: You're to find a function for e, given x --
e(x); some of you included s, as thought it were known. We can
find s, too. We can write s(x).
Some of you assumed x was positive.
Part of the problem here is unfamiliarity with logs. But you
were also told to use floor or ceiling, so you should do
that.
- p. 42, #3: Explain. Some of you merely presented some that
have known machine representation. That's a good start, but why
aren't others representable?
What do you say? Fill in the details....
Lauren can give a number theoretic answer...
- p. 42, #5: folks took this several ways --
- the smallest integer that can't be
represented in IEEE single-precision;
- the smallest positive real number the format can store;
- or the smallest integer that can't
be represented exactly (without error).
The authors meant the last. The point is this: when
are we making errors, and when aren't we? We need to
know.
Joey? Michael W.?
- p. 48, #1bcd: some of you appear to think round-to-even
means essentially "truncate to even". No, you're still
rounding.
On c. how do we know whether that 0 in the ones place is significant?
- p. 48, #2: I got a variety of answers, many expressed as
just an interval (again, without explanation). This shows why
it is so important to explain.
- p. 48, #5: You are to explain how to use this function
nint to round decimal (non-integer) numbers to the nth decimal
place. You need to produce a function: round(x,n).
- p. 48, #6: Now actually create nint. So I should see some
computable function, nint(x).
Michael M.