Consider the following codes:
A -
1 2 3 4 5 6 |
|
B -
1 2 3 4 5 6 |
|
We define the following terms:
Functional equivalence: If the functions terminate, they print the same values.
Differentiable: There exists an input on which the output of one function is different from the other.
Which of these apply to A and B?
This problem is a part of Tessellate S.T.E.M.S.
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
If n >= 0 then both functions terminate and give the same result (print n+1 times "helloworld", functional equivalence), if n<0 then both functions do not terminate, but only A will print an infinite number of "helloworld", B prints nothing (differentiable).