Chapter 3 : Relations and Functions Flashcards
What is the most direct way to express a relationship between elements of 2 sets?
- Use Ordered Pairs
Ordered pairs made up of 2 related elements, for this reason, it is also called as what?
- Binary Relations
What is the term Applications in Relations and Functions?
- Methematical Concepts related to Relations and Functions used in the real world
What relationship / connections that Applications explain?
- A program and a variable it uses
- A computer language and a valid statement in the language
What structure does elements of sets are represented in?
- Relation
A = { students }
B = { courses }
R ( Relation ) = ( a , b )
= ( students , courses )
( Jason, MCFC ) , ( Jason, IOOP )
How is Ordered Pairs written?
- Written as ( a , b ) where a is the first element and b is the second element
What does aRb represent?
- ( a, b ) ∈ R
- R - Relation
- a is said to be related to b by R
Is { a , b } = { b , a }?
- True
Is ( a , b ) = ( b , a )?
- False
( a , b ) ≠ ( b , a )
What is the purpose for Relations and Cartesian Product Set?
- Relation - to express and test if a relation holds between two individual elements
- Cartesian Product Set - combine two sets to create a new set of all possible pairings
- Example
A = {flour, sugar, eggs}
B = {bake, fry}
Relation ( Is like asking a question like “Is it delicious to bake flour?” )
- (flour)R(bake) would be FALSE (just baked flour isn’t delicious)
Cartesian Product Set
A × B = {(flour, bake), (flour, fry), (sugar, bake), (sugar, fry), (eggs, bake), (eggs, fry)}
What does A x B means?
( Both A and B are sets )
- A crosses B
- Cartesian Product of A and B
- A x B = { ( a , b ) | a ∈ A , b ∈ B }
What can A x A be represented as?
- A²
- A x A = { ( a₁ , a₂ ) | a₁ ∈ A , a₂ ∈ B }
Given
A = { 1 , 2 }
B = { p , q }
A x B = { ( 1 , p ),( 1 , q ), ( 2 , p ), ( 2 , q ) }
Determine True / False
1. R₁ = { ( 1 , p ) }
2. R₂ = { ( 2, k ) }
3. R₃ = { ( 1 , q ) , ( 2 , p ) }
- True
- False ( Not the relations from A to B )
- True
How to represent relations? ( 2 )
- Arrow Diagram
- Table
What is Domain of R?
- The set of all elements in A that are related to some element in B
What is the representation of Domain of R?
- Dom( R )
What is Range of R?
- The set of all elements in B that are related to some element in A
What is the representation of Range of R?
- Ran( R )
A = { Alice , Bob }
B = { CS101, CS102 }
R = { ( Alice , CS101 ) , ( Alice , CS102 ) , ( Bob , CS101 ) , ( Bob , CS102 ) }
Can you list out which is Domain and which is Relation?
- Domain = { Alice, Bob }
- Range = { CS101 , CS102}
How many elements that a relation on set A is a subset of A x A ?
- 2^n^2
- Example
A = { a , b ,c }
The number of possible relations on set A = 2^3^2 ( 512 )
3 = { a , b , c }
2 = A x A ( 2 Sets )
What is an equivalence relation?
- It is a binary relation that is
- Reflective
- Symmmetric
- Transitive
Let R be a relation of set A, how to determine that R is reflextive?
1, if ( a , a ) ∈ R for every element a ∈ A
( a , a )
* ( 1 , 1 ) , ( 2 , 2 ) , ( 3 , 3 )
Let R be a relation of set A, how to determine that R is symmetric?
- If ( b , a ) ∈ R whenever ( a , b ) ∈ R, for some a , b ∈ A
( b , a ) must have ( a , b )
( 1 , 2 ) must have ( 2 , 1 )
( 3 , 4 ) must have ( 4 , 3 )
Let R be a relation of set A, how to determine that R is transitive?
- If ( a, b ) ∈ R and ( b , c ) ∈ R then ( a , c ) ∈ R , for a,b,c ∈ A
( a , b ) and ( b , c ) must have ( a , c )
( 2 , 4 ) and ( 4 , 1 ) must have ( 2 , 1 )
Functions are also called as what? ( 2 )
- Mappings
- Transformation
What is a under f called when b = f ( a ) ?
- Image
What is a called?
- The object of b
What is f called when f ( A ) = { f(a) | a ∈ A }?
- The range of f
What is the noun called for a of f?
- Domain
What is the noun called for b of f?
- Range
How to write function?
- f : A -> B
What is the rule for function? ( 2 )
- One to One
- Many to One
- Elements inside A must have a relation
Not
1. Many to Many
2. One to Many
What is the difference between Relation and Function?
- Function yields a single result for any element in its domain
- Relation allows multiple mappings between the domain and the co-domain
- Function - Age, Square Root
Relation - Students enrolled in one course
Let f be the function defined by the rule f ( x ) = X^2
f
0 0
1 1
2 2
3
4
Define Domain & Codomain and list out all outcomes
- Domain = { 0 , 1 ,2 }
- Codomain = { 0 , 1 , 2 , 3 ,4 , }
- f ( x ) = X^2
f ( 0 ) = 0
f ( 1 ) = 1
f ( 2 ) = 4
Determine
1. ( f + g ) ( x ) =
2. ( f - g ) ( x ) =
3. ( fg ) ( x ) =
4. ( f/g ) ( x ) =
- f ( x ) + g ( x )
- f ( x ) - g ( x )
- f ( x ) . g ( x )
- f ( x ) / g ( x )
Determine ( Composite Functions )
1. g o f ( x )
2. f o g ( x )
- g [ f ( x ) ]
- f [ g ( x ) ]
When is f^-1 ( b ) = a ? ( Inverse Function )
- When f ( a ) = b
Given that f ( x ) = 2x + 1, find f^-1 ( x ) and f^-1 ( 15 )
Let y = f ( x )
f^-1 ( y ) = x
y = 2x +1
2x = y - 1
x = ( y - 1 ) / 2
f^-1 ( y ) = ( y - 1 ) / 2
f^-1 ( x ) = ( y - 1 ) / 2
f^-1 ( 15 ) = ( 15 - 1 ) / 2
= 7