Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

irrational numbers

1 view
Skip to first unread message

mataeux

unread,
Dec 13, 2002, 11:06:23 AM12/13/02
to
does anyone know how to tell if a number is irrational?
using lisp of course.

much obliged


Randy Richardson

unread,
Dec 13, 2002, 11:48:19 AM12/13/02
to
In computers, there is no such thing as an irrational number. Pi, for
example is an extremely close approximation to the actual number pi. Close
enough for all of the calculations that roughly 99.99999% of us are liable
to do in our lifetimes.

"mataeux" <mat...@yahoo.com> wrote in message
news:f12ce...@WebX.maYIadrTaRb...

Doug Broad

unread,
Dec 13, 2002, 12:09:31 PM12/13/02
to
If you know how to prove a number is irrational and you can express the number
symbolically rather than numerically, then lisp can be used to do the symbolic
manipulation. If you have no idea of how to prove a number is irrational, then
you can't use lisp to do it. As Randy stated, numbers are stored with only
16 decimal point precision. Brute force approaches extend to millions of decimal
places before making weak conclusions that numbers are irrational.

I suggest MathCAD or Maple or another mathematics package for such tasks.

One link that explains the intracacies of a proof is explained at:
http://mathforum.org/library/drmath/view/52619.html

If you only want to test a number against a small set of known irrational numbers
then you could do an equality test but the proof would be weak due to inability to
conveniently express a number to more than 16 decimal places.


Herman Mayfarth =>=>tktn.com>

unread,
Dec 13, 2002, 4:09:36 PM12/13/02
to
> 16 decimal point precision
>
Not exactly.

I believe AutoCAD provides 16 significant figures, not 16 decimal places.

(I am also sure you know the difference, Doug, and this was just a slip of the
keyboard.:)

Doug Broad

unread,
Dec 13, 2002, 7:35:16 PM12/13/02
to
Oops,
Thanks for the correction Herman. I guess my main point is that its impossible
to know whether a truncated real number is irrational.
It has to be handled symbolically.

It was an interesting question however. I thought surely that more folks would
comment. We're all busy I guess.

Regards,
Doug

Doug Broad

unread,
Dec 13, 2002, 8:27:55 PM12/13/02
to
:-) And therefore it it is rational, it can not be irrational.


Paul Turvill

unread,
Dec 13, 2002, 8:19:14 PM12/13/02
to
If both the numerator and denominator are integers (or can be made into
integers by multiplying both by the same number, e.g., 25.4/300 = 254/3000),
the number is rational. That's the definition of a rational number.
___

"mataeux" <mat...@yahoo.com> wrote in message

news:536CA69AB2933610...@in.WebX.maYIadrTaRb...
> but i do know the fraction as a numerator and denominator, is it then
> possible?


mataeux

unread,
Dec 13, 2002, 8:12:04 PM12/13/02
to
but i do know the fraction as a numerator and denominator, is it then
possible?


dont hurt yourselves over this one, its not now as important as i thought


"Doug Broad" <dbr...@earthlink.net> wrote in message
news:857AC2DD67EA3CD0...@in.WebX.maYIadrTaRb...

mataeux

unread,
Dec 16, 2002, 9:45:10 AM12/16/02
to
thanks, that is what ive been looking for

"Paul Turvill" <nos...@turvill.com> wrote in message
news:1658EDA702B525CA...@in.WebX.maYIadrTaRb...

Randy Richardson

unread,
Dec 16, 2002, 10:41:45 AM12/16/02
to
Oops. I meant to say that 0.43444444 was the denominator.

"Randy Richardson" <randy.ri...@yorkREJECTSPAM.com> wrote in message
news:678DBFEF990ABF1D...@in.WebX.maYIadrTaRb...
> Likewise, it is also true that 17.4233333 (with endlessly repeating 3's)
as
> the numerator and 0.423444444 (with endlessly repeating 4's) is also a
> rational, not an irrational number, although that might be a little less
> obvious to some of us.
>
> "Randy Richardson" <randy.ri...@yorkREJECTSPAM.com> wrote in message
> news:388B0C87245E0083...@in.WebX.maYIadrTaRb...
> > I'm glad that Paul's definition helped you. It is correct. So, if you
> know
> > that the numerator is 0.0234244 and the denominator is 736.797377979, it
> is
> > obvious that it is a rational, not an irrational number.


> >
> > "mataeux" <mat...@yahoo.com> wrote in message

> > news:8CCC1B4023560F84...@in.WebX.maYIadrTaRb...

Randy Richardson

unread,
Dec 16, 2002, 10:40:06 AM12/16/02
to
Likewise, it is also true that 17.4233333 (with endlessly repeating 3's) as
the numerator and 0.423444444 (with endlessly repeating 4's) is also a
rational, not an irrational number, although that might be a little less
obvious to some of us.

"Randy Richardson" <randy.ri...@yorkREJECTSPAM.com> wrote in message
news:388B0C87245E0083...@in.WebX.maYIadrTaRb...
> I'm glad that Paul's definition helped you. It is correct. So, if you
know
> that the numerator is 0.0234244 and the denominator is 736.797377979, it
is
> obvious that it is a rational, not an irrational number.
>

> "mataeux" <mat...@yahoo.com> wrote in message

> news:8CCC1B4023560F84...@in.WebX.maYIadrTaRb...

Randy Richardson

unread,
Dec 16, 2002, 10:34:43 AM12/16/02
to
I'm glad that Paul's definition helped you. It is correct. So, if you know
that the numerator is 0.0234244 and the denominator is 736.797377979, it is
obvious that it is a rational, not an irrational number.

"mataeux" <mat...@yahoo.com> wrote in message
news:8CCC1B4023560F84...@in.WebX.maYIadrTaRb...

Doug Broad

unread,
Dec 16, 2002, 12:25:49 PM12/16/02
to
In general, all numbers stored as real numbers or integers in
AutoLISP are rational.
The square root of 2 (thought of symbolically) is irrational, but
(sqrt 2) returns a rational number due to decimal truncation.
An irrational number, therefore can only be represented and
tested on a symbolic level, based on logic and not a floating
point representation.

The real question is, "What kind of drafting application would
need to know whether a number is rational or not?" The original
poster may simply need to express a slope or a scale factor
as a ratio. That function is a lot simpler to implement that to
determine whether a number is irrational in a pure mathematical
sense. An acceptable level of tolerance also helps.

Regards,
Doug


Peter Tobey

unread,
Dec 16, 2002, 3:15:47 PM12/16/02
to
A friend of mine who is into sundials showed me this:

http://plus.maths.org/issue11/features/cfractions/

It deals with the concept of "continued fractions" which is a mechanism
for "constructing rational approximations to irrational numbers".

Just another little something for the intellectually curious...

-peter

mataeux

unread,
Dec 16, 2002, 6:06:18 PM12/16/02
to
i was trying to generate any possible hatch pattern line that
would cause the endpoints of each dash segment of the line
land on a unit grid. in so doing i incorrectly assumed that i
could speed things up by eliminating lines with slopes that
were irrational, but on a unit grid the slopes are all rational.

i'm getting closer to making a hatch pattern that plots similar
to ar-sand, but is composed of lines instead of dots and a dot
linetype is assigned to the hatch pattern so that random dots
plot at a regular density regardless of the view scale.

the endpoints of the line segments must land on a unit grid to
eliminate void regions and obtain a guaranteed minimum
number of dots in a certain space. the hatch pattern that i
tested previously `performs' well between the scales 12 - 240.
that is, the plotted density appears the same at 1"=1' as it
does at 1" = 20'.

"Doug Broad" <dbr...@nash.cc.nc.us> wrote in message
news:8DC15E9A9488F017...@in.WebX.maYIadrTaRb...

0 new messages