2009-07-15

[離散] floor 課本1-74 (2)

請問以上這個式子是如何從等號左邊推倒到右邊呢?

麻煩大家指教了

1 則留言:

線代離散助教(wynne) 提到...

令g(x)=floor(x/3)+floor((x+1)/3)+floor((x+2)/3):

(a) If x=3k+0.xxx..., for some k in Z,
g(x)=floor(3k/3)+floor((3k+1)/3)+floor((3k+2)/3)
= k + k + k = 3k = floor(x)

(b)If x=(3k+1)+0.xxx..., for some k in Z,
g(x)=floor((3k+1)/3)+floor((3k+2)/3)+floor((3k+3)/3)
= k + k + (k+1) = 3k+1 = floor(x)

(c)If x=(3k+2)+0.xxx..., for some k in Z,
g(x)=floor((3k+2)/3)+floor((3k+3)/3)+floor((3k+4)/3)
= k + (k+1) + (k+1) = 3k+2 = floor(x)

p.s. 你好像打錯了, 後面應該是(2n-2)/3, 所以g(x)除外剩下的(n-1)/3+(2n-2)/3 = n-1, 書上第一行令f(x)的地方也有些點小錯誤