Solve formulas containing the floor function

In summary: However, in order to extract it one would need to understand the structure, which is not something that can easily be done. It does have the defect of assuming you know beforehand the a_i, which is tantamount of knowing beforehand the results of the truncations. If you don't know their values, it just adds a lot of new variables. It does say something new about the structure of the expression, which is the good part and might perhaps be useful in some context. However, in order to extract it one would need to understand the structure, which is not something that can easily be done.
  • #1
dodo
697
2
Is there a kosher way of manipulating formulas containing floor truncation, say,
[tex] \sum_{i=1}^n \left [ ~ { 333 \over 2^i } ~ \right ] ~=~ ? [/tex]​
(I mean analytically, not writing a computer program to find out the result.) Thanks.
 
Physics news on Phys.org
  • #2
Dodo said:
Is there a kosher way of manipulating formulas containing floor truncation, say,
[tex] \sum_{i=1}^n \left [ ~ { 333 \over 2^i } ~ \right ] ~=~ ? [/tex]​
(I mean analytically, not writing a computer program to find out the result.) Thanks.

I did not spend time on this problem, but I think not. Most problems in mathematics do not have analytic methods to them. Only special cases, or cases which can be brought to special cases. And hence computer computation is the method to use.
 
  • #3
Thanks for your reply, Kummer.

The problem being that a computer program is not a proof, or at least not for an arbitrary n in the example above. (Actually it was a bad example because the 333 constant limits the useful values of n; let's say it's not a prove for arbitraries n and constant. But you get the idea.)
 
Last edited:
  • #4
for n >= 9 that sum is 328, but i got that by summing the terms before the argument was less than 1. it seems like there should be a better way to do it. i'll think about it.
 
  • #5
Write

[tex]a=a_0+2\cdot a_1+2^2\cdot a_2+\cdots+2^k\cdot a_k[/tex]

Then

[tex]f(a, n) = \sum_{i=1}^n \frac{a}{2^i} = \sum_{i=1}^ka_i\cdot\frac12i(i+1)/2[/tex]

for n > i.
 
Last edited:
  • #6
CRGreathouse said:
Write

[tex]a=a_0+2\cdot a_1+2^2\cdot a_2+\cdots+2^k\cdot a_k[/tex]

Then

[tex]f(a, n) = \sum_{i=1}^n \frac{a}{2^i} = \sum_{i=1}^ka_i\cdot\frac12i(i+1)/2[/tex]

for n > i.

And that has what to do with the original question?
 
  • #7
HallsofIvy said:
And that has what to do with the original question?

It's a solution of the original question for n >= 8, with the constant generalized as the poster requested in the third post.
 
  • #8
There's a confusion here, CR: the square brackets in the first post are meant to mean "floor truncation", which effectively blocks many of the manipulations one is able to do.

So the solution for n>8 is in fact exactly the same as for n=8, for the a=333 case. For arbitrary a, it is not that clear.
 
Last edited:
  • #9
Dodo said:
There's a confusion here, CR: the square brackets in the first post are meant to mean "floor truncation", which effectively blocks many of the manipulations one is able to do.

So the solution for n>8 is in fact exactly the same as for n=8, for the a=333 case. For arbitrary a, it is not that clear.

Yes, I understand that. I'm truncating by cutting off binary digits -- sneaky, yes? In any case if you know the formula for n = 8 in the a = 33 case, but want the n = 7 case, you can calculate it just by taking the last term off the original sum.

The whole point of this formula is to get some kind of analytical formula (useful if the bits of the number have some special form). Perhaps other forms can be generalized from here -- but this is at least a starting point.
 
  • #10
As a side note, the reason why I posted this in the Number Theory thread is that, when there is a division involved inside the truncation, I smelled congruency somewhere. The given example becomes

[tex]\sum_{i=1}^n \left [ f(i) \over g(i) \right ] = \sum_{i=1}^n { f(i) \over g(i) } - \sum_{i=1}^n { \left ( f(i) ~mod~ g(i) \right ) \over g(i) }[/tex]

which I'm not sure it's more tractable than the original, since the modulo operation is nearly as blocking as the truncation.
 
  • #11
Oh, and thanks CR for that binary decomposition trick. Indeed very clever. Though I still can't figure out how you got the compact expression above. The presence of i(i+1)/2 would suggest that some sum of integers is done somewhere, but I still don't get it.

It does have the defect of assuming you know beforehand the a_i, which is tantamount of knowing beforehand the results of the truncations. If you don't know their values, it just adds a lot of new variables. It does say something new about the structure of the expression, which is the good part and might perhaps be useful in some context.
 
Last edited:

1. What is the floor function in mathematics?

The floor function, denoted as ⌊x⌋ or "floor of x", is a mathematical function that rounds a real number down to the nearest integer. This means that the result of the floor function will always be a whole number or an integer.

2. How do you solve a formula containing the floor function?

To solve a formula containing the floor function, you first need to identify the variables and constants in the formula. Then, you can substitute the values of the variables into the formula and use the floor function to round any resulting decimal numbers down to the nearest integer.

3. Can you give an example of solving a formula with the floor function?

Sure, let's say we have the formula ⌊x + 1⌋ = 5. To solve for x, we need to subtract 1 from both sides of the equation to get ⌊x⌋ = 4. This means that the value of x could be any real number between 4 and 5, including both 4 and 5.

4. What happens if the value inside the floor function is already an integer?

If the value inside the floor function is already an integer, then the floor function will simply return that integer as the result. For example, ⌊5⌋ = 5.

5. Are there any other functions similar to the floor function?

Yes, there are several other functions that are similar to the floor function, such as the ceiling function (⌈x⌉), which rounds a real number up to the nearest integer, and the rounding function (round(x)), which rounds a real number to the nearest integer. However, these functions may have different results for certain values, so it's important to understand which function is appropriate for a given problem.

Similar threads

  • Linear and Abstract Algebra
Replies
5
Views
2K
  • Linear and Abstract Algebra
2
Replies
41
Views
3K
Replies
5
Views
1K
Replies
3
Views
208
  • Linear and Abstract Algebra
Replies
15
Views
4K
  • Linear and Abstract Algebra
Replies
4
Views
972
  • Calculus and Beyond Homework Help
Replies
3
Views
983
  • Linear and Abstract Algebra
Replies
1
Views
1K
Replies
9
Views
1K
Replies
2
Views
778
Back
Top