Recursively defined Functions
Recursion is defined as the method of defining the functions where the distinct function is practical within its own definition. A recursively function has two parts
1. Definition of the smallest argument (f (0) or f (1)),
2. Definition of f (n), given f (n-1), f (n-2).
The recursion process is also used to define a process of repeating objects in the similar way.
Example of recursively defined function:
An example of recursively defined function is
f (0) = 5
f (n) = f (n-1) + 2 ,
The values of the function are calculated as f (0) = 5,
f (1) = f (0) +2
= 5 + 2
= 7
f (2) = f (1) + 2
= 7 + 2
= 9
The recursively defined function is similar to that of the explicitly defined function f(n) = 2n + 5. The recursive function is defined only for non negative integers. In some recursive definitions the value of the function is directly specified not only for 0 but also for the first k non negative integers.
Forms of recursively defined functions:
A recursive function defines the values of the function for some inputs. The Input is a values of the same function for the other inputs.
Recursive definition should always have the base cases; this shows the variation among the round definition and a recursive definition.
Recursive definition includes the cases that assure the definition not including being defined in terms of the definition and all other cases containing the description must be smaller.
We should identify the value of the function at zero and give a rule for finding its value at the smaller integers for recursively significant the function through the set of non negative numeral as its domain. Then according to the second principle of mathematical induction, the function will be defined for all non negative integers
1. Definition of the smallest argument (f (0) or f (1)),
2. Definition of f (n), given f (n-1), f (n-2).
The recursion process is also used to define a process of repeating objects in the similar way.
Example of recursively defined function:
An example of recursively defined function is
f (0) = 5
f (n) = f (n-1) + 2 ,
The values of the function are calculated as f (0) = 5,
f (1) = f (0) +2
= 5 + 2
= 7
f (2) = f (1) + 2
= 7 + 2
= 9
The recursively defined function is similar to that of the explicitly defined function f(n) = 2n + 5. The recursive function is defined only for non negative integers. In some recursive definitions the value of the function is directly specified not only for 0 but also for the first k non negative integers.
Forms of recursively defined functions:
A recursive function defines the values of the function for some inputs. The Input is a values of the same function for the other inputs.
Recursive definition should always have the base cases; this shows the variation among the round definition and a recursive definition.
Recursive definition includes the cases that assure the definition not including being defined in terms of the definition and all other cases containing the description must be smaller.
We should identify the value of the function at zero and give a rule for finding its value at the smaller integers for recursively significant the function through the set of non negative numeral as its domain. Then according to the second principle of mathematical induction, the function will be defined for all non negative integers