%基于Monte Carlo方法的试题难度分布研究
% 作者:姚进等
% 计算机应用与软件 2004.9
%基本思路:
%1.定义有效的难度值范围[0,1],并保证正态分布下的该区间面积不小于0.995。找到最大sigma值。
%2.作者认为,难度一般分布在[0.3,0.7]。
%3.固定u值为0.5,0.6,0.7,0.8,求最大sigma值,公式为P{(x'-Z*u)/sigma<x<(x'+Z*u)/sigma}>=0.995
%4.得到难度的pdf后,进行模拟。
%5.统计2000次的模拟值,包括:各次的平均难度、各难度区间的频率。
%6.求模拟统计值的期望。得到最终结果。
%几个基本的变量
% 难度等级A1=‘易’;A2=‘较易’;A3=‘中等’;A4=‘较难’;A5=‘难’
% 题目数:itemNUM
% 模拟次数:simuNUM
function main()
itemNUM=2000;
simuNUM=2000;
cols=itemNUM;
A=zeros(simuNUM,5);
for simuLoop=1:simuNUM
nandu=myrandn(0.6,0.155,1,cols);
expectation(simuLoop)=mean(nandu);
frequency=getndfreq(nandu);
frequency2(simuLoop,:)=frequency;
end
nandu_Mean=mean(expectation);
nandu_Sigma=std(expectation,1);
nandu_Distribution=mean(frequency2);
% fprintf(' 组卷参数 计算结果 \n')
% fprintf('难度期望 标准差 易 较易 中等 较难 难 \n')
[nandu_Mean,nandu_Sigma,nandu_Distribution(1),nandu_Distribution(2),nandu_Distribution(3),nandu_Distribution(4),nandu_Distribution(5)]
%产生特定的正态分布随机数
function rnd=myrandn(exp,sigma,rows,cols)
x1=rand(rows,cols);
x2=rand(rows,cols);
rnd=sqrt(-2*log(x1)).*cos(2*pi*x2);
rnd=exp+sigma*rnd;
%求每个难度等级下的难度值频率
function nandufrequency=getndfreq(nanduvalue)
nandufrequency(1)=sum(0<=nanduvalue&nanduvalue<=0.2);
nandufrequency(2)=sum(0.2<nanduvalue&nanduvalue<=0.4);
nandufrequency(3)=sum(0.4<nanduvalue&nanduvalue<=0.6);
nandufrequency(4)=sum(0.6<nanduvalue&nanduvalue<=0.8);
nandufrequency(5)=sum(0.8<nanduvalue&nanduvalue<=1);
nandufrequency=nandufrequency/prod(size(nanduvalue))*100;
- 1
- 2
前往页