Ditutup

Induction and recursion computer science

1. (a) Write the simple recursive program sumcube (i.e., sumcube(n) calls itself on (n-1)) to compute the sum of first n cubes, i.e, $\Sigma_{i=1}^n(i^3)$

(b) Write the simple recursive program sumi (i.e., sumi(n) calls itself on (n-1)) to compute the sum of first n numbers, i.e, $\Sigma_{i=1}^n(i)$

(b) prove using simple induction that sumcube(n) = [sumi(n)]^2.

i.e., prove $\forall n \in N. P(n)$ where $P(n) = sumcube(n) = [sumi(n)]^2$

Hint: both sides of the equation requires simplification using the programs you write - other than that, everything is direct.

2. (a) Write a simple recursive program prod_arr_s(A,n) that inputs an array and its size and returns the product of the elements in the array.

(b) Using the assumption that the elements in the array are non-negative, and simple induction, prove that the output of prod_arr_s(A,n) is non-negative.

3. (a) Write a course-of-value recursive program prod_arr_c(A,n) (i.e., prod_arr_c splits the array in half) that inputs an array and its size and returns the product of the elements in the array.

(b) Using the assumption that the elements in the array are non-negative, and strong induction, prove that the output of prod_arr_c(A,n) is non-negative.

4. (a) Write a course-of-value recursive program using repeated division binlen(n) that inputs n and finds the length of n's binary representation.

(b) Prove using strong induction that binlen(n) <= n

Kemahiran: Pengaturcaraan C, Algoritma, Matematik

Lihat lagi: subtract big numbers recursion, algorithm to find prime numbers from 1 to n, gcd of n numbers, lcm of n numbers, mathematics is the science of numbers and, n numbers, number of prime numbers less than n, prime numbers binary representation, You are given n numbers in an array A. Describe an efficient parallel algorithm for sorting the numbers in the array A using p p, You are given n numbers in an array A. Describe an efficient parallel algorithm for sorting the numbers in the array A using p , c program for permutation of numbers using recursion, c++ program to calculate variance and standard deviation of n numbers, sum of n numbers using threads in c, mpi program to add sum of n numbers, c program for sum of 3 numbers, c++ program for sum of 3 numbers, induction science examples, java program to print prime numbers upto n, compute sum of digits in all numbers from 1 to n, sum of 3 odd numbers equal to 30

Tentang Majikan:
( 0 ulasan ) Ruidoso, United States

ID Projek: #32251249

7 pekerja bebas membida secara purata $29 untuk pekerjaan ini

huzaifarizwan995

Hi, I am a professional programmer and trader and will give you the best work I have innovative tech mind with 10 years of experience working as a computer programmer. Capable of working with a variety of technology an Lagi

$25 USD dalam sehari
(30 Ulasan)
5.0
CodingHelpLine

Hello Sir/Madam I have development experience in various Programming Languages, OOP, Data Structures, Database Driven applications, APIs, Files handling and Data Transformation, ETL and various frameworks. I assure y Lagi

$30 USD dalam sehari
(44 Ulasan)
5.0
(21 Ulasan)
4.8
shashaev96

Professional Software Developer️ Hello , I hope you are safe and Doing well I have seen your project requirements , I am looking to discuss further with you Hope we will meet soon to discuss further Coming to me, I Lagi

$25 USD dalam sehari
(14 Ulasan)
4.4
karanrajput1112

As a Post Graduate in Applied Statistics, I have a lot of experience in handling statistical data, especially in Time Series Modelling & Forecasting, Regression analysis, Bio-Statistics, descriptive and Inferential Sta Lagi

$30 USD dalam 7 hari
(18 Ulasan)
4.3
ngkhoan

Hello, Sir Thank you for your job posting. I am very interested in your project and I will provide you 100% quality work. I have rich experiences in C/C++ . I am ready to start work immediately and can work full time Lagi

$30 USD dalam sehari
(8 Ulasan)
2.6
cdoory

Hello, I am a mathematician and a C programmer, with many years of experience. I will write the recursive programs that are required and I will do the required proves by the induction method. These are simple programs, Lagi

$30 USD dalam 3 hari
(0 Ulasan)
0.0