최대정수함수

최대정수함수(Floor Function)란, 실수를 집어넣으면 그 실수보다 크지 않은 최대 정수를 내뱉는 함수를 말한다. 이렇게 쓰니 뭔가 어려워 보이지만, 실상은 학교 수학 시간에 자주 보았을 가우스 함수를 말한다. 하지만 이 함수를 가우스 함수라 부르는 곳은 대한민국뿐이며, 세계적으로는 최대정수함수(Greatest Integer Function)나 바닥함수(Floor Function)이라고 부른다. 최대정수함수는 주로 수학계에서, 바닥함수는 주로 컴퓨터 프로그래밍에서 쓴다.

기호로는 [math]\displaystyle{ \left[\cdot\right] }[/math][math]\displaystyle{ \lfloor\cdot\rfloor }[/math]를 쓰는데, 정수론과 한국의 학교 수학에서는 전자를, 나머지는 후자를 쓴다. 정수론에선 아무래도 자주 쓰는 함수다 보니 익숙한 기호를 쓰고, 나머지 학문에서는 다른 함수와의 혼동을 막기 위해 전용 기호를 쓰는 것. 한국 학교 수학에서도 대괄호를 쓰는데, 사실 최대정수함수는 교육 과정 밖의 내용이다. 문제 끝에 항상 "단 [math]\displaystyle{ \left[x\right] }[/math][math]\displaystyle{ x }[/math]보다 크지 않은 최대 정수를 나타낸다" 같은 말이 있는 이유는 교육 과정 밖의 내용이기 때문. 이는 달리 말하면 대괄호가 아닌 다른 기호를 집어넣고 함정을 팔 수 있음을 의미하기도 한다.

이 문서에서는 최대정수함수를 편의상 대괄호로 표기한다.

예시[편집 | 원본 편집]

  • [1] = 1
  • [7.2] = 7
  • [-8.41] = -9

값을 계산하는 것 자체는 의외로 간단하다. 함수 안에 정수가 들어있으면 그냥 그 정수를 뱉으면 되고, 양수이면 소수점을 때버리면 된다. 음수일 경우에는 부호 때문에 쉽게 틀릴 수 있으므로 주의. 헷갈리면 수직선 위에 숫자를 찍고, 그 숫자 왼쪽에 있는 가장 큰 정수를 쓰자.

기본 성질[편집 | 원본 편집]

임의의 실수 [math]\displaystyle{ x,y }[/math]정수 [math]\displaystyle{ m,n }[/math]에 대해서 다음이 성립한다.

  1. [math]\displaystyle{ \left[x\right]\leq x\lt \left[x\right]+1 }[/math]
  2. [math]\displaystyle{ \left[x+m\right]=\left[x\right]+m }[/math]
  3. [math]\displaystyle{ \left[\left[x\right]\right]=\left[x\right] }[/math]
  4. [math]\displaystyle{ \left[x\right]+\left[y\right]\leq\left[x+y\right]\leq\left[x\right]+\left[y\right]+1 }[/math]
  5. [math]\displaystyle{ \left[x\right]+\left[-x\right]=\begin{cases}0,\quad&x\in\mathbb{Z}\\-1,\quad&x\not\in\mathbb{Z}\end{cases} }[/math]
  6. [math]\displaystyle{ \left[\frac{n}{m}\right] }[/math]은 1부터 [math]\displaystyle{ n }[/math]까지의 수 중 [math]\displaystyle{ m }[/math]의 배수의 개수
  7. [math]\displaystyle{ x\gt 0 }[/math]일 때, [math]\displaystyle{ x-\left[x\right] }[/math][math]\displaystyle{ x }[/math]소수 부분
  8. 자연수 [math]\displaystyle{ n }[/math]의 일의 자릿수는 [math]\displaystyle{ n-10\left[\frac{n}{10}\right] }[/math]
  9. [math]\displaystyle{ x,y\geq0 }[/math]이면, [math]\displaystyle{ \left[xy\right]\geq\left[x\right]\left[y\right] }[/math]
  10. [math]\displaystyle{ x\geq0 }[/math]이면, [math]\displaystyle{ \left[\sqrt{\left[\sqrt{x}\right]}\right]=\left[\sqrt{\sqrt{x}}\right] }[/math]

증명[편집 | 원본 편집]

  1. 사실 이게 진짜 정의다.
  2. 우선 정의에 의해, [math]\displaystyle{ \left[x\right]\leq x\lt \left[x\right]+1 }[/math]이 성립한다. 그러면, [math]\displaystyle{ \left[x\right]+m\leq x+m\lt \left[x\right]+m+1 }[/math]이다. 이제, [math]\displaystyle{ \left[x\right]+m=n }[/math]이라 정의하자. 그러면 [math]\displaystyle{ n\leq x+m\lt n+1 }[/math]이 성립한다. 그런데 다시 정의에 의해, [math]\displaystyle{ n=\left[x+m\right] }[/math]이다. 따라서 [math]\displaystyle{ \left[x\right]+m=\left[x+m\right] }[/math].
  3. [math]\displaystyle{ x }[/math]정수이면, 정의에 의해 [math]\displaystyle{ \left[x\right]=x }[/math]가 성립한다. 그런데 [math]\displaystyle{ \left[x\right] }[/math]는 항상 정수이므로, [math]\displaystyle{ \left[\left[x\right]\right]=\left[x\right] }[/math]가 성립한다.
  4. [math]\displaystyle{ \left[x\right]=m,\left[y\right]=n }[/math]이라하고, [math]\displaystyle{ x-m=a,y-n=b }[/math]라 하자. 그러면 [math]\displaystyle{ \left[x+y\right]=\left[m+n+a+b\right]=m+n+\left[a+b\right] }[/math]이다. 한편, [math]\displaystyle{ 0\leq a,b\lt 1 }[/math]이므로, [math]\displaystyle{ 0\leq a+b\lt 2 }[/math]이고, 따라서 [math]\displaystyle{ 0\leq\left[a+b\right]\leq1 }[/math]이다. 따라서, [math]\displaystyle{ m+n\leq m+n+\left[a+b\right]\leq m+n+1 }[/math].
  5. 우선 [math]\displaystyle{ x }[/math]가 정수이면, 정의에 의해 [math]\displaystyle{ \left[x\right]=x }[/math]이다. 그러면 [math]\displaystyle{ \left[x\right]+\left[-x\right]=x-x=0 }[/math]. 이제 [math]\displaystyle{ x }[/math]가 정수가 아니라고 가정하자. [math]\displaystyle{ \left[x\right]=m,x-m=a }[/math]라 가정하면, [math]\displaystyle{ x=m+a }[/math]이고 [math]\displaystyle{ 0\lt a\lt 1 }[/math]이다. 그러면 [math]\displaystyle{ -x=-m-a=-m-1+1-a }[/math]이고, [math]\displaystyle{ 0\lt 1-a\lt 1 }[/math]이다. 따라서, 정의에 의해 [math]\displaystyle{ \left[-x\right]=-m-1 }[/math]. [math]\displaystyle{ \therefore\left[x\right]+\left[-x\right]=m-m-1=-1 }[/math]
  6. [math]\displaystyle{ \left[\frac{n}{m}\right] }[/math][math]\displaystyle{ n }[/math][math]\displaystyle{ m }[/math]으로 나눈 몫임을 보이면 끝이다. 먼저, 정의에 의해 [math]\displaystyle{ \left[\frac{n}{m}\right]\leq\frac{n}{m}\lt \left[\frac{n}{m}\right]+1 }[/math]이고, 정리하면 [math]\displaystyle{ m\left[\frac{n}{m}\right]\leq n\lt m\left[\frac{n}{m}\right]+m }[/math]이다. [math]\displaystyle{ q=\left[\frac{m}{n}\right] }[/math]이라 두면 [math]\displaystyle{ mq\leq n\lt mq+m }[/math]이고, 정리하면 [math]\displaystyle{ 0\leq n-mq\lt m }[/math]이다. [math]\displaystyle{ r=n-mq }[/math]라 두면, [math]\displaystyle{ 0\leq r\lt m }[/math]을 만족하고, 나눗셈 정리의 유일성 파트에 의해 [math]\displaystyle{ q }[/math]가 몫이라는 사실이 보여진다.
  7. 당연한 결과. 정수론에서는 [math]\displaystyle{ x-\left[x\right] }[/math]를 기호로 간단하게 [math]\displaystyle{ \left\{x\right\} }[/math]로 표기한다. 이 기호의 경우에는 [math]\displaystyle{ x }[/math]가 음수여도 상관없음에 주의하자.
  8. [math]\displaystyle{ \left[\frac{n}{10}\right] }[/math][math]\displaystyle{ n }[/math]을 10으로 나눈 몫, 즉 일의 자리를 제외한 나머지 숫자이다. 이 수에 10을 곱하고 원래 수에서 빼면 당연히 일의 자릿수가 남는다.
  9. [math]\displaystyle{ \left[x\right]=m,\left[y\right]=n,\left\{x\right\}=a,\left\{y\right\}=b }[/math]라고 하자. 그러면 [math]\displaystyle{ \left[xy\right]=\left[mn+mb+na+ab\right]=mn+\left[mb+na+ab\right] }[/math]이다. 그런데, [math]\displaystyle{ 0\leq m,n }[/math]이고 [math]\displaystyle{ 0\leq a,b\lt 1 }[/math]이므로 [math]\displaystyle{ \left[mb+na+ab\right]\geq0 }[/math]이다. 따라서, [math]\displaystyle{ \left[xy\right]\geq mn=\left[x\right]\left[y\right] }[/math]
  10. [math]\displaystyle{ \left[\sqrt{x}\right]=m }[/math]이라 하자. 그러면, [math]\displaystyle{ 0\leq m\leq\sqrt{x}\lt m+1 }[/math]이고, 양변에 제곱근을 씌우면 [math]\displaystyle{ \sqrt{m}\leq\sqrt{\sqrt{x}}\lt \sqrt{m+1}\lt \sqrt{m}+1 }[/math]이고, 다시 양변에 최대정수함수를 씌우면 [math]\displaystyle{ \left[\sqrt{m}\right]\leq\left[\sqrt{\sqrt{x}}\right]\lt \left[\sqrt{m}+1\right]=\left[\sqrt{m}\right]+1 }[/math]이다. 따라서, 정의에 의해 [math]\displaystyle{ \left[\left[\sqrt{\sqrt{x}}\right]\right]=\left[\sqrt{\sqrt{x}}\right]=\left[\sqrt{m}\right]=\left[\sqrt{\left[\sqrt{x}\right]}\right] }[/math]이다.

다른 성질[편집 | 원본 편집]

p-지수

소수 [math]\displaystyle{ p }[/math], 음이 아닌 정수 [math]\displaystyle{ e }[/math], 양의 정수 [math]\displaystyle{ n }[/math]에 대해 [math]\displaystyle{ p^e\mid\mid n }[/math][math]\displaystyle{ p^e\mid n }[/math]이지만 [math]\displaystyle{ p^{e+1}\not\mid n }[/math]인 경우를 말한다. 이 때, [math]\displaystyle{ e }[/math][math]\displaystyle{ n }[/math][math]\displaystyle{ p }[/math]-지수라고 한다. 이제, [math]\displaystyle{ n! }[/math][math]\displaystyle{ p }[/math]-지수는 [math]\displaystyle{ e=\left[\frac{n}{p}\right]+\left[\frac{n}{p^2}\right]+\cdots=\sum_{k=1}^\infty\left[\frac{n}{p^k}\right] }[/math]이다.

이걸 어디다가 써먹냐는 생각이 들 수도 있는데, "100!을 소인수분해 했을 때 5의 지수가 몇이냐" 같은 문제를 풀 때 쓰인다. 100!의 5지수를 찾으면 끝이기 때문. 증명은 기본 성질 5번을 활용한다. 설마 진짜로 숫자를 다 써서 푼 사람은 없겠지

에르미트 항등식

실수 [math]\displaystyle{ x }[/math]자연수 [math]\displaystyle{ n }[/math]에 대해서,

[math]\displaystyle{ \sum_{k=0}^{n-1}\left[x+\frac{k}{n}\right]=\left[nx\right] }[/math]

가 성립하고, 이를 에르미트 항등식이라 부른다.

증명
[math]\displaystyle{ x }[/math]를 정수부와 소수부로 쪼개자. 즉, [math]\displaystyle{ x=\left[x\right]+\left\{x\right\} }[/math]이고, [math]\displaystyle{ 0\leq\left\{x\right\}\lt 1 }[/math]. 한편, [math]\displaystyle{ \left[x\right]=\left[x+\frac{m-1}{n}\right]\leq x\lt \left[x+\frac{m}{n}\right]=\left[x\right]+1 }[/math]을 만족하는 [math]\displaystyle{ 1\leq m\leq n }[/math]이 유일하게 존재한다 (최대정수함수를 정수 부분만 생각하여 부등식을 새우는 것으로 보면, 이 부등식은 소수부까지 세밀하게 생각해서 부등식을 세운 것이라 보면 된다). 이제, [math]\displaystyle{ \left[x\right] }[/math]를 빼주면,
[math]\displaystyle{ 0=\left[x+\frac{m-1}{n}\right]-\left[x\right]=\left[x-\left[x\right]+\frac{m-1}{n}\right]=\left[\left\{x\right\}+\frac{m-1}{n}\right]\leq\left\{x\right\}\lt \left[\left\{x\right\}+\frac{m}{n}\right]=1 }[/math]

이다. 한편, 오른쪽 최대정수함수에서 [math]\displaystyle{ 1-\frac{m}{n}\leq\left\{x\right\} }[/math]을, 왼쪽 최대정수함수에서 [math]\displaystyle{ \left\{x\right\}\lt 1-\frac{m-1}{n} }[/math]을 얻는다. 따라서, [math]\displaystyle{ 1-\frac{m}{n}\leq\left\{x\right\}\lt 1-\frac{m-1}{n} }[/math]이고, 정리해주면 [math]\displaystyle{ n-m\leq n\left\{x\right\}\lt n-m+1 }[/math]이다. 그리고 정의에 의해, [math]\displaystyle{ n-m=\left[n\left\{x\right\}\right] }[/math]이다.

이제, [math]\displaystyle{ \sum_{k=0}^{n-1}\left[x+\frac{k}{n}\right] }[/math][math]\displaystyle{ m-1 }[/math]를 기점으로 정확하게 두 가지 값으로 나눠진다. 즉,

[math]\displaystyle{ \sum_{k=0}^{n-1}\left[x+\frac{k}{n}\right]=\sum_{k=0}^{m-1}\left[x+\frac{k}{n}\right]+\sum_{k=m}^{n-1}\left[x+\frac{k}{n}\right]=\sum_{k=0}^{m-1}\left[x\right]+\sum_{k=m}^{n-1}\left(\left[x\right]+1\right)=n\left[x\right]+n-m=n\left[x\right]+\left[n\left\{x\right\}\right] }[/math]
한편, [math]\displaystyle{ n\left[x\right] }[/math]는 정수이므로, 준식[math]\displaystyle{ =\left[n\left[x\right]+n\left\{x\right\}\right]=\left[n\left(\left[x\right]+\left\{x\right\}\right)\right]=\left[nx\right] }[/math]
아이젠슈타인의 보조 정리

서로소인 홀수인 소수 [math]\displaystyle{ p,q }[/math]에 대해서,

[math]\displaystyle{ \sum_{i=1}^{\left(p-1\right)/2}\left[\frac{iq}{p}\right]+\sum_{i=1}^{\left(q-1\right)/2}\left[\frac{ip}{q}\right]=\frac{\left(p-1\right)\left(q-1\right)}{4} }[/math]

이다. 네???

사실 이차 상호 법칙을 증명하기 위해 쓰이는 보조 정리다. 격자점 세는 문제에서도 응용할 수 있다. 증명은 이차 상호 법칙 참조.

예제[편집 | 원본 편집]

최대정수함수가 나오는 문제를 푸는 방법은 여러 가지가 있지만, 자주 쓰이는 것은 부등식으로 바꾸기, 정수부와 소수부 쪼개기, 범위 쪼개기 그리고 노가다 정도가 있다. 당연하지만 위 기본 성질들을 아는 것은 문제를 빨리 풀기 위한 필수요소. 간단한 예제를 몇 개 풀어보자.

[math]\displaystyle{ 100!=n\times10^e }[/math]의 형태로 나타낼 때, [math]\displaystyle{ e }[/math]의 최댓값을 구하여라.
풀이
우선 10의 소인수는 2와 5, 둘 뿐이다. 100!을 소인수분해 하면 당연히 2보다 5의 수가 더 적으므로, 5의 개수를 찾는 것과 사실상 같은 문제이다. 즉, 100!의 5-지수를 구하면 끝. 답은 [math]\displaystyle{ \sum_{k=1}^\infty\left[\frac{100}{5^k}\right]=\left[\frac{100}{5}\right]+\left[\frac{100}{25}\right]=20+4=24 }[/math]
[math]\displaystyle{ 4x^2-40\left[x\right]+51=0 }[/math]을 만족하는 [math]\displaystyle{ x }[/math]값을 찾아라.
풀이
우선, [math]\displaystyle{ \left[x\right]\leq x }[/math]임을 이용하여, [math]\displaystyle{ 0=4x^2-40\left[x\right]+51\geq4x^2-40x+51=\left(2x-3\right)\left(2x-17\right) }[/math]을 얻는다. 즉, [math]\displaystyle{ \frac{3}{2}\leq x\leq\frac{17}{2} }[/math]이고, [math]\displaystyle{ 1\leq\left[x\right]\leq8 }[/math]. 한편, 원래 방정식에서 [math]\displaystyle{ \left[x\right] }[/math]를 문자처럼 취급하여 정리하면, [math]\displaystyle{ x=\frac{\sqrt{40\left[x\right]-51}}{2} }[/math]을 얻는다 ([math]\displaystyle{ x }[/math]가 양수임을 알기 때문에 음수는 버린다). 양변에 최대정수함수를 한 번 더 씌어주면, [math]\displaystyle{ \left[x\right]=\left[\frac{\sqrt{40\left[x\right]-51}}{2}\right] }[/math]이고, [math]\displaystyle{ \left[x\right]=1,2,\cdots,8 }[/math]를 각각 대입하여 만족하는 [math]\displaystyle{ \left[x\right] }[/math]을 찾으면 2, 6, 7, 8임을 알 수 있다. 이 값을 원래 방정식에 대입하면, [math]\displaystyle{ x=\frac{\sqrt{29}}{2},\frac{\sqrt{189}}{2},\frac{\sqrt{229}}{2},\frac{\sqrt{269}}{2} }[/math]이다.
실수 [math]\displaystyle{ x }[/math]에 대해서, [math]\displaystyle{ \left[x\right]+\left[x+\frac{1}{2}\right]=\left[2x\right] }[/math]임을 보여라.
풀이
[math]\displaystyle{ x=n+a }[/math]라 하자. 단, [math]\displaystyle{ n=\left[x\right] }[/math]이고 [math]\displaystyle{ 0\leq a=\left\{x\right\}\lt 1 }[/math]이다. 그러면, 주어진 식은 좌변[math]\displaystyle{ =n+\left[n+a+\frac{1}{2}\right]=2n+\left[a+\frac{1}{2}\right] }[/math], 우변[math]\displaystyle{ =\left[2n+2a\right]=2n+\left[2a\right] }[/math]가 되어 [math]\displaystyle{ \left[a+\frac{1}{2}\right]=\left[2a\right] }[/math]임을 보이는 것과 동치가 된다. 만약 [math]\displaystyle{ 0\leq a\lt \frac{1}{2} }[/math]이면 위 식의 양변은 0이 되어 성립하고, [math]\displaystyle{ \frac{1}{2}\leq a\lt 1 }[/math]이면 1이 되어 성립한다. 따라서 주어진 식은 모든 실수에 대해서 성립한다.

천장함수[편집 | 원본 편집]

최대정수함수가 크지 않은 최대의 정수를 내뱉는 함수라면, 천장함수(Ceiling Function)는 작지 않은 최소의 정수를 내뱉는 함수이다. 기호는 [math]\displaystyle{ \lceil\cdot\rceil }[/math]을 사용하며, 부등식적 정의는 [math]\displaystyle{ \lceil x\rceil-1\lt x\leq\lceil x\rceil }[/math]를 만족하는 정수 [math]\displaystyle{ \lceil x\rceil }[/math]의 값이다. 천장함수는 최대정수함수와 매우 비슷하기 때문에 자세한 성질은 생략한다.

각주