SlideShare uma empresa Scribd logo
1 de 57
Class 30:
Sex, Relig
ion, and
Politics
cs1120 Fall 2011
David Evans
2 November 2011
Plan
Recap big ideas from Monday (without
  Halloweenization)
Tyson’s Science’s Endless Golden Age




                                       2
What is a problem?




                     3
Procedures vs. Problems
Procedure:                 Problem:
  a well-defined             description of an
  sequence of steps          input and desired
  that can be executed       output
  mechanically (i.e., by
  a Turing Machine)




                                                 4
Example: Factoring
  Factoring Procedure             Factoring Problem
def factors(n):               Input: a number, n, that is
 res = []                       a product of two primes
 for d in range(2, n):          numbers
   if n % d == 0:             Output: two prime
      res.append(d)             numbers, p and q, such
 return res                     that pq = n
What is the running time of    What is the time complexity
this factoring procedure?      of the factoring problem?


                                                             5
P=NP ?
P = set of all problems that can be solved by
      algorithms with running times in O(Nk)
      where N is the input size and k is any
      constant.
NP = set of all problems whose answer can be
      checked by algorithms with running times
      in O(Nk) where N is the input size and k is
      any constant.
What about factoring?
How hard is the factoring problem?
 Input: a number, n
 Output: two integers > 1, p and q, such that pq = n


How hard is the CHECK-FACTORS problem?
  Input: p, q, n (three integers, all greater than 1)
  Output: true if n = pq, false otherwise
ACM1: Beyond Cyberspace (2001)

 Neil de Grasse Tyson: "Awash in Data, Awash in Discoveries:
 Defining the Golden Age of Science“
    Rice Hall Dedication Speaker!
  Alan Kay: "The Computer Revolution Hasn't Happened Yet"
Friday,President and Disney Fellow, Walt Disney
  (Vice Nov 18, 3pm: “The Future
Belongs to the Innovators”
  Imagineering)

 Dean Kamen: "Engineering the Future Depends on Future
 Engineers" (President and Owner, DEKA Research &
 Development Corporation and Founder of FIRST)
Science’s Endless
   Golden Age
“If you’re going to use your computer to
simulate some phenomenon in the
universe, then it only becomes interesting
if you change the scale of that
phenomenon by at least a factor of 10. …
For a 3D simulation, an increase by a factor
of 10 in each of the three dimensions
increases your volume by a factor of 1000.”

    What is the asymptotic running time
    for simulating the universe?
“If you’re going to use your
computer to simulate some
phenomenon in the
universe, then it only becomes
interesting if you change the
scale of that phenomenon by at
least a factor of 10. … For a 3D
simulation, an increase by a
factor of 10 in each of the three
dimensions increases your
volume by a factor of 1000.”
Simulating the Universe
Work scales linearly with volume of
simulation: scales cubically with scale


                (n3)


                   When we double the scale of the
                   simulation, the work octuples! (Just like
                   oceanography octopi simulations)
Orders of Growth
140
                                 n3   simulating
120                                   universe

100


 80


 60


 40
                                 n2
 20
                                 n
 0
      1    2    3     4      5
Orders of Growth
1400000

                                                                 simulating
1200000
                                                                 universe

1000000


 800000


 600000


 400000


 200000


     0
          1   11   21   31   41   51   61   71   81   91   101
Orders of Growth
7E+32                                                          factors
                                                               2n
6E+32


5E+32


4E+32


3E+32


2E+32


1E+32


    0                                                           simulating
        1   11   21   31   41   51   61   71   81   91   101    universe
Astrophysics and Moore’s Law
Simulating universe is     (n 3)

Moore’s “law”: computing power
  doubles every 18 months
Dr. Tyson: to understand something
  new about the universe, need to
  scale by 10x
   How long does it take to know twice
   as much about the universe?
Knowledge of the Universe
import math

# 18 months * 2 = 12 months * 3
yearlyrate = math.pow(4, 1.0/3.0) # cube root

def simulation_work(scale):
  return scale ** 3

def knowledge_of_universe(scale):
  return math.log(scale, 10) # log base 10

def computing_power(nyears):
Knowledge of the Universe
import math

# 18 months * 2 = 12 months * 3
yearlyrate = math.pow(4, 1.0/3.0) # cube root

def simulation_work(scale):
  return scale ** 3

def knowledge_of_universe(scale):
  return math.log(scale, 10) # log base 10
                                                def computing_power(nyears):
def computing_power(nyears):                      return yearlyrate ** nyears
  if nyears == 0: return 1
  else: return yearlyrate * computing_power(nyears - 1)
Knowledge of the Universe
def computing_power(nyears):
  return yearlyrate ** nyears

def simulation_work(scale):
  return scale ** 3

def knowledge_of_universe(scale):
  return math.log(scale, 10) # log base 10

def relative_knowledge_of_universe(nyears):
  scale = 1
  while simulation_work(scale + 1) <= 1000 * computing_power(nyears):
     scale = scale + 1
  return knowledge_of_universe(scale)
While Loop
  Statement ::= while Expression: Block
                          (define (while pred body)
   x=1                      (if (pred)
x =res = 0
    1                           (begin
                                  (body)
reswhile x < 100:
    =0                            (while pred body))))
while x < 100:+ x
      res = res           (define x 1)
   resx= res + x
        =x+1              (define sum 0)
print resres
   print                  (while (lambda () (< x 100))
                              (lambda ()
                                (set! sum (+ sum x))
                                (set! x (+ x 1))))
Knowledge of the Universe
def computing_power(nyears):
  return yearlyrate ** nyears

def simulation_work(scale):
  return scale ** 3

def knowledge_of_universe(scale):
  return math.log(scale, 10) # log base 10

def relative_knowledge_of_universe(nyears):
  scale = 1
  while simulation_work(scale + 1) <= 1000 * computing_power(nyears):
     scale = scale + 1
  return knowledge_of_universe(scale)

                                             (Note: with a little bit of math, could
                                             compute this directly using a log instead.)
> >>> relative_knowledge_of_universe(0)
1.0
>>> relative_knowledge_of_universe(1)
1.0413926851582249
>>> relative_knowledge_of_universe(2)
1.1139433523068367
>>> relative_knowledge_of_universe(10)
1.6627578316815739
>>> relative_knowledge_of_universe(15)
2.0
>>> relative_knowledge_of_universe(30)
3.0064660422492313
>>> relative_knowledge_of_universe(60)
5.0137301937137719
>>> relative_knowledge_of_universe(80)
6.351644238569782

  Will there be any mystery left in the Universe when you die?
Only two things are
infinite, the universe
and human
stupidity, and I'm
not sure about the
former.
       Albert Einstein
The Endless Golden Age
Golden Age – period in which knowledge/quality
  of something improves exponentially
At any point in history, half of what is known
  about astrophysics was discovered in the
  previous 15 years!
    Moore’s law today, but other advances previously:
    telescopes, photocopiers, clocks, agriculture, etc.


   Accumulating 4% per year => doubling every 15 years!
Endless/Short Golden Ages
Endless golden age: at any point in history, the
  amount known is twice what was known 15
  years ago
  Continuous exponential growth: (kn)
     k is some constant (e.g., 1.04), n is number of years

Short golden age: knowledge doubles during a
  short, “golden” period, but only improves
  linearly most of the time
  Mostly linear growth: (n)
     n is number of years
Average Goals per Game, FIFA World Cups




                  3
                                    4
                                        5
                                            6




       2
1930
1934
1938
1950
1954
1958
1962
                                             Goal-den age




1966
1970
1974
1978
1982
1986
1990
                  passback rule




1994
               Changed goalkeeper




1998
2002
2006
2010
27
Computing Power 1969-2011
    (in Apollo Control Computer Units)
300,000,000


250,000,000


200,000,000


150,000,000


100,000,000


 50,000,000


         0
Computing Power 1969-1990
 (in Apollo Control Computer Units)
18,000

16,000

14,000

12,000

10,000

 8,000

 6,000

 4,000

 2,000

    0
               .5




                              .5




                                              .5




                                                             .5




                                                                            .5




                                                                                           .5




                                                                                                          .5
         69




                     72




                                    75




                                                    78




                                                                   81




                                                                                  84




                                                                                                 87




                                                                                                                90
              70




                          73




                                          76




                                                         79




                                                                        82




                                                                                       85




                                                                                                      88
    19




                    19




                                   19




                                                   19




                                                                  19




                                                                                 19




                                                                                                19




                                                                                                               19
          19




                         19




                                         19




                                                        19




                                                                       19




                                                                                      19




                                                                                                     19
Computing Power 2008-2050?
            450,000


            400,000



   “There’s an unwritten rule in
            350,000

   astrophysics: your computer




                                                                           30 years from now?!
            300,000
   simulation must end before you die.”
            250,000
                    Neil deGrasse Tyson

            200,000


            150,000                                                                               Human brain:
Brain simulator today (IBM Blue Brain):                                                          ~100 Billion
             100,000
10,000 neurons                                                                                   neurons
30 Million connections
              50,000                                                                             100 Trillion
                                                                                                 connections
                 0
                      2008 2011 2014 2017 2020 2023 2026 2029 2032 2035 2038 2041 2044 2047 2050


                        2011 = 1 computing unit
More Moore’s Law?
  “Any physical quantity that’s growing
                                                       Current technologies are already
  exponentially predicts a disaster, you simply
                                                       slowing down...
  can’t go beyond certain major limits.”
  Gordon Moore (2007)

       An analysis of the history of technology shows that technological change is
       exponential, contrary to the common-sense 'intuitive linear' view. So we won't
       experience 100 years of progress in the 21st century-it will be more like 20,000
       years of progress (at today’s rate). The 'returns,' such as chip speed and cost-
       effectiveness, also increase exponentially. There’s even exponential growth in
       the rate of exponential growth. Within a few decades, machine intelligence will
       surpass human intelligence, leading to the Singularity — technological change
       so rapid and profound it represents a rupture in the fabric of human history.
       The implications include the merger of biological and non-biological
       intelligence, immortal software-based humans, and ultra-high levels of
       intelligence that expand outward in the universe at the speed of light.
but advances won’t come from more transistors with                            Ray Kurzweil
current technologies...new
technologies, algorithms, parallelization, architectures,
Log scale: straight line = exponential curve!




32
The Real Golden Rule?
Why do fields like astrophysics, medicine, biology and
computer science have “endless golden ages”, but
fields like
music (1775-1825)
rock n’ roll (1962-1973)*
philosophy (400BC-350BC?)
art (1875-1925?)
soccer (1950-1966)
baseball (1925-1950?)
movies (1920-1940?)
have short golden ages?
                            * or whatever was popular when you were 16.
Golden Ages
         or
Golden Catastrophes?
PS5, Question 1e

Question 1: For each f and g pair below, argue
convincingly whether or not g is (1) O(f), (2)
Ω(f), and (3) Θ(g) …

(e)   g: the federal debt n years from today,
      f: the US population n years from today
Malthusian Catastrophe
Reverend Thomas
Robert
Malthus, Essay on
the Principle of
Population, 1798
37
Malthusian Catastrophe
“The great and unlooked for discoveries that have taken
place of late years in natural philosophy, the increasing
diffusion of general knowledge from the extension of
the art of printing, the ardent and unshackled spirit of
inquiry that prevails throughout the lettered and even
unlettered world, … have all concurred to lead many
able men into the opinion that we were touching on a
period big with the most important changes, changes
that would in some measure be decisive of the future
fate of mankind.”
Malthus’ Postulates
“I think I may fairly make two postulata.
  First, that food is necessary to the existence of
    man.
  Secondly, that the passion between the sexes
    is necessary and will remain nearly in its
    present state.
 These two laws, ever since we have had any
 knowledge of mankind, appear to have been
 fixed laws of our nature, and, as we have not
 hitherto seen any alteration in them, we have
 no right to conclude that they will ever cease to
 be what they now are…”
Malthus’ Conclusion
“Assuming then my postulata as granted, I
say, that the power of population is indefinitely
greater than the power in the earth to produce
subsistence for man.
   Population, when unchecked, increases in a
geometrical ratio. Subsistence increases only in
an arithmetical ratio. A slight acquaintance
with numbers will show the immensity of the
first power in comparison of the second.”
Malthusian Catastrophe
Population growth is geometric:  (kn) (k > 1)
Food supply growth is linear: (n)
       What does this mean as n     ?

Food per person = food supply / population
                 = (n) / (kn)
As n approaches infinity, food per person
approaches zero!
Malthus’
Fallacy?
Malthus’ Fallacy
He forgot how he started:

“The great and unlooked for discoveries that
have taken place of late years in natural
philosophy, the increasing diffusion of general
knowledge from the extension of the art of
printing, the ardent and unshackled spirit of
inquiry that prevails throughout the lettered
and even unlettered world…”
Golden Age of Food Production
Agriculture is an “endless golden age”
field: production from the same land increases
as ~ (1.02n)


  Increasing knowledge of
  farming, weather forecasting, plant
  domestication, genetic engineering, pest
  repellants, distribution
  channels, preservatives, etc.
Growing Corn




1906: < 1,000           2006: 10,000
pounds per acre         pounds per acre

                         Michael Pollan’s The Omnivore’s Dilemma
Note: Log axis!
                                   Corn Yield




                  http://www.agbioforum.org/v2n1/v2n1a10-ruttan.htm
47
Green Revolution




     Norman Borlaug (1914-2009)
“At a time when doom-sayers were hopping around saying
everyone was going to starve, Norman was working. He moved
to Mexico and lived among the people there until he figured
out how to improve the output of the farmers. So that saved a
million lives. Then he packed up his family and moved to
India, where in spite of a war with Pakistan, he managed to
introduce new wheat strains that quadrupled their food
output. So that saved another million. You get it? But he wasn't
done. He did the same thing with a new rice in China. He's
doing the same thing in Africa -- as much of Africa as he's
allowed to visit. When he won the Nobel Prize in 1970, they
said he had saved a billion people. That's BILLION! BUH! That's
Carl Sagan BILLION with a "B"! And most of them were a
different race from him. Norman is the greatest human
being, and you probably never heard of him.”
                               Penn Jillette (Penn & Teller)
Malthus was wrong about #2 Also




Advances in science (birth
control), medicine (higher life
expectancy), education, and societal
and political changes (e.g., regulation
in China) have reduced k (it is < 1 in
many countries now!)
Upcoming Malthusian Catastrophes?

Human consumption
  of fossil fuels grows
  as (kn) (fairly
  large k like 1.08?)
Available fuel is
  constant (?)

                          http://wwwwp.mext.go.jp/hakusyo/book/hpag200001/hpag200001_2_006.html
PS4, Question 1e
        g: the federal debt n years from today,
       f: the US population n years from today
Debt increases:
         Spending – Revenues
                    this varies, but usually positive
       + Interest on the previous debt (exponential)
     = (kn)
Population increase is not exponential:
rate continues to decrease
     => as n increases, debt per person approaches infinity!

 This will eventually be a problem, but growth analysis doesn’t say when.
“Cornucopian View”
Few resources are really finite
All scientific things have endless golden ages
  Knowledge accumulates
  Knowledge makes it easier to acquire more
(We hope) Human ingenuity and economics and
  politics will continue solve problems before
  they become catastrophes
    No one will sell the last gallon of gas for $3.35
“Today, of Americans
officially designated as
‘poor’, 99 percent have
electricity, running
water, flush toilets, and a
refrigerator; 95 percent have
a television, 88 percent a
telephone, 71 percent a car
and 70 percent air
conditioning. Cornelius
Vanderbilt had none of
these.”           Matt Ridley
                                54
Charles Vest’s slide idea!




                    America will
                    always do the
                    right thing
                    but only
                    after exhausting
                    all other options.
Winston Churchill
                                                        55
“Kay”-sian View

The best way to
predict the
future is to
invent it.
     — Alan Kay
Charge
When picking majors:
• Pick a short golden age field that is about to
  enter its short golden age: this requires vision
  and luck!
• Or, play it safe by picking an endless golden
  age field (CS is a good choice for this!)
Friday:
  Python Dictionaries
  History of Object-Oriented Programming

Mais conteúdo relacionado

Semelhante a Class 30: Sex, Religion, and Politics

SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docxSAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
anhlodge
 
Rpartii 131126003007-phpapp01
Rpartii 131126003007-phpapp01Rpartii 131126003007-phpapp01
Rpartii 131126003007-phpapp01
Sunil0108
 

Semelhante a Class 30: Sex, Religion, and Politics (20)

Chapter 5
Chapter 5Chapter 5
Chapter 5
 
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docxSAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
 
DeepXplore: Automated Whitebox Testing of Deep Learning
DeepXplore: Automated Whitebox Testing of Deep LearningDeepXplore: Automated Whitebox Testing of Deep Learning
DeepXplore: Automated Whitebox Testing of Deep Learning
 
Introduction to computing Processing and performance.pdf
Introduction to computing Processing and performance.pdfIntroduction to computing Processing and performance.pdf
Introduction to computing Processing and performance.pdf
 
Introduction to Neural Networks and Deep Learning from Scratch
Introduction to Neural Networks and Deep Learning from ScratchIntroduction to Neural Networks and Deep Learning from Scratch
Introduction to Neural Networks and Deep Learning from Scratch
 
Introduction to Machine Learning
Introduction to Machine LearningIntroduction to Machine Learning
Introduction to Machine Learning
 
Class 18: Measuring Cost
Class 18: Measuring CostClass 18: Measuring Cost
Class 18: Measuring Cost
 
04. Growth_Rate_AND_Asymptotic Notations_.pptx
04. Growth_Rate_AND_Asymptotic Notations_.pptx04. Growth_Rate_AND_Asymptotic Notations_.pptx
04. Growth_Rate_AND_Asymptotic Notations_.pptx
 
Binomial
BinomialBinomial
Binomial
 
R part II
R part IIR part II
R part II
 
Rpartii 131126003007-phpapp01
Rpartii 131126003007-phpapp01Rpartii 131126003007-phpapp01
Rpartii 131126003007-phpapp01
 
Chapter 1 digital design.pptx
Chapter 1 digital design.pptxChapter 1 digital design.pptx
Chapter 1 digital design.pptx
 
Variables and Statements
Variables and StatementsVariables and Statements
Variables and Statements
 
Chapter 1: Linear Regression
Chapter 1: Linear RegressionChapter 1: Linear Regression
Chapter 1: Linear Regression
 
Time complexity
Time complexityTime complexity
Time complexity
 
M112rev
M112revM112rev
M112rev
 
Binomial theorem
Binomial theorem Binomial theorem
Binomial theorem
 
Class 26: Objectifying Objects
Class 26: Objectifying ObjectsClass 26: Objectifying Objects
Class 26: Objectifying Objects
 
Management Science
Management Science Management Science
Management Science
 
The Man, The Myth, The Mandelbrot Theory
The Man, The Myth, The Mandelbrot TheoryThe Man, The Myth, The Mandelbrot Theory
The Man, The Myth, The Mandelbrot Theory
 

Mais de David Evans

Mais de David Evans (20)

Cryptocurrency Jeopardy!
Cryptocurrency Jeopardy!Cryptocurrency Jeopardy!
Cryptocurrency Jeopardy!
 
Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks
Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for CypherpunksTrick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks
Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks
 
Hidden Services, Zero Knowledge
Hidden Services, Zero KnowledgeHidden Services, Zero Knowledge
Hidden Services, Zero Knowledge
 
Anonymity in Bitcoin
Anonymity in BitcoinAnonymity in Bitcoin
Anonymity in Bitcoin
 
Midterm Confirmations
Midterm ConfirmationsMidterm Confirmations
Midterm Confirmations
 
Scripting Transactions
Scripting TransactionsScripting Transactions
Scripting Transactions
 
How to Live in Paradise
How to Live in ParadiseHow to Live in Paradise
How to Live in Paradise
 
Bitcoin Script
Bitcoin ScriptBitcoin Script
Bitcoin Script
 
Mining Economics
Mining EconomicsMining Economics
Mining Economics
 
Mining
MiningMining
Mining
 
The Blockchain
The BlockchainThe Blockchain
The Blockchain
 
Becoming More Paranoid
Becoming More ParanoidBecoming More Paranoid
Becoming More Paranoid
 
Asymmetric Key Signatures
Asymmetric Key SignaturesAsymmetric Key Signatures
Asymmetric Key Signatures
 
Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to Cryptography
 
Class 1: What is Money?
Class 1: What is Money?Class 1: What is Money?
Class 1: What is Money?
 
Multi-Party Computation for the Masses
Multi-Party Computation for the MassesMulti-Party Computation for the Masses
Multi-Party Computation for the Masses
 
Proof of Reserve
Proof of ReserveProof of Reserve
Proof of Reserve
 
Silk Road
Silk RoadSilk Road
Silk Road
 
Blooming Sidechains!
Blooming Sidechains!Blooming Sidechains!
Blooming Sidechains!
 
Useful Proofs of Work, Permacoin
Useful Proofs of Work, PermacoinUseful Proofs of Work, Permacoin
Useful Proofs of Work, Permacoin
 

Último

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Último (20)

Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 

Class 30: Sex, Religion, and Politics

  • 1. Class 30: Sex, Relig ion, and Politics cs1120 Fall 2011 David Evans 2 November 2011
  • 2. Plan Recap big ideas from Monday (without Halloweenization) Tyson’s Science’s Endless Golden Age 2
  • 3. What is a problem? 3
  • 4. Procedures vs. Problems Procedure: Problem: a well-defined description of an sequence of steps input and desired that can be executed output mechanically (i.e., by a Turing Machine) 4
  • 5. Example: Factoring Factoring Procedure Factoring Problem def factors(n): Input: a number, n, that is res = [] a product of two primes for d in range(2, n): numbers if n % d == 0: Output: two prime res.append(d) numbers, p and q, such return res that pq = n What is the running time of What is the time complexity this factoring procedure? of the factoring problem? 5
  • 6. P=NP ? P = set of all problems that can be solved by algorithms with running times in O(Nk) where N is the input size and k is any constant. NP = set of all problems whose answer can be checked by algorithms with running times in O(Nk) where N is the input size and k is any constant.
  • 7. What about factoring? How hard is the factoring problem? Input: a number, n Output: two integers > 1, p and q, such that pq = n How hard is the CHECK-FACTORS problem? Input: p, q, n (three integers, all greater than 1) Output: true if n = pq, false otherwise
  • 8. ACM1: Beyond Cyberspace (2001) Neil de Grasse Tyson: "Awash in Data, Awash in Discoveries: Defining the Golden Age of Science“ Rice Hall Dedication Speaker! Alan Kay: "The Computer Revolution Hasn't Happened Yet" Friday,President and Disney Fellow, Walt Disney (Vice Nov 18, 3pm: “The Future Belongs to the Innovators” Imagineering) Dean Kamen: "Engineering the Future Depends on Future Engineers" (President and Owner, DEKA Research & Development Corporation and Founder of FIRST)
  • 9. Science’s Endless Golden Age
  • 10. “If you’re going to use your computer to simulate some phenomenon in the universe, then it only becomes interesting if you change the scale of that phenomenon by at least a factor of 10. … For a 3D simulation, an increase by a factor of 10 in each of the three dimensions increases your volume by a factor of 1000.” What is the asymptotic running time for simulating the universe?
  • 11. “If you’re going to use your computer to simulate some phenomenon in the universe, then it only becomes interesting if you change the scale of that phenomenon by at least a factor of 10. … For a 3D simulation, an increase by a factor of 10 in each of the three dimensions increases your volume by a factor of 1000.”
  • 12. Simulating the Universe Work scales linearly with volume of simulation: scales cubically with scale (n3) When we double the scale of the simulation, the work octuples! (Just like oceanography octopi simulations)
  • 13. Orders of Growth 140 n3 simulating 120 universe 100 80 60 40 n2 20 n 0 1 2 3 4 5
  • 14. Orders of Growth 1400000 simulating 1200000 universe 1000000 800000 600000 400000 200000 0 1 11 21 31 41 51 61 71 81 91 101
  • 15. Orders of Growth 7E+32 factors 2n 6E+32 5E+32 4E+32 3E+32 2E+32 1E+32 0 simulating 1 11 21 31 41 51 61 71 81 91 101 universe
  • 16. Astrophysics and Moore’s Law Simulating universe is (n 3) Moore’s “law”: computing power doubles every 18 months Dr. Tyson: to understand something new about the universe, need to scale by 10x How long does it take to know twice as much about the universe?
  • 17. Knowledge of the Universe import math # 18 months * 2 = 12 months * 3 yearlyrate = math.pow(4, 1.0/3.0) # cube root def simulation_work(scale): return scale ** 3 def knowledge_of_universe(scale): return math.log(scale, 10) # log base 10 def computing_power(nyears):
  • 18. Knowledge of the Universe import math # 18 months * 2 = 12 months * 3 yearlyrate = math.pow(4, 1.0/3.0) # cube root def simulation_work(scale): return scale ** 3 def knowledge_of_universe(scale): return math.log(scale, 10) # log base 10 def computing_power(nyears): def computing_power(nyears): return yearlyrate ** nyears if nyears == 0: return 1 else: return yearlyrate * computing_power(nyears - 1)
  • 19. Knowledge of the Universe def computing_power(nyears): return yearlyrate ** nyears def simulation_work(scale): return scale ** 3 def knowledge_of_universe(scale): return math.log(scale, 10) # log base 10 def relative_knowledge_of_universe(nyears): scale = 1 while simulation_work(scale + 1) <= 1000 * computing_power(nyears): scale = scale + 1 return knowledge_of_universe(scale)
  • 20. While Loop Statement ::= while Expression: Block (define (while pred body) x=1 (if (pred) x =res = 0 1 (begin (body) reswhile x < 100: =0 (while pred body)))) while x < 100:+ x res = res (define x 1) resx= res + x =x+1 (define sum 0) print resres print (while (lambda () (< x 100)) (lambda () (set! sum (+ sum x)) (set! x (+ x 1))))
  • 21. Knowledge of the Universe def computing_power(nyears): return yearlyrate ** nyears def simulation_work(scale): return scale ** 3 def knowledge_of_universe(scale): return math.log(scale, 10) # log base 10 def relative_knowledge_of_universe(nyears): scale = 1 while simulation_work(scale + 1) <= 1000 * computing_power(nyears): scale = scale + 1 return knowledge_of_universe(scale) (Note: with a little bit of math, could compute this directly using a log instead.)
  • 22. > >>> relative_knowledge_of_universe(0) 1.0 >>> relative_knowledge_of_universe(1) 1.0413926851582249 >>> relative_knowledge_of_universe(2) 1.1139433523068367 >>> relative_knowledge_of_universe(10) 1.6627578316815739 >>> relative_knowledge_of_universe(15) 2.0 >>> relative_knowledge_of_universe(30) 3.0064660422492313 >>> relative_knowledge_of_universe(60) 5.0137301937137719 >>> relative_knowledge_of_universe(80) 6.351644238569782 Will there be any mystery left in the Universe when you die?
  • 23. Only two things are infinite, the universe and human stupidity, and I'm not sure about the former. Albert Einstein
  • 24. The Endless Golden Age Golden Age – period in which knowledge/quality of something improves exponentially At any point in history, half of what is known about astrophysics was discovered in the previous 15 years! Moore’s law today, but other advances previously: telescopes, photocopiers, clocks, agriculture, etc. Accumulating 4% per year => doubling every 15 years!
  • 25. Endless/Short Golden Ages Endless golden age: at any point in history, the amount known is twice what was known 15 years ago Continuous exponential growth: (kn) k is some constant (e.g., 1.04), n is number of years Short golden age: knowledge doubles during a short, “golden” period, but only improves linearly most of the time Mostly linear growth: (n) n is number of years
  • 26. Average Goals per Game, FIFA World Cups 3 4 5 6 2 1930 1934 1938 1950 1954 1958 1962 Goal-den age 1966 1970 1974 1978 1982 1986 1990 passback rule 1994 Changed goalkeeper 1998 2002 2006 2010
  • 27. 27
  • 28. Computing Power 1969-2011 (in Apollo Control Computer Units) 300,000,000 250,000,000 200,000,000 150,000,000 100,000,000 50,000,000 0
  • 29. Computing Power 1969-1990 (in Apollo Control Computer Units) 18,000 16,000 14,000 12,000 10,000 8,000 6,000 4,000 2,000 0 .5 .5 .5 .5 .5 .5 .5 69 72 75 78 81 84 87 90 70 73 76 79 82 85 88 19 19 19 19 19 19 19 19 19 19 19 19 19 19 19
  • 30. Computing Power 2008-2050? 450,000 400,000 “There’s an unwritten rule in 350,000 astrophysics: your computer 30 years from now?! 300,000 simulation must end before you die.” 250,000 Neil deGrasse Tyson 200,000 150,000 Human brain: Brain simulator today (IBM Blue Brain): ~100 Billion 100,000 10,000 neurons neurons 30 Million connections 50,000 100 Trillion connections 0 2008 2011 2014 2017 2020 2023 2026 2029 2032 2035 2038 2041 2044 2047 2050 2011 = 1 computing unit
  • 31. More Moore’s Law? “Any physical quantity that’s growing Current technologies are already exponentially predicts a disaster, you simply slowing down... can’t go beyond certain major limits.” Gordon Moore (2007) An analysis of the history of technology shows that technological change is exponential, contrary to the common-sense 'intuitive linear' view. So we won't experience 100 years of progress in the 21st century-it will be more like 20,000 years of progress (at today’s rate). The 'returns,' such as chip speed and cost- effectiveness, also increase exponentially. There’s even exponential growth in the rate of exponential growth. Within a few decades, machine intelligence will surpass human intelligence, leading to the Singularity — technological change so rapid and profound it represents a rupture in the fabric of human history. The implications include the merger of biological and non-biological intelligence, immortal software-based humans, and ultra-high levels of intelligence that expand outward in the universe at the speed of light. but advances won’t come from more transistors with Ray Kurzweil current technologies...new technologies, algorithms, parallelization, architectures,
  • 32. Log scale: straight line = exponential curve! 32
  • 33. The Real Golden Rule? Why do fields like astrophysics, medicine, biology and computer science have “endless golden ages”, but fields like music (1775-1825) rock n’ roll (1962-1973)* philosophy (400BC-350BC?) art (1875-1925?) soccer (1950-1966) baseball (1925-1950?) movies (1920-1940?) have short golden ages? * or whatever was popular when you were 16.
  • 34. Golden Ages or Golden Catastrophes?
  • 35. PS5, Question 1e Question 1: For each f and g pair below, argue convincingly whether or not g is (1) O(f), (2) Ω(f), and (3) Θ(g) … (e) g: the federal debt n years from today, f: the US population n years from today
  • 36. Malthusian Catastrophe Reverend Thomas Robert Malthus, Essay on the Principle of Population, 1798
  • 37. 37
  • 38. Malthusian Catastrophe “The great and unlooked for discoveries that have taken place of late years in natural philosophy, the increasing diffusion of general knowledge from the extension of the art of printing, the ardent and unshackled spirit of inquiry that prevails throughout the lettered and even unlettered world, … have all concurred to lead many able men into the opinion that we were touching on a period big with the most important changes, changes that would in some measure be decisive of the future fate of mankind.”
  • 39. Malthus’ Postulates “I think I may fairly make two postulata. First, that food is necessary to the existence of man. Secondly, that the passion between the sexes is necessary and will remain nearly in its present state. These two laws, ever since we have had any knowledge of mankind, appear to have been fixed laws of our nature, and, as we have not hitherto seen any alteration in them, we have no right to conclude that they will ever cease to be what they now are…”
  • 40. Malthus’ Conclusion “Assuming then my postulata as granted, I say, that the power of population is indefinitely greater than the power in the earth to produce subsistence for man. Population, when unchecked, increases in a geometrical ratio. Subsistence increases only in an arithmetical ratio. A slight acquaintance with numbers will show the immensity of the first power in comparison of the second.”
  • 41. Malthusian Catastrophe Population growth is geometric: (kn) (k > 1) Food supply growth is linear: (n) What does this mean as n ? Food per person = food supply / population = (n) / (kn) As n approaches infinity, food per person approaches zero!
  • 43. Malthus’ Fallacy He forgot how he started: “The great and unlooked for discoveries that have taken place of late years in natural philosophy, the increasing diffusion of general knowledge from the extension of the art of printing, the ardent and unshackled spirit of inquiry that prevails throughout the lettered and even unlettered world…”
  • 44. Golden Age of Food Production Agriculture is an “endless golden age” field: production from the same land increases as ~ (1.02n) Increasing knowledge of farming, weather forecasting, plant domestication, genetic engineering, pest repellants, distribution channels, preservatives, etc.
  • 45. Growing Corn 1906: < 1,000 2006: 10,000 pounds per acre pounds per acre Michael Pollan’s The Omnivore’s Dilemma
  • 46. Note: Log axis! Corn Yield http://www.agbioforum.org/v2n1/v2n1a10-ruttan.htm
  • 47. 47
  • 48. Green Revolution Norman Borlaug (1914-2009)
  • 49. “At a time when doom-sayers were hopping around saying everyone was going to starve, Norman was working. He moved to Mexico and lived among the people there until he figured out how to improve the output of the farmers. So that saved a million lives. Then he packed up his family and moved to India, where in spite of a war with Pakistan, he managed to introduce new wheat strains that quadrupled their food output. So that saved another million. You get it? But he wasn't done. He did the same thing with a new rice in China. He's doing the same thing in Africa -- as much of Africa as he's allowed to visit. When he won the Nobel Prize in 1970, they said he had saved a billion people. That's BILLION! BUH! That's Carl Sagan BILLION with a "B"! And most of them were a different race from him. Norman is the greatest human being, and you probably never heard of him.” Penn Jillette (Penn & Teller)
  • 50. Malthus was wrong about #2 Also Advances in science (birth control), medicine (higher life expectancy), education, and societal and political changes (e.g., regulation in China) have reduced k (it is < 1 in many countries now!)
  • 51. Upcoming Malthusian Catastrophes? Human consumption of fossil fuels grows as (kn) (fairly large k like 1.08?) Available fuel is constant (?) http://wwwwp.mext.go.jp/hakusyo/book/hpag200001/hpag200001_2_006.html
  • 52. PS4, Question 1e g: the federal debt n years from today, f: the US population n years from today Debt increases: Spending – Revenues this varies, but usually positive + Interest on the previous debt (exponential) = (kn) Population increase is not exponential: rate continues to decrease => as n increases, debt per person approaches infinity! This will eventually be a problem, but growth analysis doesn’t say when.
  • 53. “Cornucopian View” Few resources are really finite All scientific things have endless golden ages Knowledge accumulates Knowledge makes it easier to acquire more (We hope) Human ingenuity and economics and politics will continue solve problems before they become catastrophes No one will sell the last gallon of gas for $3.35
  • 54. “Today, of Americans officially designated as ‘poor’, 99 percent have electricity, running water, flush toilets, and a refrigerator; 95 percent have a television, 88 percent a telephone, 71 percent a car and 70 percent air conditioning. Cornelius Vanderbilt had none of these.” Matt Ridley 54
  • 55. Charles Vest’s slide idea! America will always do the right thing but only after exhausting all other options. Winston Churchill 55
  • 56. “Kay”-sian View The best way to predict the future is to invent it. — Alan Kay
  • 57. Charge When picking majors: • Pick a short golden age field that is about to enter its short golden age: this requires vision and luck! • Or, play it safe by picking an endless golden age field (CS is a good choice for this!) Friday: Python Dictionaries History of Object-Oriented Programming

Notas do Editor

  1. (define (computing-power nyears) (if (= nyears 0) 1 (* 1.587 (computing-power (- nyears 1)))));;; Simulation is (n3) work(define (simulation-work scale) (* scale scalescale)) (define (log10 x) (/ (log x) (log 10))) ;;; log is base e;;; knowledge of the universe is log10 the scale of universe ;;; we can simulate(define (knowledge-of-universe scale) (log10 scale))
  2. (define (computing-power nyears) (if (= nyears 0) 1 (* 1.587 (computing-power (- nyears 1)))));;; Simulation is (n3) work(define (simulation-work scale) (* scale scalescale)) (define (log10 x) (/ (log x) (log 10))) ;;; log is base e;;; knowledge of the universe is log10 the scale of universe ;;; we can simulate(define (knowledge-of-universe scale) (log10 scale))