You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix the size of the diagrams. Add res folders. (#170)
* Add res folder for building_blocks and move images into it. Fix the size of the diagrams.
* Include images of euler in the same way as in other chapters.
* Add res folder for notation and move image. Center image of Complexity Notation chapter.
* Add res folder for principles_of_code and move images into it. Include images of Version Control in the same way as in other chapters.
* Add something to "website.css", so that all images included via <img> are centered.
* Add res folder for taylor and move images into it. Include images of Taylor Series in the same way as in other chapters.
* Remove height attribute for all images, that have an width attribute as well. Therefore avoid distortion for images.
* Use the width attribute instead of the height attribute in the Bitlogic chapter.
* Include the LabView and Scratch image in Verlet Integration like in the same way as in other chapters.
* Include the Scratch image in Tree Traversal in the same way as in other chapters.
* Add css class and add all images in mds to that class.
However, it turns out that the second half of our array of $$\omega$$ values is always the negative of the first half, so $$\omega_2^0 = -\omega_2^1$$, so we can use the following butterfly diagram:
Note that we can perform a DFT directly before using any butterflies, if we so desire, but we need to be careful with how we shuffle our array if that's the case.
188
188
In the code snippet provided in the previous section, the subdivision was performed in the same function as the concatenation, so the ordering was always correct; however, if we were to re-order with bit-reversal, this might not be the case.
189
189
190
190
For example, take a look at the ordering of FFT ([found on wikipedia](https://en.wikipedia.org/wiki/Butterfly_diagram)) that performs the DFT shortcut:
Here, the ordering of the array was simply divided into even and odd elements once, but they did not recursively divide the arrays of even and odd elements again because they knew they would perform a DFT soon thereafter.
For example, here we see dramatically different results for different timesteps for solving the ODE $$y' = \frac{x^3}{6}$$, whose solution is $$y = \frac{x^2}{2}$$.
57
59
The blue line is the analytical solution, the green is with a timestep of 0.5 and the red is with a timestep of 1.
@@ -67,7 +69,9 @@ The solution here is $$y(t) = e^{-3t}$$ and we can find this solution somewhat e
67
69
That said, by choosing a larger timestep, we see the Euler method's solution oscillate above and below 0, which should *never* happen.
68
70
If we were to take the Euler method's solution as valid, we would incorrectly assume that $$e^{-3t}$$ will become negative!
Copy file name to clipboardExpand all lines: chapters/euclidean_algorithm/euclidean.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,8 +31,8 @@ The algorithm is a simple way to find the *greatest common divisor* (GCD) of two
31
31
32
32
Here, we simply line the two numbers up every step and subtract the lower value from the higher one every timestep. Once the two values are equal, we call that value the greatest common divisor. A graph of `a` and `b` as they change every step would look something like this:
Modern implementations, though, often use the modulus operator (%) like so
@@ -64,8 +64,8 @@ Modern implementations, though, often use the modulus operator (%) like so
64
64
65
65
Here, we set `b` to be the remainder of `a%b` and `a` to be whatever `b` was last timestep. Because of how the modulus operator works, this will provide the same information as the subtraction-based implementation, but when we show `a` and `b` as they change with time, we can see that it might take many fewer steps:
The Euclidean Algorithm is truly fundamental to many other algorithms throughout the history of computer science and will definitely be used again later. At least to me, it's amazing how such an ancient algorithm can still have modern use and appeal. That said, there are still other algorithms out there that can find the greatest common divisor of two numbers that are arguably better in certain cases than the Euclidean algorithm, but the fact that we are discussing Euclid two millenia after his death shows how timeless and universal mathematics truly is. I think that's pretty cool.
Now, let's say we want to find the area of the circle without an equation.
@@ -67,8 +67,8 @@ $$
67
67
68
68
If we use a small number of points, this will only give us a rough approximation, but as we start adding more and more points, the approximation becomes much, much better (as shown below)!
0 commit comments