lynbrook computer science

9
December 1, 2008

Upload: umay

Post on 21-Jan-2016

23 views

Category:

Documents


0 download

DESCRIPTION

Lynbrook Computer Science. December 1, 2008. Announcements. USACO this week! (December 5-8) First ACSL: Monday, December 15 Two new competitions: CML (Continental Mathematics League) JAVA Computer Contest IPSC (Internet Problem Solving Contest). - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Lynbrook Computer Science

December 1, 2008

Page 2: Lynbrook Computer Science

USACO this week! (December 5-8) First ACSL: Monday, December 15 Two new competitions:

CML (Continental Mathematics League) JAVA Computer Contest

IPSC (Internet Problem Solving Contest)

Page 3: Lynbrook Computer Science

Done in JAVA Done in teams Written Contest Based on AP Computer Science A/B

curriculum 25 Questions 40 Minutes Sometime between 4/20 and 5/1

Page 4: Lynbrook Computer Science

Online contest Done in teams of 3 5 Hours Any language can be used Access to online resources is allowed USACO-like problems

Page 5: Lynbrook Computer Science

What does this program do? Number Systems (different base

operations) Recursive Functions (f(x) = f(x-1) +

1) Boolean Algebra (not A + B = …) Bit String Flicking (right shift, left shift) LISP Evaluation (ADD, SUB, etc.) Digital Electronics (AND, OR, XOR, NAND, NOR,

XNOR) Prefix/Infix/Postfix Notation (+ 3 4) Data Structures (heaps, binary trees, stacks,

etc.)

Page 6: Lynbrook Computer Science

Find f(15) given the following:

f(x) = 2 * f(x-3) – 4 [if x is composite] x2 + x [if x is prime]

Page 7: Lynbrook Computer Science

f(15) = 2 * f(12) – 4 f(12) = 2 * f(9) – 4 f(9) = 2 * f(6) – 4 f(6) = 2 * f(3) – 4 f(3) = 32 + 3 = 12

Work backwards to get f(6) = 20, f(9) = 36, f(12) = 68, and f(15) = 132

Page 8: Lynbrook Computer Science

Evaluate the following: (CDR (CDR (CAR (CDR ‘(2 ((3 (4 5) 6) 7))))))

Hint: CDR ‘((x) y) = y CAR ‘((x) y) = (x)

Page 9: Lynbrook Computer Science

Work from the inside out: (CDR '(2 ((3 (4 5) 6) 7))) = (((3 (4 5) 6) 7)) (CAR '(((3 (4 5) 6) 7))) = ((3 (4 5) 6) 7) (CDR '((3 (4 5) 6) 7)) = (7) (CDR '(7)) = ()

Answer: () or nil PARENTHESIS ARE REQUIRED!!!