# Undirected value

The undirected value is a function similar to the absolute value function, except where the absolute value negates if necessary in order to return a non-negative number (greater than or equal to zero), the undirected value reciprocates if necessary in order to return a non-subunison number (greater than or equal to one).

## Musical application

Pitch ratios are directed, while interval ratios are undirected.

It is common practice to use the colon operator ":" for undirected interval ratios, and the slash operator "/" for directed pitch ratios. For example, "5/4" means something different than "4/5"; those are two different pitches. But "5:4" means the same thing as "4:5"; they are the same interval.

## Notation

### Function

In function notation, the undirected value may be written $\text{und}(x)$. This is by analogy with the absolute value, whose function notation is $\text{abs}(x)$.

### Mathematical

The undirected value is notated mathematically using horizontal bars above and below the value being undirected: $\color{red}{\overline{\underline{\color{black}{x}}}}$.

This notation references two existing mathematical notations:

1. the vertical bars on the sides used to notate the absolute value $\color{red}{|}\color{black}{x}\color{red}{|}$
2. the fraction bar (or division bar), that is, the horizontal line between the numerator and denominator of ratios $\color{red}{\frac{\color{black}{n}}{\color{black}{d}}}$

So, by referring to these two notations in these two different ways, the undirected value notation visually helps to convey how the operation itself bridges the concepts of absolute value and fraction bars. Taken together, this notation is designed to express its use for comparing values agnostic to their positions relative to the fraction bar.

#### Unicode

The undirected value is formatted in this page using $\LaTeX$, but it can also be typed using Unicode characters, as x̲̅.

This leverages Unicode's "combining characters" technique, where a base character is followed by one or more characters which — instead of appearing immediately after the previous character, as is normal — appear layered on top of that character. This notation requires the use of two combining characters: one for the overline, and one for the underline. The full character sequence here is:

U+0078 : LATIN SMALL LETTER X
U+0332 : COMBINING LOW LINE {underline, underscore}
U+0305 : COMBINING OVERLINE {overscore, vinculum}


#### Alternative

In situations where it is difficult to realize either the $\LaTeX$ or Unicode formats, and the function notation is not desired for some reason, an alternative mathematical notation is suggested: the value may be outfixed with colons, as in ":x:".

For example, :4/5: = 4:5 = 5/4.

This alternative is designed to evoke the infix ":" operator which as previously described is the one typically used for undirected ratios.

## Definitions

### As real

In order for the undirected value to work on negative numbers as well, it is defined to take the absolute value of its input before checking if it is greater than 1.

In plain language, then, we can say that the undirected value of a real number is equal to itself if the absolute value of the number is greater than or equal to 1, or equal to its reciprocal otherwise. As a mathematical formula, we can express this as:

$\overline{\underline{x}} = \begin{equation} \begin{cases} x & \text{if} \; |x| \ge 1 \\ \frac{1}{x} & \text{if} \; |x| \lt 1 \\ \end{cases} \end{equation}$

### As ratio

An alternative way to think about the undirected value is that it puts its input into ratio form $\frac{n}{d}$, and then if $d \gt n$, then $n$ and $d$ are flipped.

We still need it to work for negative numbers, though. The sign of a number in ratio form is not associated with its numerator any more or less than its denominator. So essentially we set aside the sign temporarily for the aforementioned process, then reintroduce it afterward.

As a formula, this has an advantage over the previously provided formula, in that it is expressible without the use of a conditional statement. However, this formula does not constitute a strict improvement, as it does have the notable disadvantage of requiring the use of several math functions: $\max$, $\min$, and $\text{sign}$. Here is that formula:

$\overline{\underline{\frac{n}{d}}} = \text{sign}(\frac{n}{d})\frac{\max(|n|, |d|)}{\min(|n|, |d|)}$

To be clear, if the input is not already in ratio form, for example $\phi$, this formula requires it first to be placed over 1, like $\frac{\phi}{1}$.

## Superunison, subunison, and unison numbers

A superunison number is a real number whose absolute value is greater than 1.

A subunison number, by extension, is a real number whose absolute value is less than 1.

superunison undirected subunison
positive $\frac21$ 1 $\frac12$
unsigned $\infty$ n/a 0
negative $-\frac21$ -1 $-\frac12$

So just as the absolute value always returns a positive or zero value, the undirected value always returns a superunison or unison value.

The terms "superunison" and "subunison" may be shortened to "super" and "sub" when the context is clear.

"Superunison" and "subunison" can also be used as nouns, similar to how "positive" and "negative" can be used as nouns (e.g. "defined for the positives", "defined for the superunisons").

## Direction

The analogy between the undirected value and absolute value can be more clearly seen if the less common name for the absolute value is used: the unsigned value. This sets up a parallel between the sign of a number — whether it is positive, zero, or negative — and the direction of a number — whether it is superunison, unison, or subunison.

The absolute value function $\text{abs}$ has a partner function, $\text{sign}$ (which returns 1 for positives, 0 for 0, and -1 for negatives), which when composed with it cancels it out: $\text{abs}(x)\text{sign}(x) = x$. So the undirected value may also have a partner function defined which when composed with it cancels it out: direction, expressed as $\text{dir}$, which returns 1 for superunisons, 0 for unisons, and -1 for subunisons. While the composition between the $\text{abs}$ and $\text{sign}$ functions was multiplication, here it is exponentiation: $\text{und}(x)^{\text{dir}(x)} = x$. Naming the direction operation with the same etymological root as the undirected value operation clarifies their relationship; $\text{dir}$ extracts the direction of a value and $\text{und}$ gives you the value agnostic to what was extracted, just as $\text{sign}$ works with respect to $\text{abs}$.

The undirected value may be considered as the multiplicative analog of the unsigned value (and the unsigned value is the additive analog of the undirected value). This corresponds with the fact that the undirected value compares its inputs against the multiplicative identity, 1, and orients its outputs agnostic to their multiplicative relationship with it (removes their direction), whereas the unsigned value compares its inputs against the additive identity, and orients its outputs agnostic to their additive relationship with it (removes their sign).

And so superunison is the multiplicative analog of positive, unison is the multiplicative analog of zero, and subunison is the multiplicative analog of negative.

## Examples

$\overline{\underline{\frac45}} = \frac54$

$\overline{\underline{\frac54}} = \frac54$

$\text{und}(\frac45) = \frac54$

$\text{und}(\frac54) = \frac54$

These two examples are read as "the undirected value of four over five is five over four", and "the undirected value of five over four is five over four".

## Analogies

function unsigned (absolute) value undirected value
identity 0 1
property sign direction
operation negation reciprocation
target positive superunison
opposite of target negative subunison
function notation $\text{abs}(x)$ $\text{und}(x)$
mathematical notation $|x|$ $\overline{\underline{x}}$

The following identity shows the relationship between the undirected value and the absolute value, for positive real numbers.

$\overline{\underline{x}} = b^{|log_{b}{x}|} \;\; \text{for any base} \; b\gt 1 \; \text{and} \; x\gt 0 \\$

## Graphs plot of the absolute value of x, for comparison

## History

The terminology and notation on this page was developed by Dave Keenan and Douglas Blumeyer in 2020.