음수 팩토리얼 문제

1 문제 상황[ | ]

  • [math]\displaystyle{ 2!=2 }[/math]
  • [math]\displaystyle{ 1!=1 }[/math]
  • [math]\displaystyle{ 0!=1 }[/math]
  • [math]\displaystyle{ (-1)!=? }[/math]

2 0![ | ]

음수 팩토리얼을 생각해보기 전에 0!을 살펴보자.

[math]\displaystyle{ n! = \begin{cases} 1 & \text{if } n = 0, \\ (n-1)!\times n & \text{if } n \gt 0. \end{cases} }[/math]

정의에 따라 [math]\displaystyle{ 0!=1 }[/math]이 된다.

3 엑셀 풀이[ | ]

입력
1
2
3
4
5
6
A B C
3 =FACT(A1)
2 =FACT(A2)
1 =FACT(A3)
0 =FACT(A4)
-1 =FACT(A5)
-2 =FACT(A6)
출력
1
2
3
4
5
6
A B C
3 6
2 2
1 1
0 1
-1 #NUM!
-2 #NUM!

→ 구할 수 없다. 참고로 [math]\displaystyle{ \sqrt{-1} }[/math]=SQRT(-1)#NUM!이 된다.

4 의견[ | ]

  • 일반적으로 팩토리얼은 0 또는 양의 정수에 대해 정의되어 있기 때문에 음의 정수의 팩토리얼을 계산할 수 없다.
  • 팩토리얼의 개념을 실수로 확장한 감마함수를 이용하면 음수 팩토리얼을 구할 수 있다.
[math]\displaystyle{ \Gamma(0) = (-1)! = \infty }[/math]

5 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}