You are on page 1of 3

CE 26400 Data Analysis – Fall 2018

Survey Test Name:

1 Polynomials
The roots of a 4th order polynomial (y = a0 + a1 x + a2 x2 + a3 x3 + a4 x4 ) are r1 , r2 , r3 and r4 .
Express the coefficients (a0 , a1 , a2 , a3 , a4 ) of the polynomial from its roots (r1 , r2 , r3 and r4 ).

Solution:

y = (x − r1 ) (x − r2 ) (x − r3 ) (x − r4 )
= x2 − (r1 + r2 ) x + r1 r2 x2 − (r3 + r4 ) x + r3 r4
  

= x4 − (r1 + r2 ) x3 + r1 r2 x2
− (r3 + r4 ) x3 + (r1 r3 + r2 r3 + r1 r4 + r2 r4 ) x2 − (r1 r2 r3 + r1 r2 r4 ) x
+ r3 r4 x2 − (r1 r3 r4 + r2 r3 r4 ) x + r1 r2 r3 r4
= x4
− (r1 + r2 + r3 + r4 ) x3
+ (r1 r2 + r1 r3 + r1 r4 + r2 r3 + r2 r4 + r3 r4 ) x2
− (r1 r2 r3 + r1 r2 r4 + r1 r3 r4 + r2 r3 r4 ) x
+ r1 r2 r3 r4

a0 = r1 r2 r3 r4
a1 = −r1 r2 r3 − r1 r2 r4 − r1 r3 r4 − r2 r3 r4
a2 = r1 r2 + r1 r3 + r1 r4 + r2 r3 + r2 r4 + r3 r4
a3 = −r1 − r2 − r3 − r4
a4 = 1

2 Integral
0.5

Rx
The area (A = x01 f (x) dx) under the y =
0.4

−16ax4 +30ax3 −18ax2 +4ax function between


0.3

x0 = 0 and x1 = 1.0 (Figure 1) is equal to


y
0.2

A = 1.0. Find coefficient a in the y = f (x)


function to satisfy this condition.
0.1
0.0

0.0 0.2 0.4 0.6 0.8 1.0


x

Solution:
Figure 1: Area under polynomial

1
CE 26400 Data Analysis – Fall 2018
Survey Test Name:

Z 1.0
A= −16ax4 + 30ax3 − 18ax2 + 4axdx = 1.0
x=0.0
Z1.0
A 1
= −16x4 + 30x3 − 18x2 + 4xdx =
a x=0.0 a
 1.0
16 30 18 4
= − x5 + x4 − x3 + x
5 4 3 2 0.0
16 30 18 4
=− + − + = 0.3
5 4 3 2
1.0 1.0
= 0.3 → a = = 3.33
a 0.3
x = seq (from = 0.0, to = 1.0, by = 0.005)
roots = c(0.0, 0.3, 0.6, 1.0)

a = c(-prod(roots),
+ roots[1] * roots[2] * roots[3]
+ roots[1] * roots[2] * roots[4]
+ roots[1] * roots[3] * roots[4]
+ roots[2] * roots[3] * roots[4],
- roots[1] * roots[2]
- roots[1] * roots[3]
- roots[1] * roots[4]
- roots[2] * roots[3]
- roots[2] * roots[4]
- roots[3] * roots[4],
sum(roots), -1) * 16
a[2] = a[2] + 1
a[3] = a[3] - 1
#a[1] = 0.0
a[2] = 4.0
a[3] = -18.0
a[4] = 30.0
#a[5] = -15.0
y = a[1] + a[2] * x + a[3] * x^2 + a[4] * x^3 + a[5] * x^4
plot (x,y)

yFunction = function (x) {


y = a[1] + a[2] * x + a[3] * x^2 + a[4] * x^3 + a[5] * x^4
return (y)
}

3 Binomial coefficient
Binomial coefficients nk can be expressed with factorial notations as nk = (n−k)!k!
n!
 
, where n and
k are positive integer numbers and n! factorial is the product of the integer numbers from one to
n (n! = ni=1 i). Write out 90
Q
5 numerically.

2
CE 26400 Data Analysis – Fall 2018
Survey Test Name:

Solution:
 
90 90 × 89 × 88 × 87 × 86
=
5 1×2×3×4×5

4 Trigonometry
Find the length of the third side of an oblique triangle (Figure 2)
from the lengths of two sides (a = 425.4 [m], and b = 391.8 [m]) and
the angle (γ = 34◦ 260 4600 ) between the known sides.
Hint:

i. the area of an oblique triangle is Aabc = ab sin γ

ii. law of sines sina α = sinb β = sinc γ = 2R = 2A


abc
abc
(where R is the
radius of the circumscribed circle that can be drawn around
the triangle and Aabc is the area of the triangle)

iii. law of cosines c2 = a2 + b2 − 2ab cosγ


Figure 2: Oblique triangle
iv. Combining the laws of sines and cosines with the area of
oblique
q triangle one can derive the Heron’s formula: A =
1
4 4a2 b2 − (a2 + b2 − c2 )2 .

Solution:
p
c= a2 + b2 − 2ab cos γ = 244.09 [m]

You might also like