How to simplify factorial before calculating the result

조회 수: 1 (최근 30일)
Christophe Croisetière
Christophe Croisetière 2021년 9월 29일
편집: James Tursa 2021년 9월 29일
Hi, I'm trying to calculate (2189!/(2165!*24!))/(2190!/(2165!*25!)). MathLab is telling me it's NaN because of the Inf/Inf result but i know the answer is around 1/438. Is there a way to tell MathLab to simplify the factorials before calulating their values.
  댓글 수: 1
James Tursa
James Tursa 2021년 9월 29일
편집: James Tursa 2021년 9월 29일
Is it only this particular calculation you are interested in (which easily reduces to 25/2190 by inspection ... not close to your claimed 1/438), or is this simply an example of a more generic calculation?

댓글을 달려면 로그인하십시오.

답변 (1개)

Matt J
Matt J 2021년 9월 29일
nchoosek(2189,24)/nchoosek(2190,25),
Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits
Warning: Result may not be exact. Coefficient is greater than 9.007199e+15 and is only accurate to 15 digits
ans = 0.0114
  댓글 수: 2
Matt J
Matt J 2021년 9월 29일
I'm glad, but if so, please Accept-click the answer.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

제품


릴리스

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by