Difference between revisions of "Unambiguous"

From CS2800 wiki
(Created page with "The output of a function is unambiguous if there is only one output for any input. It is especially important to check this when the input of the function can be writ...")
 
 
Line 1: Line 1:
 +
[[Category:Functions]]
 +
 
The output of a [[function]] is [[unambiguous]] if there is only one output for any input.  It is especially important to check this when the input of the function can be written in different ways.  For example, <math>f : [[Enumerated set|\{1,2\}]] [[\to]] [[ℕ]]</math> given by <math>f(1) := 2</math>, <math>f(2) := 2</math>, and <math>f(1+1):=4</math> is not unambiguous, because <math>2 = 1 + 1</math> so it is not clear if <math>f(2) = 2</math> or <math>f(2) = 4</math>.
 
The output of a [[function]] is [[unambiguous]] if there is only one output for any input.  It is especially important to check this when the input of the function can be written in different ways.  For example, <math>f : [[Enumerated set|\{1,2\}]] [[\to]] [[ℕ]]</math> given by <math>f(1) := 2</math>, <math>f(2) := 2</math>, and <math>f(1+1):=4</math> is not unambiguous, because <math>2 = 1 + 1</math> so it is not clear if <math>f(2) = 2</math> or <math>f(2) = 4</math>.

Latest revision as of 19:34, 17 February 2018


The output of a function is unambiguous if there is only one output for any input. It is especially important to check this when the input of the function can be written in different ways. For example, [math]f : \href{/cs2800/wiki/index.php/Enumerated_set}{\{1,2\}} \href{/cs2800/wiki/index.php/%5Cto}{\to} \href{/cs2800/wiki/index.php/%E2%84%95}{ℕ} [/math] given by [math]f(1) := 2 [/math], [math]f(2) := 2 [/math], and [math]f(1+1):=4 [/math] is not unambiguous, because [math]2 = 1 + 1 [/math] so it is not clear if [math]f(2) = 2 [/math] or [math]f(2) = 4 [/math].