import random # Assume parents want boy and will continue having kids until boy # happens. Run up to total of 20 kids, pretty much the practical limit... # 1 is boy, 2 is girl maxlen=0 runs=10000 totkids = 20 odds=0 evens=0 boys=0 girls=0 for run in range(runs): allchoices= for index in range(0,totkids+1): choice=random.randint(1,2) if choice==1: # got boy. stop. allchoices.append(choice) boys=boys+1 break else: # got girl. continue allchoices.append(choice) girls=girls+1 chlen=len(allchoices) if chlen>maxlen: maxlen=chlen if chlen % 2 == 0: evens=evens+1 else: odds=odds+1 print "max len %d odds %d evens %d boys %d girls %d" % (maxlen,odds,evens,boys,girls) # endI've also placed it in this little zip. Note: This doesn't apply to the Chinese one-child-policy situation where parents were KILLING or aborting all girls to end up with one boy. In that case you don't need algorithms to see that the result will be heavy on boys.
Polistra was named after the original townsite of Manhattan (the one in Kansas). When I was growing up in Manhattan, I spent a lot of time exploring by foot, bike, and car. I discovered the ruins of an old mill along Wildcat Creek, and decided (inaccurately) that it was the remains of the original site of Polistra. Accurate or not, I've always liked the name, with its echoes of Poland (an under-appreciated friend of freedom) and stars. ==== The title icon is explained here. ==== Switchover: This 2007 entry marks a sharp change in worldview from neocon to pure populist. ===== The long illustrated story of Polistra's Dream is a time-travel fable, attempting to answer the dangerous revision of New Deal history propagated by Amity Shlaes. The Dream has 8 episodes, linked in a chain from the first. This entry explains the Shlaes connection.