Skip to content

Commit dbeaafe

Browse files
authored
Update src/geometry/manhattan-distance.md
1 parent 257340c commit dbeaafe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/geometry/manhattan-distance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ $$\max\limits_{p, q \in P}(p.x + (-q.x)) = \max\limits_{p \in P}(p.x) + \max\lim
3232

3333
Notice that we can extend this idea further for 2 (or more!) dimensions. For $d$ dimensions, we must bruteforce $2^d$ possible values of the signs. For example, if we are in $2$ dimensions and bruteforce that $p$ has both the plus signs we want to find:
3434

35-
$$\max\limits_{p, q \in P} (p.x + (-q.x)) + (p.y + (-q.y)) = \max\limits_{p \in P}(p.x + p.y) + \max\limits_{q \in P}(-q.x - q.y).$$
35+
$$\max\limits_{p, q \in P} [(p.x + (-q.x)) + (p.y + (-q.y))] = \max\limits_{p \in P}(p.x + p.y) + \max\limits_{q \in P}(-q.x - q.y).$$
3636

3737
As we made $p$ and $q$ independent, it is now easy to find the $p$ and $q$ that maximize the expression.
3838

0 commit comments

Comments
 (0)