Functions - PowerPoint PPT Presentation

About This Presentation
Title:

Functions

Description:

... and their inverses, we find that they mirror along the line x=y. This is ... direction, ex- left, right, and to keep the car from going stray on the road. ... – PowerPoint PPT presentation

Number of Views:18
Avg rating:3.0/5.0
Slides: 12
Provided by: vishnur
Learn more at: http://www.cs.iit.edu
Category:
Tags: functions

less

Transcript and Presenter's Notes

Title: Functions


1
Functions
  • A function is a systematic operation in which one
    set of events influences another set of events
    based on special ground rules.
  • Function Implies a definite end or purpose that
    the one in question serves or a particular kind
    of work it is intended to perform example- the
    function of language is two-fold to communicate
    emotion and to give information.

2
Why Functions?
  • To assign value or the rule.
  • To avoid repetition.
  • To simplify the problem by decomposing it into
    small pieces.

3
Types of Functions
  • Mathematical Functions.
  • General Functions Examples.

4
Mathematical Functions
There are different types of mathematical
functions. For example You can find out the sum
of the interior angles of a polygon with n sides
by using the formula sum of angles 180
(n-2) The right hand side of the is the
function to find out the sum of the angles of a
polygon.
5
Graph of a function X Y
6
Inverted Functions
An invertible function is a function that can be
inverted. An invertible function must satisfy the
condition that each element in the domain
corresponds to one distinct element that no other
element in the domain corresponds to. That is,
all of the elements in the domain and range are
paired-up in monogomous relationships - each
element in the domain pairs to only one element
in the range and each element in the range pairs
to only one element in the domain. Thus, the
inverse of a function is a function that looks at
this relationship from the other viewpoint. So,
for all elements a in the domain of f(x), the
inverse of f(x) (notation f-1(x))
satisfiesf(a)b implies f-1(b)aAnd, if you do
the slightest bit of manipulation, you find
thatf-1(f(a))a
7
Example of Inverse Function
When we graph functions and their inverses, we
find that they mirror along the line xy. This is
only logical. From our definition, we know that
for each (a,b) in f(x) there will be a (b,a) in
f-1(x)
8
General Functions
  • Functions are a part of our everyday life, for
    example there are mathematical functions,
    programming functions, electronic functions, etc.
  • We have already discussed some mathematical
    functions and their behavior, programming
    functions work in a similar manner.
  • While writing a program we usually break it down
    into functions and each functions performs a
    certain process, just like the buttons on a
    walkman.
  • Advantages of having functions in our programs
    are that they can be repeated as many times as
    you like, and they can be modified to perform
    extended tasks.

9
General Functions Contd
  • Example- A program that converts temperature
    from degrees Fahrenheit to degrees Celsius and
    visa-versa.
  • Main Menu
  • 1. Convert Celsius to Fahrenheit.
  • 2. Convert Fahrenheit to Celsius.
  • NOTE Options 1 2 can both be written as
    functions in your program, and each function
    performs a different action.
  • Using option 1 will take the input in degrees
    Celsius and will output the result in
    Fahrenheit.
  • Option 2 does just the opposite.

10
Example of a function
A walkman will behave in a certain manner when
different buttons are pressed. Each button on the
walkman can be considered a simple function that
performs a simple task. ltPLAYgt plays a tape, ltFFgt
forwards tape, ltREWgt rewinds the tape, ltSTOPgt
stops any current function being performed.
11
Example of a function Contd
The function of a steering wheel in a car is to
steer the car in the desired direction, ex- left,
right, and to keep the car from going stray on
the road. Another example can be the accelerator
in a motor vehicle, its function is to accelerate
the vehicle in a forward/reverse direction.
Mechanically the accelerator increases the intake
of fuel in the engine, increasing the rate of
piston motion and therefore burning the fuel
faster and moving the vehicle faster.
Write a Comment
User Comments (0)
About PowerShow.com