Determine all possible real values of x that satisfy this equation:
x+2{x} = 3*[x]
*** [n] is the floor of n, which is the least integer greater than or equal to n, and: {x} = x- [x]
Let F be the Floor and f be the fractional part with 0 ≤ f < 1
(F+f) + 2f = 3F
3f = 2F
f = (2/3)F so F can only be 0 or 1
If F=0 then f=0.
If F=1 then f=2/3.
x can be {0 or 5/3}
5/3 + 2(2/3) = 3 checks
A computer check failed to pick up any solution other than zero until I checked for the difference being less than epsilon rather than requiring equality.
Output:
0.0
1e-05
2e-05
3e-05
1.66664
1.66665
1.66666
1.66667
1.66668
1.66669
-------------------
epsilon = .0001
import math
big = 500000
for i in range(-big,big):
x = i/100000
if abs(x+2*(x - math.floor(x)) - 3*math.floor(x)) < epsilon:
print(x)
|
Posted by Larry
on 2023-10-14 11:38:34 |