Skip to content

Commit 9cb7c19

Browse files
committed
[main] Finished module 2.1
1 parent 74f17ff commit 9cb7c19

File tree

2 files changed

+129
-0
lines changed

2 files changed

+129
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
He wants to invest his USD $10,000 savings in these three accounts
2+
3+
he knows that **after a year he would receive a total of US $ 260 in interest** if he put **twice as much money in the savings account as in the CDs**, and **“z” money in bonds**.
4+
5+
x = money in cds
6+
z = money in bonds
7+
8+
2x + x + z = 260
9+
10+
3x + z = 260
11+
z = 260 - 3x
12+
13+
a + b + z = 10000
14+
2a + b + z = 260
15+
16+
a + b/2 + z/2 = 130
17+
18+
- -a -b -z = -10000
19+
20+
---
21+
22+
-b/2 -z/2 = -9870
23+
24+
-b/2 - z/2 = -9870
25+
26+
-.5b - .5z = -9870
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
mat1 = [[5, 1], [4, -3]]
2+
mat2 = [[1, 0.2], [0, 1]]
3+
4+
# x + y = 4
5+
# -6x + 2y = 16
6+
7+
8+
# x -2y/6 = 16
9+
10+
11+
# x - y/3 = 16/-6
12+
13+
# x - y/3 = -2.6
14+
15+
# x -1/3y = -26
16+
17+
# x - y = -26/3
18+
# - x - y = -4
19+
# ---------------------
20+
21+
22+
# -2y = -12/3 + 26/3
23+
# -2y = -38/3
24+
# y = 6.3
25+
26+
# x + 6.3 = 4
27+
# x = -2.3
28+
29+
30+
mat1 = [[4, -3], [7, -8]]
31+
32+
dt_1 = mat1[0][0] * mat1[1][1]
33+
dt_2 = mat1[0][1] * mat1[1][0]
34+
35+
dt_one = dt_1 - dt_2
36+
37+
print(dt_one)
38+
39+
40+
mat1 = [[-3, -8, 1], [2, 2, -1], [-5, 6, 2]]
41+
42+
dt_1_1 = mat1[0][0] * mat1[1][1] * mat1[2][2]
43+
dt_1_2 = mat1[0][1] * mat1[1][2] * mat1[2][0]
44+
dt_1_3 = mat1[0][2] * mat1[1][0] * mat1[2][1]
45+
46+
dt_anti_1 = mat1[0][2] * mat1[1][1] * mat1[2][0]
47+
dt_anti_2 = mat1[0][1] * mat1[1][0] * mat1[2][2]
48+
dt_anti_3 = mat1[0][0] * mat1[1][2] * mat1[2][1]
49+
50+
dt_1_full = dt_1_1 * dt_1_2 * dt_1_3
51+
dt_1_anti_full = dt_anti_1 * dt_anti_2 * dt_anti_3
52+
53+
print(dt_1_full - dt_1_anti_full)
54+
55+
# [[1, 1], [2, 3]]
56+
57+
# a + 2b + z = 260
58+
59+
60+
# a/2 + b + z/2 = 130
61+
62+
63+
# x + y = 4
64+
# -6x + 2y = 16
65+
66+
# x + y = 4
67+
# x + -1/3y = 16/-6
68+
69+
# x + -1/3y = -2.6
70+
# - x + y = 4
71+
72+
73+
# -4/3y = -6.6
74+
# y = 5.0
75+
76+
# x + 5 = 4
77+
# x = -1
78+
79+
80+
# x + 2x + z = 3x + z = 10000
81+
82+
# z = 10000 - 3x
83+
84+
# 0.02(2x) + 0.03(x) + 0.04(z) = 0.04x + 0.03x + 0.04z = 0.07x + 0.04z
85+
86+
# # total interest earned is 260
87+
88+
# 0.07x + 0.04z = 260
89+
90+
# 3x + z = 10000
91+
# 0.07x + 0.04z = 260
92+
93+
94+
# multiply second by 3
95+
# 0.21x + 0.12z = 780
96+
97+
# subtract second from first
98+
99+
100+
# 3x + z = 10000
101+
# - 0.21x - 0.12z = -780
102+
103+
# 2.79x + 0.12z

0 commit comments

Comments
 (0)