Uploaded by Vidur Lutchminarain

153611 Vidur Lutchminarain Maths511 Assignment

advertisement
153611_Vidur_Lutchminarain
153611_Vidur_Lutchminarain
MATHS 511
Assignment
153611_Vidur_Lutchminarain
Vidur360@gmail.com
1|Page
153611_Vidur_Lutchminarain
Table of Contents
Question 1 ............................................................................................................................................... 3
1.1)
Maximization .......................................................................................................................... 3
Tableau 1:............................................................................................................................................ 3
Tableau 2:............................................................................................................................................ 3
Tableau 3:............................................................................................................................................ 4
Tableau 4:............................................................................................................................................ 5
1.2)
Truth table .............................................................................................................................. 5
1.3)
Minimization ........................................................................................................................... 6
Tableau 1................................................................................................................................................. 6
Tableau 2................................................................................................................................................. 7
1.4) ...................................................................................................................................................... 7
Tableau 1:............................................................................................................................................ 7
Tableau 2:............................................................................................................................................ 8
Tableau 3:............................................................................................................................................ 8
1.5) a) ................................................................................................................................................. 8
1.5) b) ................................................................................................................................................ 10
1.6)
Using Cramer’s rule to find X ................................................................................................ 12
1.7) Solving the linear equation using the inverse method .............................................................. 14
1.8)
Brute force algorithm to find minimum cost circuit of Hamilton circuit: ............................. 15
1.9)
Does a Hamiltonian path or circuit exist on the graph below? ............................................ 15
1.10)
Find: a) –𝐴 − 1+ 3𝐵𝑇 ........................................................................................................ 15
b) 𝐵 − 1+ ( 𝐴𝑇+𝐴 − 1) ...................................................................................................................... 17
References ............................................................................................................................................ 19
2|Page
153611_Vidur_Lutchminarain
Question 1
1.1)
Maximization
Maximize: Z = 3a + b + 2c
Standard form: 0= -3a - b - 2c + Z
Subject to: 1. a + b + 3c <=30
2. 2a + 2b + 5c <= 24
3. 4a + b + 2c <= 36
4. a,b,c >= 0
New equations:
1. a + b + 3c+ s1 <=30
2. 2a + 2b + 5c + s2 <= 24
3. 4a + b + 2c + s3<= 36
4. a,b,c >= 0
Tableau 1:
a
b
c
1
1
3
2
2
5
⌈
4
1
2
−3 −1 −2
•
s1 s2 s3 Z
1 0 0 0 30
0 1 0 0 24
⌉ ]
0 0 1 0 36
0 0 0 1 0
-3 is the most negative in the last row, therefore the ratios are:
30
Row1: 1 = 30
24
Row2: 2 = 12
36
Row3: 4 = 9
Lowest of the ratios therefore we pivot on 4.
Pivot equations:
•
1
•
•
•
-1*R3+R1
-2*R3 +R2
3*R3 +R4
4
* R3
R3
R1
R2
R4
Tableau 2:
a
0
⌈
⌈0
⌈
⌈1
⌈
⌈
⌈0
b
c
s1 s2 s3 Z
3
5
1
1 0 −
0 21
4
2
4
⌉
3
1
⌉
4 0 1 −
0⌉ 6 ⌉
2
2
⌉
⌉
1
1
1
0 0
0⌉ 9 ⌉
⌉ ⌉
4
2
4
1
1
3
⌉
−
−
0 0
1⌉ 27]
4
2
4
3|Page
153611_Vidur_Lutchminarain
•
1
- 2 is the most negative in the last row, therefore the ratios are:
21
42
Row 1: 5 = 5 = 8.4
2
6
Row 2: 4 = 1.5
Lowest of the ratios therefore we pivot on 4.
9
Row 3: 1 = 18
2
Pivot equations:
•
1
•
− 2* R2 + R1
R1
•
− 2 * R2 + R3
R3
* R2 + R4
R4
•
* R2
4
R2
5
1
1
2
Tableau 3:
a
0
⌈
⌈0
⌈
⌈1
⌈
⌈
⌈0
•
b
3
−
16
3
8
1
16
1
−
16
c s1
0
1
1
0
0
0
0
0
s2 s3 Z
5 1
69
−
0
8 16
⌉ 4 ⌉
1
1
3
⌉
−
0⌉
4
8
⌉ 2 ⌉
33 ⌉
1 5
−
0⌉
⌉ 4 ⌉
8 16
1
11
⌉ 111⌉
1⌉
4 ]
8
16
1
− 16 is the most negative in the last row, therefore the ratios are:
Row1:
Row2:
Row3:
69
4
3
−
16
3
2
3
8
33
4
1
16
= −92
3
=4
Lowest of the ratios therefore we pivot on 8.
= 132
Pivot equations:
•
•
8
3
3
* R2
R2
* R2 + R1
16
R1
1
•
− *R2 + R3
•
1
R3
16
*R2 +R4
16
R4
4|Page
153611_Vidur_Lutchminarain
Tableau 4:
a
b
0 0
⌈
⌈0 1
⌈
⌈1 0
⌈
⌈
⌈0 0
c s1
1
1
2
8
0
3
1
−
0
6
1
0
6
s2 s3 Z
3
0 0 18
16
⌉
2
1
⌉
−
0⌉ 4 ⌉
3
3
⌉
⌉
1 1
−
0⌉ 8 ⌉
6 3
⌉ ⌉
1
2
⌉
1⌉ 28]
6
3
There are no negative numbers in the last row, therefore the table is now optimal where:
a=8
b=4
c=0
s1 = 18
s2 = 0
s3 = 0
Z = 28
Maximum value of 28 at (8, 4, 0, 18, 0, 0)
1.2)
Truth table
Truth table: 𝟐𝟑 = 𝟖, 𝟒, 𝟐, 𝟏
A
B
C
A AND B
B NAND C
¬𝐂
(A AND B) NOR ¬C
T
T
T
T
F
F
F
((A AND B) NOR ¬C) OR (B
NAND C)
F
T
T
F
T
T
T
F
T
T
F
T
F
T
F
T
T
T
F
F
F
T
T
F
T
F
T
T
F
F
F
T
T
F
T
F
F
T
T
F
T
F
F
T
F
T
F
T
T
F
F
F
F
T
T
F
T
5|Page
153611_Vidur_Lutchminarain
1.3)
Minimization
Minimize: z = a + b + c
Subject to:
1. a - b - c  0
2. a + b + c ≥ 4
3. a + b - c = 2
4. a, b  0
a
1
1
[
1
1
b
c
−1 −1 0
1
1 4
] ] Transpose
1 −1 2
1
1 0
t
1
−1
[
−1
0
u
v
1 1 1
1 1 1
] ]
1 −1 1
4 2 0
Therefore, we maximize: Z = 4u + 2v
Subject to:
1. t + u + v ≥1
2. -t + u + v ≤ 1
3. -t + u – v = 1
4. a, b ≤ 0
Tableau 1
t
u
v
a
1
1
1 1
−1 1
1 0
⌈
−1 1 −1 0
0 −4 −2 0
•
b
0
1
0
0
c
0
0
1
0
z
0 1
0 1
⌉ ]
0 1
1 0
−4 is the most negative in the last row, therefore the ratios are:
1
Row1: 1 = 1
All ratios are the same, therefore we can Pivot on 1 (first row).
1
Row2: 1 = 1
1
Row3: 1 = 1
Pivot equations:
•
•
•
•
R1
R1
−1* R1+ R2
−1 * R1 + R3
4* R1 + R4
R2
R3
R4
6|Page
153611_Vidur_Lutchminarain
Tableau 2
t
1
−2
⌈
−2
4
u
v
a b c
1 1
1 0 0
0 0 −1 1 0
0 −2 −1 0 1
0 2
4 0 0
z
0 1
0 0
⌉ ]
0 0
1 4
There are no negative numbers in the last row, therefore the table is now optimal where:
a=4
b=0
c=0
z=4
Minimum value of 4 at (4, 0, 0)
1.4)
Given the constraints:
Maximize: 24 - A- B – C
Let: Z = A + B + C
0=Z – A - B - C
1. A+B + C + S1  24,
2. B +C - S2 8
3. A  0, B  0, C  0.
Tableau 1:
A
B C s1 s2 Z
1
1
1 1 0 0 24
[0
1
1 0 1 0] 8 ]
−1 −1 −1 0 0 1 0
•
−1 is the most negative in the last row, second column, therefore the ratios are:
24
Row1: 1 = 24
8
Row2: 1 = 8
Lowest of the ratios therefore we pivot on 1.
Pivot equations:
•
•
•
R2
R2
-R2 +R1
R1
R2 + R3
R3
7|Page
153611_Vidur_Lutchminarain
Tableau 2:
•
A
B C s1 s2 Z
1 0 0 −1 0 0 16
[ 0 1 1 0 1 0] 8 ]
−1 0 0 0 1 1 8
−1 is the most negative in the last row, second column, therefore the ratios are:
16
Row1: 1 = 16
lowest real ratio, therefore we pivot on 1
8
Row2: 0 = undefined
Pivot equations:
•
•
•
R1
R1
R2
R2
R1 + R3
R3
Tableau 3:
A
1
[0
0
B C s1 s2 Z
0 0 1 −1 0 16
1 1 0 1 0] 8 ]
0 0 1 0 1 24
There are no negative numbers in the last row, therefore the table is now optimal where:
A = 16
B=8
c=0
s1 = 0
s2 = 0
Z = 24
Maximum value of 24 at (16, 8, 0, 0, 0)
1.5) a)
4
1
3 0 𝑋
[ 0 0.5 1] [𝑌 ] = [1]
0.5 0 1 𝑍
3
+
-
+
1
3 0
|𝐷| = [ 0 0.5 1]
0.5 0 1
=
0 1
0.5 1
0 0.5
1|
| −3|
|0|
|
0.5 1
0 1
0.5 0
= 1|(0.5)(1) − (0)(1)|-3|(0)(1) − (0.5)(1)|0|(0)(0) − (0.5)(0.5)|
= 1(0.5 - 0) -3(0 - 0.5) +0(0-0.25)
= 0.5 + 1.5 + 0
8|Page
153611_Vidur_Lutchminarain
=2
Therefore|𝐷| = 2.
+
-
+
0.5 1 0 1 0 0.5
[
][
][
]
0 1 0.5 1 0.5 0
3
[
0
+
-
0 1 0 1 3
][
][
]
1 0.5 1 0.5 0
+
-
3 0 1
[
][
0.5 1 0
+
0 1 3
][
]
1 0 0.5
0.5 0.5 −0.25
1
= [−3 0.5
1.5 ] x 𝐷
3 −1
0.5
0.5 0.5 −0.25
1
= [−3 0.5
1.5 ] x 2
3 −1
0.5
0.5
2
⌈−3
=⌈ 2
⌈3
[2
=[
0.5
2
0.5
2
−1
2
−0.25
2
4
1.5 ⌉
[
1]Transpose
2 ⌉
0.5 ⌉ 3
2 ]
2
2
⌈2
⌈2
⌈−1
[2
−3
2
1
2
1.5
2
9
2
3 ⌉
2 ⌉
1.5⌉
2 ]
(2 − 3 + 9)/2
(2 + 1 + 3)/2 ]
(−1 + 1.5 + 1.5)/2
4
= [ 0]
1
Therefore, X = 4, Y = 0 and Z = 1.
9|Page
153611_Vidur_Lutchminarain
1.5) b)
4
1
3 0 𝑋
[ 0 0.5 1] [𝑌 ] = [1]
0.5 0 1 𝑍
3
+
-
+
1
3 0
|𝐷| = [ 0 0.5 1]
0.5 0 1
=
0 1
0.5 1
0 0.5
1|
| −3|
|0|
|
0.5 1
0 1
0.5 0
= 1|(0.5)(1) − (0)(1)|-3|(0)(1) − (0.5)(1)|0|(0)(0) − (0.5)(0.5)|
= 1(0.5 - 0) -3(0 - 0.5) +0(0-0.25)
= 0.5 + 1.5 + 0
=2
Therefore|𝐷| = 2.
+
-
+
4 3 0
|𝐷𝑥| = [1 0.5 1]
3 0 1
1 1
0.5 1
1
4|
| − 3|
|0|
3
1
0 1
3
=
0.5
|
0
= 4|(0.5)(1) − (0)(1)|-3|(1)(1) − (3)(1)|0|(1)(0) − (3)(0.5)|
= 4(0.5-0) -3(1-3) +0(0-1.5)
=2+6+0
=8
Therefore |𝐷𝑥| = 8.
+
-
+
1 4 0
|𝐷𝑦| = [ 0 1 1]
0.5 3 1
=
1 1
0 1
0 1
1|
| − 4|
|0|
|
3 1
0.5 1
0.5 3
= 1|(1)(1) − (3)(1)|-4|(0)(1) − (0.5)(1)|0|(0)(3) − (0.5)(1)|
= 1(1-3) -4(0-0.5) +0(0-0.5)
= -2 + 2 +0
=0
Therefore |𝐷𝑦| = 0.
+
-
+
1
3 4
|𝐷𝑧| = [ 0 0.5 1]
0.5 0 3
=
0 1
0.5 1
0 0.5
1|
| − 3|
|4|
|
0.5 3
0 3
0.5 0
10 | P a g e
153611_Vidur_Lutchminarain
= 1|(0.5)(3) − (0)(1)|-3|(0)(3) − (0.5)(1)|4|(0)(0) − (0.5)(0.5)|
= 1(1.5-0) -3(0-0.5) +4(0-0.25)
= 1.5 + 1.5 -1
=2
Therefore |𝐷𝑧| = 2.
Therefore:
D = 2, Dx = 8, Dy = 0, Dz = 2
𝐷𝑋
8
𝐷𝑦
0
𝐷𝑧
2
x= 𝐷 = 2=4
y= 𝐷 = 2=0
z= 𝐷 = 2=1
Therefore (4,0,1) respectively.
11 | P a g e
153611_Vidur_Lutchminarain
1.6)
Using Cramer’s rule to find X
1. y − z = 2
2. 3x + 2y + z = 4
3. 5x + 4y = 1
+ +
0 1 −1 𝑥
2
𝑦
[3 2 1 ] [ ] = [4]
5 4 0 𝑧
1
|𝐷| = 0|2
4
1 3
|-1|
0 5
1
3 2
| − 1|
|
0
5 4
= 0[(2)(0) – (1)(4)] -1[(3)(0) – (1)(5)] -1[(3)(4) – (5)(2)]
= 0[0 – 4] -1[0 – 5] -1[12 – 10]
=0+5–2
|𝐷| = 3
+
-
+
2 1 −1
|𝐷𝑥| = [4 2 1 ]
1 4 0
|𝐷𝑥| = 2|2 1|-1|4 1| − 1 |4 2|
4 0 1 0
1 4
= 2[(2)(0) – (4)(1)] -1[(4)(0) – (1)(1)] -1[(4)(4) – (2)(1)]
= 2[0 – 4] -1[0 - 1] -1[16 - 2]
= -8 +1 -14
|𝐷𝑥|
= -21
+
-
+
0 2
|𝐷𝑦| = [3 4
5 1
−1
1]
0
|𝐷𝑦| = 0|4 1|-2|3
1 0 5
1
3
| − 1|
0
5
4
|
1
= 0[(4)(0) – (1)(1)] -2[(3)(0) - (5)(1)] -1[(3)(1) – (5)(4)]
= 0[0 -1] -2[0 – 5] -1[3 – 20]
= 0 + 10 + 27
|𝐷𝑦| = 27
12 | P a g e
153611_Vidur_Lutchminarain
+
0
|𝐷𝑧| = [3
5
-
+
1 2
2 4]
4 1
|𝐷𝑧| = 0|3
5
2 3 4
3
|-1|
|2|
4 5 1
5
2
|
4
= 0[(2)(1) – (4)(4)] -1[(3)(1) - (5)(4)] +2[(3)(4) – (5)(2)]
= 0[2 - 16] - 1[3 – 20] +2[12 - 10]
= 0[ -14] -1[-17] +2[2]
= 0 +17 + 4
|𝐷𝑧| = 21
Therefore:
|𝐷𝑥|
−21
|𝐷𝑦|
27
|𝐷𝑧|
21
X = |𝐷| = 3 = -7
Y = |𝐷| = 3 = 9
Z = |𝐷| = 3 = 7
X = -7, Y = 9, Z = 7.
13 | P a g e
153611_Vidur_Lutchminarain
1.7) Solving the linear equation using the inverse method
1. x + y + z = 4
2. -2x - y + 3z = 1
3.
y + 5z = 9
+
-
+
4
1
1 1 𝑥
[−2 −1 3] [𝑦] = [1]
0
1 5 𝑧
9
|𝐴| = 1 |−1 3| − 1 |−2 3|1|−2 −1|
1 5
0 5
0
1
|𝐴| = 1[(-1)(5) – (3)(1)]-1[(-2)(5) – (3)(0)] +1[(-2)(1) – (-1)(0)]
= 1[-5 – 3] -1[-10] +1[-2]
= -8 + 10 -2
|𝐴| = 0
+
[
[
[
-
+
1 3
]
1 5
−2 3
[
]
0 5
-
+
[
2 1
]
0 1
-
1 1
]
−1 5
1 1
[
]
0 5
+
-
−1 1
]
1 5
1 1
[
]
−2 3
[
=
2 −10
[4
5
−6
5
2
1
]
−1] x [
|
|
𝐴
3
[
1 −1
]
0 1
+
1 −1
]
2 1
2 −10 2
1
=[ 4
5
−1] x [ ]
0
−6
5
3
= No solution
Conclusion: Since the determinant is equal to 0, each value is undefined as we cannot divide
by 0, therefore there is no solution to this question.
14 | P a g e
153611_Vidur_Lutchminarain
1.8)
Brute force algorithm to find minimum cost circuit of Hamilton circuit:
A
B
C
D
A = (6 + 3 + 8 + 1) = 18
A
B
D
C
A = (6 + 9 + 8 + 2) = 25
A
D
B
C
A = (1 + 9 + 3 + 2) = 15
A
D
C
B
A = (1 + 8 + 3 + 6) = 18
A
C
B
D
A = (2 + 3 + 9 + 1) = 15
A
C
D
B
A = (2 + 8 + 9 + 6) = 25
The minimum cost circuit of the Hamilton circuit is ADBCA and ACBDA as they both = 15.
1.9)
Does a Hamiltonian path or circuit exist on the graph below?
All the possible Hamiltonian paths from the graph is:
1.
2.
3.
4.
5.
6.
7.
8.
A
B
B
E
E
E
E
D
B
A
D
C
C
C
C
A
D
D
A
D
A
A
D
B
C
C
C
B
B
D
A
C
E
E
E
A
D
B
B
E
There are no complete circuits formed by the paths, therefore only Hamilton paths exist for
the graph.
1.10) Find: a) –𝐴−1 + 3𝐵𝑇
+ - +
1 1
2
4 0
A =[2
−1
3]
0
|𝐴| = 1 |2 3| − 1 ⌈2
0 0
4
3
2 2
⌉− 1|
|
0
4 0
= 1[(2)(0) – (3)(0)] -1[(2)(0) – (3)(4)]-1[(2)(0) – (4)(2)]
= 1[0 – 0] -1[0 -12] -1[0 - 8]
= 0 + 12 + 8
= 20
15 | P a g e
153611_Vidur_Lutchminarain
[
[
+
-
2 3
]
0 0
2
[
4
-
+
3
]
0
[
2 2
]
4 0
-
1 −1
1 −1 1 1
] [
] [
]
0 0
4 0
4 0
+
[
+
-
+
1 −1
1 −1 1 1
] [
] [
]
2 3
2 3
2 2
0 12 −8
= [0 4
4 ] Transpose
5 −5 0
0 0 5
[ 12 4 −5]
−8 4 0
1
x [|𝐴|]
0 0 5
1
= [ 12 4 −5] x [20]
−8 4 0
0
0
0.25
= [ 0.6 0.2 −0.25] X -1
−0.4 0.2
0
−1
−𝐴
−1
−𝐴
1 1
B = [2 2
4 0
0
0
−0.25
= [−0.6 −0.2 0.25 ]
0.4 −0.2
0
−1
3]
0
Transpose
1 2 4
[ 1 2 0] = 𝐵 𝑇
−1 3 0
1 2 4
3𝐵 𝑇 = [ 1 2 0] X 3
−1 3 0
3𝐵 𝑇
3 6
= [3 6
−3 9
12
0]
0
3 6
0
0
−0.25
−𝐴−1 + 3𝐵 𝑇 = [−0.6 −0.2 0.25 ] + [ 3 6
−3 9
0.4 −0.2
0
12
0]
0
3
6 11.75
= [ 2.4 5.8 0.25 ]
−2.6 8.8
0
16 | P a g e
153611_Vidur_Lutchminarain
b) 𝐵−1 + ( 𝐴𝑇 +𝐴−1 )
1
1 −1
2 3]
0 0
B =[2
4
|𝐵| = 1 |2 3| − 1 ⌈2 3⌉ − 1 |2
0 0
4 0
4
2
|
0
= 1[(2)(0) – (3)(0)] -1[(2)(0) – (3)(4)]-1[(2)(0) – (4)(2)]
= 1[0 – 0] -1[0 -12] -1[0 - 8]
= 0 + 12 + 8
= 20
[
+
-
2 3
]
0 0
2
[
4
[
3
]
0
+
[
2 2
]
4 0
-
1 −1
1 −1 1 1
] [
] [
]
0 0
4 0
4 0
+
[
+
-
+
1 −1
1 −1 1 1
] [
] [
]
2 3
2 3
2 2
0 12 −8
= [0 4 −4] Transpose
5 −5 0
0
0
5
= [ 12 4 −5]
−8 −4 0
0
0
5
[ 12 4 −5]
−8 −4 0
1
x [|𝐴|]
1
x [20]
0
0
0.25
0.2 −0.25]
−0.4 −0.2
0
𝐵 −1 = [ 0.6
1 1 −1
3 ] Transpose
4 0 0
𝐴𝑇 = [2 2
1 2 4
[ 1 2 0]
−1 3 0
0
0
0.25
𝐴−1 = [ 0.6 0.2 −0.25]………. Previous question
−0.4 0.2
0
Therefore, 𝐵−1 + ( 𝐴𝑇 +𝐴−1 ):
17 | P a g e
153611_Vidur_Lutchminarain
0
0
0.25
[ 0.6 0.2 −0.25]
−0.4 0.2
0
0
0
0.25
= [ 0.6 0.2 −0.25]
−0.4 0.2
0
1
2 4
0
0
0.25
2 0] + [ 0.6 0.2 −0.25] ]
−1 3 0
−0.4 0.2
0
+ [[ 1
1
2 4.25
+ [ 1.6 2.2 0.25]
−1.4 3.2
0
1
2
4.5
= [ 2.2 2.4 −0.5]
−1.8 3.4
0
18 | P a g e
153611_Vidur_Lutchminarain
References
Chilli Math. (2015). Cramer’s Rule for a 3×3 System (with Three Variables). Available:
https://www.chilimath.com/lessons/advanced-algebra/cramers-rule-with-threevariables/. Last accessed 19/03/2020.
David Lippman. (2018). Euler and Hamiltonian Paths and Circuits. Available:
https://courses.lumenlearning.com/math4liberalarts/chapter/introduction-euler-paths/.
Last accessed 19/03/2020.
19 | P a g e
Download