Lec11_Recursion - Discrete Structures TDS1191 - Lecture 11...

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

View Full Document Right Arrow Icon
Discrete Structures 1 [Lecture 11][Recursion] Discrete Structures TDS1191 - Lecture 11 - Recursion
Background image of page 1

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

View Full DocumentRight Arrow Icon
Discrete Structures 2 Contents What is recursion? Recursively defined function Recursively defined sequence [Lecture 11][Recursion]
Background image of page 2
Discrete Structures 3 Examine the sequence 2 0 , 2 1 , 2 2 , 2 3 ,2 4 , and so on…. Can you come up with a general expression for this sequence in terms of n ; where n = 0, 1, 2, 3, 4, …. ? a(n) = ……. Now determine the first 5 terms of the sequence defined by the following function ƒ(0) = 1 ƒ(n+1) = 2 x ƒ(n) for n = 0, 1, 2, 3, 4, …. . What can you say about the 2 sequences ? [Lecture 11][Recursion]
Background image of page 3

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

View Full DocumentRight Arrow Icon
Discrete Structures 4 The formulae a(n) =2 n for n = 0,1,2,3,4…. and ƒ(0) = 1 ƒ(n+1) = 2 x ƒ(n) for n = 0, 1, 2, 3, 4, …. . are both expressions used to obtain the terms of the sequence 1, 2, 4, 8, 16……. . The second expression is a Recursive Definition for the sequence 1, 2, 4, 8, 16……. . [Lecture 11][Recursion]
Background image of page 4
Discrete Structures 5 Recursive Definition We say that a sequence is defined recursively provided: 1. Some finite set of values, usually the first one or first few, are specified. 2.
Background image of page 5

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

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/03/2012 for the course IT 1191 taught by Professor Yong during the Spring '11 term at Multimedia University, Cyberjaya.

Page1 / 18

Lec11_Recursion - Discrete Structures TDS1191 - Lecture 11...

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

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