• No results found

IST 4 Information and Logic

N/A
N/A
Protected

Academic year: 2021

Share "IST 4 Information and Logic"

Copied!
92
0
0

Loading.... (view fulltext now)

Full text

(1)

IST 4

Information and Logic

(2)

HW3 will be returned today average is A

Great job!

(3)

mon tue wed thr fri

2 M1

1

9 M1

16

1 2

M2

23 PCP

30

2

M2

7

3

14

21

3 4

PCP

28

4 5

4

5

x= hw#x out x= hw#x due

Mx= MQx out Mx= MQx due

classno

oh oh

oh oh

oh oh

oh

oh

oh oh oh oh oh oh

oh oh

oh

= office hours

oh

T

= today

T oh

oh

oh

sun

oh

PCP = Programing Challenge

midterms

oh

oh oh

(4)

- Lecture 1: Life: DNA sequences and evolution - Lecture 2: Human brain: natural languages

- Lecture 3: Artificial languages: numbers and writing

(limited) memory and innovation process (artificial languages)

information systems

- Lecture 4: Languages for quantities: Babylonian mathematics

- Lecture 5: Contrast: Babylonian mathematics vs Greek mathematics - Lecture 6: Flow: Euclid to Algorizmi to Fibonacci to Leibniz

- Lecture 8:- Lecture 7: Beyond arithmetic – a language of syntax boxesLeibniz – arithmetic, reasoning – it is all about syntax!

- Lecture 9+10: Boolean Algebra - Proofs are fun!

- Lecture 13: Shannon: design, synthesis, simplicity

- Lecture 11: Boolean is a useful language: functions and syntax boxes

- Lecture 12: Shannon: from symbols to physics

- Lecture 15: Human brain: neural circuits and learning

- Lecture 14: Life: searching for a language – stochastic circuits

(5)

A relay circuit is

a physical system for syntax manipulation

Relay circuits are not the only option!

OR gate AND gate

a t b

Linear Threshold (LT) gate (deep) learning:

adjusting the weights

(6)

Circuits with Gates

functional gates – syntax boxes AON: AND, OR, Not

LT: Linear Threshold

(7)

Efficiency and complexity Feasibility

If feasible, how many

blocks are needed? Algorizm?

Questions about building blocks?

Given a set of building blocks:

What can/cannot be constructed?

(8)

AND, OR and NOT (AON)

a b

a b a

b

What is the function computed by this circuit?

longest path from input to output – counting the number of gates

total number of gates in the circuit

2

3

(9)

Every 0-1 Boolean Function Can be

Implemented Using A Depth Two AON Circuit

Implement the DNF representation: OR of many ANDs

(10)

abc

XOR(a,b,c) 000

001010 011

0 11 100 0

101110 111

10 01

XOR of 3 Variables

(11)

> > >

> >

a b c a b c a b c a b c

Depth = 2 Size = 5

is the complement

XOR of 3 Variables

(12)

How many gates in a depth-2 circuit for XOR of n variables with AON?

XOR of More Variables?

Surprisingly, this is the optimal size for depth-2

(13)

Depth-2 AON Circuit for XOR

Theorem: An optimal size depth-2 AON circuit for has gates Proof:

The construction follows from the DNF representation:

normal terms + one OR gate

The lower bound: WLOG

>

> >

>>

ab c

ab c ab c ab c

>>>> >>

>>>>

ab c

ab c ab c ab c

(i) Every AND gate must have all n inputs

(ii) Every AND gate computes a normal term DNF is a representation, hence,

there are AND gates

???

Without Loss Of

Generality??

(14)

Depth-2 AON Circuit for XOR

Proof (cont):

Need to prove: (i) Every AND gate must have all n inputs By contradiction: Assume that there is a gate G with n-1

inputs . Say x

1

is missing from G

Assume that:

Hence, the output of the circuit is 1

OR gate has input of 1 Making G=1 ?

>> >

>>

ab c

ab c ab c ab c

>>>> >>

>>>>

ab c

ab c ab c ab c

set a variable to 1

and a complement to 0 Theorem: An optimal size depth-2 AON circuit for

has gates

>

a

bc

0 1 0

1

(15)

Note that the following two assignments force the output of the circuit to be 1:

Depth-2 AON Circuit for XOR

Proof (cont):

Assume that:

Hence, the output of the circuit is 1 (OR gate has input of 1)

Contradiction!!

Q Those assignments have different parities

So what?

Theorem: An optimal size depth-2 AON circuit for

has gates

(16)

How many gates in a depth 2 circuit for XOR of n variables with AON?

It is optimal size for depth-2

n=4 , depth 2, size 9

Q: for n=4, arbitrary depth,

suggest a circuit for XOR

with size less than 9?

(17)

Size 8 AON Circuit for XOR of Four Variables

XOR(x,y,z) b

c

a XOR(x,y)

d

size 5 size 3

XOR(a,b,c,d)

Idea:

Compute a large XOR by using a circuit of small XOR gates

Arbitrary depth circuit for XOR of n variables with AON?

(18)

AON Circuit for XOR

Idea:

Compute a large XOR by using a circuit of small XOR gates

XOR 8 variables

Tree edge = wire

in-degree = 2 leaf =

input edge

node = XOR gate

(19)

Idea:

Compute a large XOR by using a circuit of small XOR gates

XOR 8 variables

Circuit size

in AON gates?

Size =

Node size X number of nodes 3 X 7 = 21

Q: Can we do better for 8 variables?

Note that we need size 129 in depth-2…

(20)

Idea: Use a larger in-degree?

9 variables

Size =

Node size X number of nodes 5 X 4 = 20

Note that we need size 21 with in-degree 2 XOR

Size 18 for 8 variables

Q: Can we do better for 8 variables?

(21)

Idea: Use a larger in-degree?

9 variables

Size =

Node size X number of nodes 5 X 4 = 20

Note that we need size 21 with in-degree 2 XOR

Size 18 for 8 variables

In general, we can prove that degree-3

XOR trees are the best! Size is

(22)

AON Constructions for XOR

circuit kind size AON, d-2

AON

optimal

not optimal n=4

9 8

lower bound:

(23)

Circuits with Gates

LT: Linear Threshold

(24)

Neuron – Neural Gate

LT: Linear Threshold

(25)

-2 1

1 0 0 0 1

1 0 1 1

-2 -1 -1 0

0 0 0 1

LT: Linear Threshold

What is the function computed by this gate?

(26)

Neural Circuits

feasibility

(27)

2 input Linear Threshold (LT) gate

Q: Are LT gates magical?

LT: Linear Threshold

(28)

Q: Are LT gates magical?

LT: Linear Threshold

Idea: A Linear Threshold is Magical

Can compute AND, OR and NOT

(29)

We showed that we can compute the AND function with an LT gate

-2 1

1 0 0 0 1

1 0 1 1

-2 -1 -1 0

0

0

0

1

(30)

Can We Compute an OR Function with an LT Gate?

-1 1

1 0 0 0 1

1 0 1 1

-1 0 0 1

0

1

1

1

(31)

Can We Compute a NOT with an LT Gate?

-2 1

Can we compute NOT

without sgn?

(32)

More Variables for AND?

Hence is an AND

(33)

More Variables for OR?

Hence is an OR

(34)

Circuits

Efficiency and complexity

(35)

The Functions of the Adder

carry

2 symbol adder c

s

d1 d2

c

sum

(36)

XOR with a Single LT Gate

Is it possible to compute with a single LT gate?

Idea: Find weights w

0

, w

1

and w

2

such that:

2 symbol adder c

s

d1 d2

c

(37)

Is it possible to compute with a single LT gate?

Answer : NO

Proof: By contradiction

assume it is possible and reach a contradiction co ntr

adict ion !!

Q

2 symbol adder c

s

d1 d2

c

XOR with a Single LT Gate

(38)

XOR with More Variables?

Is it possible to compute with a single LT gate?

Idea: suppose that it is possible, and reach a contradiction

However, And, Contradiction

2 symbol adder c

s

d1 d2

c

Need LT circuits

for XOR!

(39)

MAJ with a Single LT Gate

Is it possible to compute with a single LT gate?

|X| MAJ

0 0

1 0

2 1

3 1

2 symbol adder c

s

d1 d2

c

(40)

AND, OR, XOR and MAJ are symmetric functions

|X| AND OR XOR MAJ

0 0 0 0 0

1 0 1 1 0

2 0 1 0 1

3 1 1 1 1

LT

1

= the class of Boolean functions that can be realized by a single LT gate.

LT

1

LT

1 not

LT

1

LT

1

Q: Which symmetric functions are in LT

1

?

(41)

|X| AND OR XOR MAJ

0 0 0 0 0

1 0 1 1 0

2 0 1 0 1

3 1 1 1 1

Definition:

A symmetric Boolean function is in TH if it has at most a single transition in the symmetric function table

= a transition

Not in TH

In TH

(42)

The Class TH

(43)

The Class TH - Single Transition

|X| TH

0

TH

1

TH

2

TH

3

TH

0

TH

1

TH

2

TH

3

0 1 0 0 0 0 1 1 1

1 1 1 0 0 0 0 1 1

2 1 1 1 0 0 0 0 1

3 1 1 1 1 0 0 0 0

Q: what is |TH| ?

the number TH functions...

A: 2n+2

= a transition

(44)

Claim:

Q

0 1

Proof:

(45)

|X| TH

0

TH

1

TH

2

TH

3

TH

0

TH

1

TH

2

TH

3

0 1 0 0 0 0 1 1 1

1 1 1 0 0 0 0 1 1

2 1 1 1 0 0 0 0 1

3 1 1 1 1 0 0 0 0

The Class TH is in LT 1

Also true (wo proof): TH functions are the only

symmetric functions that can be realized by a single LT gate

(46)

AON and Linear Threshold Circuits XOR example

Need LT circuits

for XOR!

(47)

XOR of Three Variables

> > >

> >

a b c a b c a b c a b c

Depth = 2 Size = 5

Size 5 is optimal for AON depth 2

is the complement

(48)

Size 4 LT depth 2

LT gates are MORE Powerful

1 1 1

-1 -1 -1

1 1 1

1 -1

-3

1 1 1

-2

FOR XOR: Size 5 is optimal for AON depth 2

(49)

1 1 1

-1 -1 -1

1 1 1

1 -1

-3

1 1 1

-2

A

B

C

0 1 2 3

0 1 1 1

0 0 0 1

A B C

A+B+C -2+A+B+C

1

1 0 0

Can take the sgn or add 1

1 2 1 2

-1 0 -1 0

LT gates are MORE Powerful

LT-l = LT layered

inputs go to first layer only

TH functions

(50)

XOR Function: Size of LT vs AON in Depth 2

5 4

AON LT-l

*

*

* = it is optimal Exponential gap in size

(51)

5 4

AON LT-l

General construction for symmetric functions

(52)

Linear Threshold Circuits

symmetric functions

(53)

LT Depth-2 Circuits

-1 +

TH 1

TH 2 |X| TH

1

TH

2

TH

1

+TH

2

-1

0 0 1 0

1 1 1 1

2 1 0 0

???

(54)

|X| f(x)

0 0

1 1

2 1

3 0

4 0

Generalization

(55)

|X| f(x)

0 0

1 1

2 1

3 0

4 0

Generalization

(56)

|X| f(x) TH

1

0 0 0

1 1 1

2 1 1

3 0 1

4 0 1

Generalization

(57)

|X| f(x) TH

1

TH

3

0 0 0 1

1 1 1 1

2 1 1 1

3 0 1 0

4 0 1 0

Generalization

(58)

|X| f(x) TH

1

TH

3

Σ -1

0 0 0 1 0

1 1 1 1 1

2 1 1 1 1

3 0 1 0 0

4 0 1 0 0

Generalization

(59)

|X| f(x) TH

1

TH

3

Σ -1

0 0 0 1 0

1 1 1 1 1

2 1 1 1 1

3 0 1 0 0

4 0 1 0 0

(60)

-1 +

Generalization to SYM

Q: What is the generalization to arbitrary symmetric functions?

(61)

Generalization to SYM

Q: What is the generalization to arbitrary symmetric functions?

A: Consider the symmetric function table, it is a sum of non-overlapping 1-intervals

0

0 1

1

Sum of two TH functions

(62)

Back to XOR

0 1 2 3 4 5

0 1 0 1 0 1

n TH gates for XOR of n variables

(63)

LT-l Circuit Design Algorithm for SYM

0 1 2 3 4 5

1 1 0 1 1 0

f(X)

6 7

1 1

Subtract 1 for every

isolated 1-block

(64)

The Layered Construction for SYM Some History

Saburo Muroga 1925- 2009

1959

Was born in Japan

PhD in 1958 from Tokyo U, Japan

1960-1964: Researcher at IBM Research, NY

1964-2002: professor at the University of Illinois, Urbana-Champaign

Majority Decision

(65)

The brain and computation

some history...

Aristotle (2300YA) Cajal (~125 YA)

(66)
(67)

Santiago Ramón y Cajal 1852 -1934, Spain

- a neuron is of the nervous system

- neurons with each other via specialized junctions, or spaces, between cells –

The Brain is a

Neural Circuit

Nobel Prize in Physiology or Medicine in 1906

Joint with Golgi

(68)

neural circuits and logic

some more history... ~75YA

(69)

Being Homeless and

Interdisciplinary Research

Warren McCulloch

1899 - 1969 Walter Pitts 1923 - 1969 Neurophysiologist, MD

Warren McCulloch arrived in early 1942 to the University of Chicago, invited Pitts, who was homeless, to live with his family

In the evenings McCulloch and Pitts collaborated.

Pitts was familiar with the work of Leibniz on computing.

They considered the question of whether the nervous system is a kind of universal computing device as described by Leibniz

This led to their 1943 seminal neural networks paper:

A Logical Calculus of Ideas Immanent in Nervous Activity

Logician, Autodidact

(70)

Warren McCulloch

1899 - 1969 Walter Pitts 1923 - 1969 Neurophysiologist, MD

This led to their 1943 seminal neural networks paper:

A Logical Calculus of Ideas Immanent in Nervous Activity

Logician, Autodidact

Neural networks and Logic Time Memory Threshold Logic

and Learning State Machines

Impact

(71)

Neural Networks - Three Waves

194X - McCulloch and Pitts

195X - Rosenblatt (Perceptron, Learning)…

195X - Muroga (LT Circuits)…

196X - Minsky, Papert (analysis and limitations)…

198X - Hopfield (associative memories)

Rumelhart, McClelland, Hinton (learning in networks)

197X - Werbos (learning through backpropagation - networks)…

201x - ‘deep learning’

WWW, access to data, fast computation, applications…

(72)

Neural Networks - Three Waves

194X - McCulloch and Pitts

195X - Rosenblatt (Perceptron, Learning)…

195X - Muroga (LT Circuits)…

196X - Minsky, Papert (analysis and limitations)…

198X - Hopfield (associative memories)

Rumelhart, McClelland, Hinton (learning)

197X - Werbos (learning through backpropagation - networks)…

201x - ‘deep learning’

WWW, access to data, fast computation, applications…

(73)

195X - Rosenblatt (Perceptron, Learning)…

(74)

Algorithms vs Learning

(75)

What is the difference:

Learning vs Algorithms

Awareness of the solution process

No Yes

1234

1394

2628

+

(76)

Awareness of the solution process

No Yes

1234 1394 2628 +

Computers outperform humans!!!

Computers outperform humans???

Can computers

outperform the human brain?

(77)

Can computers

outperform the human brain?

By learning? algorithmically?

Awareness of the solution process

No Yes

Recent progress:

Tasks where there is

no awareness of the solution process

learning outperforms humans!

(78)

HW#5

(79)
(80)
(81)
(82)
(83)
(84)

(6,2,0,2) (4,2,2,3)

LT

1

= Can be computed by a single LT gate In LT

1

– show a construction

Not in LT

1

– show a proof

(85)

MQs

2. Entrepreneurship (Thursday 6/7)

1. Everyone has a gift! (Tuesday 6/5)

(86)

• Alyica Lee – An Insatiable Curiosity

• Joe Como - The Gift of Laughter

• Karen Guo – The Gift of a New Perspective

• Sara Fish – The Gift of Disability

• Adam Kogan – The Gift of Speech

• Emma Qian – The Gift of Alternative Modes of Mobility

Tuesday, 6/5, 2:30pm –

(87)

• LC Chen – Madam CJ Walker

• Andrew Chan – The Caltech Bubble Tea Revolution

• Noah Sock - Ralphie

• Dylan Lu - The Aquarium PC Build

• Jacob Ressler-Craig – The Iraqi Boy

• James McLaughlin – The Bitcoin Era

• George Daghlian - The Struggles of an Entrepreneur

Thursday, 6/7, 2:30pm –

(88)

Summary

(89)

How?

Teach about the historical innovation process

Process vs Snapshot

The purpose of IST4 is to impart the sensation of ideas as they are

conceived and not as they are known

(90)

Progress happens with

the introduction of new languages

DNA

spoken language written language number systems

mathematics proofs syllogism

Boolean algebra syntax boxes

relays molecular switches

AON gates neural gates

probability stochastic relays

algebra

complexity learning

evolution

synthesis analysis

abstractions algorizms

memory

abacus

brain

axioms

(91)

The appearance of life is

the first Information Megamorphosis The appearance of the human brain is the second Information Megamorphosis

What will be

the third Information Megamorphosis?

The Final Question!

(92)

References

Related documents