0

for e.g if the numbers are 1,2 and3.

the P(x) == (x-1)(x-2)(x-3).

so if give 1 and 2 in the command line. the sample output should be 1 , -3, 2.

Please help me......

Not Yet Answered # Finding Coefficients of a polynomial, roots are provided from command line

Parv_boy grumpier 149 Discussion Starter jits_aps90 Discussion Starter jits_aps90 Hey, so I wanna ask how I need to create a method who will remove word if in that word is 2 same chars. Example: "Potato" in this word there is a 2 "o" chars so this word will need to be removed. "Forum" in this word there is no ...

Hi I'm having a problem implementing a mini shopping cart drop down in the header to show the user all the products they have in their shopping cart. It seems the only solution for this is Ajax, and I've looked all over and can't find anything that I could possibly ...

0

for e.g if the numbers are 1,2 and3.

the P(x) == (x-1)(x-2)(x-3).

so if give 1 and 2 in the command line. the sample output should be 1 , -3, 2.

Please help me......

0

Hi!

If two roots are provided a,b

then the equation will be :

x^2 - (a + b)x + (ab) = 0

If three roots are provided a,b,c

then the equation will be (not sure) :

x^3 - (a+b+c)x^2 + (ab+bc+ca)x - (abc) = 0

1

1) First, represent a polynomial (of the form c_0 + c_1*x + c_2*x^2 + .... c_n*x^n) is represented by an array with elements (c_0, c_1, c_2, c_3, .... c_n).

2) Work out how to multiply two arbitrary polynomials together. ie. given a polynomial A (a_0, a_1, a_2, a_3, .... a_n) and a polynomial B (b_0, b_1, b_2, b_3, .... b_m) work out how to obtain a polynomial A*B = C = (c_0, c_1, c_2, c_3, .... c_(m+n)). Hint: The process to produce C from A and B is called convolution.

3) For the first root on the command line, create a polynomial X = (root, 1).

4) For all other roots on the command line;

a) create a polynomial Y = (root, 1)

b) obtain a polynomial Z = X*Y using the approach worked out in Step 2.

c) set X = Z

5) Voila!!!

0

ya thnks dear...

actually, thats a solution when you have known number of roots...

But i am taking some number random number of roots from command line....

thats why i am facing a problem in coding it....

bye tc

0

hi thanks a lot!

in fact i had just worked out the same problem with the same logic.

u r too good!

bye tc

This article has been dead for over six months. Start a new discussion instead.

Recommended Articles

Hi. Im using vb 2010. I want to dynamically add textboxes to my form by clicking on a button. I've google searched and so far this code worked:

```
Private Sub btn_addline_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn_addline.Click
Dim txtB1 As New TextBox
Dim i
For i = ...
```