Foundations of Computing Professor Steve Schneider 30BB02 Course - - PowerPoint PPT Presentation

foundations of computing
SMART_READER_LITE
LIVE PREVIEW

Foundations of Computing Professor Steve Schneider 30BB02 Course - - PowerPoint PPT Presentation

Foundations of Computing Professor Steve Schneider 30BB02 Course Structure Two lectures per week One tutorial per week (exercise sheets) Mathematics Surgeries: Room 44BB02, Wednesdays 10am. Course material posted on CS189


slide-1
SLIDE 1

Foundations of Computing

Professor Steve Schneider 30BB02

slide-2
SLIDE 2

Course Structure

Two lectures per week One tutorial per week (exercise sheets) Mathematics Surgeries:

Room 44BB02, Wednesdays 10am.

Course material posted on CS189 website. Assessment: Entirely by examination. Everything covered in lectures and tutorials is

examinable.

slide-3
SLIDE 3

Course Structure

Monday 3pm: lecture Wednesday 9am: lecture (not week 1) Tuesday 2pm: tutorial (not weeks 1, 2, or 4. I n

week 4, the tutorial will be on Wednesday)

to go through the previous week’s exercise sheet. Bring your solution to the previous week’s exercise sheet; it will be

  • marked. Marks do not count towards the final assessment.

Office hours: Monday 4pm and Wednesday 10am.

Sign up for an appointment.

Maths surgery: Wednesday 10am in 44BB02

slide-4
SLIDE 4

Foundations of Computing Course Content

Set theory

Sets, relations, functions

Logic

Propositions, truth tables, logical reasoning,

predicates

The Z notation

Use of logic and set theory in specification

Number representations

Representation of values in a computer Dr Roger Peel – weeks 11 and 12

slide-5
SLIDE 5

Recommended texts

E Currie: The Essence of Z,

Prentice Hall, (1999), ISBN 0-13-749839-X

R Haggarty: Discrete Mathematics for Computing,

Pearson Education, (2002), ISBN 0-201-73047-2L

Bottaci & J Jones: Formal Specification Using Z.

Thompson, (1995), ISBN 1-850-32109-4

slide-6
SLIDE 6

Other background texts

Ben Potter, Jane Sinclair, David Till: An Introduction to

Formal Specification and Z, (Prentice Hall) ISBN 0-13-242207-7

Mike McMorran, Steve Powell: Z Guide for Beginners,

(Blackwell) ISBN 0-632-03117-4

Jim Woodcock and Jim Davies: Using Z, Specification and

Refinement, (Prentice Hall) ISBN 0-13-948472-8

Keith Devlin: Sets Functions and Logic (Chapman Hall), ISBN

1-5848-8449-5

Keith Hirst: Numbers Sequences and Series, (Edward Arnold)

ISBN 0-340-61043—3

Judith Gersting: Mathematical Structures for Computer

Science, (Freeman) ISBN 0-7167-8306-1

Daniel Velleman: How to prove it, (Cambridge University

Press) ISBN 0-521-44116-1

slide-7
SLIDE 7

Using the voting handset

Do not press this button or you will not be able to vote To vote, press

  • ne of these

buttons FIRMLY and watch the small light (goes green on successful vote) Note: you can

  • nly vote when

the green ‘polling

  • pen’ indicator is

projected in the top-right of the screen

Sim ulation only

slide-8
SLIDE 8

Did you have breakfast today?

Y e s N

  • D
  • n

’ t k n

  • w

0% 0% 0%

1.

Yes

2.

No

3.

Don’t know

0 of 5

slide-9
SLIDE 9

Are you familiar with sets and logic?

Y e s , v e r y A l i t t l e N

  • t

a t a l l

0% 0% 0%

1.

Yes, very

2.

A little

3.

Not at all

slide-10
SLIDE 10

Do you know about truth tables?

Y e s I d i d , b u t I ’ v e f

  • r

g

  • t

. . . N

  • 0%

0% 0%

1.

Yes

2.

I did, but I’ve forgotten them

3.

No

slide-11
SLIDE 11

Do you know about power sets and cartesian products?

Y e s I d i d , b u t I c

  • u

l d d

  • w

i . . N e v e r h e a r d

  • f

t h e m

33% 33% 33%

1.

Yes

2.

I did, but I could do with some revision

3.

Never heard of them

slide-12
SLIDE 12

Do you know about Karnaugh maps?

Y e s N

  • 0%

0%

1.

Yes

2.

No

slide-13
SLIDE 13

Have you come across boolean algebra?

Y e s N

  • 0%

0%

1.

Yes

2.

No

slide-14
SLIDE 14

Motivation

Logic is the foundation of computing. The ability to think and reason logically

is essential in Computing.

Humans are not always very good at

thinking logically.

Thus: formal and systematic ways of

handling logic are necessary.

slide-15
SLIDE 15

This lecture

Some exercises and discussion in logical

thinking.

slide-16
SLIDE 16

Example 1: quality control

You work in quality control at a games

manufacturer.

A game contains cards with letters on

  • ne side and numbers on the other.

They must be printed according to the

rule: If one side has a vowel, the other side must have an even number

slide-17
SLIDE 17

Example 1: quality control

You have 4 cards in front of you. Which

cards do you need to turn over to check the rule is being followed? If one side has a vowel, the other side must have an even number

A B C D

slide-18
SLIDE 18

Which cards do you need to turn

  • ver to check the rule is being

followed?

A C A a n d B A a n d C A a n d D B a n d C A , C a n d D A , B , C , a n d D S

  • m

e

  • t

h e r c

  • m

b i n a t i

  • n

0% 0% 0% 0% 0% 0% 0% 0% 0%

1.

A

2.

C

3.

A and B

4.

A and C

5.

A and D

6.

B and C

7.

A, C and D

8.

A, B, C, and D

9.

Some other combination

slide-19
SLIDE 19

Example 2: law enforcement

You work in law enforcement. A law states that anyone buying alcohol

in a bar should be at least 18 years old.

slide-20
SLIDE 20

Example 2: law enforcement

You have 4 customers in front of you. You can question up to 2 of them.

A: buying a beer B: buying a coke C: a 21 year old D: a 17 year old

slide-21
SLIDE 21

Which customers should you question to check the rule is being followed?

A B C D A a n d B A a n d C A a n d D B a n d C

0% 0% 0% 0% 0% 0% 0% 0%

1.

A

2.

B

3.

C

4.

D

5.

A and B

6.

A and C

7.

A and D

8.

B and C

slide-22
SLIDE 22

Logical structure

What can we say about the logical

structure of examples 1 and 2?

slide-23
SLIDE 23

Example 3: genealogy

You are trying to trace your great-

great-grandfather and you are looking through the records at the Family Records Office.

You have spoken to Aunt Gladys and

Uncle Alan

Your sister has spoken to Grandma

slide-24
SLIDE 24

Example 3: genealogy Aunt Gladys and Uncle Alan

Aunt Gladys: He was born in Halifax or

married in Derby.

Uncle Alan: He was married in Derby or he

died in Skipton.

Gladys and Alan together: He was born in

Halifax or married in Derby, AND he was married in Derby or died in Skipton.

slide-25
SLIDE 25

Example 3: genealogy: Grandma Carol

Grandma Carol: He was either married

in Derby, or he was born in Halifax and died in Skipton.

slide-26
SLIDE 26

Whose information narrows it down more: Gladys&Alan, or Carol?

0% 0% 0% 0% 0%

1.

Gladys & Alan

2.

Carol

3.

Neither - they are just different

4.

They are the same.

5.

No idea

slide-27
SLIDE 27

Example 4: truth and lies

Consider two kinds of people: truth

tellers who always tell the truth, and liars who never tell the truth.

Alice says: “If you asked Bob, he would

say that I am a liar.”

slide-28
SLIDE 28

What can you deduce?

0% 0% 0% 0% 0%

Alice says: “If you asked Bob, he would say that I am a liar.”

1.

Alice is a truth teller

2.

Alice is a liar

3.

Bob is a truth teller

4.

Bob is a liar

5.

You can’t deduce anything

slide-29
SLIDE 29

Summary

Logical reasoning is not always easy or

intuitive.

Treating logic and logical thinking in a

formal and systematic way is necessary.

slide-30
SLIDE 30

Please ensure you return your handset before leaving.

The handset is useless outside of this class and non-returns will decease the likelihood of future voting system use on this course.