1 of 19

Functions

By:) Manheer Dudeja

2 of 19

Motto of this article

  • To get an intuitive feeling of the definition of function

j

3 of 19

Who Am I?

  • My name is Manheer Dudeja, a graduate in engineering and an ex Senior Systems Engineer at Infosys ltd.
  • I have been teaching math to high school students for over 6 years now through live online classes.
  • I always wanted to create some content but 3b1b inspired me to do so
  • My motto to teach math is to make my students feel that ideas in math were not born in isolation in books to be applied to the life or world but it is the necessity that leads to the invention.

4 of 19

Let us Begin!!

  • Imagine you have a business of groceries.
  • You get a lot of customers. Therefore you want to install a kiosk in your store
  • You decide to put a list of stuff in the kiosk for which person does not need to come to the counter

5 of 19

Let us decide the list of stuff

  • BrandX Chewing Gum
  • BrandY Soda Drink
  • BrandC Classic Chips
  • BrandZ WaterBottle
  • BrandW Chocolate
  • BrandV Mango Drink
  • A laughing Buddha( Not for sale but for good luck ☺ )

6 of 19

Let’s give shorthand notations

Item Name

Short Name

BrandX Chewing Gum

X

BrandY Soda Drink

Y

BrandC Classic Chips

C

BrandZ WaterBottle

Z

BrandW Chocolate

W

BrandV Mango Drink

V

Laughing Buddha

L

Note: All items are unique or distinct

7 of 19

Create Code

  • Codes shall be required to enter in the keyboard to select a particular item
  • Let us answer a few questions!
  • We have 7 items in the list, 1 of which is not for sale

8 of 19

Requirements for code

  • Do we need a code for L?
  • No we don’t. As that can not be purchased
  • Can two different items have the same code?
  • No, How will the kiosk know which item of the two do we need?
  • Can I have two codes for an item?
  • May be. In case we need a back up when the first code has stopped working for a technical glitch
  • Can I have codes that fetch nothing?
  • No. We can have backup codes for items, but why to have an empty code that could make a machine unresponsive?

9 of 19

Let’s write the codes

  • Let us first decide the no. of codes for our kiosk that has 7 items but needs to sell 6 of them
  • How many minimum codes do we need?
  • Equal to the no of items for sale. Therefore 6

***More than 6 in case of backup codes

  • Let us have 6 codes for now : A,B,C,D,E,F
  • Note: In case we need to reduce the no of purchasing items after having 6 codes, we will have to re-assign empty codes as backup codes for the left purchasing items

10 of 19

Let us see which code fetches which item

Code FETCHES

Item

A

X

B

Y

C

Z

D

W

E

V

F

C

L

11 of 19

Mapping from Code to Item

  • Code Item

A

B

C

D

E

F

C

W

V

X

Y

Z

L

12 of 19

Let us create a backup code

  • If we have a backup code for Item X i.e Along with Code A, Code G also fetches X
  • Let us look our mapping diagram now

13 of 19

A new backup Code Added

A

B

C

D

E

F

G

C

W

V

X

Y

Z

L

14 of 19

Let us see mappings which are not allowed

A

B

C

D

E

F

G

C

W

V

X

Y

Z

L

Here Code G wants to fetch two items, which we know creates confusion. SO NOT ALLOWED for any code

15 of 19

Let us see mappings which are not allowed

A

B

C

D

E

F

G

C

W

V

X

Y

Z

L

Here Code G wants to have an empty mapping which is also allowed for any code

16 of 19

What do mathematicians see?

  • On seeing a problem, they not only want to solve the problem but also like to solve the similar problems and help others to solve them as well
  • So, whenever someone wants to create a machine not just kiosk, they create rules that we formed for kiosk
  • As a result, they create a general solution which can be applied to similar problems and define terms which can be applied by others as well.

17 of 19

Mathematical Terms

  • Kiosk 🡪 Machine 🡪 Function
  • Code 🡪 Input
  • Item 🡪 Output
  • List (Collection/Set) of Input 🡪 Domain
  • List (Collection/Set) of Output 🡪 Codomain
  • List/Set of items that could be purchased 🡪 Set of outputs that have a mapping 🡪Range
  • Note: Laughing buddha in our case was an element of codomain but not of range

18 of 19

Rules for function

  • Not Allowed: one Code for two items 🡪 One input having two outputs
  • Not Allowed: Code with empty mapping 🡪 No mapping for an input
  • Not Allowed: Empty list of code and Items 🡪 Empty Domain and Range

19 of 19

Formal Definition of Functions

  • Function is a rule defined from a non empty set A to a non empty set B
  • Where A is called domain and B is called codomain
  • Such that
  • Every element of A is mapped to one and only one element of B