Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1 The pictorial below represents the triangular number sequence. 1, 3, 6, 10, 15, 21, 28, 36 and 45 are examples of triangular numbers.

image text in transcribed
image text in transcribed
image text in transcribed
Question 1 The pictorial below represents the triangular number sequence. 1, 3, 6, 10, 15, 21, 28, 36 and 45 are examples of triangular numbers. Ti=1 T2 =3 T3=6 T = 10 Ts = 15 To = 21 A triangular number is equal to the sum of n numbers from 1 to n. It can be calculated using the equation: In = k = 1+2+3 +4 +n = n (n + 1) 2 k=1 Where; Tn is the triangular number. k is a positive integer n indicated the nth triangular number in the sequence. A program is required which will display all triangular numbers between 1 and 100. Draw a flow chart for the required program (10 Marks) Question 2 Consider Pascals Triangle used to determine binomial coefficients, where each row begins and ends with the number 1, and every entry in the row is the sum of the 2 adjacent elements in the preceding row (i.e. Pinxta = Pn-1x + Pn-iku:): O TOW 1" row zodrow 3o row nth row throw 5th row 15 10 10 15 2015 6th row 6 kth element Where; P is the binomial coefficient. n is the row number. k is the position of the binomial coefficient in the row. Draw a flow chart for a program to calculate the binomial coefficients in the nth row given the starting vector [1 1] which represents the binomial coefficients in the l" row. [10 Marks] Question 2 Consider Pascals Triangle used to determine binomial coefficients, where each row begins and ends with the number 1, and every entry in the row is the sum of the 2 adjacent elements in the preceding row (i.e. Pinxta = Pn-1x + Pn-iku:): O TOW 1" row zodrow 3o row nth row throw 5th row 15 10 10 15 2015 6th row 6 kth element Where; P is the binomial coefficient. n is the row number. k is the position of the binomial coefficient in the row. Draw a flow chart for a program to calculate the binomial coefficients in the nth row given the starting vector [1 1] which represents the binomial coefficients in the l" row. [10 Marks]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts International Edition

Authors: David M. Kroenke

6th Edition International Edition

0133098222, 978-0133098228

More Books

Students also viewed these Databases questions

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago