How does a piecewise function work when multiple conditions are met? Does it default to the first (like a switch-case) or is the statement invalid?

913 Views Asked by At

If I have a piecewise function:

$$ f(x) = \begin{cases} g(x) & x>5 \\ h(x) & x \mod 2 = 0 \end{cases} $$

is f(6) = g(6) or is this statement invalid?

Does it default to the first condition, or is it invalid?

1

There are 1 best solutions below

0
On BEST ANSWER

For your particular function, when $x > 5$ and $x$ is even, $f(x)$ is generally not well-defined, which means that $x$ maps to multiple things. This can be resolved if $g(x) = h(x)$ when $x>5$ and $x$ is even. So if you mean "valid" as in well-defined, it depends whether or not the previous condition is met.

A function must be well-defined (as per definition of a function), but there are examples of mappings which aren't functions. For instance, consider the $n$-th root of a real number $a$. For $n>1$ and $a \neq 0$, the amount of numbers that satisfy $x^n = a$ is more than one. Hence, we mathematicians avoid this problem by only using a specific "branch cut". The most common example is the principle square root, or $\sqrt{\hspace{1em}}$, which is well-defined and hence, a function.