News for hackers. Stuff that matters.
Re:Rational or Not? This Basic Math Question Took Decades to... by cbm-vic-20 on Thursday January 09, 2025 @01:30PM (#42648481)
Is the result of the addition or multiplication of an irrational number with any other real number not equal to it (and non-zero in the case of multiplication) always irrational? ex: pi + e, pi * e, but also sqrt(2) - 1 or sqrt(3) * 2.54 ?
Re:Rational or Not? This Basic Math Question Took Decades to... by AlotOfReading on Thursday January 09, 2025 @01:39PM (#42648565)
No, sqrt(5)*sqrt(16*5)=20. More trivially, there's always a number y such that z = x*y for a given irrational x. You can give similar examples for all the other basic operations.
Re:Rational or Not? This Basic Math Question Took Decades to... by LPisGood on Thursday January 09, 2025 @02:03PM (#42648806)
Take any irrational a where 1/a is also irrational. Then a * 1/a = 1.

Even moving from addition and multiplication to exponentials won’t save you: there are irrational numbers to irrational powers that are raational.

Re:Rational or Not? This Basic Math Question Took Decades to... by umanwizard on Thursday January 09, 2025 @02:56PM (#42649279)
> Take any irrational a where 1/a is also irrational.

In other words: any irrational at all

Re:Rational or Not? This Basic Math Question Took Decades to... by pfdietz on Thursday January 09, 2025 @02:40PM (#42649129)
The nonconstructive proof of that is simple and fun: either sqrt(2)^sqrt(2) or (sqrt(2)^sqrt(2))^sqrt(2) is just such an example.
Re:Rational or Not? This Basic Math Question Took Decades to... by aidenn0 on Thursday January 09, 2025 @01:33PM (#42648507)
Definitely not; consider the formula for calculating the log of any base given only the natural logarithm. That can result e.g. in two irrational numbers, the ratio of which are integers.
Re:Rational or Not? This Basic Math Question Took Decades to... by umanwizard on Thursday January 09, 2025 @02:24PM (#42648991)
pi and -pi are both irrational and their sum is zero.
Re:Rational or Not? This Basic Math Question Took Decades to... by ryandv on Thursday January 09, 2025 @04:53PM (#42650175)
There is an important distinction to be made here. Examples in this thread show cases of irrational numbers multiplied by or added to other irrational numbers producing real numbers, but in the special case of a rational number added to or multiplied by an irrational number, the result is always irrational.

Otherwise, supposing for instance that (n/m)x is rational for integers n, m, both non-zero, and irrational x, we can express (n/m)x as a ratio of two integers p, q, q non-zero: (n/m)x = p/q if and only if x = (mp)/(qn). Since integers are closed under multiplication, x is rational, against supposition; thus by contradiction (n/m)x is irrational for any rational r = (n/m), with integers n, m both non-zero. Similarly for the case of addition.

Re:Rational or Not? This Basic Math Question Took Decades to... by yen223 on Thursday January 09, 2025 @05:46PM (#42650640)
irrational number + rational number = irrational number [1]

irrational number + irrational number could be rational or irrational.

5 - sqrt(2) is irrational

sqrt(2) is irrational

Add them up you get 5, which is rational

[1] If it were rational, you will be able to construct a rational representation of the irrational number using this equation.

Re:Rational or Not? This Basic Math Question Took Decades to... by dhosek on Friday January 10, 2025 @11:53AM (#42657366)
To put the first equation more formally, we know that ℚ is closed under addition¹, so given k∊ℝ\ℚ, l∊ℚ then if k+l=m∊ℚ, then m-l=m+(-l)∊ℚ, but m-l=k which is not in ℚ so k+l∉ℚ.

⸻

1. For p,q∊ℚ, let p=a/b, q=c/d, a,b,c,d∊ℤ, then p+q=(ad+bc)/bd, but the products and sums of integers are integers, so p+q∊ℚ

Re:Rational or Not? This Basic Math Question Took Decades to... by vrighter on Friday January 10, 2025 @09:05AM (#42655654)
x - (x - floor(x)) == x truncated to an integer

when x is an irrational number > 1:

"x - floor(x)" is just the fractional part of x, so it's an irrational number which is not equal to x.

Subtracting the fractional part from the original leaves only the integer part, which is obviously rational.