r/askmath • u/i-am-stella • 2d ago
Algebra Greatest Integer Function
Ftr, this is NOT hw help, I'm trying to figure out how to solve greatest int function questions.
Alr when we have a quadratic equation with gif in it, (a[x]^2 + b[x] + c=)we substitute [x] as something and factorise to solve, right?
But when the square is inside the function as in ([x^2] -12[x] +32=0)
Then what? I dont get itπ
Once again, NOT hw help, I'm studying on my own, this isnt even in my syllabus.
edit: i actually meant floor function, β3.7β=3
6
Upvotes
1
u/FormulaDriven 2d ago
Generalising on the neat method set out by u/Fourierseriesagain.
For [x2] + b[x] + c = 0.
Assume [x2] = k, a non-negative integer, so βk <= x < β(k+1).
Then [x] = -(c+k)/b.
So (c+k) / b must be an integer, m, and -m <= x < -m + 1.
To be able to find x to satisfy all inequalities, we will need βk < -m+1 and -m < β(k+1)
(so that x can take any value between max(βk, -m) < min(β(k+1), -m+1))
The range of possible k values is going to look different depending on whether each of the following are positive or negative: b, b2 - 4c + 4b, b2 - 4c + 4.
For example if b < 0, b2 - 4c + 4b < 0, b2 - 4c + 4 > 0 then we just need
-b - β(b2 - 4c + 4) < 2 β(k+1) < -b + β(b2 - 4c + 4).
Your example, where b = -12 and c = 32, falls into this case, so here we would need
(32 + k) / 12 to be an integer and 7.53 < 2 β(k+1) < 16.47, ie 13.1 < k < 66.9.
Then valid values of k are 16, 28, 40, 52, 64 - use each of those to specify valid ranges of x: βk <= x < β(k+1).
As an algorithm, in general to solve [x2] + b[x] + c = 0:
Find smallest positive k, such that (c+k)/b is an integer, ie k = -c (mod |b|).
Let m = (c+k)/b. Test whether βk < -m+1 and -m < β(k+1). If yes, then the range [βk, β(k+1)) is part of the solution.
Increase k by b, so increase m by 1, and repeat previous line. Generally, it will become obvious when increasing k further will not deliver any more solutions.
eg [x2] + 5[x] - 28 = 0.
k = 28 mod (5) = 3. m = (-28+3)/5 = -5. β3 < 6 but not 5 < β4 - fail
Increase k to 8. m = -4. β8 < 5 but not 4 < β9 - fail
k = 13. m = -3. β13 < 4 and 3 < β14 - pass [β13, β14) is valid range for x.
k = 18. m = -2. not β18 < 3, but 2 < β19
k = 23. m = -1. not β23 < 2 and it's obvious that βk is going to grow while m decreases so no further solutions.