lec11 - CSE 20 Lecture 11 Function, Recursion &...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
1 CSE 20 Lecture 11 Function, Recursion & Analysis (Ch. 6 Shaum’s ) May 3, 2011
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Motivation Complexity of the execution 2 Input x Output y y= Function (x) Recursion
Background image of page 2
OUTLINE DEFINITION FUNTION RECURSION: CASES ANALYSIS 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 I. Definition A function f: A → B maps elements in domain A to codomain B such that for each a ϵ A, f(a) is exact one element in B. f: A → B A: Domain B: Codomain f(A): range or image of function f(A) B
Background image of page 4
5 Examples (2) f(x) (1) f(x)=x 2 , x ∈ ℝ (3) f(x) NOT a function
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6 (5) NOT a function Examples (4) Mapping from x to y When domain A is an integer set Z, we may denote f(x) as f x , ie. f 0 , f 1 , f 2 .
Background image of page 6
7 Case of Recursion Fibonacci Sequence Index: 0 1 2 3 4 5 6 Sequence: 0 1 1 2 3 5 8 0 1 n n-1 2 f =0, f =1, f =f +f 1 n n - 2200
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
8 Another Case of Recursion: Ackermann Function Ackermann Function: A(m,n), m, n N 1) m=0: A(0,n)=n+1 2) m≠0, n=0: A(m,0)=A(m-1,1) 3) m≠0, n≠0: A(m,n)=A(m-1, A(m,n- 1)) Example: A(1,1)= A(0, A(1,0)) =A(0,2) A(2,0) =A(1,1)
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 14

lec11 - CSE 20 Lecture 11 Function, Recursion &...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online