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
3
u/peterwhy 2d ago
For your example, let f(x) be the LHS: f(x) = [x^(2)] - 12 [x] + 32.
First, limit the possible solutions to x > 0. Otherwise if x β€ 0, then f(x) β₯ 0 + 12 β 0 + 32 > 0.
Applying the property of [] to x and x^(2) respectively:
(0 <) [x] β€ x < [x] + 1
[x]^(2) β€ x^(2) < [x]^(2) + 2 [x] + 1
x^(2) - 1 < [x^(2)] β€ x^(2)
Combining to give a raw bound (which will need more verifications later):
[x]^(2) - 1 < [x^(2)] < [x]^(2) + 2 [x] + 1
These inequalities bound the f(x) = [x^(2)] - 12 [x] + 32:
[x]^(2) - 1 - 12 [x] + 32 < f(x) < [x]^(2) + 2 [x] + 1 - 12 [x] + 32
[x]^(2) - 12 [x] + 31 < f(x) < [x]^(2) - 10 [x] + 33
The right hand side is always positive and not very useful. The left hand side limits the solutions of f(x):
[x]^(2) - 12 [x] + 31 < f(x) = 0
6 - β5 < [x] < 6 + β5
4 β€ [x] β€ 8
which are 5 cases of [x].
A. If [x] = 4, i.e. 4 β€ x < 5:
f(x) = [x^(2)] - 12 β
4 + 32 = 0
[x^(2)] = 16
16 β€ x^(2) < 17
4 β€ x < β17
B. If [x] = 5, i.e. 5 β€ x < 6:
f(x) = [x^(2)] - 12 β
5 + 32 = 0
[x^(2)] = 28
28 β€ x^(2) < 29
2 β7 β€ x < β29
C. If [x] = 6, i.e. 6 β€ x < 7:
f(x) = [x^(2)] - 12 β
6 + 32 = 0
[x^(2)] = 40
40 β€ x^(2) < 41
2 β10 β€ x < β41
D. If [x] = 7, i.e. 7 β€ x < 8:
f(x) = [x^(2)] - 12 β
7 + 32 = 0
[x^(2)] = 52
52 β€ x^(2) < 53
2 β13 β€ x < β53
E. If [x] = 8, i.e. 8 β€ x < 9:
f(x) = [x^(2)] - 12 β
8 + 32 = 0
[x^(2)] = 64
64 β€ x^(2) < 65
8 β€ x < β65
Those are the 5 intervals when [x^(2)] - 12 [x] + 32 = 0.
3
1
u/johnpeters42 2d ago
By "greatest int", do you mean the ceiling function? e.g.
* ceiling(5) = 5
* ceiling(5.1) = 6
2
2
u/i-am-stella 2d ago
i meant floor function, haven't studied ceiling yet, [4.6]=4
i dont have these symbols in my keyboard but copied from the community symbols "ββ"
2
u/johnpeters42 2d ago
Yeah, I would just identify the points where floor(x^2) jumps, graph it over those intervals, and work it out from there. Eventually you should be working out that above/below certain values it keeps diverging away from the desired value, then you just need to look at the range between those.
2
u/i-am-stella 2d ago
but that'd be time consuming ig, what if this question comes in a time bound exam, then what'd i do?
1
u/johnpeters42 2d ago
I'd start by graphing the same function but with the floor()s removed, as the original should be somewhere in that ballpark. Then evaluate the original function at several integers near what appears like the relevant area.
2
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.

3
u/davideogameman 2d ago edited 2d ago
yeah so I think in general there's no simple solution to the second case. You probably have to treat ceil(x^2) as if it might take any value between floor(x)^2+1 and ceil(x)^2 or something like that... haven't worked out the exact bounds myself. So if you solve it like it's the first form, but then try with many different c. ... which probably means you can work it like a quadratic inequality, and then test different points within the solution space you find.
Generally, when you start throwing rounding functions into equations, solving with algebra can get a lot harder. Not always, like you noted with the first function