LOGO
General Discussion Undecided where to post - do it here.

Reply to Thread New Thread
Old 11-23-2007, 07:42 AM   #1
leflyCode

Join Date
Oct 2005
Posts
357
Senior Member
Default Floor and Ceiling function
Is there a way to prove that:

Code:
Code
floor(x) + 1 = ceiling(x)

?

I think it is true, but I cant think how to prove the damn thing! Cheers.
leflyCode is offline


Old 11-23-2007, 07:55 AM   #2
stastony

Join Date
Oct 2005
Posts
477
Senior Member
Default
Is there a way to prove that:

Code:
Code
floor(x) + 1 = ceiling(x)


?

I think it is true, but I cant think how to prove the damn thing! Cheers.
If x is a real integer, then the equation no longer holds.
stastony is offline


Old 11-23-2007, 08:03 AM   #3
leflyCode

Join Date
Oct 2005
Posts
357
Senior Member
Default
If x is a real integer, then the equation no longer holds.
How so?

edit - Forgot to mention the restriction on x is x is a positive integer
leflyCode is offline


Old 11-23-2007, 08:17 AM   #4
stastony

Join Date
Oct 2005
Posts
477
Senior Member
Default
How so?

edit - Forgot to mention the restriction on x is x is a positive integer
Maybe I'm not understanding the problem. Here's how I look at it.

Say x = 2

Floor(x) = 2
Ceiling(x) = 2

Floor(x) + 1 = 3

3 != 2
stastony is offline


Old 11-23-2007, 08:22 AM   #5
leflyCode

Join Date
Oct 2005
Posts
357
Senior Member
Default
LMAO! Oh my, how could I miss that? Cheers [thumbup]
leflyCode is offline


Old 11-23-2007, 08:23 AM   #6
jesyflowers

Join Date
Oct 2005
Posts
409
Senior Member
Default
it could be true if floor and ceiling are variables, not necessarily the same.
jesyflowers is offline


Old 11-23-2007, 08:27 AM   #7
leflyCode

Join Date
Oct 2005
Posts
357
Senior Member
Default
Oh my, I read the question entirely wrong

Code:
Code
floor(log2(x)) +1 = ceiling(log2(x))  x is positive integer

That is log to base 2. I read the wrong question for the last one. I think this one is true...


edit - Ah, doesnt work for 1
leflyCode is offline


Old 11-23-2007, 08:37 AM   #8
stastony

Join Date
Oct 2005
Posts
477
Senior Member
Default
Oh my, I read the question entirely wrong

Code:
Code
floor(log2(x)) +1 = ceiling(log2(x))

Code:
Code
  x is positive integer

That is log to base 2. I read the wrong question for the last one. I think this one is true...
I think it's still false. My reasoning:

Let y = log2(x)

Therefore, x = 2^y

Since x = positive integer, y = positive integer too.

Therefore, floor(y) + 1 != ceiling(y)
stastony is offline


Old 11-23-2007, 08:44 AM   #9
leflyCode

Join Date
Oct 2005
Posts
357
Senior Member
Default
Cheers, thats a good proof to go with my counter example [thumbup] Many thanks.
leflyCode is offline



Reply to Thread New Thread

« Previous Thread | Next Thread »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

All times are GMT +1. The time now is 12:00 AM.
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 PL2
Design & Developed by Amodity.com
Copyright© Amodity