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