久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

<tfoot id='pMohC'></tfoot>

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

      <i id='pMohC'><tr id='pMohC'><dt id='pMohC'><q id='pMohC'><span id='pMohC'><b id='pMohC'><form id='pMohC'><ins id='pMohC'></ins><ul id='pMohC'></ul><sub id='pMohC'></sub></form><legend id='pMohC'></legend><bdo id='pMohC'><pre id='pMohC'><center id='pMohC'></center></pre></bdo></b><th id='pMohC'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='pMohC'><tfoot id='pMohC'></tfoot><dl id='pMohC'><fieldset id='pMohC'></fieldset></dl></div>
      <legend id='pMohC'><style id='pMohC'><dir id='pMohC'><q id='pMohC'></q></dir></style></legend>

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

    1. 如果我們在不同的機(jī)器上播種 c++11 mt19937 相同,

      If we seed c++11 mt19937 as the same on different machines, will we get the same sequence of random numbers(如果我們在不同的機(jī)器上播種 c++11 mt19937 相同,我們會(huì)得到相同的隨機(jī)數(shù)序列嗎) - IT屋-程序員軟件開發(fā)

        <i id='7EVtY'><tr id='7EVtY'><dt id='7EVtY'><q id='7EVtY'><span id='7EVtY'><b id='7EVtY'><form id='7EVtY'><ins id='7EVtY'></ins><ul id='7EVtY'></ul><sub id='7EVtY'></sub></form><legend id='7EVtY'></legend><bdo id='7EVtY'><pre id='7EVtY'><center id='7EVtY'></center></pre></bdo></b><th id='7EVtY'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='7EVtY'><tfoot id='7EVtY'></tfoot><dl id='7EVtY'><fieldset id='7EVtY'></fieldset></dl></div>

            <bdo id='7EVtY'></bdo><ul id='7EVtY'></ul>

            1. <tfoot id='7EVtY'></tfoot>

                <tbody id='7EVtY'></tbody>
              <legend id='7EVtY'><style id='7EVtY'><dir id='7EVtY'><q id='7EVtY'></q></dir></style></legend>
            2. <small id='7EVtY'></small><noframes id='7EVtY'>

                本文介紹了如果我們在不同的機(jī)器上播種 c++11 mt19937 相同,我們會(huì)得到相同的隨機(jī)數(shù)序列嗎的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                問題描述

                受this和類似問題的啟發(fā),我想了解 mt19937C++11 中的偽數(shù)生成器的行為,當(dāng)在兩臺(tái)不同的機(jī)器上時(shí),它以相同的輸入作為種子.

                Inspired from this and the similar questions, I want to learn how does mt19937 pseudo-number generator in C++11 behaves, when in two separate machines, it is seeded with the same input.

                換句話說,假設(shè)我們有以下代碼;

                In other words, say we have the following code;

                std::mt19937 gen{ourSeed};
                std::uniform_int_distribution<int> dest{0, 10000};
                int randNumber = dist(gen);
                

                如果我們在不同的時(shí)間在不同的機(jī)器上嘗試這段代碼,我們會(huì)得到相同序列的 randNumber 值還是每次不同的序列?

                If we try this code on different machines at different times, will we get the same sequence of randNumber values or a different sequence each time ?

                無論哪種情況,為什么會(huì)這樣?

                And in either case, why this is the case ?

                另一個(gè)問題:

                不管種子如何,這段代碼會(huì)無限生成隨機(jī)數(shù)嗎?我的意思是比如說,如果我們在一個(gè)連續(xù)運(yùn)行幾個(gè)月的程序中使用這塊代碼,會(huì)不會(huì)出現(xiàn)數(shù)字的生成問題或數(shù)字的統(tǒng)一性問題?

                Regardless of the seed, will this code generate randomly numbers infinitely ? I mean for example, if we use this block of code in a program that runs for months without stopping, will there be any problem in the generation of the number or in the uniformity of the numbers ?

                推薦答案

                generator 將生成相同的值.

                發(fā)行版 可能不會(huì),至少在不同的編譯器或庫版本中是這樣.該標(biāo)準(zhǔn)沒有詳細(xì)說明他們的行為.如果您想要編譯器和庫版本之間的穩(wěn)定性,則必須推出自己的發(fā)行版.

                The distributions may not, at least with different compilers or library versions. The standard did not specify their behaviour to that level of detail. If you want stability between compilers and library versions, you have to roll your own distribution.

                除非庫/編譯器更改,否則將以相同的順序返回相同的值.但是,如果您愿意編寫自己的發(fā)行版.

                Barring library/compiler changes, that will return the same values in the same sequence. But if you care write your own distribution.

                ...

                所有 PRNG 都有模式和句點(diǎn).mt19937 以其周期 2^19937-1 命名,這不太可能是問題.但其他模式可以發(fā)展.MT PRNG 對許多統(tǒng)計(jì)測試都很穩(wěn)健,但它們在密碼學(xué)上不是安全的 PRNG.

                All PRNGs have patterns and periods. mt19937 is named after its period of 2^19937-1, which is unlikely to be a problem. But other patterns can develop. MT PRNGs are robust against many statistical tests, but they are not crytographically secure PRNGs.

                因此,如果您運(yùn)行數(shù)月,這將是一個(gè)問題,這取決于您發(fā)現(xiàn)問題的具體細(xì)節(jié).但是,mt19937 將是比您可能自己編寫的任何內(nèi)容都更好的 PRNG.但假設(shè)攻擊者可以根據(jù)過去的證據(jù)預(yù)測其未來的行為.

                So it being a problem if you run for months will depend on specific details of what you'd find to be a problem. However, mt19937 is going to be a better PRNG than anything you are likely to write yourself. But assume attackers can predict its future behaviour from past evidence.

                這篇關(guān)于如果我們在不同的機(jī)器上播種 c++11 mt19937 相同,我們會(huì)得到相同的隨機(jī)數(shù)序列嗎的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                相關(guān)文檔推薦

                read input files, fastest way possible?(讀取輸入文件,最快的方法?)
                The easiest way to read formatted input in C++?(在 C++ 中讀取格式化輸入的最簡單方法?)
                Reading from .txt file into two dimensional array in c++(從 .txt 文件讀取到 C++ 中的二維數(shù)組)
                How to simulate a key press in C++(如何在 C++ 中模擬按鍵按下)
                Why doesn#39;t getline(cin, var) after cin.ignore() read the first character of the string?(為什么在 cin.ignore() 之后沒有 getline(cin, var) 讀取字符串的第一個(gè)字符?)
                What is the cin analougus of scanf formatted input?(scanf 格式輸入的 cin 類比是什么?)

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

                  <tbody id='fRqk4'></tbody>
                • <bdo id='fRqk4'></bdo><ul id='fRqk4'></ul>
                  <tfoot id='fRqk4'></tfoot>
                  <i id='fRqk4'><tr id='fRqk4'><dt id='fRqk4'><q id='fRqk4'><span id='fRqk4'><b id='fRqk4'><form id='fRqk4'><ins id='fRqk4'></ins><ul id='fRqk4'></ul><sub id='fRqk4'></sub></form><legend id='fRqk4'></legend><bdo id='fRqk4'><pre id='fRqk4'><center id='fRqk4'></center></pre></bdo></b><th id='fRqk4'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='fRqk4'><tfoot id='fRqk4'></tfoot><dl id='fRqk4'><fieldset id='fRqk4'></fieldset></dl></div>

                      • <legend id='fRqk4'><style id='fRqk4'><dir id='fRqk4'><q id='fRqk4'></q></dir></style></legend>

                          主站蜘蛛池模板: 日本一区二区三区四区五区 | 国产伦理一区二区 | 久久久久久久av | 国产成人精品亚洲男人的天堂 | 日日干视频 | 精品福利在线 | 激情另类小说 | 久久高清免费视频 | 精品国产视频 | 国产黄网 | 99亚洲精品 | 日韩成人中文字幕 | 黄色小视频在线观看 | 日韩视频一区二区 | 成人免费网站黄 | 少妇搡bbbb搡bbb搡毛茸茸 | 久久精品1| 欧美日韩在线看 | 蜜桃精品一区二区 | 毛片网站大全 | 三级视频在线 | 国产精品久久久久久久久借妻 | 九九在线免费视频 | av黄色在线观看 | 欧美精品久久久久 | 在线免费看毛片 | 99精品欧美一区二区蜜桃免费 | 三级福利视频 | 欧美一级淫片免费视频魅影视频 | 亚洲一区二区三区四区在线 | 久久艳片www.17c.com| 波多野结衣视频在线播放 | 日本在线不卡视频 | 精品无人国产偷自产在线 | 激情综合网站 | 91极品视频| 福利片在线观看 | 成人免费视频观看视频 | 久久久久久久国产精品 | 少妇一级淫片免费看 | 久久国产影院 |