<small id='947CJ'></small><noframes id='947CJ'>

    <bdo id='947CJ'></bdo><ul id='947CJ'></ul>

    1. <i id='947CJ'><tr id='947CJ'><dt id='947CJ'><q id='947CJ'><span id='947CJ'><b id='947CJ'><form id='947CJ'><ins id='947CJ'></ins><ul id='947CJ'></ul><sub id='947CJ'></sub></form><legend id='947CJ'></legend><bdo id='947CJ'><pre id='947CJ'><center id='947CJ'></center></pre></bdo></b><th id='947CJ'></th></span></q></dt></tr></i><div id='947CJ'><tfoot id='947CJ'></tfoot><dl id='947CJ'><fieldset id='947CJ'></fieldset></dl></div>
    2. <tfoot id='947CJ'></tfoot>

    3. <legend id='947CJ'><style id='947CJ'><dir id='947CJ'><q id='947CJ'></q></dir></style></legend>

      在 C/C++ 中生成服从正态分布的随机数

      Generate random numbers following a normal distribution in C/C++(在 C/C++ 中生成服从正态分布的随机数)
          <tfoot id='XxBCJ'></tfoot>
          <legend id='XxBCJ'><style id='XxBCJ'><dir id='XxBCJ'><q id='XxBCJ'></q></dir></style></legend>
            <tbody id='XxBCJ'></tbody>
            <i id='XxBCJ'><tr id='XxBCJ'><dt id='XxBCJ'><q id='XxBCJ'><span id='XxBCJ'><b id='XxBCJ'><form id='XxBCJ'><ins id='XxBCJ'></ins><ul id='XxBCJ'></ul><sub id='XxBCJ'></sub></form><legend id='XxBCJ'></legend><bdo id='XxBCJ'><pre id='XxBCJ'><center id='XxBCJ'></center></pre></bdo></b><th id='XxBCJ'></th></span></q></dt></tr></i><div id='XxBCJ'><tfoot id='XxBCJ'></tfoot><dl id='XxBCJ'><fieldset id='XxBCJ'></fieldset></dl></div>

            • <bdo id='XxBCJ'></bdo><ul id='XxBCJ'></ul>

              • <small id='XxBCJ'></small><noframes id='XxBCJ'>

                本文介绍了在 C/C++ 中生成服从正态分布的随机数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                如何在 C 或 C++ 中轻松生成服从正态分布的随机数?

                How can I easily generate random numbers following a normal distribution in C or C++?

                我不想使用任何 Boost.

                I don't want any use of Boost.

                我知道 Knuth 详细谈到了这个问题,但我现在手头没有他的书.

                I know that Knuth talks about this at length but I don't have his books at hand right now.

                推荐答案

                生成的方法有很多来自常规 RNG 的高斯分布数.

                Box-Muller 变换 是常用的.它正确地产生具有正态分布的值.数学很容易.您生成两个(均匀)随机数,并通过对它们应用公式,您会得到两个正态分布的随机数.返回一个,并将另一个保存为下一个随机数请求.

                The Box-Muller transform is commonly used. It correctly produces values with a normal distribution. The math is easy. You generate two (uniform) random numbers, and by applying an formula to them, you get two normally distributed random numbers. Return one, and save the other for the next request for a random number.

                这篇关于在 C/C++ 中生成服从正态分布的随机数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                Consistent pseudo-random numbers across platforms(跨平台一致的伪随机数)
                Vary range of uniform_int_distribution(改变uniform_int_distribution的范围)
                What is a seed in terms of generating a random number?(就生成随机数而言,种子是什么?)
                Is 1.0 a valid output from std::generate_canonical?(1.0 是 std::generate_canonical 的有效输出吗?)
                Getting big random numbers in C/C++(在 C/C++ 中获取大随机数)
                What is the best way to generate random numbers in C++?(在 C++ 中生成随机数的最佳方法是什么?)

                <tfoot id='NNbGQ'></tfoot>
                    <bdo id='NNbGQ'></bdo><ul id='NNbGQ'></ul>

                    <small id='NNbGQ'></small><noframes id='NNbGQ'>

                        1. <legend id='NNbGQ'><style id='NNbGQ'><dir id='NNbGQ'><q id='NNbGQ'></q></dir></style></legend>

                            <tbody id='NNbGQ'></tbody>
                        2. <i id='NNbGQ'><tr id='NNbGQ'><dt id='NNbGQ'><q id='NNbGQ'><span id='NNbGQ'><b id='NNbGQ'><form id='NNbGQ'><ins id='NNbGQ'></ins><ul id='NNbGQ'></ul><sub id='NNbGQ'></sub></form><legend id='NNbGQ'></legend><bdo id='NNbGQ'><pre id='NNbGQ'><center id='NNbGQ'></center></pre></bdo></b><th id='NNbGQ'></th></span></q></dt></tr></i><div id='NNbGQ'><tfoot id='NNbGQ'></tfoot><dl id='NNbGQ'><fieldset id='NNbGQ'></fieldset></dl></div>