Skip to content

Commit

Permalink
Tidy up math blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacG committed Dec 31, 2023
1 parent 3afc58c commit ecae800
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions 2023/notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,17 @@ return math.prod(
Note the inequality:
```
(time - i) * i > distance
-1 * x * x + time * x - distance > 0
# Quadratic equation!
x = (-b +/- sqrt(b**2 - 4 * a * c)) / (2 * a)
x = (-time +/- math.sqrt(time**2 - 4 * distance)) / (-2)
```math
(time - i) * i > distance\\
-1 * x * x + time * x - distance > 0\\
\text{Quadratic equation!}\\
x = (-b +/- sqrt(b**2 - 4 * a * c)) / (2 * a)\\
x = (-time +/- math.sqrt(time**2 - 4 * distance)) / (-2)\\
x = (time +/- math.sqrt(time**2 - 4 * distance)) / 2
```
Expand Down Expand Up @@ -417,9 +422,9 @@ If the rocks finish in the same location after $cycle_a$ and $cycle_b$ rotations
To compute the finish pattern after a large number of cycles, $number$,
```math
cycle_len = cycle_b - cycle_a
remainder = (number - cycle_a) % cycle_len
cycle_number = cycle_(a + remainder)
cycle_{len} = cycle_b - cycle_a \\
remainder = (number - cycle_a) % cycle_len \\
cycle_number = cycle_{a + remainder}
```
## Notes
Expand Down

0 comments on commit ecae800

Please sign in to comment.