{"id":29830836,"url":"https://github.com/finite-sample/prop_male","last_synced_at":"2026-03-18T17:43:05.490Z","repository":{"id":144885768,"uuid":"375876544","full_name":"finite-sample/prop_male","owner":"finite-sample","description":"How does stopping rule matter for sex ratio?","archived":false,"fork":false,"pushed_at":"2023-06-15T02:44:30.000Z","size":43,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-29T03:34:41.440Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/finite-sample.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-11T01:54:40.000Z","updated_at":"2025-06-19T01:27:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"2ef3f4e6-d3e8-4f28-806b-56efc9ebf53a","html_url":"https://github.com/finite-sample/prop_male","commit_stats":{"total_commits":19,"total_committers":1,"mean_commits":19.0,"dds":0.0,"last_synced_commit":"3eea5ff584f3de797c0dd23cd00109b57b5242d3"},"previous_names":["finite-sample/prop_male","soodoku/prop_male"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/finite-sample/prop_male","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finite-sample%2Fprop_male","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finite-sample%2Fprop_male/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finite-sample%2Fprop_male/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finite-sample%2Fprop_male/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/finite-sample","download_url":"https://codeload.github.com/finite-sample/prop_male/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/finite-sample%2Fprop_male/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29195054,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-07T12:38:28.597Z","status":"ssl_error","status_checked_at":"2026-02-07T12:38:23.888Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-29T10:11:44.315Z","updated_at":"2026-02-07T13:31:13.084Z","avatar_url":"https://github.com/finite-sample.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"## How does the stopping rule matter for the sex ratio?\n\n1. Preference for male children, etc., doesn't affect the aggregate sex ratio\n\n    Let there be $n$ families and let the stopping rule be that after the birth of a male child, the family stops procreating. Let $p$ be the probability a male child is born and $q = 1 -p$\n\n    After 1 round:  $\\frac{pn}{n} = p$\n\n    After 2 rounds: $\\frac{(pn + qpn)}{(n + qn)} = \\frac{(p + pq)}{(1 + q)} = \\frac{p(1 + q)}{(1 + q)}$\n\n    After 3 rounds: $\\frac{(pn + qpn + q^2pn)}{(n + qn + q^2n)}$\n                    $= \\frac{(p + pq + q^2p)}{(1 + q + q^2)}$\n                    \n\n    After $k$ rounds: $\\frac{(pn + qpn + q^2pn + ... + q^kpn)}{(n + qn + q^2n + \\ldots q^kn)}$\n\n    After infinite rounds:  \n\n    Total male children $= pn + qpn + q^2pn + \\ldots$\n                        $= pn (1 + q + q^2 + \\ldots)$\n                        $= \\frac{np}{(1 - q)}$\n\n    Total children $= n + qn + q^2n + \\ldots$\n                   $= n (1 + q + q^2 + \\ldots)$\n                   $= \\frac{n}{(1 - q)}$\n\n    Prop. Male     $= \\frac{np}{(1 - q)} * \\frac{(1 - q)}{n}$\n                   $= p$\n\n    If it still seems like a counterintuitive result, here's one way to think: In each round, we get $pq^k$ successes and the total number of kids increases by $q^k$.  \n\n2. When families prefer male children but have similar preferences for family size, there is a strong negative correlation between the number of children and the proportion of male children.\n\n3. The preference for male children and the proportion of male children is weakly correlated if people have a preference of not having too many children. But if there is a preference for very large families, e.g., 15 children, the correlation can be non-negligible (though still small). \n\n4. If the preference for large families is correlated with a preference for male children, the correlation between preference for male children and the proportion of male children is yet stronger.\n\n\n### Script and Output\n\n* [Script (Rmd)](prop_men.Rmd) and [Output (md)](prop_men.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinite-sample%2Fprop_male","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffinite-sample%2Fprop_male","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinite-sample%2Fprop_male/lists"}