<p>hi everyone, </p>

<p>what's the difference between the domain and the range of a function? </p>

<p>thanks in advance</p>

<p>hi everyone, </p>

<p>what's the difference between the domain and the range of a function? </p>

<p>thanks in advance</p>

<p>Domain is all the x values the function includes </p>

<p>Range is all the y values the function includes </p>

<p>Sent from my Nexus 5 using Tapatalk</p>

<p>thanks a lot!</p>

<p>x and y are just letters. In elementary math classes the independent variable is often labelled “x” and the dependent variable is often labeled “y.” But there is no reason this has to be the case. For example, if you have a relationship between time and height, you might use “t” for the independent variable and “h” for the dependent variable.</p>

<p>In expressions with three variables, often both x and y are independent.</p>

<p>So a better way to think of the domain is the set of all possible inputs. And the range is the set of all possible outputs. If it helps you to think of the inputs as x-values and the outputs as y-values, that’s okay. Just be aware that anyone writing a math question or solving a word problem can use different letters.</p>

<p>Usually, the range is the set of all elements mapped to by a function. So the range of f(x) = cos x is [-1, 1]. </p>

<p>However, the word “range” can also refer to a codomain, which is a set that contains the function’s outputs (image). Because of this, “codomain” and “image” are more widely used in mathematics.</p>

<p>I have never heard of range being used for codomain before in mathematics (maybe this terminology is used in computer science or engineering?). Certainly in lower level mathematics in the United States the word range is interchangeable with image.</p>

<p>I’m curious, in what course, book, or journal have you seen the word range used for codomain?</p>

<p>I don’t recall seeing range used with codomain myself, but a few undergraduate math courses I’ve taken explicitly state that they avoid the word “range” due to ambiguity. The first sentence of Wikipedia article on “range” gives both definitions.</p>

<p>Pretty annoying that “range” can mean two different things; I only remember learning range as “image”, not as “codomain”. But I could see the usefulness of range meaning “codomain” for CS since you might be interested in knowing what kind of variable to store a function output in.</p>

<p>I wasn’t even aware of the range ambiguity until I had to teach “onto” from an Algebra 2 book (I can’t remember which, but I believe it was a commonly used one) in a discussion of functions, domain, and range. The onto concept seems like a completely unnecessary additional topic to add for people learning about domain and range. But “onto” only makes sense when you also define “codomain” and “image” (the former being a superset of the latter, which contains only the outputs of the function and nothing more).</p>

<p>Maybe I just dislike codomain because it isn’t uniquely defined. Anyway, end rant.</p>