Top Banner
Welcome to SoC!
54

Welcome to SoC!. CS1101S or CS1010? why are you here?

Dec 25, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Welcome to SoC!. CS1101S or CS1010? why are you here?

Welcometo SoC!

Page 2: Welcome to SoC!. CS1101S or CS1010? why are you here?

CS1101S or CS1010?

why are you here?

why are you here?

Page 3: Welcome to SoC!. CS1101S or CS1010? why are you here?

DDP folksDDP folks

You can sleep

You can sleep

Page 4: Welcome to SoC!. CS1101S or CS1010? why are you here?

Turing Programme

Turing Programme

Yes, you also can

sleep

Yes, you also can

sleep

Page 5: Welcome to SoC!. CS1101S or CS1010? why are you here?
Page 6: Welcome to SoC!. CS1101S or CS1010? why are you here?

Brief History Brief History • Scheme was developed at MIT

in 1975 to teach programming methodology

• First introduced at NUS 13 years ago

• I took this class at MIT in 1994.

Page 7: Welcome to SoC!. CS1101S or CS1010? why are you here?

What is Scheme?

Page 8: Welcome to SoC!. CS1101S or CS1010? why are you here?

(+ 5 3)

(- (+ 5 3) (* 2 3))

prefix notationprefix notation

8

2

Page 9: Welcome to SoC!. CS1101S or CS1010? why are you here?

(+ 5 6)

(define a 5)

(+ a 6)

11

11

Page 10: Welcome to SoC!. CS1101S or CS1010? why are you here?

Scheme is ExpressiveScheme is Expressive

(define (square x) (* x x))

To square something, multiply it by itself

(square 2)

(square (square 3))

436 81

Page 11: Welcome to SoC!. CS1101S or CS1010? why are you here?

Congratulations!You know Scheme

Page 12: Welcome to SoC!. CS1101S or CS1010? why are you here?

Why Scheme?

Page 13: Welcome to SoC!. CS1101S or CS1010? why are you here?

Simple(didn’t you just learn

it in 10 mins? )

Page 14: Welcome to SoC!. CS1101S or CS1010? why are you here?

Futile to Teach a Language

(Here today, gone tomorrow)(Here today, gone tomorrow)

Page 15: Welcome to SoC!. CS1101S or CS1010? why are you here?

Computational Thinking

Page 16: Welcome to SoC!. CS1101S or CS1010? why are you here?

Towers of HanoiTowers of Hanoi

Page 17: Welcome to SoC!. CS1101S or CS1010? why are you here?

Towers of HanoiTowers of Hanoi

Page 18: Welcome to SoC!. CS1101S or CS1010? why are you here?

Towers of HanoiTowers of Hanoi

Page 19: Welcome to SoC!. CS1101S or CS1010? why are you here?

Towers of HanoiTowers of Hanoi

Page 20: Welcome to SoC!. CS1101S or CS1010? why are you here?

Towers of HanoiTowers of Hanoi

Page 21: Welcome to SoC!. CS1101S or CS1010? why are you here?

Towers of HanoiTowers of Hanoi

Page 22: Welcome to SoC!. CS1101S or CS1010? why are you here?

Towers of HanoiTowers of Hanoi

Page 23: Welcome to SoC!. CS1101S or CS1010? why are you here?

Towers of HanoiTowers of Hanoi

Page 24: Welcome to SoC!. CS1101S or CS1010? why are you here?

Can you solve this

for 1,000 discs?

Page 25: Welcome to SoC!. CS1101S or CS1010? why are you here?

How would we think about the

problem?

Page 26: Welcome to SoC!. CS1101S or CS1010? why are you here?

What if we have one

disc?

Page 27: Welcome to SoC!. CS1101S or CS1010? why are you here?

What if we have no discs?

Do nothing!

Page 28: Welcome to SoC!. CS1101S or CS1010? why are you here?

Towers of HanoiTowers of Hanoi

Suppose we know how to move 3 discs from A to C

A B C

Page 29: Welcome to SoC!. CS1101S or CS1010? why are you here?

Towers of HanoiTowers of Hanoi

Suppose we know how to move 3 discs from A to C

A B C

Page 30: Welcome to SoC!. CS1101S or CS1010? why are you here?

Towers of HanoiTowers of Hanoi

Claim: we can move 3 discs from A to B. Why?

A B C

Page 31: Welcome to SoC!. CS1101S or CS1010? why are you here?

Towers of HanoiTowers of Hanoi

Claim: we can move 3 discs from A to B. Why?

A B C

Page 32: Welcome to SoC!. CS1101S or CS1010? why are you here?

Towers of HanoiTowers of Hanoi

What do we do for4 discs?

A B C

Page 33: Welcome to SoC!. CS1101S or CS1010? why are you here?

Towers of HanoiTowers of Hanoi(define (move-tower size from to extra)(cond ((= size 0) #t)(else

(move-tower (- size 1) from extra to)(print-move from to)(move-tower (- size 1) extra to

from))))

from extra to

Page 34: Welcome to SoC!. CS1101S or CS1010? why are you here?

Towers of HanoiTowers of Hanoi(define (print-move from to)(newline)(display "move top disk from ")(display from)(display " to ")(display to))

Page 35: Welcome to SoC!. CS1101S or CS1010? why are you here?

Recursion

Page 36: Welcome to SoC!. CS1101S or CS1010? why are you here?

CS1101S Road MapCS1101S Road Map

BASIC

INTERMEDIATE

ADVANCED

Procedural Abstraction

Higher-Order Procedures

Recursion

Iteration

Wishful Thinking

Order of Growth

Data Abstraction

Symbolic DataList

ProcessingGeneric

Operators

Object-Oriented Programming

StreamsMemoization

Dynamic Programming

Mutation & State

Java

Fundamental concepts of computer programming

Page 37: Welcome to SoC!. CS1101S or CS1010? why are you here?

CS1101S or CS1010?

Page 38: Welcome to SoC!. CS1101S or CS1010? why are you here?

How to decide?

Page 39: Welcome to SoC!. CS1101S or CS1010? why are you here?

PukeTest

Page 40: Welcome to SoC!. CS1101S or CS1010? why are you here?

Caveat Caveat • To enroll in CS1101S, min

requirement of A grade for ‘A’ Level Math or equivalent.

• Or you can appeal at Undergrad Office

Page 41: Welcome to SoC!. CS1101S or CS1010? why are you here?

like ?

Page 42: Welcome to SoC!. CS1101S or CS1010? why are you here?

Scheme vs C Scheme vs C •Who would you marry?–Pretty but poor?–Rich but ugly?

Page 43: Welcome to SoC!. CS1101S or CS1010? why are you here?

Ask your friend

Page 44: Welcome to SoC!. CS1101S or CS1010? why are you here?

Ask a senior

Page 45: Welcome to SoC!. CS1101S or CS1010? why are you here?

10 Reasons NOT to take CS1101S10 Reasons NOT to take CS1101S

1. If you hate Math

2. If you don’t like challenges

3. If you cannot manage self-studying and need to be spoonfed

4. If you just want to get a free A

5. If you are not interested in learning more

Page 46: Welcome to SoC!. CS1101S or CS1010? why are you here?

10 Reasons NOT to take CS1101S10 Reasons NOT to take CS1101S

6. If you don’t like personalised attention

7. If you don’t wish to meet like-minded peers

8. If you don’t care about applying your knowledge

9. If you don’t take shocks well/if you fear evilness

10. If you don’t like shuai prof :P

Page 47: Welcome to SoC!. CS1101S or CS1010? why are you here?

Google is your Friend

Google is your Friend

“cs1101s midterm review”

Page 48: Welcome to SoC!. CS1101S or CS1010? why are you here?
Page 49: Welcome to SoC!. CS1101S or CS1010? why are you here?

Why are you here?

Page 50: Welcome to SoC!. CS1101S or CS1010? why are you here?

What is the meaning of life?

Page 51: Welcome to SoC!. CS1101S or CS1010? why are you here?

many paths to

success

Page 52: Welcome to SoC!. CS1101S or CS1010? why are you here?

“Your time is limited, so don't waste it living someone else's life. Don't be trapped by dogma - which is living with the results of other people's thinking. Don't let the noise of other's opinions drown out your own inner voice......

Page 53: Welcome to SoC!. CS1101S or CS1010? why are you here?

......And most important, have the courage to follow your heart and intuition. They somehow already know what you truly want to become. Everything else is secondary.”

- Steve Jobs

Page 54: Welcome to SoC!. CS1101S or CS1010? why are you here?

QUESTIONSQUESTIONS