- #1
r0bHadz
- 194
- 17
Homework Statement
Alright guys this took me an hour because I am really, really... i don't want to say it. I'm about to pop a gasket if my argument is not logical.
I couldn't find any info on the latex primer on floor and ceil symbols so i apologize in advance
show that if n and k are positive integers, then ceil(n/k) = floor((n-1)/k) + 1
Homework Equations
The Attempt at a Solution
let n/k = x - ε where x is a positive int and 0≤ε<1
ceil(n/k) = ceil(x-ε) = x
from n/k = x - ε, n = k(x-ε) => n-1 = k(x-ε) - 1 => (n-1)/k = (x-ε) - (1/k)
floor((n-1)/k) + 1 = floor( (x)+( -ε - (1/k))) +1
I want to evaluate floor( (x)+( -ε - (1/k)))
since k can only be an int, k=1, it becomes clear that -ε will be zero, as there will be no ε in n/k = x - ε
so floor(x-1) + 1 = x-1 + 1 = x, which = ceil(x-ε). For k = 1, ceil(n/k) = floor((n-1)/k) + 1
floor(n/k) = floor (x-ε) = x-1
floor((n-1) / k) = floor (x-ε-(1/k)) = y
x-1 ≥ y for all values of positive ints n and k, so I don't think I even had to use the case where k=1..
but since its a floor function, y has to be x-1, because besides k=1 where it will be exactly x-1, -∈-(1/k) will always produce a number 0<-∈-(1/k)<1, and due to the floor property, it will always be x-1.
So
ceil(n/k) = floor((n-1)/k) + 1
I hope this makes sense my home dogs