A general comment on multiplying by the conjugate to rationalize a denominator with surds / square roots.
For a binomial, the conjugate of √a + √b is √a - √b
For a trinomial, at least one conjugate of √a+√b+√c is
(√a-√b+√c)*(√a+√b-√c)*(√a-√b-√c)
I conjecture that for a sum of n square roots, a conjugate can be found by multiplying the original sum by a number of modified sums in which one or more signs have been changed as in the above examples. But I don't how one would know which combination of signs must be changed or how many terms would be needed in order to find the smallest working conjugate.
For this case, I took (√2 + √3 + √6 + √8 + √16), and wrote a program to multiply this sum by all other possible sums created from the same 5 square roots but with every combination of signs, changed to a minus. In all cases, I kept the coefficient of √2 as positive, so there were 16 terms (one for the original and 15 for the conjugate) in all. I believe this did multiply to an integer.
For Output, I got: -613548574.9999989 which I assume/hope would be -613548575 if not for math precision error.
Next, I looked at all combinations of changing from 1 to all 4 signs and printed out the ones that gave a denominator close to an integer.
3 (5, 9, 12) -22.99999999999997
4 (3, 4, 13, 15) -4355.999934620247
5 (1, 8, 12, 13, 15) 75597.99994918141
6 (2, 8, 9, 10, 13, 14) 15016.999928381965
7 (1, 4, 5, 8, 9, 12, 13) 27024.999999999967
7 (1, 5, 7, 10, 13, 14, 15) -31882.00007515131
7 (2, 5, 7, 9, 11, 12, 14) 7152.999999999986
7 (3, 5, 6, 9, 10, 12, 15) -1678.9999999999984
8 (3, 4, 6, 8, 10, 12, 13, 14) -162677.00007294805
10 (1, 3, 5, 6, 8, 9, 11, 12, 14, 15) -151015.99991751887
10 (1, 4, 5, 6, 8, 9, 10, 13, 14, 15) 628873.0000605269
11 (1, 2, 4, 5, 7, 8, 9, 11, 12, 13, 14) -8404774.999999985
11 (1, 3, 4, 5, 6, 8, 9, 10, 12, 13, 15) 1972824.999999998
11 (2, 3, 5, 6, 7, 9, 10, 11, 12, 14, 15) 522168.99999999895
15 (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15) -613548574.9999989
The integers in parentheses above represent the sign change pattern: convert the integer to binary, wherever there is a 0 in the binary, the sign remains +; where there is a 1 in the binary, the sign changes to -.
The smallest only uses 3 terms.
If the 5 square roots are called a,b,c,d,e then the three terms need to have sign changes at (b,e), (b,c), (c,e); 1001, 1100, 0101.
The conjugate is:
(√2+√3-√6+√8-√16)*(√2-√3+√6+√8-√16)*(√2-√3-√6+√8+√16)
Numerator:
(√2+√3+√6)(√2+√3-√6+√8-√16)(√2-√3+√6+√8-√16)(√2-√3-√6+√8+√16)
= -10.35902021491 approx
Denominator:
(√2+√3+√6+√8+√16)(√2+√3-√6+√8-√16)(√2-√3+√6+√8-√16)(√2-√3-√6+√8+√16)
= -23
Numerator / Denominator: 0.4503921832569821
-----------
d = [2**.5, 3**.5, 6**.5, 8**.5, 4]
dsum = sum(d)
def modsum(d,signs):
""" d has 5 entries, signs has 4 all ± 1 """
ans = d[0]
for i in range(4):
ans += d[i+1] * signs[i]
return ans
mults = []
for n in range(16):
mymults = []
binary = bin(n)[2:].zfill(4)
for b in binary:
if b == '0':
mymults.append(1)
elif b == '1':
mymults.append(-1)
mults.append(mymults)
epsilon = .0001
digits = [n for n in range(1,16)]
from itertools import combinations
for number_of_terms in range(2,16):
for samples in combinations(digits,number_of_terms):
product = dsum
for n in samples:
product *= modsum(d, mults[n])
if abs(product - round(product)) < epsilon:
print(number_of_terms, samples, product)
|
Posted by Larry
on 2024-07-10 12:03:00 |