4 views

Uploaded by Linda Zhang

- 55101-mt----design and analysis of algorithms
- scimakelatex.9340.Alexika+hoon
- Recursion C++ PDF
- A Reevaluation of an Efficient Algorithm for Determining the Convex Hull of a Finite Planar Set
- chapter5
- Topaz
- Cs Life Universe Everything
- Matlad Code of Nr Method
- 14_Sameer Sharma_FinalPaper
- Jack+Jackson.Inti+Barrera.Ptrior+Masayev.Ngyen+Da+Tsu
- aoc_week2
- Cooccurrence and Gabor Abstract
- 5.5_ca
- Secrets of the Mathematical Contest in Modeling
- Discrete Mathematics 8th Ed - Richard Johnsonbaugh
- lab file
- Adaptive Control by Landau
- Graph Based Disambiguation of Named Entities using Linked Data
- Lda and Twitter Lda
- GRG

You are on page 1of 3

function f from the set of nonnegative integers to the set of integers. If f is well defined,

find a formula for f(n) when n is a nonnegative integer and prove that your formula is

valid.

a) f(0)=1, f(n)=2f(n-2), for n 1, n is even

f(n) = 2f(n-2)= 22f((n-2)-2)= 23f(n-32) =24f(n-42) =..2kf(n-k2)=

= 2(n-2)/2f(2)= 22(n-2)/2

n-k2 = 2; n = 2 + 2k; n-2 = 2k, k =(n-2)/2

b) f(0)=1, f(n) = f(n-1) 1, for n 1

f(n)= f(n-1) 1= f(n-2)-2= f(n-k) k = = f(n-n) n = 1 - n

n-k = 0, k=n

c) f(0)=2, f(1)=3, f(n)=f(n-1) 1, for n 2

f(n) = f(n-1) 1= f(n-2)-2= f(n-k) k = = f(n-(n-1)) (n-1)= f(1) n+1=4-n

n-k=1 , k = n-1

d) f(0)=1, f(1)=2, f(n)= 2f(n-2), for n 2

f(n) = 2f(n-2) = . =24f(n-42) = 2kf(n-k2) = 2n/2

n-k2 = 0 ..

e) f(0)=1, f(n)= 3f(n-1) if n is odd and n 1 and f(n)= 9f(n-2) if n is even and n 2

Problem 2.

Give a recursive definition of the sequence {a n}, n=1,2,3 if

a) an = 6n

a0=0 ; an+1 = 6(n+1)=6n + 6 = an + 6

b) an = 2n +1

a0 = 1; an+1 = 2(n+1) + 1 = (2n +1) + 2 = an + 2

c) an = 10n

a0 = 1 ; an+1 = 10n+1 = 10n10 = 10an

d) an = 5

Problem 3.

Assuming that fn is the nth Fibonacci number [f0=f1=1; fn+1= fn+ fn-1],

prove that f02 + f12 + + fn2 = fnfn+1

when n is a positive integer.

Inductive step: assumption - f02 + f12 + + fn2 = fnfn+1

We have to prove: f02 + f12 + + fn2 + fn+12 = fn+1fn+2

fnfn+1+ fn+12 = fn+1fn+2 = fn+1(fn+1+ fn)

Problem 4.

Give a recursive definition of

a) the set S of odd positive integers

1 S, k S k+2 S

b) the set S of positive integer powers of 3

S = {31, 32, }

3 S , k S 3k S

c) the set S of polynomials with integer coefficients

S = {a0 + a1x + a2x2 +. akxk : (i k)[ai N]}

a N, k N {0} axk S

s1 , s2 S s1 + s2 S

Problem 5.

Give a recursive definition of each of these sets of ordered pairs of positive integers.

Use structural induction to prove that the recursive definition you found is correct.

[Hint: To find a recursive definition, plot the points in the set in the plane and look for

paterns]

a) S={(a,b): aZ+, bZ+, and a+b is even}

(1,1) S, (2,2) S,

(p,q) S (p, q+2) S, (p+2,q) S

b) S={(a,b): aZ+, bZ+, and a or b is odd}

(1,1) S, (1,2) S, (2,1) S

(p,q) S (p, q+2) S, (p+2,q) S

c) S={(a,b): aZ+, bZ+, a+b is odd, 3 b}

(2,3) S , (1,6) S

(p,q) S (p,q+6) S, (p+2,q) S

Problem 6.

Give a recursive algorithm for finding the sum of the first n positive integers

if n=1 then S(n):=1

else S(n):= S(n-1) + n

Problem 7.

Give a recursive algorithm for finding the minimum of a finite set of integers, making use

of the fact that the minimum of n integers is the smaller of the last integer in the list and

the minimum of the first n-1 integers in the list.

if n=1 then S(a1,a2,,an):=a1

else S(a1,a2,,an):= min(S(a1,a2,,an-1), an)

Problem 8.

Device a recursive algorithm for computing n 2 where n is a nonnegative integer using

the fact that (n+1)2 = n2 + 2n + 1.

if n=0 then S(n):= 0

else S(n):= S(n-1) + 2(n-1) + 1

Problem 9.

Device a recursive algorithm to find the nth term of the sequence defined by a0=1, a1=2,

an = an-1an-2, for n=2,3,4,.

if n=0 then S(n):= 1

else if n=1 then S(n):= 2

else S(n):= S(n-1) S(n-2)

- 55101-mt----design and analysis of algorithmsUploaded bySRINIVASA RAO GANTA
- scimakelatex.9340.Alexika+hoonUploaded byehsan_sa405
- Recursion C++ PDFUploaded bycoaysekhongbaogiobiet
- A Reevaluation of an Efficient Algorithm for Determining the Convex Hull of a Finite Planar SetUploaded bygduthu
- chapter5Uploaded byapi-262297334
- TopazUploaded byAnonymous oXL3YI
- Cs Life Universe EverythingUploaded bynaomictchoi3254
- Matlad Code of Nr MethodUploaded bySwagat Pradhan
- 14_Sameer Sharma_FinalPaperUploaded byiiste
- Jack+Jackson.Inti+Barrera.Ptrior+Masayev.Ngyen+Da+TsuUploaded byHenry Pablo
- aoc_week2Uploaded byaferraiolo
- Cooccurrence and Gabor AbstractUploaded bygremlini2
- 5.5_caUploaded byalex
- Secrets of the Mathematical Contest in ModelingUploaded byhijazensis
- Discrete Mathematics 8th Ed - Richard JohnsonbaughUploaded byjun
- lab fileUploaded byDevasish Saikia
- Adaptive Control by LandauUploaded bySabit Rashid
- Graph Based Disambiguation of Named Entities using Linked DataUploaded byEditor IJRITCC
- Lda and Twitter LdaUploaded bysameendra
- GRGUploaded byVarsha Kankani
- vb2008me_preview.pdfUploaded byMohamed Vandy
- 1) Introduction to Computer ProgrammingUploaded byMaizie Planillo
- Group Role Assignment via a Kuhn–Munkres Algorithm-Based SolutionUploaded byscribd023x
- Mid-term Exam With AnswersUploaded bykallady
- ENGG407_Ch1_1 Numerical methods lecture oneUploaded byStella Cheng
- Map GenerationUploaded byalarue
- Algorithm AnalysisUploaded byAbdulrahman Alhabshi
- Voice Command RecognitionUploaded byRajesh Kanna
- The AlgorithmUploaded byWaiChipNgai
- NEAP Omniscient TechnologyUploaded by57f922ed41f61

- HW8.keyUploaded byLinda Zhang
- 4.4e (2)Uploaded byLinda Zhang
- 4.4e (2)Uploaded byLinda Zhang
- 4.4e (2)Uploaded byLinda Zhang
- Bruch Violin ConcertoUploaded byClare Gorton
- Ch 12 Matrix Worksheet SolutionsUploaded byLinda Zhang
- Cell Respiration Background and IntroductionUploaded byLinda Zhang
- Kiss the Rain- Yiruma Piano SheetUploaded byapi-3726081

- die_casting_maintainance.pdfUploaded bygksp
- Project CharterUploaded byAli Akhter
- Geogrid-Rigidgrid BX GayatriUploaded bygayatrigeo
- Cable CatalogueUploaded byDavid Bell
- Lab5 Formal ReportUploaded byram010
- Mark Schollmeyer ResumeUploaded bymomnpop
- Joe-Wheeler-Elec-Member-Corp-Residential-ServiceUploaded byGenability
- Star StudiesUploaded byfedericovitella
- ARIIA_DCS_User_Manual.pdfUploaded byArpita Ghatak Chatterjee
- Cf RemoverUploaded byNielz Tulalessy
- ATC DigitalUploaded bypmads07
- 01 Momentum transport - Viscosity.pptxUploaded bymumblex
- AWS A5.01Uploaded byEdgar Sorto
- Hydraulic Seal Identification ChartUploaded byAnonymous K6mLK72Aa
- CAN 01_.pdfUploaded bymesquitanm
- WDM Phasar User GuideUploaded byNida Ak
- recycling al paper.pdfUploaded bySrinivasa Rao Pulivarti
- Ecs208 Chapter 1 All UpdatedUploaded bybino_rye
- N2XSY - 12-20kVUploaded byJulien Reddi
- Improved Charge Transport of Nb-doped TiO2 Nanorods in Methylammonium Lead Iodide Bromide Perovskite Solar CellsUploaded byHuckkey Hu
- mpc_gsUploaded byd-fbuser-91931741
- Lecture 6. Geo ReferencingUploaded byRazi Baig
- D41E-6_KEPB002801Uploaded byJeffersonDias
- 1830 PSS Overview v3 Apr 16Uploaded bybosterrd
- Solar Manual BagUploaded byLeo Nel
- Hydraulic AccumulatorUploaded byAnonymous pC7MGO
- My Script Elc501 ForumUploaded byAiedah Oto
- Trimble Dimensions 2006 Conference at a GlanceUploaded byTrimbleDimensions
- BPP MM Devolucion de a ProveedorUploaded byandersonjaviera
- Hector Quine -Introduction to the GuitarUploaded byphilipJcun