PRNG Analysis

go


0:0.100673
1:0.100084
2:0.099911
3:0.099538
4:0.099491
5:0.099708
6:0.100496
7:0.099969
8:0.099907
9:0.1002230:0.100008
1:0.099994
2:0.099991
3:0.100009
4:0.100003
5:0.100000
6:0.099995
7:0.099989
8:0.100012
9:0.1000010:0.000959
1:0.001000
2:0.000990
3:0.000967
4:0.001042
5:0.001017
6:0.001007
7:0.000972
8:0.001031
9:0.001011
10:0.000982
11:0.000996
12:0.001039
13:0.000981
14:0.001001
15:0.001027
16:0.000943
17:0.001042
18:0.000952
19:0.001024
20:0.001076
21:0.000966
22:0.001019
23:0.001007
24:0.001034
25:0.001011
26:0.000978
27:0.001058
28:0.000985
29:0.001004
30:0.000997
31:0.000978
32:0.000971
33:0.000988
34:0.000967
35:0.001012
36:0.001031
37:0.000910
38:0.001015
39:0.000983
40:0.001003
41:0.000993
42:0.000950
43:0.000958
44:0.001040
45:0.000993
46:0.000973
47:0.001015
48:0.000993
49:0.000967
50:0.001014
51:0.001012
52:0.000991
53:0.001005
54:0.000999
55:0.001000
56:0.000984
57:0.000994
58:0.001003
59:0.001036
60:0.000979
61:0.001036
62:0.000999
63:0.000976
64:0.001019
65:0.000978
66:0.001018
67:0.001015
68:0.000936
69:0.001004
70:0.001018
71:0.000981
72:0.000980
73:0.000956
74:0.001013
75:0.000993
76:0.001012
77:0.000987
78:0.001012
79:0.000982
80:0.000968
81:0.000947
82:0.000965
83:0.001033
84:0.001001
85:0.001040
86:0.001033
87:0.001020
88:0.001024
89:0.000962
90:0.000948
91:0.001031
92:0.001002
93:0.001054
94:0.001011
95:0.000990
96:0.000992
97:0.000998
98:0.001016
99:0.001013
100:0.001013
101:0.000960
102:0.000971
103:0.000963
104:0.001009
105:0.001083
106:0.001011
107:0.000998
108:0.000996
109:0.001032
110:0.000997
111:0.000993
112:0.000965
113:0.000917
114:0.001065
115:0.001004
116:0.000997
117:0.000991
118:0.001001
119:0.000968
120:0.000969
121:0.000969
122:0.001027
123:0.001004
124:0.001006
125:0.001025
126:0.001020
127:0.000980
128:0.001040
129:0.000962
130:0.000943
131:0.000984
132:0.001031
133:0.001007
134:0.000952
135:0.001011
136:0.001063
137:0.000998
138:0.000954
139:0.001028
140:0.000970
141:0.000996
142:0.001059
143:0.001036
144:0.001002
145:0.001041
146:0.001007
147:0.001025
148:0.000982
149:0.001028
150:0.000987
151:0.000985
152:0.001034
153:0.001029
154:0.000989
155:0.001009
156:0.000967
157:0.000983
158:0.001068
159:0.000974
160:0.001062
161:0.000958
162:0.000999
163:0.000959
164:0.001032
165:0.001029
166:0.001009
167:0.001008
168:0.001034
169:0.001076
170:0.001018
171:0.000986
172:0.001041
173:0.000959
174:0.000952
175:0.000925
176:0.001007
177:0.001012
178:0.000992
179:0.000990
180:0.001024
181:0.001022
182:0.000968
183:0.000980
184:0.000935
185:0.000996
186:0.001040
187:0.001019
188:0.000971
189:0.000945
190:0.001001
191:0.001010
192:0.001051
193:0.001038
194:0.000981
195:0.000997
196:0.000918
197:0.000977
198:0.000997
199:0.000975
200:0.001021
201:0.001003
202:0.001014
203:0.001042
204:0.001050
205:0.000963
206:0.000942
207:0.000999
208:0.001036
209:0.000991
210:0.001009
211:0.000980
212:0.001001
213:0.001019
214:0.001023
215:0.000983
216:0.001006
217:0.000995
218:0.001006
219:0.001027
220:0.000986
221:0.000968
222:0.000972
223:0.001000
224:0.001031
225:0.000997
226:0.001064
227:0.001022
228:0.000997
229:0.000963
230:0.001015
231:0.001064
232:0.001002
233:0.001030
234:0.000977
235:0.000982
236:0.001085
237:0.000983
238:0.000961
239:0.001052
240:0.001031
241:0.001027
242:0.000975
243:0.001002
244:0.000985
245:0.000990
246:0.000935
247:0.000998
248:0.000989
249:0.000961
250:0.001033
251:0.000974
252:0.001044
253:0.001001
254:0.001038
255:0.001019
256:0.001027
257:0.001008
258:0.000951
259:0.000988
260:0.000984
261:0.000990
262:0.000982
263:0.000987
264:0.000998
265:0.001001
266:0.000998
267:0.001009
268:0.001001
269:0.001071
270:0.000989
271:0.000984
272:0.001018
273:0.000952
274:0.000980
275:0.001010
276:0.001007
277:0.001008
278:0.000945
279:0.001028
280:0.000991
281:0.001021
282:0.001021
283:0.000982
284:0.000959
285:0.001067
286:0.001044
287:0.001049
288:0.001057
289:0.000999
290:0.000974
291:0.001030
292:0.000991
293:0.000989
294:0.001015
295:0.001003
296:0.000947
297:0.000990
298:0.001003
299:0.001022
300:0.000931
301:0.001013
302:0.001015
303:0.000944
304:0.000982
305:0.001009
306:0.000970
307:0.000964
308:0.000989
309:0.000983
310:0.000985
311:0.000974
312:0.001036
313:0.000980
314:0.001000
315:0.001053
316:0.001039
317:0.001011
318:0.000970
319:0.000980
320:0.000959
321:0.001012
322:0.000987
323:0.001028
324:0.001009
325:0.000961
326:0.001020
327:0.000979
328:0.000973
329:0.000951
330:0.001001
331:0.000958
332:0.001057
333:0.000989
334:0.000985
335:0.001009
336:0.001018
337:0.001023
338:0.000965
339:0.001012
340:0.000967
341:0.000996
342:0.001095
343:0.000990
344:0.000972
345:0.001039
346:0.000971
347:0.001008
348:0.000950
349:0.001050
350:0.001007
351:0.000938
352:0.000971
353:0.001067
354:0.000968
355:0.000955
356:0.001036
357:0.001047
358:0.001005
359:0.000976
360:0.001004
361:0.000980
362:0.000992
363:0.001005
364:0.001038
365:0.000991
366:0.000991
367:0.000984
368:0.000922
369:0.001005
370:0.000978
371:0.000937
372:0.001059
373:0.001023
374:0.000986
375:0.000990
376:0.000989
377:0.000971
378:0.001056
379:0.001021
380:0.000984
381:0.000914
382:0.000953
383:0.000977
384:0.000974
385:0.001005
386:0.001086
387:0.001025
388:0.000994
389:0.001004
390:0.000951
391:0.001009
392:0.001069
393:0.000956
394:0.000941
395:0.001012
396:0.001012
397:0.001032
398:0.001057
399:0.001027
400:0.000946
401:0.000995
402:0.000993
403:0.000973
404:0.000997
405:0.001052
406:0.000952
407:0.000967
408:0.001005
409:0.001006
410:0.001024
411:0.000997
412:0.000970
413:0.000985
414:0.000939
415:0.001002
416:0.001029
417:0.000994
418:0.001037
419:0.000990
420:0.001012
421:0.000998
422:0.001022
423:0.001045
424:0.000978
425:0.000973
426:0.001032
427:0.001065
428:0.000967
429:0.000972
430:0.001002
431:0.000986
432:0.001032
433:0.000996
434:0.001020
435:0.001012
436:0.001024
437:0.000999
438:0.000980
439:0.001056
440:0.001027
441:0.001013
442:0.001004
443:0.001010
444:0.000991
445:0.000988
446:0.000955
447:0.001030
448:0.000985
449:0.000981
450:0.000976
451:0.000988
452:0.000998
453:0.001013
454:0.001022
455:0.000980
456:0.001017
457:0.001003
458:0.000992
459:0.001013
460:0.000979
461:0.000983
462:0.001011
463:0.001026
464:0.000993
465:0.001031
466:0.001052
467:0.000981
468:0.001012
469:0.001080
470:0.001058
471:0.001058
472:0.000989
473:0.000998
474:0.001007
475:0.000999
476:0.001029
477:0.001023
478:0.001013
479:0.001043
480:0.001004
481:0.000993
482:0.001009
483:0.001020
484:0.001036
485:0.001008
486:0.001019
487:0.001001
488:0.000997
489:0.001058
490:0.000968
491:0.001004
492:0.000982
493:0.001006
494:0.001001
495:0.001005
496:0.001029
497:0.001017
498:0.001017
499:0.001002
500:0.001011
501:0.001061
502:0.001001
503:0.001035
504:0.000975
505:0.001038
506:0.000990
507:0.001010
508:0.001024
509:0.001042
510:0.001026
511:0.001008
512:0.001005
513:0.000951
514:0.001003
515:0.000979
516:0.000992
517:0.001003
518:0.001039
519:0.000973
520:0.001001
521:0.001005
522:0.000993
523:0.001012
524:0.000941
525:0.000973
526:0.001034
527:0.001035
528:0.001026
529:0.001029
530:0.000975
531:0.001001
532:0.000989
533:0.001017
534:0.001013
535:0.000927
536:0.000989
537:0.001004
538:0.001000
539:0.000984
540:0.000964
541:0.000986
542:0.001000
543:0.001009
544:0.001022
545:0.001042
546:0.001025
547:0.001006
548:0.001041
549:0.000958
550:0.000996
551:0.000992
552:0.001001
553:0.001022
554:0.001028
555:0.000999
556:0.000997
557:0.000982
558:0.000988
559:0.001017
560:0.000970
561:0.000979
562:0.001003
563:0.000985
564:0.001035
565:0.001008
566:0.001024
567:0.001043
568:0.001011
569:0.001008
570:0.000959
571:0.000945
572:0.001021
573:0.000974
574:0.001039
575:0.000988
576:0.000994
577:0.001014
578:0.001053
579:0.000989
580:0.001023
581:0.000991
582:0.001025
583:0.001036
584:0.000971
585:0.001023
586:0.001038
587:0.001018
588:0.001049
589:0.001025
590:0.000996
591:0.001005
592:0.000985
593:0.000950
594:0.001017
595:0.001004
596:0.001019
597:0.000994
598:0.000947
599:0.001045
600:0.000983
601:0.000975
602:0.001010
603:0.000915
604:0.000989
605:0.000973
606:0.001025
607:0.000980
608:0.000987
609:0.001008
610:0.000979
611:0.001042
612:0.001010
613:0.000924
614:0.000958
615:0.001052
616:0.000952
617:0.000998
618:0.000998
619:0.001015
620:0.000963
621:0.001026
622:0.000968
623:0.000984
624:0.000962
625:0.000971
626:0.001003
627:0.000962
628:0.000975
629:0.000988
630:0.001020
631:0.000975
632:0.000997
633:0.000990
634:0.001001
635:0.001014
636:0.000978
637:0.000988
638:0.000993
639:0.000985
640:0.000965
641:0.001020
642:0.000971
643:0.000979
644:0.000999
645:0.000993
646:0.001014
647:0.000995
648:0.000998
649:0.000975
650:0.000986
651:0.000994
652:0.001011
653:0.000946
654:0.000955
655:0.001075
656:0.000986
657:0.001031
658:0.000967
659:0.001066
660:0.001018
661:0.000985
662:0.000963
663:0.001006
664:0.000967
665:0.000969
666:0.001033
667:0.000975
668:0.000938
669:0.001024
670:0.000979
671:0.000976
672:0.000987
673:0.001004
674:0.000979
675:0.001006
676:0.000994
677:0.000988
678:0.001005
679:0.000988
680:0.001034
681:0.001021
682:0.000979
683:0.001030
684:0.000980
685:0.001034
686:0.001050
687:0.000970
688:0.001032
689:0.000989
690:0.000945
691:0.000981
692:0.000994
693:0.000957
694:0.001023
695:0.000926
696:0.000935
697:0.000986
698:0.000975
699:0.000970
700:0.000990
701:0.001015
702:0.001007
703:0.001026
704:0.000903
705:0.000918
706:0.000996
707:0.001097
708:0.001000
709:0.001015
710:0.000979
711:0.000953
712:0.001050
713:0.000989
714:0.000953
715:0.001015
716:0.001007
717:0.000951
718:0.001016
719:0.000981
720:0.001021
721:0.001049
722:0.000973
723:0.001019
724:0.001058
725:0.000974
726:0.001033
727:0.001002
728:0.000980
729:0.001015
730:0.000996
731:0.000992
732:0.000986
733:0.000992
734:0.000986
735:0.001009
736:0.001021
737:0.000953
738:0.000936
739:0.001029
740:0.001005
741:0.000997
742:0.000989
743:0.001010
744:0.001021
745:0.001035
746:0.001020
747:0.001004
748:0.000992
749:0.001018
750:0.001047
751:0.001045
752:0.001001
753:0.001036
754:0.001069
755:0.000981
756:0.001031
757:0.000989
758:0.000977
759:0.001028
760:0.001022
761:0.000988
762:0.000973
763:0.000995
764:0.000989
765:0.000966
766:0.001003
767:0.001023
768:0.000988
769:0.000982
770:0.000995
771:0.000931
772:0.000996
773:0.001008
774:0.001047
775:0.001003
776:0.000962
777:0.001046
778:0.000982
779:0.000982
780:0.001026
781:0.000994
782:0.000994
783:0.001043
784:0.000963
785:0.000993
786:0.001015
787:0.001007
788:0.001011
789:0.000996
790:0.000994
791:0.001019
792:0.001038
793:0.001071
794:0.000961
795:0.001022
796:0.001014
797:0.001001
798:0.001035
799:0.001013
800:0.000973
801:0.001025
802:0.000971
803:0.001017
804:0.000947
805:0.000981
806:0.001024
807:0.000923
808:0.001003
809:0.000996
810:0.000978
811:0.000988
812:0.000974
813:0.000965
814:0.000972
815:0.001001
816:0.001016
817:0.000955
818:0.000941
819:0.001028
820:0.001034
821:0.000998
822:0.000941
823:0.001018
824:0.001057
825:0.000997
826:0.000966
827:0.001015
828:0.000948
829:0.001004
830:0.000995
831:0.000988
832:0.000953
833:0.001035
834:0.001001
835:0.000989
836:0.001006
837:0.001001
838:0.001005
839:0.000975
840:0.001007
841:0.000941
842:0.000993
843:0.001001
844:0.000997
845:0.000975
846:0.000970
847:0.001011
848:0.001021
849:0.001012
850:0.001024
851:0.001009
852:0.001003
853:0.001027
854:0.001042
855:0.000947
856:0.001028
857:0.001063
858:0.000974
859:0.000984
860:0.001026
861:0.000963
862:0.000991
863:0.001010
864:0.000972
865:0.001013
866:0.000988
867:0.000990
868:0.000974
869:0.001011
870:0.000968
871:0.001016
872:0.000962
873:0.001017
874:0.001055
875:0.001084
876:0.000975
877:0.000981
878:0.000988
879:0.000998
880:0.000981
881:0.001033
882:0.001006
883:0.000964
884:0.000987
885:0.001048
886:0.000994
887:0.001032
888:0.000954
889:0.001022
890:0.001052
891:0.001002
892:0.001014
893:0.000965
894:0.000972
895:0.000999
896:0.000991
897:0.001001
898:0.000976
899:0.000915
900:0.000974
901:0.001007
902:0.001000
903:0.000987
904:0.000982
905:0.000962
906:0.001027
907:0.000997
908:0.000961
909:0.001036
910:0.000978
911:0.001079
912:0.000994
913:0.001003
914:0.000954
915:0.000986
916:0.001010
917:0.000992
918:0.000992
919:0.001030
920:0.000978
921:0.001026
922:0.000966
923:0.000995
924:0.001020
925:0.000977
926:0.000963
927:0.000986
928:0.001025
929:0.001003
930:0.001038
931:0.001015
932:0.001028
933:0.001017
934:0.001033
935:0.001009
936:0.000932
937:0.001001
938:0.001013
939:0.000986
940:0.000928
941:0.001014
942:0.001007
943:0.001007
944:0.000985
945:0.001025
946:0.000990
947:0.001015
948:0.000979
949:0.000983
950:0.000982
951:0.000995
952:0.001016
953:0.001024
954:0.001007
955:0.001004
956:0.000999
957:0.000964
958:0.001030
959:0.000993
960:0.001038
961:0.000995
962:0.000911
963:0.001038
964:0.001070
965:0.001048
966:0.001019
967:0.001072
968:0.000975
969:0.001007
970:0.001002
971:0.001007
972:0.001070
973:0.001045
974:0.000898
975:0.001012
976:0.001004
977:0.001021
978:0.001009
979:0.001025
980:0.001013
981:0.000974
982:0.000968
983:0.000967
984:0.000989
985:0.001028
986:0.001003
987:0.001064
988:0.001007
989:0.001038
990:0.001029
991:0.001036
992:0.001082
993:0.001014
994:0.000998
995:0.000978
996:0.000983
997:0.000994
998:0.001101
999:0.001007

package main

import (
    "math/rand"
    "strconv"
    "time"
)

func main() {
    // Set the number of random numbers to generate and the upper bound for the numbers
    n := 10
    x := 100

    // Generate N random numbers between 1 and X
    rand.Seed(time.Now().UnixNano())
    numbers := make([]int, n)
    for i := range numbers {
        numbers[i] = rand.Intn(x) + 1
    }

    // Calculate the probability of each number
    counts := make(map[int]int)
    for _, number := range numbers {
        counts[number]++
    }
    total := len(numbers)
    probabilities := make(map[int]float64)
    for number, count := range counts {
        probabilities[number] = float64(count) / float64(total)
    }

    // Generate a file name based on the values of N and X
    fileName := "go_" + strconv.Itoa(n) + "_" + strconv.Itoa(x)

    // Create the "outputs" directory if it does not exist
    err := os.MkdirAll("../outputs", 0755)
    if err != nil {
        panic(err)
    }

    // Write the probabilities to a file in the "outputs" directory
    file, err := os.Create("../outputs/" + fileName)
    if err != nil {
        panic(err)
    }
    defer file.Close()

    for number, probability := range probabilities {
        _, err := file.WriteString(strconv.Itoa(number) + "," + strconv.FormatFloat(probability, 'f', -1, 64) + "\n")
        if err != nil {
            panic(err)
        }
    }
}