38
What should Computer Science students learn from Mathematics? Y. C. Tay Department of Mathematics Department of Computer Science National University of Singapore Proc. Asian Technology Conference in Mathematics, Singapore (Dec. 2004), 38--51. Reproduced with permission in ACM SIGACT News 36, 2 (June 2005), 131--143.

What should Computer Science students learn from Mathematics? Y. C. Tay Department of Mathematics Department of Computer Science National University of

Embed Size (px)

Citation preview

What should Computer Science students learn from Mathematics?

Y. C. Tay

Department of MathematicsDepartment of Computer ScienceNational University of Singapore

Proc. Asian Technology Conference in Mathematics, Singapore (Dec. 2004), 38--51.

Reproduced with permission in ACM SIGACT News 36, 2 (June 2005), 131--143.

What Mathematics should CS students learn?

Discrete Mathematics:– logic– sets/relations/functions– combinatorics/graphs– probability– automata/formal languages

Traditional Topics– Linear Algebra– Calculus– ...– ...– ...– Partial Differential Equations

What Mathematics should CS students learn?

Traditional Topic– Linear Algebra √ – Calculus– ...– ...– ...– Partial Differential Equations

What Mathematics should CS students learn?

Traditional Topic– Linear Algebra √ – Calculus– ...– ...– ...– Partial Differential Equations

What Mathematics should CS students learn?

Central Limit Theorem√

What Mathematics should CS students learn?

Traditional Topic– Linear Algebra √ – Calculus √ – ...– ...– ...– Partial Differential Equations ?

What should CS students learn from Mathematics?

content

to be a programmer

discipline art

notimportant

methodrigor

important

What should CS students learn from Mathematics?

content discipline art

methodrigor

Mathematics CS

definition data structure

2does 2 divide 2 ?example: Common virus trick :buffer overflows

lemma/theorem subroutine/procedure

example: { x : x >0 } contains a minimum Ariane 5 rocket explosionproof algorithm

example: if ... then ...example: one-page proof thousand-line codegcd (b, c)=d d=bx+cy

definition

What should CS students learn from Mathematics?

content

to be a programmer

discipline art

notimportant

methodrigor

important

to be a researcher

important important

What should CS students learn from Mathematics?

content discipline art

methodrigor

formalizing concepts with definitions

gaining intuition from examples

formulating conjectures to capture intuition

proving conjectures with lemmas/theorems

deriving corollaries/generalizations

how to construct a theory

What should CS students learn from Mathematics?

content discipline art

methodrigor model

Maths CS

x

y

d

d(Newton/Liebniz)

iyx (Descartes)

?

Mathematics (Hilbert)

I will then use the survey to illustrate my points so far.

Next: A survey of Computer Science

P = NP?

functions

NPP

(fast computation possible)

0

1)(nfPRIME

n is a prime

n is not a prime

0

1),( nmfFACTOR

if n has a factor d such that 1<d<m

otherwise

P = NP FACTORf P

FACTORf P P NP

PRIMEfFACTORf

P = NP?

f PRIME f FACTOR

traditional cryptography

decryption key = encryption key

(secret) (secret)

public key cryptography

decryption key encryption key

(secret) (public)

example: p q = n

primes

PRIMEf P

easy to generate p, q

FACTORf P

hard to factor n to

get secret p,q

P = NP?

f PRIME f FACTOR

Public keycryptography

security

data network

electroniccommerce

factorization

try one factor at a time slow

try all factors simultaneously fast

possible with quantum states

danger to public key cryptography

P = NP?

f PRIME f FACTOR

Public keycryptography

data

security

electroniccommerce

network

quantumphysics

modeling business data :

QS123

NA55

NA11

NA11

Aini

Shanti

Shanti

Aini

88235235

11220000

11220000

88235235

B747

A033

B747

B747

200

16

200

200

$399

$500

$211

$188

Aini

Shanti

88235235

11220000

B747

A033

200

16

QS123

NA55

NA11

B747

A033

B747

QS123

NA55

NA11

NA11

Aini

Shanti

Shanti

Aini

$399

$500

$211

$188

or

relational database ($$$)

Mathematically, table relation

P = NP?

f PRIME f FACTOR

Public keycryptography

data

security

electroniccommerce

network

relations

quantumphysics

putting business data on the web: XML

<!DOCTYPE CATALOG [<!ENTITY AUTHOR "John Doe"><!ENTITY COMPANY "JD Power Tools, Inc.">

<!ELEMENT CATALOG (PRODUCT+)>

<!ELEMENT PRODUCT (SPECIFICATIONS+,OPTIONS?,PRICE+,NOTES?)><!ATTLIST PRODUCT NAME CDATA #IMPLIED CATEGORY (HandTool|Table|Shop-Professional) "HandTool" INVENTORY (InStock|Backordered|Discontinued) "InStock">

<!ELEMENT SPECIFICATIONS (#PCDATA)><!ATTLIST SPECIFICATIONS WEIGHT CDATA #IMPLIED POWER CDATA #IMPLIED>

<!ELEMENT OPTIONS (#PCDATA)><!ATTLIST OPTIONS FINISH (Metal|Polished|Matte) "Matte" CASE (HardShell|Soft|NotApplicable) "HardShell">

<!ELEMENT PRICE (#PCDATA)><!ATTLIST PRICE WHOLESALE CDATA #IMPLIED STREET CDATA #IMPLIED SHIPPING CDATA #IMPLIED>

]>

example:

formal language:

grammar to generate XML documents

automata theory:

how to parse XML documentsXML

P = NP?

f PRIME f FACTOR

Public keycryptography

data

security

electroniccommerce

network

relations

quantumphysics

telephone traffic

good model

Internet traffic

bad model

Poisson process

fractalsXML

P = NP?

f PRIME f FACTOR

Public keycryptography

data

security

electroniccommerce

network

relations

quantumphysics

UK X Y Z China... ...

ISP ISP ISP ISP ISP

how much should Y charge for forwarding traffic?

pricing

game

ISP

profit

network

efficiency

gamesfractalsXML

P = NP?

f PRIME f FACTOR

Public keycryptography

data

security

electroniccommerce

network

relations

quantumphysics

Intel's Pentium bug (1994)x = 4195835, y = 3145727,

256

y

y

xx

specification

implementation hardwarebug

verification

= proof that gates/circuits satisfy specification

$$$

specification

implementation verification hardware

bug

gamesfractalsXML

P = NP?

f PRIME f FACTOR

Public keycryptography

data

security

electroniccommerce

network

relations

quantumphysics

computability

ComputerScience

verification

complexity

Distributed Computing:

Geographically separated computers collaborate through message exchange to achieve some global objective

Example: Power blackout

Computer that control power generators should agree on powering up sequence

possible?

complexity

ComputerScience

computability

distributedcomputing

Assume computers C1, ..., Cn

• want to reach consensus

• by exchanging messages;

• each Ck can fail and

• message delay is unbounded

Impossibility Theorem:No algorithm can guarantee fault-tolerant consensus.

relativity

fault-tolerantconsensus

distributedcomputing

complexity

ComputerScience

computability

Proof?

How to overcome Impossibility Theorem?

One way: randomized algorithms

(when stuck: toss a coin)

consensus achievable

in practice, computed by randomization (but with small error probability)

PRIMEf

power of randomization

relativity

randomizedalgorithms

fault-tolerantconsensus

distributedcomputing

complexity

ComputerScience

computability

how to toss a coin in an algorithm?

X0=2004

deterministic but “look” random

Is there a pseudo-random number generator such that

no fast algorithm can distinguish its output

from a “true” random sequence?

Yes P NP

pseudo-random number generator

Xk+1 =remainder ((1317Xk+26797)/121072)

X1=45525X2=84218X3=55891

relativity

pseudo-random number generator

randomizedalgorithms

fault-tolerantconsensus

distributedcomputing

complexity

ComputerScience

computability

another impossibility result:

0

1),( DPHALTf

if program P haltswhen run on input Dotherwise

Halting Problem:

Is there an algorithm to compute ? HALTf

Theorem: No.

pseudo-random number generator

relativity

Haltingproblem

randomizedalgorithms

fault-tolerantconsensus

distributedcomputing

complexity

ComputerScience

computability

Can aliens in another galaxy

compute

and solve fault-tolerant consensus?

HALTf

Answer: No

magic: Church-Turing Thesismagic?

relativity

universality

Haltingproblem

pseudo-random number generator

randomizedalgorithms

fault-tolerantconsensus

distributedcomputing

complexity

ComputerScience

computability

Church-Turing Thesis:

is computable (by any means)

is computable with a Turing machinef

f

thesis theorem in Mathematics law in Physics

Church-Turing Law

Science

universality

Haltingproblem

pseudo-random number generator

randomizedalgorithms

fault-tolerantconsensus

distributedcomputing

complexity

ComputerScience

computability

verification

relativity

Church-Turing Law

Science

universality

Haltingproblem

pseudo-random number generator

randomizedalgorithms

fault-tolerantconsensus

distributedcomputing

complexity

ComputerScience

computability

gamesfractalsXML

P = NP?

f PRIME f FACTOR

Public keycryptography

data

security

electroniccommerce

network

relations

quantumphysics

end of survey

What Mathematics should CS students learn?

Discrete Mathematics:– logic– sets/relations/functions– combinatorics/graphs– probability– automata/formal languages

logic

automata

graphs

formal languages

verification

Church-Turing Law

Science

universality

Haltingproblem

pseudo-random number generator

randomizedalgorithms

fault-tolerantconsensus

distributedcomputing

complexity

ComputerScience

computability

gamesfractalsXML

P = NP?

f PRIME f FACTOR

Public keycryptography

data

security

electroniccommerce

network

relations

quantumphysics relativity

combinatorics

probability

What should CS students learn from Mathematics?

content discipline art

methodrigor

to be a researcher

important important

relativity

verification

Church-Turing Law

Science

universality

Haltingproblem

pseudo-random number generator

randomizedalgorithms

fault-tolerantconsensus

distributedcomputing

complexity

ComputerScience

computability

gamesfractalsXML

P = NP?

f PRIME f FACTOR

Public keycryptography

data

security

electroniccommerce

network

relations

quantumphysicsmethod

method

method

method method

method

What should CS students learn from Mathematics?

Content Discipline Art

methodrigor model

Math CS

?

relativity

verification

Church-Turing Law

Science

universality

Haltingproblem

pseudo-random number generator

randomizedalgorithms

fault-tolerantconsensus

distributedcomputing

complexity

ComputerScience

computability

gamesfractalsXML

P = NP?

f PRIME f FACTOR

Public keycryptography

data

security

electroniccommerce

network

relations

quantumphysics

model model model model

model model

model

modelmodelmodel

P=NP?

NP = co-NP?

co-NP = PSPACE?

PSPACE = BPP?

Maybe: Complexity model is wrong?

etc.

Complexity Zoo

relativity

verification

Church-Turing Law

Science

universality

Haltingproblem

pseudo-random number generator

randomizedalgorithms

fault-tolerantconsensus

distributedcomputing

complexity

ComputerScience

computability

gamesfractalsXML

P = NP?

f PRIME f FACTOR

Public keycryptography

data

security

electroniccommerce

network

relations

quantumphysics

model model model model

model model

model

modelmodelmodel

Thank You!

What should Computer Science students learn from Mathematics?

Y. C. Tay

Department of MathematicsDepartment of Computer ScienceNational University of Singapore