如何在 Open Office 中执行蒙特卡罗模拟?

发布于 2024-09-10 12:04:51 字数 310 浏览 0 评论 0原文

我正在尝试为我正在解决的问题生成一些范围。这些护林员将基于一堆数字的比率之和。例如,常数是 5 6 和 7。

我得到的范围是 5/x + 6/y + 7/z = S

我希望 x、y 和 z 来自我拥有的数字列表 -比如说 .5、.6、.7、.8、.9 和 1

所以如果我运行 100 次迭代,我希望电子表格从该数字列表中随机填充 X 中的一个值,另一个随机选择 y,还有一个 z 。

就像我说的,我希望以这样的方式计算总和 S 100 次,这样我就能得到 S 的一系列值。

我一直在试图弄清楚如何在不使用宏的情况下做到这一点。

I am trying to generate some ranges for a problem I am working on. These rangers are going to be based on the sum of the ratio's of a bunch of numbers. So for example, the constant's are 5 6 and 7.

The ranges I get will be 5/x + 6/y + 7/z = S

I want x, y, and z to come out of a list of numbers I have - say .5, .6, .7, .8, .9, and 1

So If I run 100 iterations of this, I want the spreadsheet to randomly fill a value in X from that list of numbers, another random selection for y, and yet another for z.

And like I said, I want that sum, S, to be calculated 100 times in such a way that I will get a range of values for S.

I have been trying to figure out how to do this without the use of macros.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

じ违心 2024-09-17 12:04:51

这是一种方法。创建 x、y 和 z 输入值的表。在表格左侧放置一列,其中包含每个输入值的编号 (1...N)。假设每个输入值都有 10 个潜在输入值。因此,您的表位于 A1:D10 中,A 列中包含 1 到 10,B 中包含 x 值,C 中包含 y 值,D 中包含 z 值。

然后您可以通过编写 =VLOOKUP(10 来选择 x 值的随机值*RAND()+1,$A$1:$D$10,2,TRUE)。这会随机选择 0 到 10 之间的数字,并查找与 A 列匹配的 x 值(向下舍入)。例如,随机数是 4.3——那么它将选择第 4 个值。将 VLOOKUP 列中的第三个参数替换为 3(y 值)和 4(z 值)...

如果 A:D 列中没有任何其他数据,则可以使用 =VLOOKUP(count($A:$ A)*RAND()+1,$A:$D,2,TRUE)。

Here's one way to do it. Create a table of x, y, and z input values. Put a column to the left of the table with the number of each input value (1...N). Say that you have 10 potential input values for each. So your table is in A1:D10 with 1 through 10 in column A and the x values in B, y values in C, and z valued in D.

Then you can select a random value of the x values by writing =VLOOKUP(10*RAND()+1,$A$1:$D$10,2,TRUE). This randomly selects a number between 0 and 10 and looks up the x value matching the A column that matches the number, rounded down. E.g. the random number is 4.3 -- then it will select the 4th value. Replace the third parameter in the VLOOKUP column with 3 for y values and 4 for z values...

If you don't have any other data in columns A:D, you can generalize this with =VLOOKUP(count($A:$A)*RAND()+1,$A:$D,2,TRUE).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文