Article View: pl.comp.programming
Article #217533Re: Jak zrobić test za pomocą PractRand?
From: osobli...
Date: Mon, 23 Aug 2021 12:31
Date: Mon, 23 Aug 2021 12:31
69 lines
7228 bytes
7228 bytes
poniedziałek, 23 sierpnia 2021 o 11:18:03 UTC+2 M.M. napisał(a):
> On Monday, August 23, 2021 at 5:23:14 AM UTC+2, osobli...@gmail.com wrote:
> > Właściwie to mój generator oblewa po 16 MB:
> >
> > length= 16 megabytes (2^24 bytes), time= 2.1 seconds
> >
> > A ten LCG oblewa po 2 MB:
> >
> > length= 2 megabytes (2^21 bytes), time= 3.3 seconds
> >
> > Czyli mój radzi sobie chyba lepiej. O ile to ma w ogóle jakiekolwiek znaczenie, skoro testy prawdopodobnie nie są wykonywane poprawnie. Raczej wróżenie z fusów.
> Jeśli użyłeś tego samego generatora co ja, tych samych stałych A i B, jeśli zainicjowałeś x=1, jeśli odrzuciłeś sto
> początkowych wygenerowanych liczb (500 bitów), jeśli bierzesz tylko 5 najstarszych bitów - to powinno być tak samo jak
> u mnie... chociaż ja mam wersję PractRanda 0.94 a Ty 0.93 - nie wiem czy zostało zmienione coś na tyle
> istotnego aby wyniki testów były całkiem inne. Raczej w nowszej wersji testy powinny być bardziej surowe.
>
> Moje początkowe 1000 bitów wygląda tak:
> ./SimpPRNG 1 1000
> 1100010111000111110000011110101111001001011010001110001111001111000000001111100100010110111111100000111111101001001100000110110011001011101000100100110111011111001010111011011101001101100110001001111000101011000001000001110101101001111110111111000001011001011111100010101001010000000101111110000110010011100111101011010111110000100101100110100001110100000110101010001100010000011000111101110001110011111000101101110100110010110011011000001001101100011011011111100101000010110101110111011010111111100001101101011101011011100000100001110010011100010001101100011110011000100010011011001100010100010011110011101001010010000011010101000101111100100101110010011000001000001101101100110101110000101011010011110101101000100010110000000101001111110101110011001110001110110011110011101011101000001001001001100100111110111110110000110010101011011001100010100010111000010010100100100000011101010101001101001011101011110001000111000000000110000000101110000010110100110111011000100010101110000010010011001101000101
>
> Wyświetlam z tych 5 bitów począwszy od najmłodszego:
>
> https://github.com/mmarszik/SimpPRNG/blob/main/main.cpp
> type_out v = r();
> for( int k=0 ; k<bits && j<BUFF_SIZE && i<size ; k++, j++, i++ ) {
> buff[j] = '0' + (v & 1);
> v >>= 1;
> }
>
> Ale na jakość generatora i zaliczenie testów nie powinno wpłynąć wyświetlanie od najstarszego.
>
> Początkowe liczby z tego generatora są statystycznie bardzo słabe jeśli inicjuje się małą liczbą
> (np. jedynką), jest dużo zer na początku, warto odrzucić np. 100 początkowych generowań.
>
> Pozdrawiam
Mam inne wyniki. Oto wyniki w formacie dziesiętnym:
x = 1
x = (x * 79908886691 + 8143076871913) & 340282366920938463463374607431768211455 = 8222985758604
8222985758604 >> 123 = 0
x = (8222985758604 * 79908886691 + 8143076871913) & 340282366920938463463374607431768211455 = 657089637254136791211277
657089637254136791211277 >> 123 = 0
x = (657089637254136791211277 * 79908886691 + 8143076871913) & 340282366920938463463374607431768211455 = 52507301369171109219924401511286320
52507301369171109219924401511286320 >> 123 = 0
x = (52507301369171109219924401511286320 * 79908886691 + 8143076871913) & 340282366920938463463374607431768211455 = 333442790507095493699328894974793383801
333442790507095493699328894974793383801 >> 123 = 31
x = (333442790507095493699328894974793383801 * 79908886691 + 8143076871913) & 340282366920938463463374607431768211455 = 225174366013576153541971350915313012980
225174366013576153541971350915313012980 >> 123 = 21
Czyli uzyskuję:
0
0
0
31
21
I tak dalej. Jak mogą tu wychodzić inne wyniki?
Technical Details
Message-ID:
<9d144f96-4b9c-4b36-b3d3-65f57d60f94cn@googlegroups.com>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!fu-berlin.de!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mailReferences:
<6a2d60cf-5d52-4f70-a0bb-67ac51f2ea47n@googlegroups.com> <0b0e0278-0506-4691-8051-1f73a327e87an@googlegroups.com> <1aabf0e1-8c01-4479-90fc-62d1026d221cn@googlegroups.com> <fcda7316-c8b0-445b-a5d5-2c8db0e2c939n@googlegroups.com> <59524bbe-00b1-4756-b359-19bb000e8641n@googlegroups.com> <2aec1845-1ec1-4e83-835a-ccc9aa089c23n@googlegroups.com> <f201e244-08b1-4ec6-977a-40aba70eac76n@googlegroups.com> <48a87319-4f87-4ace-b9e1-e8c9842514can@googlegroups.com> <5af4b1e3-4d68-4ea8-a5cf-7d2b1075041cn@googlegroups.com> <680b4111-0c0b-4406-ae78-fc27fa1a545an@googlegroups.com> <efe0a67a-6b05-40d2-b877-e5a51f57dd9fn@googlegroups.com> <cb8e26f0-392e-4848-b573-e232e943b6f5n@googlegroups.com> <08cd0111-4022-41af-a03a-a3a4a6307ef6n@googlegroups.com> <c66ce87b-7302-4c87-813b-187c36feffd1n@googlegroups.com> <4a215489-d501-49d5-ade6-cf771ffee901n@googlegroups.com> <7ccd7613-9d6d-4d46-b68f-1db4e9d7a5e3n@googlegroups.com> <9082e2ac-cd7d-436d-80a8-7d12109d3297n@googlegroups.com> <227b1c0e-5d3c-4323-a374-de316aec2ffcn@googlegroups.com> <11f92832-5699-4cf9-be0d-412f9248f4den@googlegroups.com> <97a8c494-64a8-46c0-a17a-114d86aa94d9n@googlegroups.com> <d5976242-a26f-4b4a-93c0-49f7c056c46dn@googlegroups.com> <bf97ae93-0973-4e7d-a7dc-36e681b2479bn@googlegroups.com> <bdc239bf-9878-4a79-a5c4-e007aee2c279n@googlegroups.com> <f453f15f-4c3f-4eee-9714-850a0fb56161n@googlegroups.com> <03af61d9-e808-4daf-82b1-82e45f41372dn@googlegroups.com> <8c2590d8-1517-49f7-b95e-40e5fcaf830bn@googlegroups.com> <f341cef1-76f8-4aa4-ab18-ddf45ba038f3n@googlegroups.com> <a4f24c35-46a4-4dc4-90c0-fa9ee06ce740n@googlegroups.com> <bab05158-796a-4b3f-a52a-42659629ff42n@googlegroups.com> <268d32c4-3f2f-47cd-9544-d15a448f801cn@googlegroups.com> <c9a68c22-8a39-4c63-86e6-cb54d35bfde5n@googlegroups.com> <867ac372-f472-44ea-9346-d99449427a7fn@googlegroups.com> <a1e5bdaf-1701-420b-b2cf-f6831b771a92n@googlegroups.com> <df195a86-c889-47f3-9e9f-e2cb1828efc9n@googlegroups.com> <d2a0fb33-27b9-493e-a88c-fe2e8ec7624bn@googlegroups.com> <21f1661f-f0bc-40af-819b-67e491912f03n@googlegroups.com> <bede20ee-7292-489d-8159-c4460dd09ccdn@googlegroups.com> <1fcfa96a-47ba-4e47-8eea-f9df6a87099bn@googlegroups.com> <715772df-0454-47c9-8dba-ea9f1feb4f77n@googlegroups.com> <18a7e41b-e819-41dc-8749-f4073068d368n@googlegroups.com> <df4a2584-0ce2-4238-9ea2-611b7539a7cdn@googlegroups.com>Show Full Headers
Complete Article Headers
X-Received: by 2002:ad4:48d2:: with SMTP id v18mr32853158qvx.41.1629721899090; Mon, 23 Aug 2021 05:31:39 -0700 (PDT) X-Received: by 2002:a37:a442:: with SMTP id n63mr15023835qke.302.1629721898835; Mon, 23 Aug 2021 05:31:38 -0700 (PDT) Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!fu-berlin.de!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: pl.comp.programming Date: Mon, 23 Aug 2021 05:31:38 -0700 (PDT) In-Reply-To: <df4a2584-0ce2-4238-9ea2-611b7539a7cdn@googlegroups.com> Injection-Info: google-groups.googlegroups.com; posting-host=77.169.12.87; posting-account=5sNFBgoAAAAxlae8lv99mPyGsDs6ynwB NNTP-Posting-Host: 77.169.12.87 References: <6a2d60cf-5d52-4f70-a0bb-67ac51f2ea47n@googlegroups.com> <0b0e0278-0506-4691-8051-1f73a327e87an@googlegroups.com> <1aabf0e1-8c01-4479-90fc-62d1026d221cn@googlegroups.com> <fcda7316-c8b0-445b-a5d5-2c8db0e2c939n@googlegroups.com> <59524bbe-00b1-4756-b359-19bb000e8641n@googlegroups.com> <2aec1845-1ec1-4e83-835a-ccc9aa089c23n@googlegroups.com> <f201e244-08b1-4ec6-977a-40aba70eac76n@googlegroups.com> <48a87319-4f87-4ace-b9e1-e8c9842514can@googlegroups.com> <5af4b1e3-4d68-4ea8-a5cf-7d2b1075041cn@googlegroups.com> <680b4111-0c0b-4406-ae78-fc27fa1a545an@googlegroups.com> <efe0a67a-6b05-40d2-b877-e5a51f57dd9fn@googlegroups.com> <cb8e26f0-392e-4848-b573-e232e943b6f5n@googlegroups.com> <08cd0111-4022-41af-a03a-a3a4a6307ef6n@googlegroups.com> <c66ce87b-7302-4c87-813b-187c36feffd1n@googlegroups.com> <4a215489-d501-49d5-ade6-cf771ffee901n@googlegroups.com> <7ccd7613-9d6d-4d46-b68f-1db4e9d7a5e3n@googlegroups.com> <9082e2ac-cd7d-436d-80a8-7d12109d3297n@googlegroups.com> <227b1c0e-5d3c-4323-a374-de316aec2ffcn@googlegroups.com> <11f92832-5699-4cf9-be0d-412f9248f4den@googlegroups.com> <97a8c494-64a8-46c0-a17a-114d86aa94d9n@googlegroups.com> <d5976242-a26f-4b4a-93c0-49f7c056c46dn@googlegroups.com> <bf97ae93-0973-4e7d-a7dc-36e681b2479bn@googlegroups.com> <bdc239bf-9878-4a79-a5c4-e007aee2c279n@googlegroups.com> <f453f15f-4c3f-4eee-9714-850a0fb56161n@googlegroups.com> <03af61d9-e808-4daf-82b1-82e45f41372dn@googlegroups.com> <8c2590d8-1517-49f7-b95e-40e5fcaf830bn@googlegroups.com> <f341cef1-76f8-4aa4-ab18-ddf45ba038f3n@googlegroups.com> <a4f24c35-46a4-4dc4-90c0-fa9ee06ce740n@googlegroups.com> <bab05158-796a-4b3f-a52a-42659629ff42n@googlegroups.com> <268d32c4-3f2f-47cd-9544-d15a448f801cn@googlegroups.com> <c9a68c22-8a39-4c63-86e6-cb54d35bfde5n@googlegroups.com> <867ac372-f472-44ea-9346-d99449427a7fn@googlegroups.com> <a1e5bdaf-1701-420b-b2cf-f6831b771a92n@googlegroups.com> <df195a86-c889-47f3-9e9f-e2cb1828efc9n@googlegroups.com> <d2a0fb33-27b9-493e-a88c-fe2e8ec7624bn@googlegroups.com> <21f1661f-f0bc-40af-819b-67e491912f03n@googlegroups.com> <bede20ee-7292-489d-8159-c4460dd09ccdn@googlegroups.com> <1fcfa96a-47ba-4e47-8eea-f9df6a87099bn@googlegroups.com> <715772df-0454-47c9-8dba-ea9f1feb4f77n@googlegroups.com> <18a7e41b-e819-41dc-8749-f4073068d368n@googlegroups.com> <df4a2584-0ce2-4238-9ea2-611b7539a7cdn@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <9d144f96-4b9c-4b36-b3d3-65f57d60f94cn@googlegroups.com> Subject: Re: Jak zrobić test za pomocą PractRand? From: "osobli...@gmail.com" <osobliwy.nick@gmail.com> Injection-Date: Mon, 23 Aug 2021 12:31:39 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit