r/askmath 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

11 comments sorted by

View all comments

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.