{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "Human Evolution\n", "\n", "Suppose we have a population of 50 million. Suppose that we have a gene that gives you a 10% boost to your worth as a member of a community, in the sense that it increases the number of your children who survive to reproductive ager by 10%.\n", "\n" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "-16.11809565095832" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# log odds ratio for 1/10 million\n", "\n", "import numpy as np \n", "\n", "\n", "\n", "np.log(1/(10*10**6))" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "-2.3025850929940455" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# log odds ratio for 1/10\n", "\n", "np.log(1/10)" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2.302585092994046" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# log odds ratio for 9/10\n", "\n", "np.log(10)" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1149.9999999999998" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# time to go from 10% to 90%\n", "\n", "25*(4.6/.1)" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "3450.0" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "25*(13.8/.1)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.6.7" } }, "nbformat": 4, "nbformat_minor": 4 }