• Support PF! Buy your school textbooks, materials and every day products Here!

Integral involving the floor function

  • #1
1,456
44

Homework Statement


##\displaystyle \int_0^1 \frac{1}{\lfloor 1- \log_2 (1-x)\rfloor}##

Homework Equations




The Attempt at a Solution


How in general do I approach integrals with floor functions? I'm thinking maybe I can figure out what the function in the integrand looks like on paper and calculate the area manually, but that seems very tedious...
 

Answers and Replies

  • #2
33,287
4,991

Homework Statement


##\displaystyle \int_0^1 \frac{1}{\lfloor 1- \log_2 (1-x)\rfloor}##

Homework Equations




The Attempt at a Solution


How in general do I approach integrals with floor functions? I'm thinking maybe I can figure out what the function in the integrand looks like on paper and calculate the area manually, but that seems very tedious...
What I would do is to look at the values of x = 1/2, 1/4, 1/8, and so on, to get values for you integrand function. Maybe that will give you some ideas. Also note that you have a problem when x = 1, since ##\log_2(0)## is ##-\infty##.
 
  • #3
Ray Vickson
Science Advisor
Homework Helper
Dearly Missed
10,706
1,728

Homework Statement


##\displaystyle \int_0^1 \frac{1}{\lfloor 1- \log_2 (1-x)\rfloor}##

Homework Equations




The Attempt at a Solution


How in general do I approach integrals with floor functions? I'm thinking maybe I can figure out what the function in the integrand looks like on paper and calculate the area manually, but that seems very tedious...
Some problems just have tedious solutions.

Start off by doing it the hard way, and maybe while writing down the solution you will arrive at some insights that will help you to shorten the solution.
 
  • #4
1,456
44
So what it seems is that the integrand forms a staircase starting at x=1, and goes down to x=0, where, in the very least, there is a new stair at each ##x=1/2^n## in between. So that's something, but I'm wondering now, how can I prove whether or not there are additional drops in between each ##(1/2^{n+1}, 1/2^n)##...
 
  • #5
33,287
4,991
So what it seems is that the integrand forms a staircase starting at x=1, and goes down to x=0, where, in the very least, there is a new stair at each ##x=1/2^n## in between. So that's something, but I'm wondering now, how can I prove whether or not there are additional drops in between each ##(1/2^{n+1}, 1/2^n)##...
Instead of powers of 1/2, as I first suggested, look at values of x of 1/2, 3/4, 7/8, 15/16, ... ##\frac{2^n - 1}{2^n}##. These will produce numbers whose base-2 logs are integers.

##\log_2(1 - 1/2) = \log_2(1/2) = -1##
##\log_2(1 - 3/4) = \log_2(1/4) = -2##
and so on...
 
  • #6
epenguin
Homework Helper
Gold Member
3,656
725
I don't know why are you call it a floor function.It looks to me a function which is continuous and smooth between the integration limits.

Maybe you just need to put the integrand in a more evident form, remembering elementary definitions? Start by thinking what is 1 log2 of?
 
  • #7
1,456
44
Instead of powers of 1/2, as I first suggested, look at values of x of 1/2, 3/4, 7/8, 15/16, ... ##\frac{2^n - 1}{2^n}##. These will produce numbers whose base-2 logs are integers.

##\log_2(1 - 1/2) = \log_2(1/2) = -1##
##\log_2(1 - 3/4) = \log_2(1/4) = -2##
and so on...
So if I let ##\displaystyle f(x) = \frac{1}{\lfloor 1- \log_2 (1-x) \rfloor}##, then ##\displaystyle f \left(\frac{2^n-1}{2^n} \right) = \frac{1}{n+1}##. So ##f(0) = 1,~ f(1/2) = 1/2, ~ f(3/4)=1/3 ##, and so on. So I have infinite steps down to 0 as ##n## approaches infinity. This makes me think that I will end up with an infinite sum, summing up a bunch of areas that are getting smaller and smaller. However, I guess the last thing I need to check is whether is is true or not that if ##x^* \in \left[\frac{2^n-1}{2^n},\frac{2^{n+1}-1}{2^{n+1}} \right)## then ##f(x^*) = \frac{1}{n+1}##... I don't really see how. Should I just assume it's true?
 
  • #8
33,287
4,991
So if I let ##\displaystyle f(x) = \frac{1}{\lfloor 1- \log_2 (1-x) \rfloor}##, then ##\displaystyle f \left(\frac{2^n-1}{2^n} \right) = \frac{1}{n+1}##. So ##f(0) = 1,~ f(1/2) = 1/2, ~ f(3/4)=1/3 ##, and so on. So I have infinite steps down to 0 as ##n## approaches infinity. This makes me think that I will end up with an infinite sum, summing up a bunch of areas that are getting smaller and smaller. However, I guess the last thing I need to check is whether is is true or not that if ##x^* \in \left[\frac{2^n-1}{2^n},\frac{2^{n+1}-1}{2^{n+1}} \right)## then ##f(x^*) = \frac{1}{n+1}##... I don't really see how. Should I just assume it's true?
Set up a Riemann sum to approximate your integral. In the integral you're not just adding 1 + 1/2 + 1/3 + ... -- you're adding the areas of the rectangles, all of which are decreasing in width.
 
  • #9
andrewkirk
Science Advisor
Homework Helper
Insights Author
Gold Member
3,792
1,390
I guess the last thing I need to check is whether is is true or not that if ##x^* \in \left[\frac{2^n-1}{2^n},\frac{2^{n+1}-1}{2^{n+1}} \right)## then ##f(x^*) = \frac{1}{n+1}##... I don't really see how. Should I just assume it's true?
It is true, and I think you would be expected to prove it.

The proof is not difficult. Just use the fact that log base 2 is a monotonic function to conclude that the inside of the floor function is monotonic, and then show that it is an integer whenever ##x=\frac{2^k-1}{2^k}## for some non-negative integer ##k##.

I don't expect there will be a closed expression for the infinite sum, but it will converge rapidly so can be calculated to good accuracy with only a few terms.
 
  • #10
Ray Vickson
Science Advisor
Homework Helper
Dearly Missed
10,706
1,728
It is true, and I think you would be expected to prove it.

The proof is not difficult. Just use the fact that log base 2 is a monotonic function to conclude that the inside of the floor function is monotonic, and then show that it is an integer whenever ##x=\frac{2^k-1}{2^k}## for some non-negative integer ##k##.

I don't expect there will be a closed expression for the infinite sum, but it will converge rapidly so can be calculated to good accuracy with only a few terms.
Actually, it has a quite familiar closed-form.
 
  • #11
epenguin
Homework Helper
Gold Member
3,656
725
Again I say there is nothing in problem statement 1 to tell me this is a floor function. The integrand plots as a fairly ordinary function with a finite integral between the given limits, see below.

However the integrals of reciprocal logs require a special function, Li, (I am not telling you one) not simply related as far as I know to any of the widely known functions, just defined by an integral

$$Li\left( x\right) =\int ^{x}_{0}\dfrac {dx}{\ln x}$$

Once one knows that, one can work out as already indicated the answer to the present problem in terms of this function, I think it is
$$2\ln 2Li\left( \dfrac {1}{2}\right) $$
Which is about 0.525



BF08CED9-2163-431A-BFB0-FE6EA61D239B.jpeg
The
 

Attachments

  • #12
andrewkirk
Science Advisor
Homework Helper
Insights Author
Gold Member
3,792
1,390
there is nothing in problem statement 1 to tell me this is a floor function.
The integrand is not a floor function, but there is a floor function applied in the denominator of the integrand, denoted by the infix operator ##\lfloor ... \rfloor##. That function returns the greatest integer that is less than or equal to the argument. The latex codes for the delimiters are \lfloor and \rfloor. The difficulty it raises is that it turns the integrand into a function that is discontinuous but piecewise constant. It is also càdlàg.
 
  • #13
Ray Vickson
Science Advisor
Homework Helper
Dearly Missed
10,706
1,728
So what it seems is that the integrand forms a staircase starting at x=1, and goes down to x=0, where, in the very least, there is a new stair at each ##x=1/2^n## in between. So that's something, but I'm wondering now, how can I prove whether or not there are additional drops in between each ##(1/2^{n+1}, 1/2^n)##...
There is nothing to prove. As long as ##k \leq 1-\log_2(1-x) < k+1## for integer ##k## the floor function gives a value of ##k## by definition.
 

Related Threads on Integral involving the floor function

  • Last Post
Replies
1
Views
5K
  • Last Post
Replies
3
Views
2K
  • Last Post
Replies
9
Views
7K
Replies
0
Views
1K
  • Last Post
Replies
7
Views
1K
  • Last Post
Replies
4
Views
1K
Replies
4
Views
2K
  • Last Post
Replies
2
Views
673
Replies
1
Views
2K
Replies
3
Views
11K
Top