필터 지우기
필터 지우기

How can i solve this equation to n ?

조회 수: 1 (최근 30일)
Nick
Nick 2012년 2월 3일
편집: T 2013년 10월 11일
I try to solve this equation 1-(γ(a,x)/(n-1)!)=R to n but i can't find how, where R>=0 and γ(a,x) is the lower incomplete gamma function as i found. Does anyone have any idea?

답변 (4개)

Walter Roberson
Walter Roberson 2012년 2월 3일
If 1-(γ(a,x)/(n-1)!)=R then 1 + R = y(a,x) / (n-1)! and so
(n-1)! = y(a,x) / (1 + R);
(n-1)! is gamma(n), so you want to solve gamma(n) = y(a,x) / (1+R)
c = gammainc(a,x) / (1+R);
fzero( @(n) gamma(n) - c, 5 )
  댓글 수: 1
Sean de Wolski
Sean de Wolski 2012년 2월 3일
Definitely more optimized than mine. One comment: gammainc() expects (x,a) not(a,x).

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


Sean de Wolski
Sean de Wolski 2012년 2월 3일
fzero(@(n)1-(gammainc(x,a)/gamma(n))-R,5)
Maybe? You'll hit overflow if you start with a big n.

Nick
Nick 2012년 2월 13일
Thank you for your answers...

Nick
Nick 2012년 2월 14일
Also, why to put the number 5 to the fzero ? Did you put it randomly ?
  댓글 수: 1
Walter Roberson
Walter Roberson 2012년 2월 14일
I used it because Sean used it ;-)

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

카테고리

Help CenterFile Exchange에서 Gamma Functions에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by