0% found this document useful (0 votes)
144 views19 pages

MAT10f Midterm PDF

The document discusses solving systems of linear equations using Cramer's rule. It begins by presenting Cramer's rule for solving a system of two equations with two unknowns. It then shows how to apply Cramer's rule to systems with three unknowns. Finally, it provides an example problem solving a 3x3 system using Cramer's rule and arriving at the solution set {(7, -3, -4)}.

Uploaded by

Julius Boitizon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
144 views19 pages

MAT10f Midterm PDF

The document discusses solving systems of linear equations using Cramer's rule. It begins by presenting Cramer's rule for solving a system of two equations with two unknowns. It then shows how to apply Cramer's rule to systems with three unknowns. Finally, it provides an example problem solving a 3x3 system using Cramer's rule and arriving at the solution set {(7, -3, -4)}.

Uploaded by

Julius Boitizon
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

Solution of Linear Equations by Determinants: (Cramer’s Rule)

Consider a system of linear equations in two variables x and y

Multiply equation (1) by b2 and equation (2) by b1 and subtracting, we get

Again multiply eq. (1) by a2 and eq. (2) by a1 and subtracting, we get

Note that x and y from equations (3) and (4) has the same denominator a1b2 –
a2b1. So the system of equations (1) and (2) has solution only when a1b2 – a2b1
≠ 0.
The solutions for x and y of the system of equations (1) and (2) can be
written directly in terms of determinants without any algebraic operations, as

Here

is the determinant of the coefficient of x and y in equations (1) and (2)

If

and

Then,

and

Prepared by: ENGR. GILBERT R. ESQUILLO


Solution for a system of Linear Equations in Three Variables:

Consider the linear equations

Hence the determinant of coefficients is

Then by Cramer‟s Rule the value of variables is

SAMPLE PROBLEM

Solve the system using Cramer’s rule given the equations below

SOLUTION

Here the determinant of the coefficients is

for |Ax|, replacing the first column of |A| with the corresponding constants
2, 5 and 8, we have

Prepared by: ENGR. GILBERT R. ESQUILLO


Similarly,

And

Hence

So the solution set of the system is {(7, –3, –4)}

Prepared by: ENGR. GILBERT R. ESQUILLO


INSTRUCTION: Analyze and solve the given problems in a neat and precise manner.
Label your final answer.

Use Cramer’s rule to solve the following system of equations

1.

2.

3.

4.

5.

Prepared by: ENGR. GILBERT R. ESQUILLO


ROOTS OF AN EQUATIONS

INTRODUCTION
There are many other functions for which the root cannot be determined so
easily. Before the advent of digital computers, there were a number of ways to
solve for the roots of such equations. For some cases, the roots could be
obtained by direct methods. Although there were equations like this that could
be solved directly, there were many more that could not. In such instances, the
only alternative is an approximate solution technique.

OBJECTIVE
After completing this module, you should be able to
 understand what roots problems are and where they occur in engineering and
science
 Knowing how to determine a root graphically
 Knowing how to solve a roots problem with the bisection method

DISCUSSION

BRACKETING METHODS

1. GRAPHICAL METHODS

A simple method for obtaining an estimate of the root of the equation f(x) = 0
is to make a plot of the function and observe where it crosses the x axis.
This point, which represents the x value for which f (x) = 0, provides a rough
approximation of the root.

Graphical techniques are of limited practical value because they are not very
precise. However, graphical methods can be utilized to obtain rough estimates
of roots

Aside from providing rough estimates of the root, graphical interpretations


are useful for understanding the properties of the functions and anticipating
the pitfalls of the numerical methods

Steps to find roots of rational functions


1. Set each factor in the numerator to equal zero
2. Solve that factor for x.
3. Check the denominator factors to make sure you aren't dividing by
zero!

EXAMPLE

Find the roots of the given equation

Prepared by: ENGR. GILBERT R. ESQUILLO


SOLUTION

Graph the equation. This could either be done by making a table of values or
by computer or a graphing calculator.

The parabola cross the x-axis at x = -2 and x = 5. These are the roots of the
quadratic equation.

Note:
 A quadratic equation has two roots if its graph has two x-intercepts
 A quadratic equation has one root it its graph has one x-intercept
 A quadratic equation has no real solutions if its graph has no x-
intercepts.

2. THE BISECTION METHOD


When applying the graphical technique, you have observed that f(x) changed
sign on opposite sides of the root. In general, if f(x) is real and
continuous in the interval from xl to xu and f(xl) and f(xu) have opposite
signs, that is

then there is at least one real root between xl and xu.

The bisection method, which is alternatively called binary chopping,


interval halving, or Bolzano’s method, is one type of incremental search
method in which the interval is always divided in half. If a function changes
sign over an interval, the function value at the midpoint is evaluated. The
location of the root is then determined as lying at the midpoint of the
subinterval within which the sign change occurs. The process is repeated to
obtain refined estimates.

The following goes through the actual computations involved in the method
1. Choose lower xl and upper xu guesses for the root such that the function
changes sign over the interval. This can be checked by ensuring that
f( xl )f(xu) < 0.
2. An estimate of the root xr is determined by

3. Make the following evaluations to determine in which subinterval the


root lies:

Prepared by: ENGR. GILBERT R. ESQUILLO


(a) If f(xl)f(xu) < 0, the root lies in the lower subinterval. Therefore,
set xu = xr and return to step 2.
(b) ) If f(xl )f(xr)>0, the root lies in the upper subinterval. Therefore,
set xl = xr and return to step 2.
(c) If f(xl )f(xr) = 0, the root equals xr; terminate the computation.

EXAMPLE
Determine the root of the given equation x² - 3 = 0 for x ∈ [1, 2].

SOLUTION
Given: x²-3 = 0

Let f(x) = x²-3


Now, find the value of f(x) at a= 1 and b=2.
f(x=1) = 1² - 3 = 1 – 3 = -2 < 0
f(x=2) = 2² - 3 = 4 – 3 = 1 > 0

The given function is continuous, and the root lies in the interval [1,
2].

Let “t” be the midpoint of the interval.


i.e., t = (1+2)/2
t =3 / 2
t = 1.5

Therefore, the value of the function at “t” is


f(t) =f(1.5) = (1.5)2-3 = 2.25 – 3 = -0.75 < 0
f(t) is negative, so b is replaced with t= 1.5 for the next iterations.

The iterations for the given functions are:

So, at the seventh iteration, we get the final interval [1.7266, 1.7344]
Hence, 1.7344 is the approximated solution.

Prepared by: ENGR. GILBERT R. ESQUILLO


3. THE FALSE-POSITION METHOD
Although bisection is a perfectly valid technique for determining roots, its
“brute-force” approach is relatively inefficient. False position is an
alternative based on a graphical insight.

Using similar triangles (Fig. 5.12), the intersection of the straight line
with the x axis can be estimated as

Eq. (3-a)
which can be solved for

Eq. (3-b)

Cross-multiply Eq. (3 - a) to yield

Collect terms and rearrange:

Divide by f(xl)- f(xu):

(Eq. 3-c)
This is one form of the method of false position. Note that it allows the
computation of the root xr as a function of the lower and upper guesses xl and
xu. It can be put in an alternative form by expanding it:

then adding and subtracting xu on the right-hand side

Collecting terms yields

Or

Prepared by: ENGR. GILBERT R. ESQUILLO


which is the same as Eq. (3-b). We use this form because it involves one less
function evaluation and one less multiplication than Eq.3-c.

This is the false-position formula. The value of xr computed with Eq. (3-c) then
replaces whichever of the two initial guesses, xl or xu, yields a function value
with the same sign as f(xr). In this way, the values of xl and xu always bracket
the true root. The process is repeated until the root is estimated adequately.

EXAMPLE
Find a root of an equation f(x)= 2x³ - 2x - 5 using False Position method
(regula falsi method)

SOLUTION
Here 2x³ -2x -5 = 0

Here

1st iteration :
Here f(1)=-5<0 and f(2)=7>0

∴ Now, Root lies between x0 = 1 and x1 = 2

2nd iteration :
Here f(1.41667)=-2.14699<0 and f(2)=7>0
∴ Now, Root lies between x0=1.41667 and x1=2

Prepared by: ENGR. GILBERT R. ESQUILLO


3rd iteration :
Here f(1.55359)=-0.60759<0 and f(2)=7>0

∴ Now, Root lies between x0=1.55359 and x1=2

4th iteration :
Here f(1.58924)=-0.15063<0 and f(2)=7>0

∴ Now, Root lies between x0=1.58924 and x1=2

5th iteration :
Here f(1.59789)=-0.0361<0 and f(2)=7>0

∴ Now, Root lies between x0=1.59789 and x1=2

6th iteration :
Here f(1.59996)=-0.00858<0 and f(2)=7>0

Prepared by: ENGR. GILBERT R. ESQUILLO


∴ Now, Root lies between x0=1.59996 and x1=2

7th iteration :
Here f(1.60045)=-0.00203<0 and f(2)=7>0

∴ Now, Root lies between x0=1.60045 and x1=2

Approximate root of the equation 2x³-2x-5=0 using False Position method


is 1.60056.

Prepared by: ENGR. GILBERT R. ESQUILLO


CURVE FITTING

INTRODUCTION
From previous topic you have learned how to find the roots of an equation.
Now, you now apply your minimization results to the interpolation and least
squares fitting of data and functions.

OBJECTIVE
After completing this module, you should be able to solve linear systems with
more equations than unknowns.

DISCUSSION

There are two general approaches for curve fitting

1. Interpolation is such approximation, in which the function φ (x ) goes


exactly through given points [ xi,yi ] , where yi = f(xi ) . Sometimes I also
require that functions f and φ have the same derivatives in points xi .

Estimating intermediate values between precise data points, We first fit a


function that exactly passes through the given data points and then evaluate
intermediate values using this function.

Polynomial Interpolation
 Given the following n+1 data points

there is a unique nth order polynomial that passes through them

 The question is to find the coefficients a0 , a1 , . . ., an


 Linear Interpolation:
 Given: (x0 , y0 ) and (x1 , y1 )
 A straight line passes from these two points.
 Using similar triangles

Prepared by: ENGR. GILBERT R. ESQUILLO


Linear Interpolation Formula

 Quadratic Interpolation
 Given: (x0,y0 ) , (x1,y1 ) and (x2,y2)
 A parabola passes from these three points.
 Similar to the linear case, the equation of this parabola can be written
as

 • How to find b0 , b1 and b2 in terms of given quantities?


 at x=x0 f2 (x) = f(x0 ) = b0

 at x=x1 f2 (x) = f(x1 ) = b0 + b1x1


 at x=x2 f2 (x) = f(x2 ) = b0 + b1 (x2 -x0 )+ b2 (x2 -x0 )(x2 -x1 )

EXAMPLE
For the data points (2, 3) and (5, 7) find P1(x).

SOLUTION

In general, if y0 = f(x0) and y1 = f(x1) for some function f, then P1(x) is a


linear approximation of f(x) for all x ∈ [x0, x1].

2. Least-square method is such approximation, in which φ (x ) is


“interlaced“ between given points [ xi,yi ] in such a way, that the
“distance“ between functions f and φ is in some sense minimal. Usually the
function φ (x ) does not go through points [ xi,yi ].

The least squares solution to a linear system is one means of getting as close
as one can to an actual solution.

Prepared by: ENGR. GILBERT R. ESQUILLO


To fit the straight line y=a+bx
a) Substitute the observed set of n values in this equation
b) Form the normal equations for each constant i.e

c) Solve these normal equations as simultaneous equations of a and b


d) Substitute the values of a and b in y=a+bx, which is the required
line of best fit
e) From the normal equations ,

f) Solve these as simultaneous equations for a,b,c


g) Substitute the values of a,b, c in y = a + bx + cx², which is the
required parabola of best fit.

EXAMPLE

Fit the line to the x and y values in the following table

Xi Yi XiYi Xi²
1 0.5 0.5 1
2 2.5 5 4
3 2 6 9
4 4 16 16
5 3.5 17.5 25
6 6 36 36
7 5.5 38.5 49
Ʃ 28 24 119.5 140

answer

Prepared by: ENGR. GILBERT R. ESQUILLO


OPTIMIZATION
INTRODUCTION
From previous topic you have learned how to apply approximation in the given
problems. Also, you are able to find the roots of a given equation which
optimization are related in the sense that both involve guessing and searching
for a point on a function. Root location involves searching for zeros of a
function or functions. In contrast, optimization involves searching for either
the minimum or the maximum

OBJECTIVE
After completing this module, you should be able to determine the maximum or
minimum values that an equation may have.

DISCUSSION

The optimum is the point where the curve is flat. In mathematical terms, this
corresponds to the x value where the derivative f’(x) is equal to zero.
Additionally, the second derivative, f”(x), indicates whether the optimum is
a minimum or a maximum: if f”(x)< 0, the point is a maximum; if f”(x)> 0, the
point is a minimum.

Most of the mathematical models you have dealt with to this point have been
descriptive models. That is, they have been derived to simulate the behavior of
an engineering device or system. In contrast, optimization typically deals with
finding the “best result,” or optimum solution, of a problem. Thus, in the
context of modeling, they are often termed prescriptive models since they can
be used to prescribe a course of action or the best design

GOLDEN-SECTION SEARCH. The golden-section search is a simple, general-purpose,


single-variable search technique. It is similar in spirit to the bisection
approach for locating roots. Recall that bisection hinged on defining an
interval, specified by a lower guess (xl) and an upper guess (xu), that bracketed
a single root. The presence of a root between these bounds was verified by
determining that f(xl) and f(xu) had different signs. The root was then estimated
as the midpoint of this interval,

Now we can develop a similar approach for locating the optimum of a one-
dimensional function. For simplicity, we will focus on the problem of finding
a maximum. When we discuss the computer algorithm, we will describe the minor
modifications needed to simulate a minimum.

The initial step of the golden-section search algorithm involves choosing two
interior points according to the golden ratio.

Prepared by: ENGR. GILBERT R. ESQUILLO


The key to making this approach efficient is the wise choice of the
intermediate points. As in bisection, the goal is to minimize function
evaluations by replacing old values with new values. This goal can be achieved
by specifying that the following two conditions hold

(Eq. 6-1)

(Eq. 6-2)

The first condition specifies that the sum of the two sublengths l1 and l2 must
equal the original interval length. The second says that the ratio of the
lengths must be equal. Equation (6-1) can be substituted into Eq. (6-2).

If the reciprocal is taken and R = l2/11, we arrive at

or
which can be solved for the positive root

EXAMPLE
Use the golden-section search to find the maximum of

within the interval xl = 0 and xu = 4.

SOLUTION
First, the golden ratio is used to create the two interior points

The function can be evaluated at the interior points

Because f(x2) > f(x1), the maximum is in the interval defined by xl , x2, and
x1. Thus, for the new interval, the lower bound remains xl = 0, and x1 becomes
the upper bound, that is, xu = 2.472. In addition, the former x2 value becomes

Prepared by: ENGR. GILBERT R. ESQUILLO


the new x1, that is, x1 = 1.528. Further, we do not have to recalculate f(x1)
because it was determined on the previous iteration as f(1.528) 5 1.765.
All that remains is to compute the new values of d and x2,

The function evaluation at x2 is f(0.994) = 1.531. Since this value is less


than the function value at x1, the maximum is in the interval prescribed by
x2, x1, and xu. The process can be repeated, with the results tabulated below:

Note that the current maximum is highlighted for every iteration. After the
eighth iteration, the maximum occurs at x = 1.4427 with a function value of
1.7755. Thus, the result is converging on the true value of 1.7757 at x =
1.4276.

Prepared by: ENGR. GILBERT R. ESQUILLO


LEARNING ACTIVITY 6-1

Name:_____________________________ Date: ___________________

Course/Yr/Sec: ___________________ Score: __________________

INSTRUCTION: Analyze and solve the given problems in a neat and precise manner.
Label your final answer. Submit in Long bond paper, due date May 12, 2023

ROOTS OF AN EQUATIONS
Find the roots of the given function using
A) Graphical Method
B) Bisection Method
C) False-Position Method

1. y= 2x³ -5x² +20x -5 between 0 and 1

2. 𝑓(𝑥) = 𝑒 −𝑥

INTERPOLATION
3. The following logarithmic table is given below. a) Interpolate log(5) using the
points x=4 and x=6, b) Interpolate log(5) using the points x=4.5 and x=5.5, c)
Interpolate log(5) using the points x=4.5, x=5.5 and x=6 ( Quadratic
Interpolation)
Note: The exact value is log(5) = 0.69897

LEAST SQUARE APPROXIMATION


4. Fit a relation of the form ab^x => lny = ln a +x ln b
x y
2 144
3 172.8
4 207.4
5 248.8
6 298.5

5. Supposed your company have figures: the turnover of the last five (5) years as
shown in table below.Determine the equation of the line best fit for 6th year and the
estimated turnover for 2021.
Year Xi Yi
2015 1 80
2016 2 162
2017 3 250
2018 4 300
2020 5 408

Prepared by: ENGR. GILBERT R. ESQUILLO


OPTIMIZATION

6. Maximize the daily output in producing x1 chairs by Process P1 and chairs x2


by Process P2 subject to 3x1 _x0005_+ 4x2 ≦ 550(machine hours), 5x1 + 4x2 ≦
650 (labor).

7. Maximize the daily profit in producing x1 metal frames F1 (profit P90.00 per
frame) and x2 frames F2(profit P50.00 per frame) subject to x1 + _x0005_ 3x2 ≦
18(material), x1 + x2 ≦ 10(machine hours), 3x1 + x2 ≦ 24 (labor).

8. Maximize f = 2x1 _x0005_+ x2 _x0005_+ 3x3 subject to 4x1+ 3x2 + 6x3 = 12.

9. Maximize f = 2x1+ 3x2 + x3 subject to x1+ x2 + x3 ≦ 4.8, 10x1+ x3 ≦ 9.9,x2 -


x3 ≦ 40.2

10. Maximize f = 2x1 + 3x2 subject to 5x1+ 3x2 ≦ 105, 3x1+ 6x2 ≦ 126.

Prepared by: ENGR. GILBERT R. ESQUILLO

You might also like