Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Irrational number
#11
(May-08-2020, 10:17 AM)chpyel Wrote: if you check the digits of the number for a period.....?
You could I guess check for repetition in the digits, then if so declare it rational. Then if there is no repetition in a long float then I supposed you could declare it most likely irrational, but I could have a digit of 10000 decimal places and it's still rational because it ends. An irrational number is a number in which it's digits go on forever, so it's hard to measure that.I don't know much about proving irrational numbers but if there happens to be some algorithm or method out there to do so you could possibly implement it. Though I'd assume different irrational constants are proved irrational through various methods.
Reply
#12
There is no way to consistently determine if a number is irrational for a couple of reasons.

First, in mathematics, there is no single proof that can be used on all irrational numbers. Some numbers have been proven, such as π or √2, but the proofs take advantage of certain properties of those specific constants. They won't work with all numbers. For example, there is still no proof that π + e is irrational.

Secondly, any value that is stored on your computer will be rational. Even math.pi is a rational approximation of π. Since irrational numbers require infinite precision and computers only have a finite amount of space, no irrational number can be accurately contained. Also, you can't just check if the number is beyond a certain precision and assume irrationality, because many rational numbers also have infinite precision, such as 1/3.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020