会C语言的帮下忙1/2={365*(365-1)*(365-2)*(365-3)*(365-4)*………[365-(n-1)]}/365的n次方能帮我算下n=多少吗?I just want a number

来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/20 08:36:28
会C语言的帮下忙1/2={365*(365-1)*(365-2)*(365-3)*(365-4)*………[365-(n-1)]}/365的n次方能帮我算下n=多少吗?Ijustwantanumber会

会C语言的帮下忙1/2={365*(365-1)*(365-2)*(365-3)*(365-4)*………[365-(n-1)]}/365的n次方能帮我算下n=多少吗?I just want a number
会C语言的帮下忙
1/2={365*(365-1)*(365-2)*(365-3)*(365-4)*………[365-(n-1)]}/365的n次方
能帮我算下n=多少吗?
I just want a number

会C语言的帮下忙1/2={365*(365-1)*(365-2)*(365-3)*(365-4)*………[365-(n-1)]}/365的n次方能帮我算下n=多少吗?I just want a number
x1=0.001379
验证731*0.001379-0.001379*0.001379=1.008170
pow(365,0.001379)=1.008170
x2=1.139602
验证731*1.139602-1.139602*1.139602=831.750012
pow(365,1.139602)=831.750012
请按任意键继续. . .
(365+(365-n+1))*(n)/2/(365^n)
(731n-n*n)/(2*365^n)=1/2
(731n-n*n)/(365^n)=
731n-n*n=365^n
365^n这个是增函数
731n-n*n这个是开口向下的,左边是增函数,右边是减函数
所以一定存在两个解.
365^0=1
731*0-0*0=0
1>0
365^1=365
731*1-1*1=730
365pow(365,mid))
{
high=mid;
}
else low=mid;
}
printf("x1=%lf\n",low);
printf("验证731*%lf-%lf*%lf=%lf\n",low,low,low,731*low-low*low);
printf("pow(365,%lf)=%lf\n",low,pow(365,low));
test=100;
low=1;
high=2;
while(test--)
{
mid=(low+high)/2;
if(731*mid-mid*mid>pow(365,mid))low=mid;
else high=mid;
}
printf("x2=%lf\n",low);
printf("验证731*%lf-%lf*%lf=%lf\n",low,low,low,731*low-low*low);
printf("pow(365,%lf)=%lf\n",low,pow(365,low));
return 0;
}
365^2=133225
731*2-2*2=1458
133225>1458
所以在区间[1,2]内有一个解
123456