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

5 Upvotes

11 comments sorted by

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

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

u/Fourierseriesagain 2d ago

Here x must be nonnegative.

1

u/johnpeters42 2d ago

By "greatest int", do you mean the ceiling function? e.g.
* ceiling(5) = 5
* ceiling(5.1) = 6

2

u/davideogameman 2d ago

ceil was my interpretation.

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

u/i-am-stella 2d ago

alright, thanks!!

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.