Expression as argument in function definition

288 Views Asked by At

When a function definition has an expression (instead of just a single variable) as the argument to the function, what does this mean?

For example, I have this question (part b):

question

Given a certain concrete input to the function $N$, how would I go about extracting the $a$ and $b$. Also (in this particular case), where does the capital D come from?

I'm a bit confused about the notation of an expression as a function argument, since it seems to be at odds with the idea of viewing a function as something which takes an input, and provides an output, as this image from wikipedia illustrates:

function

1

There are 1 best solutions below

2
On BEST ANSWER

By definition of $R$, for every $x\in R$ there exist integers $a,b$ such that $x=a+b\sqrt D$. In principle it is possible that $(a,b)$ is not uniquely determined, i.e. that there exist $(c,d)$ with $(c,d)\ne(a,b)$ and yet also $x=c+\sqrt D$. In such a case, one would have to show that $N$ is in fact well-defined, i.e. that the value does not depend on the representation chosen. So here we have to show that $a+b\sqrt D=c+d\sqrt D$ with $a,b,c,d\in\mathbb Z$ implies $a^2-Db^2=c^2-Dd^2$. Well does it? Indeed, $a+b\sqrt D=c+d\sqrt D$ implies $a-c=d\sqrt D-b\sqrt D$. If $b\ne d$, this implies $\sqrt D=\frac{a-c}{d-b}\in\mathbb Q$, which is not the case (because $D$ is not a square); hence we must gave $b=d$, and consequently $a=c$. This shows that for any $x\in R$, we can speak of "the" $a\in\mathbb Z$ and "the" $b\in\mathbb Z$ such that $x=a+\sqrt b$. That allows us to define $N(x)=a^2-Db^2$ where $a,b$ are the unique integers for which $x=a+b\sqrt D$. The notation you found in the text is a shorthand for this lengthy explanation.