SlideShare ist ein Scribd-Unternehmen logo
1 von 68
Recursion Zeph Grunschlag
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object]
Recursively Defined Sequences ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Recursive Definitions and Induction ,[object Object],[object Object],[object Object],[object Object],[object Object]
Recursive Functions ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Recursive Functions Factorial ,[object Object],[object Object],[object Object],[object Object]
Recursive Functions Factorial ,[object Object],[object Object],[object Object],[object Object]
Recursive Functions Factorial ,[object Object],[object Object],[object Object],[object Object],recursion
Recursive Functions Factorial ,[object Object],[object Object],[object Object],[object Object],recursion
Recursive Functions Factorial ,[object Object],[object Object],[object Object],[object Object],[object Object],recursion
Recursive Functions Factorial ,[object Object],[object Object],[object Object],[object Object],[object Object],recursion
Recursive Functions Factorial ,[object Object],[object Object],[object Object],[object Object],[object Object],recursion
Recursive Functions Factorial ,[object Object],[object Object],[object Object],[object Object],[object Object],recursion initialization
Recursive Functions n  choose  k ,[object Object],[object Object],[object Object],[object Object],[object Object]
n  choose  k  and Pascal’s Triangle ,[object Object]
n  choose  k  and Pascal’s Triangle ,[object Object]
n  choose  k  and Pascal’s Triangle ,[object Object],[object Object]
n  choose  k  and Pascal’s Triangle ,[object Object],[object Object],[object Object]
n  choose  k  and Pascal’s Triangle ,[object Object],[object Object],[object Object],[object Object]
n  choose  k  and Pascal’s Triangle ,[object Object],[object Object],[object Object],[object Object],[object Object]
n  choose  k  and Pascal’s Triangle ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
n  choose  k  and Pascal’s Triangle ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
n  choose  k  and Pascal’s Triangle ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],n  =   row 0 1 2 3 4 5 6 0   k  =   diagonal col. 1 2 3 4   5   6
n  choose  k  and Pascal’s Triangle ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],n  =   row 0 1 2 3 4 5 6 0   k  =   diagonal col. 1 2 3 4   5   6
n  choose  k  and Pascal’s Triangle ,[object Object],[object Object],[object Object],[object Object]
n  choose  k  and Pascal’s Triangle ,[object Object],[object Object]
Recursive Definitions gcd ,[object Object],[object Object]
Recursive Definitions of Mathematical Notation ,[object Object]
Recursive Definitions of Mathematical Notation ,[object Object],[object Object],[object Object]
Recursive Definitions of Mathematical Notation ,[object Object],[object Object]
Recursive Definitions of Mathematical Notation ,[object Object],[object Object]
Recursive Definition of Sets ,[object Object],[object Object],[object Object],[object Object],[object Object]
Recursive Definition of Sets ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Recursive Definition of Sets ,[object Object],[object Object],[object Object]
Character Strings ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Strings Notation ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
String Alphabets ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Strings Length ,[object Object],[object Object],[object Object],[object Object]
Strings Length and the Empty String ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Strings Length and the Empty String ,[object Object],[object Object],[object Object]
Strings Concatenation ,[object Object],[object Object],[object Object],[object Object],[object Object]
Strings  Concatenation ,[object Object],[object Object]
Strings Reversal ,[object Object],[object Object],[object Object]
Strings  Recursive Sets ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Strings  Recursive Sets ,[object Object],[object Object],[object Object]
Blackboard Exercises ,[object Object],[object Object],[object Object],[object Object],[object Object]
Recursive Algorithms (Section 3.4) ,[object Object],[object Object]
Recursive Algorithms (Section 3.4) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Recursive Algorithms Computer Implementation ,[object Object],[object Object],[object Object],[object Object],[object Object]
Recursive Algorithms Computer Implementation ,[object Object],[object Object],[object Object],[object Object],f(5)=5·f(4)
Recursive Algorithms Computer Implementation ,[object Object],[object Object],[object Object],[object Object],f(4)=4·f(3) f(5)=5·f(4)
Recursive Algorithms Computer Implementation ,[object Object],[object Object],[object Object],[object Object],f(3)=3·f(2) f(4)=4·f(3) f(5)=5·f(4)
Recursive Algorithms Computer Implementation ,[object Object],[object Object],[object Object],[object Object],f(3)=3·f(2) f(4)=4·f(3) f(5)=5·f(4) f(2)=2·f(1)
Recursive Algorithms Computer Implementation ,[object Object],[object Object],[object Object],[object Object],f(3)=3·f(2) f(4)=4·f(3) f(5)=5·f(4) f(2)=2·f(1) f(1)=1·f(0)
Recursive Algorithms Computer Implementation ,[object Object],[object Object],[object Object],[object Object],f(3)=3·f(2) f(4)=4·f(3) f(5)=5·f(4) f(2)=2·f(1) f(1)=1·f(0) f(0)= 1 
Recursive Algorithms Computer Implementation ,[object Object],[object Object],[object Object],[object Object],f(3)=3·f(2) f(4)=4·f(3) f(5)=5·f(4) f(2)=2·f(1) 1·1= 1 
Recursive Algorithms Computer Implementation ,[object Object],[object Object],[object Object],[object Object],f(3)=3·f(2) f(4)=4·f(3) f(5)=5·f(4) 2·1= 2 
Recursive Algorithms Computer Implementation ,[object Object],[object Object],[object Object],[object Object],3·2= 6  f(4)=4·f(3) f(5)=5·f(4)
Recursive Algorithms Computer Implementation ,[object Object],[object Object],[object Object],[object Object],4·6= 24  f(5)=5·f(4)
Recursive Algorithms Computer Implementation ,[object Object],[object Object],[object Object],[object Object],5·24= 120 
Recursive Algorithms Computer Implementation ,[object Object],[object Object],[object Object],[object Object],Return  5! = 120
From Recursive Definitions To Recursive Algorithms ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Recursive Algorithms Examples ,[object Object],[object Object]
Recursive Algorithms Fibonacci ,[object Object],[object Object],[object Object],[object Object],[object Object]
Recursive Algorithms Binomial Coefficients ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Recursive Algorithms Binomial Coefficients ,[object Object],[object Object]
Recursive Algorithms Binomial Coefficients ,[object Object]
Recursive Algorithms gcd ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]

Weitere ähnliche Inhalte

Was ist angesagt?

Analysis Of Algorithms Ii
Analysis Of Algorithms IiAnalysis Of Algorithms Ii
Analysis Of Algorithms Ii
Sri Prasanna
 
Dinive conquer algorithm
Dinive conquer algorithmDinive conquer algorithm
Dinive conquer algorithm
Mohd Arif
 
Inverse trig functions
Inverse trig functionsInverse trig functions
Inverse trig functions
Jessica Garcia
 

Was ist angesagt? (20)

Divide and conquer
Divide and conquerDivide and conquer
Divide and conquer
 
Recursion
RecursionRecursion
Recursion
 
Integral Domains
Integral DomainsIntegral Domains
Integral Domains
 
Analysis Of Algorithms Ii
Analysis Of Algorithms IiAnalysis Of Algorithms Ii
Analysis Of Algorithms Ii
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquer
 
Fermat and euler theorem
Fermat and euler theoremFermat and euler theorem
Fermat and euler theorem
 
Recursion | C++ | DSA
Recursion | C++ | DSARecursion | C++ | DSA
Recursion | C++ | DSA
 
EULER AND FERMAT THEOREM
EULER AND FERMAT THEOREMEULER AND FERMAT THEOREM
EULER AND FERMAT THEOREM
 
Ch 2 lattice & boolean algebra
Ch 2 lattice & boolean algebraCh 2 lattice & boolean algebra
Ch 2 lattice & boolean algebra
 
Proof in Mathematics
Proof in MathematicsProof in Mathematics
Proof in Mathematics
 
Dinive conquer algorithm
Dinive conquer algorithmDinive conquer algorithm
Dinive conquer algorithm
 
Inverse trig functions
Inverse trig functionsInverse trig functions
Inverse trig functions
 
Recursion
RecursionRecursion
Recursion
 
Report in math 830
Report in math 830Report in math 830
Report in math 830
 
Chapter 6
Chapter 6Chapter 6
Chapter 6
 
Functions
FunctionsFunctions
Functions
 
Divide and Conquer
Divide and ConquerDivide and Conquer
Divide and Conquer
 
Recursion
RecursionRecursion
Recursion
 
08 decrease and conquer spring 15
08 decrease and conquer spring 1508 decrease and conquer spring 15
08 decrease and conquer spring 15
 
01.02 linear equations
01.02 linear equations01.02 linear equations
01.02 linear equations
 

Andere mochten auch

Computer and cleaning service it outsourcing
Computer and cleaning service  it outsourcingComputer and cleaning service  it outsourcing
Computer and cleaning service it outsourcing
thuongdang1511
 
9 leadership development strategies
9 leadership development strategies9 leadership development strategies
9 leadership development strategies
Abhishek Saha
 
Film industry work
Film industry workFilm industry work
Film industry work
NShuttle
 
Putting the WOW into your School's WOM, ADVIS Presentation
Putting the WOW into your School's WOM, ADVIS PresentationPutting the WOW into your School's WOM, ADVIS Presentation
Putting the WOW into your School's WOM, ADVIS Presentation
Rick Newberry
 

Andere mochten auch (20)

FYI - Gems' Art Show 2015
FYI - Gems' Art Show 2015FYI - Gems' Art Show 2015
FYI - Gems' Art Show 2015
 
TUGAS TIK KOMPUTER MENURUT UKURAN DAN KAPASITAS
TUGAS TIK KOMPUTER MENURUT UKURAN DAN KAPASITASTUGAS TIK KOMPUTER MENURUT UKURAN DAN KAPASITAS
TUGAS TIK KOMPUTER MENURUT UKURAN DAN KAPASITAS
 
Chemistry ace
Chemistry aceChemistry ace
Chemistry ace
 
소셜의 이해
소셜의 이해소셜의 이해
소셜의 이해
 
Tourism English 15
Tourism English 15Tourism English 15
Tourism English 15
 
Computer and cleaning service it outsourcing
Computer and cleaning service  it outsourcingComputer and cleaning service  it outsourcing
Computer and cleaning service it outsourcing
 
Casbase presentation
Casbase presentationCasbase presentation
Casbase presentation
 
GMC Ukraine 2011/2012
GMC Ukraine 2011/2012GMC Ukraine 2011/2012
GMC Ukraine 2011/2012
 
9 leadership development strategies
9 leadership development strategies9 leadership development strategies
9 leadership development strategies
 
Проект стратегии развития
Проект стратегии развитияПроект стратегии развития
Проект стратегии развития
 
Compiler design file
Compiler design fileCompiler design file
Compiler design file
 
A day in the life of learner with a smart phone
A day in the life of learner with a smart phoneA day in the life of learner with a smart phone
A day in the life of learner with a smart phone
 
Film industry work
Film industry workFilm industry work
Film industry work
 
Getting started
Getting startedGetting started
Getting started
 
20 лет Независимости Республики Казахстан
20 лет Независимости Республики Казахстан20 лет Независимости Республики Казахстан
20 лет Независимости Республики Казахстан
 
ทวีปอาฟริกา
ทวีปอาฟริกาทวีปอาฟริกา
ทวีปอาฟริกา
 
Quiet room
Quiet roomQuiet room
Quiet room
 
Putting the WOW into your School's WOM, ADVIS Presentation
Putting the WOW into your School's WOM, ADVIS PresentationPutting the WOW into your School's WOM, ADVIS Presentation
Putting the WOW into your School's WOM, ADVIS Presentation
 
KVH DCNet 資料
KVH DCNet 資料KVH DCNet 資料
KVH DCNet 資料
 
Parts body
Parts bodyParts body
Parts body
 

Ähnlich wie L16

Skiena algorithm 2007 lecture21 other reduction
Skiena algorithm 2007 lecture21 other reductionSkiena algorithm 2007 lecture21 other reduction
Skiena algorithm 2007 lecture21 other reduction
zukun
 
Integral Calculus Anti Derivatives reviewer
Integral Calculus Anti Derivatives reviewerIntegral Calculus Anti Derivatives reviewer
Integral Calculus Anti Derivatives reviewer
JoshuaAgcopra
 
Infinite series & sequence lecture 2
Infinite series & sequence lecture 2Infinite series & sequence lecture 2
Infinite series & sequence lecture 2
Mohsin Ramay
 

Ähnlich wie L16 (20)

BP106RMT.pdf
BP106RMT.pdfBP106RMT.pdf
BP106RMT.pdf
 
Grovers Algorithm
Grovers Algorithm Grovers Algorithm
Grovers Algorithm
 
sequence and series.docx
sequence and series.docxsequence and series.docx
sequence and series.docx
 
Binomial theorem
Binomial theorem Binomial theorem
Binomial theorem
 
Sequence and Series
Sequence and SeriesSequence and Series
Sequence and Series
 
P, NP and NP-Complete, Theory of NP-Completeness V2
P, NP and NP-Complete, Theory of NP-Completeness V2P, NP and NP-Complete, Theory of NP-Completeness V2
P, NP and NP-Complete, Theory of NP-Completeness V2
 
11.1 Sequences and Series
11.1 Sequences and Series11.1 Sequences and Series
11.1 Sequences and Series
 
Recursive Definitions in Discrete Mathmatcs.pptx
Recursive Definitions in Discrete Mathmatcs.pptxRecursive Definitions in Discrete Mathmatcs.pptx
Recursive Definitions in Discrete Mathmatcs.pptx
 
Skiena algorithm 2007 lecture21 other reduction
Skiena algorithm 2007 lecture21 other reductionSkiena algorithm 2007 lecture21 other reduction
Skiena algorithm 2007 lecture21 other reduction
 
opt_slides_ump.pdf
opt_slides_ump.pdfopt_slides_ump.pdf
opt_slides_ump.pdf
 
Applied Algorithms and Structures week999
Applied Algorithms and Structures week999Applied Algorithms and Structures week999
Applied Algorithms and Structures week999
 
Anlysis and design of algorithms part 1
Anlysis and design of algorithms part 1Anlysis and design of algorithms part 1
Anlysis and design of algorithms part 1
 
Integral Calculus Anti Derivatives reviewer
Integral Calculus Anti Derivatives reviewerIntegral Calculus Anti Derivatives reviewer
Integral Calculus Anti Derivatives reviewer
 
1 chapter1 introduction
1 chapter1 introduction1 chapter1 introduction
1 chapter1 introduction
 
jalalam.ppt
jalalam.pptjalalam.ppt
jalalam.ppt
 
4.3e.pptx
4.3e.pptx4.3e.pptx
4.3e.pptx
 
Infinite series & sequence lecture 2
Infinite series & sequence lecture 2Infinite series & sequence lecture 2
Infinite series & sequence lecture 2
 
Recursion Algorithms Derivation
Recursion Algorithms DerivationRecursion Algorithms Derivation
Recursion Algorithms Derivation
 
Unit-1 DAA_Notes.pdf
Unit-1 DAA_Notes.pdfUnit-1 DAA_Notes.pdf
Unit-1 DAA_Notes.pdf
 
Theoryofcomp science
Theoryofcomp scienceTheoryofcomp science
Theoryofcomp science
 

Mehr von FALLEE31188 (20)

Lecture4
Lecture4Lecture4
Lecture4
 
Lecture2
Lecture2Lecture2
Lecture2
 
L2
L2L2
L2
 
Inheritance
InheritanceInheritance
Inheritance
 
Inheritance
InheritanceInheritance
Inheritance
 
Functions
FunctionsFunctions
Functions
 
Field name
Field nameField name
Field name
 
Encapsulation
EncapsulationEncapsulation
Encapsulation
 
Cpp tutorial
Cpp tutorialCpp tutorial
Cpp tutorial
 
Cis068 08
Cis068 08Cis068 08
Cis068 08
 
Chapter14
Chapter14Chapter14
Chapter14
 
Chapt03
Chapt03Chapt03
Chapt03
 
C++lecture9
C++lecture9C++lecture9
C++lecture9
 
C++ polymorphism
C++ polymorphismC++ polymorphism
C++ polymorphism
 
C++ classes tutorials
C++ classes tutorialsC++ classes tutorials
C++ classes tutorials
 
C1320prespost
C1320prespostC1320prespost
C1320prespost
 
Brookshear 06
Brookshear 06Brookshear 06
Brookshear 06
 
Book ppt
Book pptBook ppt
Book ppt
 
Assignment 2
Assignment 2Assignment 2
Assignment 2
 
Assignment
AssignmentAssignment
Assignment
 

Kürzlich hochgeladen

Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Kürzlich hochgeladen (20)

Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 

L16

  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66.
  • 67.
  • 68.

Hinweis der Redaktion

  1. A closed formula for C ( n,k ) is given by: C ( n,k ) = n !/( k ! ( n-k )! )
  2. 1 In other texts, including the text for computability the Greek letter epsilon is used instead.
  3. 1 In other texts, including the text for computability (CS3261) the Greek letter  (epsilon) is used instead.
  4. 1 In other texts, including the text for computability the Greek letter  is used instead.
  5. 1 In other texts, including the text for computability the Greek letter  (epsilon) is used instead.
  6. 1 In other texts, including the text for computability the Greek letter  (epsilon) is used instead.
  7. 1 In other texts, including the text for computability the Greek letter  (epsilon) is used instead.
  8. n<=0 is used instead of n==0 because Java’s long is signed, and we don’t want the program to crash or enter an infinite loop for negative numbers. Exceptions handling would be more appropriate here, but this is well beyond the scope of 3203.
  9. Here we assume that the ranges are mutually disjoint and cover all possible input values. Strictly speaking, this code will not compile in Java because there is no default return value. This is fixed by changing the last clause: “ if ( n in range k ) return output k ” to a simple return statement which removes the conditional: “ return output k ”