SlideShare una empresa de Scribd logo
1 de 1
Descargar para leer sin conexión
Below is an algorithm which computes (n)Enumeration(i = 0) (n(n+1))/2 where n is an integer
and n 0:
Algorithmn 1 int rec( int n )
1: if ( n = 0 ) then
2: return 0;
3: end if
4: if ( n%2 == 1 ) then .......... (note: i.e n is odd)
5: return rec(n 1) + n;
6: else
7: return 4 rec(n/2) n/2;
8: end
if Prove that rec(n) = n(n+1)/2 using strong induction.
(a) (3 points) Base case: n = Complete the base case:
(b) Recursive case:
i. (2 points) What are you assuming is true:
ii. (2 points) What are you proving is true:
iii. (3 points) Complete the proof:
case 1: n is odd rec(n) = rec(n 1) + n = (n1)n 2 + n = n 2n+2n 2 = n 2+n 2 = n(n+1) 2 (The
easier case is done for you ,)
case 2: n is even

Más contenido relacionado

Más de alankarshoe84

Below is my code for a line editor import java.io.BufferedReader;.pdf
Below is my code for a line editor import java.io.BufferedReader;.pdfBelow is my code for a line editor import java.io.BufferedReader;.pdf
Below is my code for a line editor import java.io.BufferedReader;.pdf
alankarshoe84
 
B�l�m B � Nehir Sistemlerine Genel Bak Nehirler ve akarsular bir d.pdf
B�l�m B � Nehir Sistemlerine Genel Bak Nehirler ve akarsular bir d.pdfB�l�m B � Nehir Sistemlerine Genel Bak Nehirler ve akarsular bir d.pdf
B�l�m B � Nehir Sistemlerine Genel Bak Nehirler ve akarsular bir d.pdf
alankarshoe84
 
Below is a C code that serves as a handwritten lexical analyzer on a.pdf
Below is a C code that serves as a handwritten lexical analyzer on a.pdfBelow is a C code that serves as a handwritten lexical analyzer on a.pdf
Below is a C code that serves as a handwritten lexical analyzer on a.pdf
alankarshoe84
 
Buenaventura B�y�me, Perunun �nde gelen madencilik irketi ve d�ny.pdf
Buenaventura B�y�me, Perunun �nde gelen madencilik irketi ve d�ny.pdfBuenaventura B�y�me, Perunun �nde gelen madencilik irketi ve d�ny.pdf
Buenaventura B�y�me, Perunun �nde gelen madencilik irketi ve d�ny.pdf
alankarshoe84
 

Más de alankarshoe84 (20)

Ben - Satisfy the individuals need for affiliation Analyse-Develop,.pdf
Ben - Satisfy the individuals need for affiliation Analyse-Develop,.pdfBen - Satisfy the individuals need for affiliation Analyse-Develop,.pdf
Ben - Satisfy the individuals need for affiliation Analyse-Develop,.pdf
 
C Programming LanguageHello can i please get help understanding ho.pdf
C Programming LanguageHello can i please get help understanding ho.pdfC Programming LanguageHello can i please get help understanding ho.pdf
C Programming LanguageHello can i please get help understanding ho.pdf
 
C Language PLEASE Write a C program that inputs a line of text.pdf
C Language PLEASE Write a C program that inputs a line of text.pdfC Language PLEASE Write a C program that inputs a line of text.pdf
C Language PLEASE Write a C program that inputs a line of text.pdf
 
C Language PLEASE Write a C program to create a dynamic array. T.pdf
C Language PLEASE Write a C program to create a dynamic array. T.pdfC Language PLEASE Write a C program to create a dynamic array. T.pdf
C Language PLEASE Write a C program to create a dynamic array. T.pdf
 
B�y�k bir kuruluta, dahili veri kaynaklarnn y�netimine y�nelik polit.pdf
B�y�k bir kuruluta, dahili veri kaynaklarnn y�netimine y�nelik polit.pdfB�y�k bir kuruluta, dahili veri kaynaklarnn y�netimine y�nelik polit.pdf
B�y�k bir kuruluta, dahili veri kaynaklarnn y�netimine y�nelik polit.pdf
 
C language in visual studios with comments1) use standard inputou.pdf
C language in visual studios with comments1) use standard inputou.pdfC language in visual studios with comments1) use standard inputou.pdf
C language in visual studios with comments1) use standard inputou.pdf
 
B�t�elerle ilgili olarak aadaki ifadelerden hangisi doru DELDR A..pdf
B�t�elerle ilgili olarak aadaki ifadelerden hangisi doru DELDR A..pdfB�t�elerle ilgili olarak aadaki ifadelerden hangisi doru DELDR A..pdf
B�t�elerle ilgili olarak aadaki ifadelerden hangisi doru DELDR A..pdf
 
Below is my code for a line editor import java.io.BufferedReader;.pdf
Below is my code for a line editor import java.io.BufferedReader;.pdfBelow is my code for a line editor import java.io.BufferedReader;.pdf
Below is my code for a line editor import java.io.BufferedReader;.pdf
 
B�l�m B � Nehir Sistemlerine Genel Bak Nehirler ve akarsular bir d.pdf
B�l�m B � Nehir Sistemlerine Genel Bak Nehirler ve akarsular bir d.pdfB�l�m B � Nehir Sistemlerine Genel Bak Nehirler ve akarsular bir d.pdf
B�l�m B � Nehir Sistemlerine Genel Bak Nehirler ve akarsular bir d.pdf
 
business information systems (a). Explain three opportunities and.pdf
business information systems  (a). Explain three opportunities and.pdfbusiness information systems  (a). Explain three opportunities and.pdf
business information systems (a). Explain three opportunities and.pdf
 
business information systems 1. Explain the five components of an.pdf
business information systems  1. Explain the five components of an.pdfbusiness information systems  1. Explain the five components of an.pdf
business information systems 1. Explain the five components of an.pdf
 
Below is a C code that serves as a handwritten lexical analyzer on a.pdf
Below is a C code that serves as a handwritten lexical analyzer on a.pdfBelow is a C code that serves as a handwritten lexical analyzer on a.pdf
Below is a C code that serves as a handwritten lexical analyzer on a.pdf
 
Buenaventura B�y�me, Perunun �nde gelen madencilik irketi ve d�ny.pdf
Buenaventura B�y�me, Perunun �nde gelen madencilik irketi ve d�ny.pdfBuenaventura B�y�me, Perunun �nde gelen madencilik irketi ve d�ny.pdf
Buenaventura B�y�me, Perunun �nde gelen madencilik irketi ve d�ny.pdf
 
Buick Company presented the following data at the end of 2019Curr.pdf
Buick Company presented the following data at the end of 2019Curr.pdfBuick Company presented the following data at the end of 2019Curr.pdf
Buick Company presented the following data at the end of 2019Curr.pdf
 
Bu Illinois temyiz mahkemesi davas, mal s�zlemesinin birincil deeriy.pdf
Bu Illinois temyiz mahkemesi davas, mal s�zlemesinin birincil deeriy.pdfBu Illinois temyiz mahkemesi davas, mal s�zlemesinin birincil deeriy.pdf
Bu Illinois temyiz mahkemesi davas, mal s�zlemesinin birincil deeriy.pdf
 
Bristol Plc is a large listed retailer based in the UK. Which of the.pdf
Bristol Plc is a large listed retailer based in the UK. Which of the.pdfBristol Plc is a large listed retailer based in the UK. Which of the.pdf
Bristol Plc is a large listed retailer based in the UK. Which of the.pdf
 
Buenos sistemas de medici�n del rendimiento a. Se compran a provee.pdf
Buenos sistemas de medici�n del rendimiento  a. Se compran a provee.pdfBuenos sistemas de medici�n del rendimiento  a. Se compran a provee.pdf
Buenos sistemas de medici�n del rendimiento a. Se compran a provee.pdf
 
Bu haftaki okuma �devi, bir iletmenin nternet varlndan elde edilen v.pdf
Bu haftaki okuma �devi, bir iletmenin nternet varlndan elde edilen v.pdfBu haftaki okuma �devi, bir iletmenin nternet varlndan elde edilen v.pdf
Bu haftaki okuma �devi, bir iletmenin nternet varlndan elde edilen v.pdf
 
Bu yln balarnda yaplan bilimsel bir keif, solunum i�in oksijen kulla.pdf
Bu yln balarnda yaplan bilimsel bir keif, solunum i�in oksijen kulla.pdfBu yln balarnda yaplan bilimsel bir keif, solunum i�in oksijen kulla.pdf
Bu yln balarnda yaplan bilimsel bir keif, solunum i�in oksijen kulla.pdf
 
Briefly discuss why international diversification reduces portfolio .pdf
Briefly discuss why international diversification reduces portfolio .pdfBriefly discuss why international diversification reduces portfolio .pdf
Briefly discuss why international diversification reduces portfolio .pdf
 

Último

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
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Último (20)

Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
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
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
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
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
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
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 

Below is an algorithm which computes (n)Enumeration(i = 0) (n(n+1)).pdf

  • 1. Below is an algorithm which computes (n)Enumeration(i = 0) (n(n+1))/2 where n is an integer and n 0: Algorithmn 1 int rec( int n ) 1: if ( n = 0 ) then 2: return 0; 3: end if 4: if ( n%2 == 1 ) then .......... (note: i.e n is odd) 5: return rec(n 1) + n; 6: else 7: return 4 rec(n/2) n/2; 8: end if Prove that rec(n) = n(n+1)/2 using strong induction. (a) (3 points) Base case: n = Complete the base case: (b) Recursive case: i. (2 points) What are you assuming is true: ii. (2 points) What are you proving is true: iii. (3 points) Complete the proof: case 1: n is odd rec(n) = rec(n 1) + n = (n1)n 2 + n = n 2n+2n 2 = n 2+n 2 = n(n+1) 2 (The easier case is done for you ,) case 2: n is even