⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 match.m

📁 一些常被用于教学或者参考的概率论的实例的源代码
💻 M
字号:
%match.m/created by PJNahin for "Duelling Idiots"(6/3/98)
%This m-file computes the probability that N people,
%flipping fair coins n times, will each get the same
%number of heads.
%
%
n=input('How many flips? ')
N=input('How many people? ')
summation=0;
for k=0:n
   bc=binomial(n,k);      %call binomial coefficient function
   summation=summation+(bc)^N;
end
summation/(2^(N*n))

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -