



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Project 3 for computer science 106 and computing in engineering and science, focusing on two-dimensional arrays and multilinear regression. The project involves solving simultaneous linear equations using given data and library programs. Students are required to compute the coefficients (b0 to bk) by solving k + 1 simultaneous linear equations.
Typology: Slides
1 / 5
This page cannot be seen from the preview
Don't miss anything!




Larry Caretto Computer Science 106
2
3
4
Fitted Line
y
x indicates data points
y (^) i x (^) i
y ˆ i
5
6
7
j
K
j
=
1
0
8
m y x 1 x 2 x 3 0 2.55 3.00 440 500 1 1.95 3.47 350 400 2 1.89 3.14 440 540 3 2.24 3.46 350 370 4 2.31 3.59 450 480 5 1.74 1.75 200 320 6 1.87 3.03 310 470 7 0.83 3.18 290 400
9
10
11
−
=
1
0
N
m
−
=
=
1
0
N
m
K
j
0
=
12
m y x 0 x 1 x 2 x 3 0 2.55 1 3.00 440 500 1 1.95 1 3.47 350 400 2 1.89 1 3.14 440 540 3 2.24 1 3.46 350 370 4 2.31 1 3.59 450 480 5 1.74 1 1.75 200 320 6 1.87 1 3.03 310 470 7 0.83 1 3.18 290 400
−
=
=
1
0
N
m
Aij ximxjm
19
−
=
1
0
N
m
−
=
1
0
N
m
20
−
=
1
0
N
m
21
0 , , 1
1
0
= = −
−
=
N
j
ij j K
22
bool GaussianElim( double a[][MAX_VAR], double b[], double x[], int N_eqn );
23
24
if ( GaussianElim( A, c, b, K+1 ) ) { cout << “No solution for b[j]”; return EXIT_FAILURE; }
bool GaussianElim( double a[][MAX_VAR], double b[], double x[], int N_eqn ); Left-side
Right-side Unknowns
Number of equations
25
Passing the Second Dimension
26
yˆ m