- Jan 9, 2001
- 7,572
- 2
- 76
Originally posted by: johnjohn320
Apparently it's possible for 0 prime to equal 1? Any ideas?
Apparently it's possible for 0 prime to equal 1? Any ideas?
Originally posted by: notfred
If the question is "When does 0! = 1" then the answer is always.
If the question is "When does 0 != 1" then the answer is still always.
I'm confused.
Originally posted by: Balthazar
Originally posted by: notfred
If the question is "When does 0! = 1" then the answer is always.
If the question is "When does 0 != 1" then the answer is still always.
I'm confused.
I don't know what language you use but I know at least PHP PERL and C/C++ would st@b you in your sleep for using syntax like that ;p
Now $0! = 1; might pass with PERL or C/C++ (kinda doubt it in PERL, not sure about C)
And $0 != 1; Is only true so long as its not proveeded by $0 = 1;
Hahaha, this is so sad....
But actually now that I think about it, I don't think you are allowed to start a PHP variable with a number
Carry on.
#include <stdio.h>
int main(){
if(0 != 1){
printf("0 isn't 1\n");
}
}
#!/usr/bin/perl
if(0 != 1){
print "0 ins't 1\n";
}
Originally posted by: Mday
By definition:
n! = n*(n-1)*...*1
(n-1)! = (n-1)*...*1
From the above two lines:
(n-1)! = n! / n
let n = 4 ---> (n - 1) = 3
by definition we have
4! = 4 * 3 * 2 * 1
3! = 3 * 2 * 1
by above: (n-1)! = n! / n
3! = (4 * 3 * 2 * 1 ) / 4 = 3 * 2 * 1
makes sense, follows the definition of n! even.
how about now: n = 1
(n-1)! = n! / n
(1-1)! = 1!/1
0! = 1
we often think of factorials as multiplying by increasing "n's". if you think of factorialization backwards, as n decreases, you're dividing. so, by definition, and "backwards" thinking of n! and (n-1)!, we have it clearly stated that 0! = 1
if you look at this analysis, you see clearly why (n-1)! is not defined for n = (-1) or n=0. And by recursion, you see that factorials are not defined for ANY negative number, simply because you get a division by 0 error.
please note that even though we "define" 0! as 1, it makes sense that 0! is 1, and that factorial is truly undefined for negative numbers.
Originally posted by: DrPizza
Originally posted by: Mday
By definition:
n! = n*(n-1)*...*1
(n-1)! = (n-1)*...*1
From the above two lines:
(n-1)! = n! / n
let n = 4 ---> (n - 1) = 3
by definition we have
4! = 4 * 3 * 2 * 1
3! = 3 * 2 * 1
by above: (n-1)! = n! / n
3! = (4 * 3 * 2 * 1 ) / 4 = 3 * 2 * 1
makes sense, follows the definition of n! even.
how about now: n = 1
(n-1)! = n! / n
(1-1)! = 1!/1
0! = 1
we often think of factorials as multiplying by increasing "n's". if you think of factorialization backwards, as n decreases, you're dividing. so, by definition, and "backwards" thinking of n! and (n-1)!, we have it clearly stated that 0! = 1
if you look at this analysis, you see clearly why (n-1)! is not defined for n = (-1) or n=0. And by recursion, you see that factorials are not defined for ANY negative number, simply because you get a division by 0 error.
please note that even though we "define" 0! as 1, it makes sense that 0! is 1, and that factorial is truly undefined for negative numbers.
beat me. nice work too.
Originally posted by: notfred
Originally posted by: Balthazar
Originally posted by: notfred
If the question is "When does 0! = 1" then the answer is always.
If the question is "When does 0 != 1" then the answer is still always.
I'm confused.
I don't know what language you use but I know at least PHP PERL and C/C++ would st@b you in your sleep for using syntax like that ;p
Now $0! = 1; might pass with PERL or C/C++ (kinda doubt it in PERL, not sure about C)
And $0 != 1; Is only true so long as its not proveeded by $0 = 1;
Hahaha, this is so sad....
But actually now that I think about it, I don't think you are allowed to start a PHP variable with a number
Carry on.
in C:
#include <stdio.h>
int main(){
if(0 != 1){
printf("0 isn't 1\n");
}
}
in perl:
#!/usr/bin/perl
if(0 != 1){
print "0 ins't 1\n";
}
Go ahead and compile and run them, they both work.
Originally posted by: Mday
By definition:
n! = n*(n-1)*...*1
(n-1)! = (n-1)*...*1
From the above two lines:
(n-1)! = n! / n
let n = 4 ---> (n - 1) = 3
by definition we have
4! = 4 * 3 * 2 * 1
3! = 3 * 2 * 1
by above: (n-1)! = n! / n
3! = (4 * 3 * 2 * 1 ) / 4 = 3 * 2 * 1
makes sense, follows the definition of n! even.
how about now: n = 1
(n-1)! = n! / n
(1-1)! = 1!/1
0! = 1
we often think of factorials as multiplying by increasing "n's". if you think of factorialization backwards, as n decreases, you're dividing. so, by definition, and "backwards" thinking of n! and (n-1)!, we have it clearly stated that 0! = 1
if you look at this analysis, you see clearly why (n-1)! is not defined for n = (-1) or n=0. And by recursion, you see that factorials are not defined for ANY negative number, simply because you get a division by 0 error.
please note that even though we "define" 0! as 1, it makes sense that 0! is 1, and that factorial is truly undefined for negative numbers.