-
Notifications
You must be signed in to change notification settings - Fork 1
/
RootsIntroduction.yml
178 lines (143 loc) · 4.05 KB
/
RootsIntroduction.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
#Bisection Method
#Type 1: Line and a pause
#Type 2: Input
#Type 3: Number
#Type 4: No pause in line
#Type 5: Graph
#Type 6: Video Links
#Type 7: 2 Variable Array
l01: #All tags must be of same length
id: 1
content: "Bisection Method is a simple idea to find roots of an equation or zeroes of a function* \n *both roots and zeroes are often used interchangeably but an equation has roots and a function has zeroes"
type: 1
l02:
id: 2
content: "Hey! I know how to find the root of a function. It is called the quadratic formula."
type: 1
l03:
id: 3
content:
message: Ok. Let us test it. Use quadratic formula to find the root(s) of x^2 - 4x + 4 #Can this format be made better?
answer: 2
type: 2
l04:
id: 4
content:
message: "Now find the sum of the roots of x^3 - 7x - 6" #Can this format be better? #Avoiding the multiple possible answers dilemma here
answer: 0
type: 2
l05:
id: 5
content: "This was tougher, right?" #Does YAMLparser render commas?
type: 1
l06:
id: 6
content: "Why do you have to learn a new method for finding roots?"
type: 1
l07:
id: 7
content: "In non-linear and transcendental equations(equations containing non algebraic functions such as \n 3x + sin(x) - exp(x)), finding roots can be a pain"
type: 1
#Right now I have to hardcode the spaces. Not good
l08:
id: 8
content: "Some direct methods exist (such as factor method for finding roots of polynomial) \n but there are many equations that cannot be solved directly"
type: 1
l09:
id: 9
content: "In this case, we use Approximate Solution Techniques"
type: 1
l10:
id: 10
content: "Approximate Solution means that we get close enough to the acutal value \n (usually correct up to 4 decimal places)"
type: 1
l11:
id: 11
content: "One way to obtain an approximate solution is to draw the graph of the function \n and see where it touches the x-axis."
type: 1
l12:
id: 12
content: "Let us estimate the root of x^3 -x -2"
type: 1
l13:
id: 13
content:
y: x^3 -x -2
xmin: -5
xmax: 5
hold: 1
type: 5
l14:
id: 14
content: "We can see the root is somewhere between -2 and 2"
type: 1
l15:
id: 15
content:
x1: -2
x2: 2
type: 5
l16:
id: 16
content: "But it is difficult to pin-point the exact root from this graph"
type: 1
l17:
id: 17
content: "Graphical Methods are great for rough estimates but they lack precision"
type: 1
l18:
id: 18
content: "So, we'll use a numerical method"
type: 1
l19:
id: 19
content: "A numerical method is an algorithm to find a close enough approximation \n by repeating the procedure again and again"
type: 1
l20:
id: 20
content: "The general idea of a numerical method is that we start with an initial guess"
type: 1
l21:
id: 21
content: "Then, at each step, we improve our guess till we get close enough to the answer"
type: 1
l22:
id: 22
content: "These steps are also called iterations"
type: 1
l23:
id: 23
content: "The good news is, we can simply write a program to feed the equation \n to the computer and then let it run the iterations \n over and over and over and over and over and over \n and over again and output the final answer to us"
type: 1
l24:
id: 24
content: "This abstraction helps increase our productivity"
type: 1
l25:
id: 25
content: "There are two kinds of numerical methods for finding roots."
type: 1
l26:
id: 26
content: "1. Bracketing Method (when we start with an interval and make it smaller)"
type: 1
l27:
id: 27
content: "2. Open Method (when we start with a point and move towards the root)"
type: 1
l28:
id: 28
content: "Why do we need two types of methods?"
type: 1
l29:
id: 29
content: "Open Methods are faster but do not always converge \n (i.e. they diverge or move away from the root sometimes)"
type: 1
l30:
id: 30
content: "Bracketing Methods always converge (move closer to the root) but sometimes at painfully slow speed"
type: 1
l31:
id: 31
content: "In Summary: Bracketing Methods are painfully slow and Open Methods are reckless"
type: 1