# HG changeset patch # User Robert McIntyre # Date 1335774192 18000 # Node ID 6842199d5e26fb1849ad956363412b34ca2e8688 # Parent 44f31e2126fae69d3692cc2d18dd43db63318c0d update to clojure 1.4 diff -r 44f31e2126fa -r 6842199d5e26 org/man-years.org --- a/org/man-years.org Thu Oct 20 07:35:52 2011 -0700 +++ b/org/man-years.org Mon Apr 30 03:23:12 2012 -0500 @@ -5,23 +5,19 @@ #+keywords: man-year man-month man-hour universe human experience philosophy #+setupfile: ../../aurellem/org/setup.org #+include: ../../aurellem/org/level-0.org -#+babel: :results output :exports both * What is a Man-Hour? - A [[http://en.wikipedia.org/wiki/Man-hour][/Man-Hour/]] is a term from the field of Management. It is one hour of work by one person for a certain task. -For example, if I have a nine-to-five programming job at Initrode, but +For example, if I have a nine-to-five programming job at [[http://www.imdb.com/title/tt0151804/quotes][Initrode]], but I slack off most of the time and only /actually/ work from 10:00-11:00, then I only put in one man-hour of work a day. If my task is simply existing, then I put in 24 man-hours of work every day. - * Experience - I've often wondered what it would feel like to have more than one body, and to experience the same day from different perspectives. @@ -40,15 +36,13 @@ tomb]] and live to see [[http://www.burjkhalifa.ae/][Burj Khalifa]] and they would accrue the same amount of experience as the MIT class of '82 did in one year. - * Forever in a Day - How many man-years does everyone experience in a day? There are almost 7 billion people around today, according to [[http://www.census.gov/main/www/popclock.html][www.census.gov]]. -#+begin_src clojure +#+begin_src clojure :results output :exports both (ns lifespan) -(use '[clojure.contrib [pprint :only [cl-format]]]) +(use '[clojure [pprint :only [cl-format]]]) (cl-format *out* "Man-years per day: \n ~R" (* 6969492979 ;; people on Earth @@ -65,9 +59,7 @@ A week in the lives of the people of Earth is enough to reach back to the age of the dinosaurs. - * The Infinite Stories of Humanity - How many man-years is the sum total of human experience? That is, how many man-years has every human who has ever lived experienced? @@ -75,12 +67,13 @@ average human lifespans through the ages found [[http://en.wikipedia.org/wiki/Life_expectancy][here]], I get the following: -#+begin_src clojure +#+begin_src clojure :results output :exports both (in-ns 'lifespan) -(use '[clojure.contrib [def :only [defvar]]]) -(defvar +(def time-periods + "The time periods under question. + 'start' here is taken to be 50,000BC" [:start-8000BC :8000BC-1 :1-1200 @@ -90,29 +83,29 @@ :1850-1900 :1900-1950 :1950-1995 - :1995-2011] - "The time periods under question. - 'start' here is taken to be 50,000BC") + :1995-2011]) -(defvar births +(def births + "number of people who existed in the given time periods" (zipmap time-periods [ 1137789769 ;; \ 46025332354 ;; | 26591343000 ;; | 12782002453 ;; | - 3171931513 ;; | -- from the video at: - 4046240009 ;; | http://www.prb.org/Articles/2002/ - 2900237856 ;; | HowManyPeopleHaveEverLivedonEarth.aspx - 3390198215 ;; | - 5427305000 ;; | - 2130327622]);; / - "number of people who existed in the given time periods") + 3171931513 ;; | -- from the video at: + 4046240009 ;; | http://www.prb.org/Articles/2002/ + 2900237856 ;; | HowManyPeopleHaveEverLivedonEarth.aspx + 3390198215 ;; | + 5427305000 ;; | + 2130327622]));; / + ;; Confirm that the sum of people agrees with that in the video. (assert (= 107602707791 (reduce + (vals births)))) -(defvar lifespans +(def lifespans + "lifespans in years from birth for the various time periods" (zipmap time-periods [33 ;; start-8000BC \ @@ -127,28 +120,27 @@ 70 ;; 1995-2011-------> form: ;; http://www.prb.org/DataFinder/Topic/ ;; Rankings.aspx?ind=6&loc=241 - ]) - "lifespans in years from birth for the various time periods") + ])) - - +;;; ---------------------------------------- +;;; And now for the result! ;; This section is just here to make the result look pretty. (dorun (map println - (clojure.contrib.string/split - #"," + (clojure.string/split (cl-format nil "years of human experience: \n ~R years" -;; Multiply each time-period's total number of people -;; by those people's average lifespan in years to get -;; the total number of man-years experienced during -;; that period, then add them together. + ;; Multiply each time-period's total number of people + ;; by those peoples' average lifespan in years to get + ;; the total number of man-years experienced during + ;; that period, then add them together. (reduce + (map * (map births time-periods) - (map lifespans time-periods))))))) + (map lifespans time-periods)))) + #","))) #+end_src @@ -160,7 +152,5 @@ : five hundred ninety-five thousand : one hundred eighty-one years - - -Humans have already collectively lived far longer than the age of the -universe. +Humans have already collectively lived about two-hundred times longer +than the age of the universe.