Basic Functions - Day1

Definition of a Function

  • A function is defined as a relation between two or more variables.

  • Functions can be visualized through a machine analogy:

    • Input: Represents the initial set of values sent into the function (e.g. First name, Flour).

    • Output: Represents the resultant values produced by the function (e.g. Last name, Cake).

Importance of Inputs and Outputs

  • Functions transform inputs into outputs.

  • Examples of relationships:

    • If the input is a first name, the output is the corresponding last name.

    • If the input is flour, the output is cake (implying a baking function).

Characterization of a Function

  • A function can be termed as a subclass of relation where:

    • Each output has one unique input.

  • It is possible for two different inputs to produce the same output, as illustrated in the example where two people can share the same last name (output) but cannot have the same first name (input).