Closed

# calculate coefficient of each element in (a + b)n for various integer n values from n = 0, to n = a specified value.

This project received 14 bids from talented freelancers with an average bid price of \$122 USD.

N/A
14
###### Project Description

There are two methods for computing those coefficients.

1) Use combinations. Find coefficient of by calculating , where 0 &acirc;&permil;&curren; k &acirc;&permil;&curren; n.

2) Use Pascal's triangle. nth line of this triangle contains coefficients of (a + b)n. kth element of

nth line is coefficient of . Each line can be generated by using the line on top of it.

Hint: See that triangle is symmetric.

Because,

This sample triangle has coefficients of each element in (a+b)n, from n = 0 to n = 10. First line is n=0. In each line, leftmost elements are k=0.

Source: [url removed, login to view]

This may sound simple, but when n is larger than 35, coefficients will not be able to fit in 32

bit unsigned integers. To handle with this problem, you will design and implement

BigUnsignedInteger class that can hold and operate on unlimited sized unsigned integers.

With the help of BigUnsignedInteger class, you will implement Pascal's triangle and

combinatorial solution for finding coefficients. You will write your code in C++ programming

language. You are not allowed to use any library except standard C++ library. In your code,

you will measure running times of both methods respectively (in milliseconds). In your

report, you will compare and contrast their asymptotical bounds (space and time).

Code (60 points)

## Hire Freelancers who also bid on this project

• Forbes
• The New York Times
• Time
• Wall Street Journal
• Times Online