久久久久久久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. 如果我們?cè)诓煌臋C(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(如果我們?cè)诓煌臋C(jī)器上播種 c++11 mt19937 相同,我們會(huì)得到相同的隨機(jī)數(shù)序列嗎) - IT屋-程序員軟件開(kāi)發(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'>

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

                問(wèn)題描述

                受this和類(lèi)似問(wèn)題的啟發(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.

                換句話說(shuō),假設(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);
                

                如果我們?cè)诓煌臅r(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 ?

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

                And in either case, why this is the case ?

                另一個(gè)問(wèn)題:

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

                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ì),至少在不同的編譯器或庫(kù)版本中是這樣.該標(biāo)準(zhǔn)沒(méi)有詳細(xì)說(shuō)明他們的行為.如果您想要編譯器和庫(kù)版本之間的穩(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.

                除非庫(kù)/編譯器更改,否則將以相同的順序返回相同的值.但是,如果您愿意編寫(xiě)自己的發(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 命名,這不太可能是問(wèn)題.但其他模式可以發(fā)展.MT PRNG 對(duì)許多統(tǒng)計(jì)測(cè)試都很穩(wěn)健,但它們?cè)诿艽a學(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è)問(wèn)題,這取決于您發(fā)現(xiàn)問(wèn)題的具體細(xì)節(jié).但是,mt19937 將是比您可能自己編寫(xiě)的任何內(nèi)容都更好的 PRNG.但假設(shè)攻擊者可以根據(jù)過(guò)去的證據(jù)預(yù)測(cè)其未來(lái)的行為.

                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)于如果我們?cè)诓煌臋C(jī)器上播種 c++11 mt19937 相同,我們會(huì)得到相同的隨機(jī)數(shù)序列嗎的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                相關(guān)文檔推薦

                read input files, fastest way possible?(讀取輸入文件,最快的方法?)
                The easiest way to read formatted input in C++?(在 C++ 中讀取格式化輸入的最簡(jiǎn)單方法?)
                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() 之后沒(méi)有 getline(cin, var) 讀取字符串的第一個(gè)字符?)
                What is the cin analougus of scanf formatted input?(scanf 格式輸入的 cin 類(lèi)比是什么?)

                <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>

                          主站蜘蛛池模板: 国产在线www | 少妇一级淫片免费播放 | 亚洲精品一区在线 | 99久久精品免费看国产四区 | 国产乱码精品1区2区3区 | 亚洲毛片在线观看 | 亚洲男人网 | 欧美视频二区 | 成人国产精品一级毛片视频毛片 | 黄色av网站在线观看 | 人人艹人人爽 | 91视频三区| av网址在线 | 中文字幕视频一区二区 | 成人av网站在线观看 | 久久一级大片 | 超碰日本| 久久黄色网 | 国产一区免费视频 | 国产一级片免费视频 | 久久天堂网 | 97超碰人人 | 九九久视频| 久久香蕉网 | 久久99精品久久久97夜夜嗨 | 欧美精品第一页 | 99欧美精品 | 久久夜夜 | 中文字幕二区 | 在线黄| 黄色免费网 | 成人欧美一区二区三区黑人孕妇 | 麻豆成人在线视频 | 天天干天天想 | 日本男人天堂 | 99久久亚洲 | 精品欧美乱码久久久久久 | 国产精品久久久久久吹潮 | 日韩一区二区三区在线 | 国产日韩久久 | 不卡的av一区 |