## Detailed analysis of a seemingly simple equation |

### Overview

Consider the following simple function:
if x^y > y^x then color1 else color2

It produces some very strange results when trying to graph it. Although the first quadrant looks like a fairly simple pattern defined by functions

**y = 1/(ax^2)**and

**y = x**, it's actually incredibly more complicated and shown in the conclusion. All other quadrants produce even stranger patterns due to having results in complex space.

Also the related function

**x^y - y^x**has it's own set of interesting properties, pictured below.

### Pictures

### Solution for Quadrants 1 and 4 curve

### Octave and Complex Numbers

Another weird thing is complex numbers in octave. Consider:
c1 = 1 + i

c2 = 1 - i

c3 = -1 + i

c4 = -1 - i

c1 > c3

ans = 1

c4 < c2

ans = 1

c1 > c2

ans = 0

c1 < c2

ans = 0

c1 == c2

ans = 0

c1 != c2

ans = 0

c2 = 1 - i

c3 = -1 + i

c4 = -1 - i

c1 > c3

ans = 1

c4 < c2

ans = 1

c1 > c2

ans = 0

c1 < c2

ans = 0

c1 == c2

ans = 0

c1 != c2

ans = 0

It looks like Octave is comparing only the real portions of complex numbers for less-than and greater-than, and then using both terms of testing equality. Vector normalization doesn't really work either since should we consider -1 - i equivalent to 1 + i? Although normalization actually makes more sense if you think of it in terms of polar coordinates, as opposed to the default octave handling.

## No comments:

Post a Comment