tag:blogger.com,1999:blog-19649274.post2000455468275436267..comments2022-12-04T19:32:24.298+05:30Comments on The Leap Blog: Small samples from big populations shouldn't bother usAjay Shahhttp://www.blogger.com/profile/03835842741008200034noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-19649274.post-46506838391722308872013-12-16T23:34:18.001+05:302013-12-16T23:34:18.001+05:30Interesting indeed! Thank you.
A couple of sugges...Interesting indeed! Thank you.<br /><br />A couple of suggestions:<br /><br />1) The script works fine with Python 3.x, but for 2.x, one might need to add the following line in the beginning so the percentage calculation in the last few lines doesn't truncate to zero:<br /><br />from __future__ import division<br /><br /><br />2) "Let us assume that there is at least a 5 percent gap in the support level of the two candidates. It can then be shown that over 99 percent of the tickets will have the name of the candidate with more support."<br /><br />This part needed a little more illustration for me. While the python script explains the details, the calculation below helped me understand it easier: Say the population size is 100 and sample size is 3. Then there are 100-choose-3 = 161700 total lists possible. If there is a 2 percent difference in support levels, 51 people favor Raghu and 49 favor Prasad. There are two main ways in which Raghu shows up as the winner in the opinion poll of 3 people:<br />1) If all 3 are drawn from the 51 voters favoring Raghu (51-choose-3 = 20825 ways of doing this)<br />2) If 2 are from the 51 voters favoring Raghu and 1 is from the 49 voters favoring Prasad (51-choose-2 * 49-choose-1 = 1275*49 = 62475 ways of doing this)<br />So, in a total of 62475+20825=83300 lists, (out of the total 161700 lists or 51.51%) Raghu appears as the winner in the opinion poll<br /><br />SKhttps://www.blogger.com/profile/00571286955954022484noreply@blogger.com