Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/redis/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Random 使用Wolfram Mathematica进行样本模拟以获得分布_Random_Integer_Wolfram Mathematica_Simulation_Distribution - Fatal编程技术网

Random 使用Wolfram Mathematica进行样本模拟以获得分布

Random 使用Wolfram Mathematica进行样本模拟以获得分布,random,integer,wolfram-mathematica,simulation,distribution,Random,Integer,Wolfram Mathematica,Simulation,Distribution,我的数学作业需要一些帮助。。 我想得到一些从0到10的随机数的平均值,每次都是更大数量的样本(从10到20)。然后我想以某种方式将其绘制为所有方法的分布,或者如果不可能,则绘制为列表图。我必须证明,随着样本数量的增加,平均值变得越来越正确。这就是我已经拥有的 For[i = 10, i < 20, i++, Print[Mean[RandomInteger[10, i]]]] 对于[i=10,i

我的数学作业需要一些帮助。。 我想得到一些从0到10的随机数的平均值,每次都是更大数量的样本(从10到20)。然后我想以某种方式将其绘制为所有方法的分布,或者如果不可能,则绘制为列表图。我必须证明,随着样本数量的增加,平均值变得越来越正确。这就是我已经拥有的

For[i = 10, i < 20, i++, Print[Mean[RandomInteger[10, i]]]]
对于[i=10,i<20,i++,打印[Mean[RandomInteger[10,i]]]

我非常感谢你的帮助

For
循环不会返回结果,因此必须收集结果。
打印
没有帮助

output = {};
For[i = 10, i < 20000, i++, AppendTo[output, Mean[RandomInteger[10, i]]]]
ListPlot[output, AxesLabel -> {"Samples", "Mean"}]

欢迎来到SO。这不是家庭作业完成服务。你的导师给你布置了作业,你首先需要自己做一些努力。如果你甚至不能开始,请向你的老师寻求帮助。将问题隔离到特定的编程片段中,然后搜索答案。如果您需要一门课程或教程,堆栈溢出不是合适的地方。我们祝你学习顺利。看:。谢谢,我会这样试的!如果根本不包括基于的计算的
,这将是一个更好的答案。
output = Table[Mean[RandomInteger[10, i]], {i, 10, 20000}];
ListPlot[output, AxesLabel -> {"Samples", "Mean"}]