{"id":19079,"date":"2016-12-12T17:27:34","date_gmt":"2016-12-12T17:27:34","guid":{"rendered":"http:\/\/www.oracletutoring.ca\/blog\/?p=19079"},"modified":"2016-12-12T17:27:55","modified_gmt":"2016-12-12T17:27:55","slug":"perl-random-numbers-but-less-random","status":"publish","type":"post","link":"https:\/\/www.oracletutoring.ca\/blog\/perl-random-numbers-but-less-random\/","title":{"rendered":"Perl:  random numbers, but less random"},"content":{"rendered":"<h1>The tutor prepares for a statistics experiment.  The first step is to generate two lists:  one random, one less so.<\/h1>\n<p>To generate fifteen random numbers with Perl one can use the following code:<\/p>\n<p style=\"font-family:monospace;font-size:120%;white-space:pre-wrap\">\nfor ($i=0;$i<15;$i++){\n\n$num=sprintf(\"%.0f\",100*rand());\n\nprint $num;\nprint \" \";\n}\n<\/p>\n<p>To generate fifteen somewhat less random numbers, one can add 5 to each output:<\/p>\n<p style=\"font-family:monospace;font-size:120%;white-space:pre-wrap\">\nfor ($i=0;$i<15;$i++){\n\n$num=sprintf(\"%.0f\",100*rand()+5);\n\nprint $num;\nprint \" \";\n}\n<\/p>\n<p>My plan is to compare these two lists, using the matched-pairs t-test (see my <a href=\"?p=19046\">post from yesterday<\/a>), to find if it can determine a difference between them.<\/p>\n<p>Source:<\/p>\n<p>McGrath, Mike.  <u>Perl in easy steps<\/u>.  Southam:  Computer Step, 2004.<\/p>\n<p>Jack of <a href=\"https:\/\/www.oracletutoring.ca\">Oracle Tutoring by Jack and Diane,<\/a> Campbell River, BC.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The tutor prepares for a statistics experiment. The first step is to generate two lists: one random, one less so. To generate fifteen random numbers with Perl one can use the following code: for ($i=0;$i<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[105,3,19],"tags":[104,2066],"class_list":["post-19079","post","type-post","status-publish","format-standard","hentry","category-computer-science","category-math","category-statistics","tag-perl","tag-random-number"],"_links":{"self":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/19079","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/comments?post=19079"}],"version-history":[{"count":17,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/19079\/revisions"}],"predecessor-version":[{"id":19096,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/posts\/19079\/revisions\/19096"}],"wp:attachment":[{"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/media?parent=19079"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/categories?post=19079"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.oracletutoring.ca\/blog\/wp-json\/wp\/v2\/tags?post=19079"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}