Math Help Forum

Math Help Forum Feed Site Feed

Go Back   Math Help Forum > Pre-University Math Help > Pre-Algebra and Algebra
Reply
 
Thread Tools Display Modes
  #1  
Old December 25th, 2006, 11:56 AM
raju
Guest
 
Posts: n/a
Default factorial for big numbers

I need a way to find factorail for big numbers like 8479!

Thanks in advance

raju
Reply With Quote
Advertisement
 
  #2  
Old December 25th, 2006, 12:01 PM
ThePerfectHacker's Avatar
Global Moderator

 
Join Date: Nov 2005
Location: New York City
Posts: 11,186
Country:
Thanks: 482
Thanked 3,751 Times in 3,070 Posts
ThePerfectHacker has a reputation beyond reputeThePerfectHacker has a reputation beyond reputeThePerfectHacker has a reputation beyond reputeThePerfectHacker has a reputation beyond reputeThePerfectHacker has a reputation beyond reputeThePerfectHacker has a reputation beyond reputeThePerfectHacker has a reputation beyond reputeThePerfectHacker has a reputation beyond reputeThePerfectHacker has a reputation beyond reputeThePerfectHacker has a reputation beyond reputeThePerfectHacker has a reputation beyond repute
Default

Quote:
Originally Posted by raju View Post
I need a way to find factorail for big numbers like 8479!

Thanks in advance

raju
A simple way.
Just multiply them out.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


"Democracy has proved only that the best way to gain power
over people is to assure the people that they are ruling
themselves. Once they believe that, they make wonderfully
submissive slaves." - Joseph Sobran


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Reply With Quote
  #3  
Old December 25th, 2006, 12:48 PM
CaptainBlack's Avatar
Grand Panjandrum
 
Join Date: Nov 2005
Location: South of England
Posts: 11,265
Country:
Thanks: 656
Thanked 3,585 Times in 2,887 Posts
CaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond repute
Default

Quote:
Originally Posted by raju View Post
I need a way to find factorail for big numbers like 8479!

Thanks in advance

raju
See Stirlings formula (equations 13 and 14 here)

RonL
__________________
Truth does not change because it is, or is not, believed by a majority of the people.

Giordano Bruno
Reply With Quote
  #4  
Old December 25th, 2006, 01:19 PM
ThePerfectHacker's Avatar
Global Moderator

 
Join Date: Nov 2005
Location: New York City
Posts: 11,186
Country:
Thanks: 482
Thanked 3,751 Times in 3,070 Posts
ThePerfectHacker has a reputation beyond reputeThePerfectHacker has a reputation beyond reputeThePerfectHacker has a reputation beyond reputeThePerfectHacker has a reputation beyond reputeThePerfectHacker has a reputation beyond reputeThePerfectHacker has a reputation beyond reputeThePerfectHacker has a reputation beyond reputeThePerfectHacker has a reputation beyond reputeThePerfectHacker has a reputation beyond reputeThePerfectHacker has a reputation beyond reputeThePerfectHacker has a reputation beyond repute
Default

Quote:
Originally Posted by CaptainBlank View Post
See Stirlings formula (equations 13 and 14 here)

RonL
That is only an approximation.
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


"Democracy has proved only that the best way to gain power
over people is to assure the people that they are ruling
themselves. Once they believe that, they make wonderfully
submissive slaves." - Joseph Sobran


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Reply With Quote
  #5  
Old December 25th, 2006, 03:02 PM
CaptainBlack's Avatar
Grand Panjandrum
 
Join Date: Nov 2005
Location: South of England
Posts: 11,265
Country:
Thanks: 656
Thanked 3,585 Times in 2,887 Posts
CaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond repute
Default

Quote:
Originally Posted by ThePerfectHacker View Post
That is only an approximation.
How many digits does 8479! have?

(Rhetorical question)

RonL
__________________
Truth does not change because it is, or is not, believed by a majority of the people.

Giordano Bruno
Reply With Quote
  #6  
Old December 25th, 2006, 04:52 PM
galactus's Avatar
Eater of Worlds

 
Join Date: Jul 2006
Location: Chaneysville, PA
Posts: 2,853
Country:
Thanks: 120
Thanked 1,098 Times in 986 Posts
galactus has much to be proud ofgalactus has much to be proud ofgalactus has much to be proud ofgalactus has much to be proud ofgalactus has much to be proud ofgalactus has much to be proud ofgalactus has much to be proud ofgalactus has much to be proud ofgalactus has much to be proud of
Default

Quote:
Originally Posted by CaptainBlack View Post
How many digits does 8479! have?

(Rhetorical question)

RonL
Over 29,000.

25972686487041052159869258722936182200373790277711 48344797668281885988268302193747006721558615751528[...29429 digits...]00000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000
Reply With Quote
  #7  
Old December 25th, 2006, 05:45 PM
ThePerfectHacker's Avatar
Global Moderator

 
Join Date: Nov 2005
Location: New York City
Posts: 11,186
Country:
Thanks: 482
Thanked 3,751 Times in 3,070 Posts
ThePerfectHacker has a reputation beyond reputeThePerfectHacker has a reputation beyond reputeThePerfectHacker has a reputation beyond reputeThePerfectHacker has a reputation beyond reputeThePerfectHacker has a reputation beyond reputeThePerfectHacker has a reputation beyond reputeThePerfectHacker has a reputation beyond reputeThePerfectHacker has a reputation beyond reputeThePerfectHacker has a reputation beyond reputeThePerfectHacker has a reputation beyond reputeThePerfectHacker has a reputation beyond repute
Default

Quote:
Originally Posted by CaptainBlack View Post
How many digits does 8479! have?

(Rhetorical question)

RonL
I can find how many zeros is has .
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


"Democracy has proved only that the best way to gain power
over people is to assure the people that they are ruling
themselves. Once they believe that, they make wonderfully
submissive slaves." - Joseph Sobran


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Reply With Quote
  #8  
Old January 29th, 2007, 06:08 AM
Member
 
Join Date: Nov 2006
Location: oxford
Posts: 118
Country:
Thanks: 57
Thanked 15 Times in 15 Posts
chogo is on a distinguished road
Default

i had this problems some weeks back. Stirlings function is probably the best for large factorials. But otherwise use this bit of code i wrote in java which is computationally efficient.


public double gammaln(float xx){
double x,y,tmp,ser;
double[] cof={76.18009172947146,-86.50532032941677,
24.01409824083091,-1.231739572450155,
0.1208650973866179e-2,-0.5395239384953e-5};
int j;
y=x=xx;
tmp=x+5.5;
tmp -= (x+0.5)*Math.log(tmp);
ser=1.000000000190015;
for (j=0;j <= 5;j++) {ser += cof[j]/++y;}
return -tmp+ Math.log(2.5066282746310005*ser/x);}


public double factorial(float n){
double value = gammaln(n + 1);
double answer = Math.exp(value);
return answer;}

This is based around a method of gamma approximation by C.lanczos. (Paper is called - (A precision approximation of the gamma function).

This method can also be used to find NON integer factorials
Reply With Quote
  #9  
Old March 12th, 2007, 05:47 PM
Newbie
 
Join Date: Mar 2007
Posts: 7
Country:
Thanks: 0
Thanked 0 Times in 0 Posts
spanner is on a distinguished road
Default

I think ur asking this for a question like "find the lowest common multiple" (LCM)

there is no need to use massive formulas unless the number is greater then 1trillion.

just use Prime factorisation.

eg. 4 = 2 power of 2
6 = 3 x 2
1001 = 7 x 11 x 13
etc...

take the number and find all possible prime numbers which go ito it. (see examples above)
then...

eg. find the lowest common multiple of 4, 2, 6
4 = 2 squared 2 = 2 and 6 = 2x3
therfore the number must contain 2 squared and 3.
= 2 squared x 3
= 12

find all prime factors of the numbers. and take the common ones out
eg. 2 squared and 2
only use 2 squared because 2 is within 2 squared

then multiply them together.


(i can go on but it would just be useless)
Reply With Quote
  #10  
Old March 12th, 2007, 11:05 PM
CaptainBlack's Avatar
Grand Panjandrum
 
Join Date: Nov 2005
Location: South of England
Posts: 11,265
Country:
Thanks: 656
Thanked 3,585 Times in 2,887 Posts
CaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond repute
Default

Quote:
Originally Posted by spanner View Post
I think ur asking this for a question like "find the lowest common multiple" (LCM)
How does this relate to finding the factorial of a large number?

RonL
__________________
Truth does not change because it is, or is not, believed by a majority of the people.

Giordano Bruno
Reply With Quote
  #11  
Old March 12th, 2007, 11:17 PM
Newbie
 
Join Date: Mar 2007
Posts: 7
Country:
Thanks: 0
Thanked 0 Times in 0 Posts
spanner is on a distinguished road
Default

Quote:
Originally Posted by CaptainBlack View Post
How does this relate to finding the factorial of a large number?

RonL
it gives the base of a number in its prime factors,

then u can use all of theose prime numbers in different combinations to find the factors
Reply With Quote
  #12  
Old March 13th, 2007, 12:05 AM
CaptainBlack's Avatar
Grand Panjandrum
 
Join Date: Nov 2005
Location: South of England
Posts: 11,265
Country:
Thanks: 656
Thanked 3,585 Times in 2,887 Posts
CaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond repute
Default

Quote:
Originally Posted by spanner View Post
it gives the base of a number in its prime factors,

then u can use all of theose prime numbers in different combinations to find the factors
This is incomprehensible, please give us an example

RonL
__________________
Truth does not change because it is, or is not, believed by a majority of the people.

Giordano Bruno
Reply With Quote
  #13  
Old March 13th, 2007, 08:22 AM
Member
 
Join Date: Nov 2006
Location: oxford
Posts: 118
Country:
Thanks: 57
Thanked 15 Times in 15 Posts
chogo is on a distinguished road
Default

hang on maybe some confusion. spanner were finding a method of carrying out the factorial function not the LCM. I dont see how in anyway ur method can find the factorials of large numbers.
Reply With Quote
  #14  
Old March 14th, 2007, 02:55 AM
CaptainBlack's Avatar
Grand Panjandrum
 
Join Date: Nov 2005
Location: South of England
Posts: 11,265
Country:
Thanks: 656
Thanked 3,585 Times in 2,887 Posts
CaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond reputeCaptainBlack has a reputation beyond repute
Default

Quote:
Originally Posted by chogo View Post
hang on maybe some confusion. spanner were finding a method of carrying out the factorial function not the LCM. I dont see how in anyway ur method can find the factorials of large numbers.
I think that is what I was trying to indicate, indirectly so as not to cause offence .

RonL
__________________
Truth does not change because it is, or is not, believed by a majority of the people.

Giordano Bruno
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump


All times are GMT -7. The time now is 10:45 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc.
©2005 - 2009 Math Help Forum


Math Help Forum is a community of maths forums with an emphasis on maths help in all levels of mathematics.
Register to post your math questions or just hang out and try some of our math games or visit the arcade.