comparison org/man-years.org @ 4:6842199d5e26

update to clojure 1.4
author Robert McIntyre <rlm@mit.edu>
date Mon, 30 Apr 2012 03:23:12 -0500
parents 44f31e2126fa
children 66396e76dab9
comparison
equal deleted inserted replaced
3:44f31e2126fa 4:6842199d5e26
3 #+email: rlm@mit.edu 3 #+email: rlm@mit.edu
4 #+description: How many man-years are in a year? 4 #+description: How many man-years are in a year?
5 #+keywords: man-year man-month man-hour universe human experience philosophy 5 #+keywords: man-year man-month man-hour universe human experience philosophy
6 #+setupfile: ../../aurellem/org/setup.org 6 #+setupfile: ../../aurellem/org/setup.org
7 #+include: ../../aurellem/org/level-0.org 7 #+include: ../../aurellem/org/level-0.org
8 #+babel: :results output :exports both
9 8
10 * What is a Man-Hour? 9 * What is a Man-Hour?
11
12 A [[http://en.wikipedia.org/wiki/Man-hour][/Man-Hour/]] is a term from the field of Management. It is one hour 10 A [[http://en.wikipedia.org/wiki/Man-hour][/Man-Hour/]] is a term from the field of Management. It is one hour
13 of work by one person for a certain task. 11 of work by one person for a certain task.
14 12
15 For example, if I have a nine-to-five programming job at Initrode, but 13 For example, if I have a nine-to-five programming job at [[http://www.imdb.com/title/tt0151804/quotes][Initrode]], but
16 I slack off most of the time and only /actually/ work from 14 I slack off most of the time and only /actually/ work from
17 10:00-11:00, then I only put in one man-hour of work a day. 15 10:00-11:00, then I only put in one man-hour of work a day.
18 16
19 If my task is simply existing, then I put in 24 man-hours of work 17 If my task is simply existing, then I put in 24 man-hours of work
20 every day. 18 every day.
21 19
22
23 * Experience 20 * Experience
24
25 I've often wondered what it would feel like to have more than one 21 I've often wondered what it would feel like to have more than one
26 body, and to experience the same day from different perspectives. 22 body, and to experience the same day from different perspectives.
27 23
28 For example, there are around twenty different majors available at 24 For example, there are around twenty different majors available at
29 MIT. If you had ten different bodies, and each of them double-majored 25 MIT. If you had ten different bodies, and each of them double-majored
38 34
39 One person could help lay the first blocks of [[http://en.wikipedia.org/wiki/Great_Pyramid_of_Giza][great Pharaoh Khufu's 35 One person could help lay the first blocks of [[http://en.wikipedia.org/wiki/Great_Pyramid_of_Giza][great Pharaoh Khufu's
40 tomb]] and live to see [[http://www.burjkhalifa.ae/][Burj Khalifa]] and they would accrue the same 36 tomb]] and live to see [[http://www.burjkhalifa.ae/][Burj Khalifa]] and they would accrue the same
41 amount of experience as the MIT class of '82 did in one year. 37 amount of experience as the MIT class of '82 did in one year.
42 38
43
44 * Forever in a Day 39 * Forever in a Day
45
46 How many man-years does everyone experience in a day? There are almost 40 How many man-years does everyone experience in a day? There are almost
47 7 billion people around today, according to [[http://www.census.gov/main/www/popclock.html][www.census.gov]]. 41 7 billion people around today, according to [[http://www.census.gov/main/www/popclock.html][www.census.gov]].
48 42
49 #+begin_src clojure 43 #+begin_src clojure :results output :exports both
50 (ns lifespan) 44 (ns lifespan)
51 (use '[clojure.contrib [pprint :only [cl-format]]]) 45 (use '[clojure [pprint :only [cl-format]]])
52 46
53 (cl-format *out* "Man-years per day: \n ~R" 47 (cl-format *out* "Man-years per day: \n ~R"
54 (* 6969492979 ;; people on Earth 48 (* 6969492979 ;; people on Earth
55 (/ 1 365) ;; years-per-day 49 (/ 1 365) ;; years-per-day
56 )) 50 ))
63 Together, we experience almost 20 million years every day! 57 Together, we experience almost 20 million years every day!
64 58
65 A week in the lives of the people of Earth is enough to reach back to 59 A week in the lives of the people of Earth is enough to reach back to
66 the age of the dinosaurs. 60 the age of the dinosaurs.
67 61
68
69 * The Infinite Stories of Humanity 62 * The Infinite Stories of Humanity
70
71 How many man-years is the sum total of human experience? That is, how 63 How many man-years is the sum total of human experience? That is, how
72 many man-years has every human who has ever lived experienced? 64 many man-years has every human who has ever lived experienced?
73 65
74 Using a very rough calculation involving the table from [[http://www.prb.org/Articles/2002/HowManyPeopleHaveEverLivedonEarth.aspx][here]] and the 66 Using a very rough calculation involving the table from [[http://www.prb.org/Articles/2002/HowManyPeopleHaveEverLivedonEarth.aspx][here]] and the
75 average human lifespans through the ages found [[http://en.wikipedia.org/wiki/Life_expectancy][here]], I get the 67 average human lifespans through the ages found [[http://en.wikipedia.org/wiki/Life_expectancy][here]], I get the
76 following: 68 following:
77 69
78 #+begin_src clojure 70 #+begin_src clojure :results output :exports both
79 (in-ns 'lifespan) 71 (in-ns 'lifespan)
80 (use '[clojure.contrib [def :only [defvar]]])
81 72
82 (defvar 73 (def
83 time-periods 74 time-periods
75 "The time periods under question.
76 'start' here is taken to be 50,000BC"
84 [:start-8000BC 77 [:start-8000BC
85 :8000BC-1 78 :8000BC-1
86 :1-1200 79 :1-1200
87 :1200-1650 80 :1200-1650
88 :1650-1750 81 :1650-1750
89 :1750-1850 82 :1750-1850
90 :1850-1900 83 :1850-1900
91 :1900-1950 84 :1900-1950
92 :1950-1995 85 :1950-1995
93 :1995-2011] 86 :1995-2011])
94 "The time periods under question.
95 'start' here is taken to be 50,000BC")
96 87
97 (defvar births 88 (def births
89 "number of people who existed in the given time periods"
98 (zipmap 90 (zipmap
99 time-periods 91 time-periods
100 [ 1137789769 ;; \ 92 [ 1137789769 ;; \
101 46025332354 ;; | 93 46025332354 ;; |
102 26591343000 ;; | 94 26591343000 ;; |
103 12782002453 ;; | 95 12782002453 ;; |
104 3171931513 ;; | -- from the video at: 96 3171931513 ;; | -- from the video at:
105 4046240009 ;; | http://www.prb.org/Articles/2002/ 97 4046240009 ;; | http://www.prb.org/Articles/2002/
106 2900237856 ;; | HowManyPeopleHaveEverLivedonEarth.aspx 98 2900237856 ;; | HowManyPeopleHaveEverLivedonEarth.aspx
107 3390198215 ;; | 99 3390198215 ;; |
108 5427305000 ;; | 100 5427305000 ;; |
109 2130327622]);; / 101 2130327622]));; /
110 "number of people who existed in the given time periods") 102
111 103
112 ;; Confirm that the sum of people agrees with that in the video. 104 ;; Confirm that the sum of people agrees with that in the video.
113 (assert (= 107602707791 (reduce + (vals births)))) 105 (assert (= 107602707791 (reduce + (vals births))))
114 106
115 (defvar lifespans 107 (def lifespans
108 "lifespans in years from birth for the various time periods"
116 (zipmap 109 (zipmap
117 time-periods 110 time-periods
118 [33 ;; start-8000BC \ 111 [33 ;; start-8000BC \
119 22 ;; 8000BC-1 | -- from: 112 22 ;; 8000BC-1 | -- from:
120 30 ;; 1-1200 | http://en.wikipedia.org/wiki/ 113 30 ;; 1-1200 | http://en.wikipedia.org/wiki/
125 66 ;; 1900-1950 | Ke-Ma/Life-Expectancy.html 118 66 ;; 1900-1950 | Ke-Ma/Life-Expectancy.html
126 66 ;; 1950-1995 / 119 66 ;; 1950-1995 /
127 70 ;; 1995-2011-------> form: 120 70 ;; 1995-2011-------> form:
128 ;; http://www.prb.org/DataFinder/Topic/ 121 ;; http://www.prb.org/DataFinder/Topic/
129 ;; Rankings.aspx?ind=6&loc=241 122 ;; Rankings.aspx?ind=6&loc=241
130 ]) 123 ]))
131 "lifespans in years from birth for the various time periods")
132 124
133 125
134 126 ;;; ----------------------------------------
135 127 ;;; And now for the result!
136 128
137 ;; This section is just here to make the result look pretty. 129 ;; This section is just here to make the result look pretty.
138 (dorun 130 (dorun
139 (map println 131 (map println
140 (clojure.contrib.string/split 132 (clojure.string/split
141 #","
142 (cl-format 133 (cl-format
143 nil "years of human experience: \n ~R years" 134 nil "years of human experience: \n ~R years"
144 ;; Multiply each time-period's total number of people 135 ;; Multiply each time-period's total number of people
145 ;; by those people's average lifespan in years to get 136 ;; by those peoples' average lifespan in years to get
146 ;; the total number of man-years experienced during 137 ;; the total number of man-years experienced during
147 ;; that period, then add them together. 138 ;; that period, then add them together.
148 (reduce + 139 (reduce +
149 (map * 140 (map *
150 (map births time-periods) 141 (map births time-periods)
151 (map lifespans time-periods))))))) 142 (map lifespans time-periods))))
143 #",")))
152 144
153 #+end_src 145 #+end_src
154 146
155 #+results: 147 #+results:
156 : years of human experience: 148 : years of human experience:
158 : three hundred seventy-one billion 150 : three hundred seventy-one billion
159 : ninety-three million 151 : ninety-three million
160 : five hundred ninety-five thousand 152 : five hundred ninety-five thousand
161 : one hundred eighty-one years 153 : one hundred eighty-one years
162 154
163 155 Humans have already collectively lived about two-hundred times longer
164 156 than the age of the universe.
165 Humans have already collectively lived far longer than the age of the
166 universe.