Skip to content

Instantly share code, notes, and snippets.

@3735943886
Created April 4, 2019 01:55
Show Gist options
  • Save 3735943886/c3cd83fa1867e2b6f227d16e2f632200 to your computer and use it in GitHub Desktop.
Save 3735943886/c3cd83fa1867e2b6f227d16e2f632200 to your computer and use it in GitHub Desktop.
Sex ratio calculation
from random import random
CONST_FAMILIES = 65536
CONST_GENERATIONS = 100
CONST_NATURAL_RATIO = 0.5
# User input data
A1 = input('How many families are there? (default ' + str(CONST_FAMILIES) + ')')
A2 = input('How many children will one family have? (default ' + str(CONST_GENERATIONS) + ')')
# Data processing
try:
families = int(A1)
except:
families = CONST_FAMILIES
try:
generations = int(A2)
except:
generations = CONST_GENERATIONS
# Total number of boys and girls
totalboys = 0
totalgirls = 0
# Loop
for i in range(0, generations):
# Number of boys in current generations
boys = 0
for j in range(0, families):
childsex = int(random() + CONST_NATURAL_RATIO)
boys += childsex
print('{0} - total {1}, M/F ratio : {2}/{3}'.format(i + 1, families, boys, families - boys))
totalboys += boys
totalgirls += families - boys
# Only families who gave birth a boy will be calculated next loop
families = boys
if(boys == 0):
break
print('total children : {0}, boys : {1}, girls {2}'.format(totalboys + totalgirls, totalboys, totalgirls))
@maksimkapromax-gif
Copy link

Hi guys, I'm looking for a good dating site where I can meet serious people. Does anyone have any recommendations?

@bybyslan
Copy link

I tried one recently, but it was more about fun than serious relationships. Maybe you should try paid platforms?

@maksimkapromax-gif
Copy link

I've heard that it's better to choose sites with profile verification to avoid fakes. It's a bit more expensive, but it's more reliable.

@bybyslan
Copy link

I agree, quality service is important. I think you should study the reviews and see where there are more positive experiences.

@MkRezz21
Copy link

Hey, ever had one of those nights where you're just bored and want some excitement? That was me a few weeks ago. I kept seeing people talk about www.flirtini.com/local.html, so I gave it a go. I was expecting endless small talk, but nope—people here actually know what they want. Matched with someone who had the same energy, and let’s just say, that night was anything but boring.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment