-
Title:
21-07 Functional Properties Solution
-
Description:
-
The first one of course is not a functional property because condition two is not fulfilled.
-
All computer programs are computer programs.
-
There is no computer program that is not a computer program.
-
Of course, this sounds a bit silly but it's actually
-
the only example I could think of where this condition here is violated.
-
A program always returns one already is a functional property.
-
First of all, it describes how output relates to the input
-
namely output doesn't care about the input and is always one
-
and property two is also always satisfied.
-
For example, there are computer programs that I could write that always return two
-
and property two is fulfilled for all the other three as well, so I won't even mention it anymore.
-
A program solves vertex cover?
-
Yes, definitely that describes an input-output behavior, how output relates to the input.
-
Is a computer a virus? I would say yes, this is a functional property.
-
Now, it is a bit debatable if saying it is a computer virus
-
already described sufficiently how the output relates to the input
-
but I would say that probably any definition of a computer virus that you would give me
-
would in some way describe what the computer virus is doing.
-
So, it might ignore anything that receives and overwrite your hard disc,
-
so put something in the memory, or it might lock your screen.
-
So, I would say here, the input-output behavior is variable
-
depending on how you define computer virus but it is always defined.
-
Now, the final one that is a bit of a tricky one saying that
-
a program only requires linear time is not a functional property
-
because that does not describe how the output relates to the input.
-
It is the property of the program but it is not a functional property
-
because it doesn't ask what does the program do
-
and what does the program do is actually this relationship here.
-
It only asked how fast that the program are doing that.
-
This is something that is a little more tricky to figure out,
-
but basically, any time that you ask can a program do X
-
that will be a functional property that you are asking for
-
at least in almost any of the cases.