Download presentation
Presentation is loading. Please wait.
Published byReginald Hoover Modified over 9 years ago
1
A Scheme Workshop Ben Leong NUS School of Computing 31 July 2007
2
Welcome to SoC Help you make an informed decision on whether to choose between CS1101 and CS1101S Help you make an informed decision on whether to choose between CS1101 and CS1101S NOT to teach you Scheme NOT to teach you Scheme About which class is more suitable for YOU About which class is more suitable for YOU NOT about which is better…. NOT about which is better….
3
Overview What’s Scheme? What’s Scheme? Why Scheme? Why Scheme? Module Synopsis Module Synopsis (i.e. what to expect) What your seniors say What your seniors say
4
Brief History of CS1101S The language Scheme was designed 25 years ago at MIT to teach programming methodology The language Scheme was designed 25 years ago at MIT to teach programming methodology The success of the MIT programming methodology module led to its adoption in many universities worldwide The success of the MIT programming methodology module led to its adoption in many universities worldwide Scheme was first introduced at NUS 10 years ago Scheme was first introduced at NUS 10 years ago I took this class at MIT in 1994. I took this class at MIT in 1994.
5
Objectives Teach Scheme as a programming language Teach Scheme as a programming language Teach programming concepts Teach programming concepts Inspire CONFIDENCE in students that ANYTHING can be solved if they try hard enough Inspire CONFIDENCE in students that ANYTHING can be solved if they try hard enough Teach students Teach students Computational Thinking TO THINK TO THINK NOT!
6
Introduction to Scheme Scheme is expression oriented. Type an expression and its result will be printed out. Scheme is expression oriented. Type an expression and its result will be printed out. Works with a variety of types of numbers: integers (both positive and negative), fractions (rational numbers), and real numbers Works with a variety of types of numbers: integers (both positive and negative), fractions (rational numbers), and real numbers
7
Introduction to Scheme Expressions use prefix notation. Expressions use prefix notation. Use (+ 2 3) instead of (2 + 3) Use (+ 2 3) instead of (2 + 3) Use (* (+ 2 3) (- 3 1)) instead of (2+3)*(3-1) Use (* (+ 2 3) (- 3 1)) instead of (2+3)*(3-1) There is a wealth of predefined functions There is a wealth of predefined functions sqrt computes the square root of its argument. sqrt computes the square root of its argument. + is also a predefined function + is also a predefined function
8
Why Scheme? Teaching a language is futile Teaching a language is futile (Here today, gone tomorrow) Scheme is simple as a language Scheme is simple as a language So we can focus on the CONCEPTS instead of clunky language rules So we can focus on the CONCEPTS instead of clunky language rules Let’s see for ourselves….. Let’s see for ourselves…..
9
Recursion Express (divide) a problem into smaller similar problems Express (divide) a problem into smaller similar problems Solve the problem for a simple (base) case Solve the problem for a simple (base) case We are done (!) Similar to Similar to Mathematical Induction
10
The Towers of Hanoi We have 3 pegs and a set of discs, all of different diameters. Objective: move the pile of discs to last peg, by: moving 1 disc at a time from 1 peg to another; never placing a disk on top of another disc with smaller diameter. Suppose you have not 3, but n discs …
11
The Towers of Hanoi We must start somewhere…. Suppose we have one disc …. What if there are no discs? Nothing to do! Base case
12
The Towers of Hanoi We notice the following pattern: if we want to move n disks from peg a to peg c using peg b as intermediary storage, then we: assume we know how to move n−1 disks to peg b, using peg c as intermediary storage; we move disk n from a to c ; we move n−1 disks from b to c, using a as intermediary storage.RECURSION
13
The Towers 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)))) (define (print-move from to) (newline) (display "move top disk from ") (display from) (display " to ") (display to))
14
CS1101S: Programming Methodology (Scheme) Lectures: Lectures: Wed 10am-12pm, Fri 11am-12pm, LT15 Wed 10am-12pm, Fri 11am-12pm, LT15 Recorded for webcast Recorded for webcast Recitations: 1 hr/wk Recitations: 1 hr/wk Two or three groups: Prob Thurs, Venue TBA Two or three groups: Prob Thurs, Venue TBA Discussion Groups: 2 hr/wk Discussion Groups: 2 hr/wk Three or four groups: TBA Three or four groups: TBA Bid for group in CORS Bid for group in CORS
15
Teaching Staff Lecturer: Dr. Ben Leong, benleong@comp.nus.edu.sg Office: S14 #06-14 Lecturer: Dr. Ben Leong, benleong@comp.nus.edu.sg Office: S14 #06-14 benleong@comp.nus.edu.sg Phone: 6516-4240 Hours: TBA, or by appointment Undergraduate Discussion Group Leaders Undergraduate Discussion Group Leaders
16
Syllabus (in Brief) Numeric computations in Scheme Building recipes with functions Recursion Data structures: lists, trees Memoization & Dynamic Programming Generic operations Object oriented abstractions Java Covers core concepts of computer programming
17
Textbook : SICP FREE!! FREE!! Available online at http://mitpress.mit.edu/sicp/full- text/book/book.html Available online at http://mitpress.mit.edu/sicp/full- text/book/book.html http://mitpress.mit.edu/sicp/full- text/book/book.html http://mitpress.mit.edu/sicp/full- text/book/book.html
18
Supplementary Text ALSO FREE!! ALSO FREE!! Available online at http://gustavus.edu/+max/conc rete-abstractions- pdfs/index.html Available online at http://gustavus.edu/+max/conc rete-abstractions- pdfs/index.html http://gustavus.edu/+max/conc rete-abstractions- pdfs/index.html http://gustavus.edu/+max/conc rete-abstractions- pdfs/index.html
19
Scheme Interpreter We will be using DrScheme We will be using DrScheme It’s FREE!!! It’s FREE!!! Download from: Download from: http://www.drscheme.org/
20
Assessment Overview Tutorial participation: 10% Tutorial participation: 10% Problem sets: 30% Problem sets: 30% Midterm exam: 15% Midterm exam: 15% 3 Oct 2007 (Wed) 10am-12 pm Practical exam:15% Practical exam:15% 7 Nov 2007 (Wed) 10am-12 pm Final exam: 30% Final exam: 30% 26 Nov 2007 (Mon) Morning
21
Tutorial Participation (10%) Questions will usually be given out prior to the recitations/discussion groups, sometimes not Questions will usually be given out prior to the recitations/discussion groups, sometimes not Assessed mainly by tutors, with some inputs from lecturer from interactions during recitations & lectures Assessed mainly by tutors, with some inputs from lecturer from interactions during recitations & lectures You need to be active, participate by offering solutions, making comments and asking questions. You need to be active, participate by offering solutions, making comments and asking questions.
22
Midterm and Final Exams (15% + 30%) Standard fare – 2 hours each Standard fare – 2 hours each Will test concepts, NOT memory Will test concepts, NOT memory Open-sheet Open-sheet 1 x A4 sheet of notes allowed for midterm 1 x A4 sheet of notes allowed for midterm 2 x A4 sheet of notes allowed for finals 2 x A4 sheet of notes allowed for finals Sample midterms available on IVLE Sample midterms available on IVLE Sample finals available from Library Sample finals available from Library
23
Problem Sets (30%) Seven problem sets Seven problem sets Due approximately once every two weeks Due approximately once every two weeks Graded by the Undergraduate Tutors Graded by the Undergraduate Tutors Crucial for learning the material in this class Crucial for learning the material in this class This is effectively the lab component of the class This is effectively the lab component of the class
24
Practical Exam (15%) “Test of the Pudding” At the completion of Scheme syllabus At the completion of Scheme syllabus 2 hours to solve three programming problems of increasing difficulty 2 hours to solve three programming problems of increasing difficulty Sample exams available on IVLE Sample exams available on IVLE
25
Other Highlights Will build a Lego Mindstorm robot in the middle of the Semester Will build a Lego Mindstorm robot in the middle of the Semester Regular Programming Contests to keep students challenged Regular Programming Contests to keep students challenged
26
CS1101S vs. CS1101 Progression: CS1101S CS1102S CS1101 CS1102 Progression: CS1101S CS1102S CS1101 CS1102 Two-semester sequence Two-semester sequence Discouraged from crossing over Discouraged from crossing over CS1101S CS1102, CS1101 CS1102S CS1101S CS1102, CS1101 CS1102S Similarities Similarities S and non-S versions both teach basic programming principles S and non-S versions both teach basic programming principles
27
CS1101S/02S vs. CS1101/02 Differences Differences CS1101S/02S cover more advanced topics CS1101S/02S cover more advanced topics More challenging More challenging CS1102S covers Java + more CS1102S covers Java + more Good introduction to many computer science topics Good introduction to many computer science topics
28
Which to take? Take CS1101S/02S if you want to be challenged. Take CS1101S/02S if you want to be challenged. If you have programmed before If you have programmed before No real advantage No real advantage In fact, can be a disadvantage! In fact, can be a disadvantage! If you have never programmed before If you have never programmed before Great! You are not at a disadvantage. Great! You are not at a disadvantage. Keep an open mind. Keep an open mind. Some evidence show that female students cope better with Scheme than Java. Some evidence show that female students cope better with Scheme than Java.
29
Java vs Scheme: What’s the Tradeoff? Java: sophisticated, mature can be used for commercial applications but has many underlying concepts that a beginner may find hard to understand Scheme: simple, elegant easy to learn (hard to master) designed to illustrate the concepts will eventually learn Java anyway…. Mainly a question of personal choice (taste?)
30
What your seniors say…. I think Scheme really does bring about concepts easily. Java's messy, so messy for an amateur programmer. (on Problem Sets) They are all very difficult, but some are killers. I learnt a tiny bit of java before I attended this class and I was totally lost. Teaching introduction to programming in Scheme is a quite smart idea. I feel much better when I came back to Java at the end of this class. [What doesn’t kill you makes you strong]
31
What your seniors say…. I was warned by my seniors not to take scheme because they said it was very tough.... now when I’ve done this module, I agree that it is tough.. but it is worth the effort..scheme makes u smarter !!! :) Do you agree that Scheme is easier than Java? 32% NO; 68% YES! Luv the class, luv the company of students, luv the interaction with teachers, bla bla bla... Scheme's cool I think we need more classmates I think we need more classmates
32
More comments here …. http://www.comp.nus.edu.sg/~bleong/ http://www.comp.nus.edu.sg/~bleong/ http://www.comp.nus.edu.sg/~bleong/ teaching/cs1101s06-midterm.htm http://www.comp.nus.edu.sg/~bleong/ http://www.comp.nus.edu.sg/~bleong/ http://www.comp.nus.edu.sg/~bleong/ teaching/cs1101s06-final.htm Just Google “ cs1101s survey”!!! Just Google “ cs1101s survey”!!!
33
Words of Advice Don’t worry about the curve Don’t worry about the curve Scheme is easier (or so I would claim), but doesn’t mean that CS1101S is an easier class Scheme is easier (or so I would claim), but doesn’t mean that CS1101S is an easier class Take CS1101S still have to learn Java…. so it is definitely more work Take CS1101S still have to learn Java…. so it is definitely more work Have to be prepared to work very hard in CS1101S Have to be prepared to work very hard in CS1101S
34
QUESTIONS
35
THANK YOU
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.