{"id":85,"date":"2007-03-20T21:05:18","date_gmt":"2007-03-21T02:05:18","guid":{"rendered":"http:\/\/raffy.ch\/blog\/2007\/03\/20\/not-so-random-numbers\/"},"modified":"2007-03-20T21:07:22","modified_gmt":"2007-03-21T02:07:22","slug":"not-so-random-numbers","status":"publish","type":"post","link":"https:\/\/raffy.ch\/blog\/2007\/03\/20\/not-so-random-numbers\/","title":{"rendered":"Not so Random Numbers"},"content":{"rendered":"<p>In cryptography or science in general, you often need perfect random numbers. Well, up to today, that was my need as well. However, today I was trying to generate numbers that are not too random, but have a certain bias. I think it&#8217;s kind of ironic. Googling for a solution is almost impossible. Every link shows a perfect random number generator \ud83d\ude09<\/p>\n<p>I don&#8217;t care what the bias is in the numbers that are generated. Actually, the bias can be pretty high. Anyone have a method to do this in Perl?<\/p>\n<p>Can you do something like int(rand($upperLimit*1000)) % 1000 ??? Basically changing the interval from where the random number is taken and then shrinking it again?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In cryptography or science in general, you often need perfect random numbers. Well, up to today, that was my need as well. However, today I was trying to generate numbers that are not too random, but have a certain bias. I think it&#8217;s kind of ironic. Googling for a solution is almost impossible. Every link [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-85","post","type-post","status-publish","format-standard","hentry","category-unix-scripting"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/posts\/85","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/comments?post=85"}],"version-history":[{"count":0,"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/posts\/85\/revisions"}],"wp:attachment":[{"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/media?parent=85"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/categories?post=85"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raffy.ch\/blog\/wp-json\/wp\/v2\/tags?post=85"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}