필터 지우기
필터 지우기

how to solve an equation with two unknowns

조회 수: 12 (최근 30일)
fatima alansari
fatima alansari 2019년 7월 14일
답변: Jyotsna Talluri 2019년 7월 17일
Hello,
I have this equation
y = (n*p)*(1-p)^(n-1);
I want to take the derivative and let it equal to zero to find out p, which should be 1/n as a result!
I could get the derivative for this equation manually and using MATLAB, the result is:
dydp = n*(1 - p)^(n - 1) - n*p*(n - 1)*(1 - p)^(n - 2))
However, I couldn't solve it as the way mentioned above to find p!
p = 1/n, i could do it manually. How can i find it using MATLAB??
Regards
  댓글 수: 3
fatima alansari
fatima alansari 2019년 7월 14일
Yes, to find the efficiency of Slotted ALOHA protocol. It is a multiple access protocol, used in networking.
Thenk you. I'll try these functions

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

답변 (1개)

Jyotsna Talluri
Jyotsna Talluri 2019년 7월 17일
Hi,
For solving the equation with 2 variables,you can use the solve() function
syms n
syms p
p=solve(n*(1 - p)^(n - 1)-n*p*(n - 1)*(1 - p)^(n - 2)==0,p);

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by