On Thu, 14 Oct 2010 00:27:39 +0200
"Felix H. Dahlke" <[email protected]> wrote:
> On 13/10/10 22:28, David Sletten wrote:
> >
> > On Oct 12, 2010, at 5:44 PM, Brian Hurt wrote:
> >
> >> For example, in base 10, 1/3 * 3 = 0.99999...
> >
> > It may seem counterintuitive, but that statement is perfectly true.
> > 1 = 0.9999...
> >
> > That's a good test of how well you understand infinity.
>
> I'm clearly not a mathematician, but doesn't 0.99999... asymptotically
> approach 1, i.e. never reaching it? How is that the same as 1?
This representation implies the sum of the series (iterate #(/ % 10)
9/10), and that sum behaves as you say. However, since the series is
infinite, you can prove that the number it represents is actually
equal to one, like so:
1) a = 0.999... # define a as 0.999...
2) 10a = 9.999... # multiply both sides by 10
3) 10a - a = 9.999... - 0.999... # subtract equation 1 from equation 2
4) 9a = 9 # simplify
5) a = 1 # divide both sides by 9.
The subtraction step doesn't work unless the sequence is infinite, if
a is any finite sequence of 9s, you'll get a number whose decimal
representation is matches the re 8\.(9)*1. This relies on the property
that adding 1 to an infinite number gives you back the same infinite
number, so that:
(= (rest (map #(* % 10) (iterate #(/ % 10) 9/10)))
(iterate #(/ % 10) 9/10))
is true, but I don't recommend typing that into a repl to check it!
Hmm. I wonder if you could represent irrationals as lazy sequences,
and do arithmetic on those?
<mike
--
Mike Meyer <[email protected]> http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en