Sets & Set Operation
CMSC 56 | Discrete Mathematical Structure for Computer Science
September 11, 2018
Instructor: Allyn Joy D. Calcaben
College of Arts & Sciences
University of the Philippines Visayas
Sets & Set Operation
CMSC 56 | Discrete Mathematical Structure for Computer Science
September 11, 2018
Instructor: Allyn Joy D. Calcaben
College of Arts & Sciences
University of the Philippines Visayas
Discrete Mathematics - Sets. ... He had defined a set as a collection of definite and distinguishable objects selected by the means of certain rules or description. Set theory forms the basis of several other fields of study like counting theory, relations, graph theory and finite state machines.
JEE Mathematics/ Lakshmikanta Satapathy/ Fundamentals of set theory part 1/ Definition of set, Types of sets, empty set and infinite sets/ subset and power set/ Intervals as subsets of R
Discrete Mathematics - Sets. ... He had defined a set as a collection of definite and distinguishable objects selected by the means of certain rules or description. Set theory forms the basis of several other fields of study like counting theory, relations, graph theory and finite state machines.
Discrete Mathematics - Sets. ... He had defined a set as a collection of definite and distinguishable objects selected by the means of certain rules or description. Set theory forms the basis of several other fields of study like counting theory, relations, graph theory and finite state machines.
JEE Mathematics/ Lakshmikanta Satapathy/ Fundamentals of set theory part 1/ Definition of set, Types of sets, empty set and infinite sets/ subset and power set/ Intervals as subsets of R
Discrete Mathematics - Sets. ... He had defined a set as a collection of definite and distinguishable objects selected by the means of certain rules or description. Set theory forms the basis of several other fields of study like counting theory, relations, graph theory and finite state machines.
Presentation about nice functional programming things you can do with python. and some simple techniques you can use to do a good and functional design
Master Thesis on the Mathematial Analysis of Neural NetworksAlina Leidinger
Master Thesis submitted on June 15, 2019 at TUM's chair of Applied Numerical Analysis (M15) at the Mathematics Department.The project was supervised by Prof. Dr. Massimo Fornasier. The thesis took a detailed look at the existing mathematical analysis of neural networks focusing on 3 key aspects: Modern and classical results in approximation theory, robustness and Scattering Networks introduced by Mallat, as well as unique identification of neural network weights. See also the one page summary available on Slideshare.
Basic Concept of discrete math. I discuss a few topic of basic discrete math. I think you get a clear concept. Topics are definition,story of discrete math, Importance of discrete math, and many other basic topic.
A Comparative Study of Two-Sample t-Test Under Fuzzy Environments Using Trape...inventionjournals
This paper proposes a method for testing hypotheses over two sample t-test under fuzzy environments using trapezoidal fuzzy numbers (tfns.). In fact, trapezoidal fuzzy numbers have many advantages over triangular fuzzy numbers as they have more generalized form. Here, we have approached a new method where trapezoidal fuzzy numbers are defined in terms of alpha level of trapezoidal interval data and based on this approach, the test of hypothesis is performed. Moreover the proposed test is analysed under various types of trapezoidal fuzzy models such as Alpha Cut Interval, Membership Function, Ranking Function, Total Integral Value and Graded Mean Integration Representation. And two numerical examples have been illustrated. Finally a comparative view of all conclusions obtained from various test is given for a concrete comparative study.
Suggest one psychological research question that could be answered.docxpicklesvalery
Suggest one psychological research question that could be answered by each of the following types of statistical tests:
z test
t test for independent samples, and
t test for dependent samples
FINAL EXAM
STAT 5201
Fall 2016
Due on the class Moodle site or in Room 313 Ford Hall
on Tuesday, December 20 at 11:00 AM
In the second case please deliver to the office staff
of the School of Statistics
READ BEFORE STARTING
You must work alone and may discuss these questions only with the TA or Glen Meeden. You
may use the class notes, the text and any other sources of printed material.
Put each answer on a single sheet of paper. You may use both sides and additional sheets if
needed. Number the question and put your name on each sheet.
If I discover a misprint or error in a question I will post a correction on the class web page. In
case you think you have found an error you should check the class home page before contacting us.
1
1. Find a recent survey reported in a newspaper, magazine or on the web. Briefly describe
the survey. What are the target population and sampled population? What conclusions are drawn
from the survey in the article. Do you think these conclusions are justified? What are the possible
sources of bias in the survey? Please be brief.
2. In a small country a governmental department is interested in getting a sample of school
children from grades three through six. Because of a shortage of buildings many of the schools had
two shifts. That is one group of students came in the morning and a different group came in the
afternoon. The department has a list of all the schools in the country and knows which schools
have two shifts of students and which do not. Devise a sampling plan for selecting the students to
appear in the sample.
3. For some population of size N and some fixed sampling design let π1 be the inclusion
probability for unit i. Assume a sample of size n was used to select a sample.
i) If unit i appears in the sample what is the weight we associate with it?
ii) Suppose the population can be partitioned into four disjoint groups or categories. Let Nj be
the size of the j’th category. For this part of the problem we assume that the Nj’s are not known.
Assume that for units in category j there is a constant probability, say γi that they will respond if
selected in the sample. These γj’s are unknown. Suppose in our sample we see nj units in category
j and 0 < rj ≤ nj respond. Note n1 + n2 + n3 + n4 = n. In this case how much weight should be
assigned to a responder in category j.
iii) Answer the same question in part ii) but now assume that the Nj’s are known.
iv) Instead of categories suppose that there is a real valued auxiliary variable, say age, attached
to each unit and it is known that the probability of response depends on age. That is units of
a similar age have a similar probability of responding when selected in the sample. Very briefly
explain how you would assign adjusted weights o ...
Prinsip biaya yang diterapkan untuk asset tetap mencakup seluruh pengeluaran yg dibutuhkan untuk memperoleh aset dan membuat aset itu siap digunakan.
Harga perolehan diukur dengan kas atau setara kas yang dibayarkan
Embracing GenAI - A Strategic ImperativePeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
Read| The latest issue of The Challenger is here! We are thrilled to announce that our school paper has qualified for the NATIONAL SCHOOLS PRESS CONFERENCE (NSPC) 2024. Thank you for your unwavering support and trust. Dive into the stories that made us stand out!
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
Honest Reviews of Tim Han LMA Course Program.pptxtimhan337
Personal development courses are widely available today, with each one promising life-changing outcomes. Tim Han’s Life Mastery Achievers (LMA) Course has drawn a lot of interest. In addition to offering my frank assessment of Success Insider’s LMA Course, this piece examines the course’s effects via a variety of Tim Han LMA course reviews and Success Insider comments.
A Strategic Approach: GenAI in EducationPeter Windle
Artificial Intelligence (AI) technologies such as Generative AI, Image Generators and Large Language Models have had a dramatic impact on teaching, learning and assessment over the past 18 months. The most immediate threat AI posed was to Academic Integrity with Higher Education Institutes (HEIs) focusing their efforts on combating the use of GenAI in assessment. Guidelines were developed for staff and students, policies put in place too. Innovative educators have forged paths in the use of Generative AI for teaching, learning and assessments leading to pockets of transformation springing up across HEIs, often with little or no top-down guidance, support or direction.
This Gasta posits a strategic approach to integrating AI into HEIs to prepare staff, students and the curriculum for an evolving world and workplace. We will highlight the advantages of working with these technologies beyond the realm of teaching, learning and assessment by considering prompt engineering skills, industry impact, curriculum changes, and the need for staff upskilling. In contrast, not engaging strategically with Generative AI poses risks, including falling behind peers, missed opportunities and failing to ensure our graduates remain employable. The rapid evolution of AI technologies necessitates a proactive and strategic approach if we are to remain relevant.
1. April 14, Applied Discrete Mathematics 1
Combining RelationsCombining Relations
Another Example:Another Example: Let X and Y be relations onLet X and Y be relations on
A = {1, 2, 3, …}.A = {1, 2, 3, …}.
X = {(a, b) | b = a + 1} “b equals a plus 1”X = {(a, b) | b = a + 1} “b equals a plus 1”
Y = {(a, b) | b = 3a} “b equals 3 times a”Y = {(a, b) | b = 3a} “b equals 3 times a”
X = {(1, 2), (2, 3), (3, 4), (4, 5), …}X = {(1, 2), (2, 3), (3, 4), (4, 5), …}
Y = {(1, 3), (2, 6), (3, 9), (4, 12), …}Y = {(1, 3), (2, 6), (3, 9), (4, 12), …}
XX°° Y = {Y = { (1, 4),(1, 4), (2, 7),(2, 7), (3, 10),(3, 10), (4, 13),(4, 13), ……}}
Y maps an element a to the element 3a, andY maps an element a to the element 3a, and
afterwards X maps 3a to 3a + 1.afterwards X maps 3a to 3a + 1.
XX°° Y = {(a,b) | b = 3a + 1}Y = {(a,b) | b = 3a + 1}
2. April 14, Applied Discrete Mathematics 2
n-ary Relationsn-ary Relations
In order to study an interesting application of relations,In order to study an interesting application of relations,
namelynamely databasesdatabases, we first need to generalize the, we first need to generalize the
concept of binary relations toconcept of binary relations to n-ary relationsn-ary relations..
Definition:Definition: Let ALet A11, A, A22, …, A, …, Ann be sets. Anbe sets. An n-ary relationn-ary relation
on these sets is a subset of Aon these sets is a subset of A11××AA22××……××AAnn..
The sets AThe sets A11, A, A22, …, A, …, Ann are called theare called the domainsdomains of theof the
relation, and n is called itsrelation, and n is called its degreedegree..
3. April 14, Applied Discrete Mathematics 3
n-ary Relationsn-ary Relations
Example:Example:
Let R = {(a, b, c) | a = 2bLet R = {(a, b, c) | a = 2b ∧∧ b = 2c with a, b, cb = 2c with a, b, c∈∈ZZ}}
What is the degree of R?What is the degree of R?
The degree of R is 3, so its elements are triples.The degree of R is 3, so its elements are triples.
What are its domains?What are its domains?
Its domains are all equal to the set of integers.Its domains are all equal to the set of integers.
Is (2, 4, 8) in R?Is (2, 4, 8) in R?
No.No.
Is (4, 2, 1) in R?Is (4, 2, 1) in R?
Yes.Yes.
4. April 14, Applied Discrete Mathematics 4
Databases and RelationsDatabases and Relations
Let us take a look at a type of databaseLet us take a look at a type of database
representation that is based on relations, namely therepresentation that is based on relations, namely the
relational data model.relational data model.
A database consists of n-tuples calledA database consists of n-tuples called recordsrecords, which, which
are made up ofare made up of fieldsfields..
These fields are theThese fields are the entriesentries of the n-tuples.of the n-tuples.
The relational data model represents a database asThe relational data model represents a database as
an n-ary relation, that is, a set of records.an n-ary relation, that is, a set of records.
5. April 14, Applied Discrete Mathematics 5
Databases and RelationsDatabases and Relations
Example:Example: Consider a database of students, whoseConsider a database of students, whose
records are represented as 4-tuples with the fieldsrecords are represented as 4-tuples with the fields
Student NameStudent Name,, ID NumberID Number,, MajorMajor, and, and GPAGPA::
R = {(Ackermann, 231455, CS, 3.88),R = {(Ackermann, 231455, CS, 3.88),
(Adams, 888323, Physics, 3.45),(Adams, 888323, Physics, 3.45),
(Chou, 102147, CS, 3.79),(Chou, 102147, CS, 3.79),
(Goodfriend, 453876, Math, 3.45),(Goodfriend, 453876, Math, 3.45),
(Rao, 678543, Math, 3.90),(Rao, 678543, Math, 3.90),
(Stevens, 786576, Psych, 2.99)}(Stevens, 786576, Psych, 2.99)}
Relations that represent databases are also calledRelations that represent databases are also called
tablestables, since they are often displayed as tables., since they are often displayed as tables.
6. April 14, Applied Discrete Mathematics 6
Databases and RelationsDatabases and Relations
A domain of an n-ary relation is called aA domain of an n-ary relation is called a primary keyprimary key
if the n-tuples are uniquely determined by their valuesif the n-tuples are uniquely determined by their values
from this domain.from this domain.
This means that no two records have the same valueThis means that no two records have the same value
from the same primary key.from the same primary key.
In our example, which of the fieldsIn our example, which of the fields Student NameStudent Name,, IDID
NumberNumber,, MajorMajor, and, and GPAGPA are primary keys?are primary keys?
Student NameStudent Name andand ID NumberID Number are primary keys,are primary keys,
because no two students have identical values inbecause no two students have identical values in
these fields.these fields.
In a real student database, onlyIn a real student database, only ID NumberID Number would bewould be
a primary key.a primary key.
7. April 14, Applied Discrete Mathematics 7
Databases and RelationsDatabases and Relations
In a database, a primary key should remain one evenIn a database, a primary key should remain one even
if new records are added.if new records are added.
Therefore, we should use a primary key of theTherefore, we should use a primary key of the
intensionintension of the database, containing all the n-tuplesof the database, containing all the n-tuples
that can ever be included in our database.that can ever be included in our database.
Combinations of domainsCombinations of domains can also uniquely identifycan also uniquely identify
n-tuples in an n-ary relation.n-tuples in an n-ary relation.
When the values of aWhen the values of a set of domainsset of domains determine an n-determine an n-
tuple in a relation, thetuple in a relation, the Cartesian productCartesian product of theseof these
domains is called adomains is called a composite keycomposite key..
8. April 14, Applied Discrete Mathematics 8
Databases and RelationsDatabases and Relations
We can apply a variety ofWe can apply a variety of operationsoperations on n-aryon n-ary
relations to form new relations.relations to form new relations.
Definition:Definition: TheThe projectionprojection PPii11, i, i22, …, i, …, imm
maps the n-tuplemaps the n-tuple
(a(a11, a, a22, …, a, …, ann) to the m-tuple (a) to the m-tuple (aii11
, a, aii22
, …, a, …, aiimm
), where m), where m ≤≤
n.n.
In other words, a projection PIn other words, a projection Pii11, i, i22, …, i, …, imm
keeps the mkeeps the m
components acomponents aii11
, a, aii22
, …, a, …, aiimm
of an n-tuple and deletes itsof an n-tuple and deletes its
(n – m) other components.(n – m) other components.
Example:Example: What is the result when we apply theWhat is the result when we apply the
projection Pprojection P2,42,4 to the student record (Stevens, 786576,to the student record (Stevens, 786576,
Psych, 2.99) ?Psych, 2.99) ?
Solution:Solution: It is the pair (786576, 2.99).It is the pair (786576, 2.99).
9. April 14, Applied Discrete Mathematics 9
Databases and RelationsDatabases and Relations
In some cases, applying a projection to an entire tableIn some cases, applying a projection to an entire table
may not only result in fewer columns, but also inmay not only result in fewer columns, but also in
fewer rowsfewer rows..
Why is that?Why is that?
Some records may only have differed in those fieldsSome records may only have differed in those fields
that were deleted, so they becomethat were deleted, so they become identicalidentical, and, and
there is no need to list identical records more thanthere is no need to list identical records more than
once.once.
10. April 14, Applied Discrete Mathematics 10
Databases and RelationsDatabases and Relations
We can use theWe can use the joinjoin operation to combine two tablesoperation to combine two tables
into one if they share some identical fields.into one if they share some identical fields.
Definition:Definition: Let R be a relation of degree m and S aLet R be a relation of degree m and S a
relation of degree n. Therelation of degree n. The joinjoin JJpp(R, S), where p(R, S), where p ≤≤ mm
and pand p ≤≤ n, is a relation of degree m + n – p thatn, is a relation of degree m + n – p that
consists of all (m + n – p)-tuplesconsists of all (m + n – p)-tuples
(a(a11, a, a22, …, a, …, am-pm-p, c, c11, c, c22, …, c, …, cpp, b, b11, b, b22, …, b, …, bn-pn-p),),
where the m-tuple (awhere the m-tuple (a11, a, a22, …, a, …, am-pm-p, c, c11, c, c22, …, c, …, cpp) belongs) belongs
to R and the n-tuple (cto R and the n-tuple (c11, c, c22, …, c, …, cpp, b, b11, b, b22, …, b, …, bn-pn-p) belongs) belongs
to S.to S.
11. April 14, Applied Discrete Mathematics 11
Databases and RelationsDatabases and Relations
In other words, to generate Jp(R, S), we have to findIn other words, to generate Jp(R, S), we have to find
all the elements in R whose p last components matchall the elements in R whose p last components match
the p first components of an element in S.the p first components of an element in S.
The new relation contains exactly these matches,The new relation contains exactly these matches,
which are combined to tuples that contain eachwhich are combined to tuples that contain each
matching field only once.matching field only once.
12. April 14, Applied Discrete Mathematics 12
Databases and RelationsDatabases and Relations
Example:Example: What is JWhat is J11(Y, R), where Y contains the(Y, R), where Y contains the
fieldsfields Student NameStudent Name andand Year of BirthYear of Birth,,
Y = {(1978, Ackermann),Y = {(1978, Ackermann),
(1972, Adams),(1972, Adams),
(1917, Chou),(1917, Chou),
(1984, Goodfriend),(1984, Goodfriend),
(1982, Rao),(1982, Rao),
(1970, Stevens)},(1970, Stevens)},
and R contains the student records as defined before?and R contains the student records as defined before?
13. April 14, Applied Discrete Mathematics 13
Databases and RelationsDatabases and Relations
Solution:Solution: The resulting relation is:The resulting relation is:
{(1978, Ackermann, 231455, CS, 3.88),{(1978, Ackermann, 231455, CS, 3.88),
(1972, Adams, 888323, Physics, 3.45),(1972, Adams, 888323, Physics, 3.45),
(1917, Chou, 102147, CS, 3.79),(1917, Chou, 102147, CS, 3.79),
(1984, Goodfriend, 453876, Math, 3.45),(1984, Goodfriend, 453876, Math, 3.45),
(1982, Rao, 678543, Math, 3.90),(1982, Rao, 678543, Math, 3.90),
(1970, Stevens, 786576, Psych, 2.99)}(1970, Stevens, 786576, Psych, 2.99)}
Since Y has two fields and R has four, the relationSince Y has two fields and R has four, the relation
JJ11(Y, R) has 2 + 4 – 1 = 5 fields.(Y, R) has 2 + 4 – 1 = 5 fields.
14. April 14, Applied Discrete Mathematics 14
Representing RelationsRepresenting Relations
We already know different ways of representingWe already know different ways of representing
relations. We will now take a closer look at two waysrelations. We will now take a closer look at two ways
of representation:of representation: Zero-one matricesZero-one matrices andand directeddirected
graphsgraphs..
If R is a relation from A = {aIf R is a relation from A = {a11, a, a22, …, a, …, amm} to B =} to B =
{b{b11, b, b22, …, b, …, bnn}, then R can be represented by the zero-}, then R can be represented by the zero-
one matrix Mone matrix MRR = [m= [mijij] with] with
mmijij = 1, if (a= 1, if (aii, b, bjj))∈∈R, andR, and
mmijij = 0, if (a= 0, if (aii, b, bjj))∉∉R.R.
Note that for creating this matrix we first need to listNote that for creating this matrix we first need to list
the elements in A and B in athe elements in A and B in a particular, but arbitraryparticular, but arbitrary
orderorder..
15. April 14, Applied Discrete Mathematics 15
Representing RelationsRepresenting Relations
Example:Example: How can we represent the relationHow can we represent the relation
R = {(2, 1), (3, 1), (3, 2)} as a zero-one matrix?R = {(2, 1), (3, 1), (3, 2)} as a zero-one matrix?
Solution:Solution: The matrix MThe matrix MRR is given byis given by
=
11
01
00
RM
16. April 14, Applied Discrete Mathematics 16
Representing RelationsRepresenting Relations
What do we know about the matrices representing aWhat do we know about the matrices representing a
relation on a setrelation on a set (a relation from A to A) ?(a relation from A to A) ?
They areThey are squaresquare matrices.matrices.
What do we know about matrices representingWhat do we know about matrices representing
reflexivereflexive relations?relations?
All the elements on theAll the elements on the diagonaldiagonal of such matrices Mof such matrices Mrefref
must bemust be 1s1s..
=
1
.
.
.
1
1
refM
17. April 14, Applied Discrete Mathematics 17
Representing RelationsRepresenting Relations
What do we know about the matrices representingWhat do we know about the matrices representing
symmetric relationssymmetric relations??
These matrices are symmetric, that is, MThese matrices are symmetric, that is, MRR = (M= (MRR))tt
..
=
1101
1001
0010
1101
RM
symmetric matrix,symmetric matrix,
symmetric relation.symmetric relation.
=
0011
0011
0011
0011
RM
non-symmetric matrix,non-symmetric matrix,
non-symmetric relation.non-symmetric relation.
18. April 14, Applied Discrete Mathematics 18
Representing RelationsRepresenting Relations
The Boolean operationsThe Boolean operations joinjoin andand meetmeet (you(you
remember?)remember?) can be used to determine the matricescan be used to determine the matrices
representing therepresenting the unionunion and theand the intersectionintersection of twoof two
relations, respectively.relations, respectively.
To obtain theTo obtain the joinjoin of two zero-one matrices, we applyof two zero-one matrices, we apply
the Boolean “or” function to all corresponding elementsthe Boolean “or” function to all corresponding elements
in the matrices.in the matrices.
To obtain theTo obtain the meetmeet of two zero-one matrices, we applyof two zero-one matrices, we apply
the Boolean “and” function to all correspondingthe Boolean “and” function to all corresponding
elements in the matrices.elements in the matrices.
19. April 14, Applied Discrete Mathematics 19
Representing RelationsRepresenting Relations
Example:Example: Let the relations R and S be represented byLet the relations R and S be represented by
the matricesthe matrices
=∨=∪
011
111
101
SRSR MMM
=
001
110
101
SM
What are the matrices representing RWhat are the matrices representing R∪∪S and RS and R∩∩S?S?
Solution:Solution: These matrices are given byThese matrices are given by
=∧=∩
000
000
101
SRSR MMM
=
010
001
101
RM
20. April 14, Applied Discrete Mathematics 20
Representing Relations Using MatricesRepresenting Relations Using Matrices
Do you remember theDo you remember the Boolean productBoolean product of two zero-of two zero-
one matrices?one matrices?
Let A = [aLet A = [aijij] be an m] be an m××k zero-one matrix andk zero-one matrix and
B = [bB = [bijij] be a k] be a k××n zero-one matrix.n zero-one matrix.
Then theThen the Boolean productBoolean product of A and B, denoted byof A and B, denoted by
AAοοB, is the mB, is the m××n matrix with (i, j)th entry [cn matrix with (i, j)th entry [cijij], where], where
ccijij = (a= (ai1i1 ∧∧ bb1j1j)) ∨∨ (a(ai2i2 ∧∧ bb2i2i)) ∨∨ …… ∨∨ (a(aikik ∧∧ bbkjkj).).
ccijij = 1 if and only if at least one of the terms= 1 if and only if at least one of the terms
(a(ainin ∧∧ bbnjnj) = 1 for some n; otherwise c) = 1 for some n; otherwise cijij = 0.= 0.
21. April 14, Applied Discrete Mathematics 21
Representing Relations Using MatricesRepresenting Relations Using Matrices
Let us now assume that the zero-one matricesLet us now assume that the zero-one matrices
MMAA = [a= [aijij], M], MBB = [b= [bijij] and M] and MCC = [c= [cijij] represent relations A, B,] represent relations A, B,
and C, respectively.and C, respectively.
Remember:Remember: For MFor MCC = M= MAAοοMMBB we have:we have:
ccijij = 1 if and only if at least one of the terms= 1 if and only if at least one of the terms
(a(ainin ∧∧ bbnjnj) = 1 for some n; otherwise c) = 1 for some n; otherwise cijij = 0.= 0.
In terms of theIn terms of the relationsrelations, this means that C contains a pair, this means that C contains a pair
(x(xii, z, zjj) if and only if there is an element y) if and only if there is an element ynn such that (xsuch that (xii, y, ynn))
is in relation A andis in relation A and
(y(ynn, z, zjj) is in relation B.) is in relation B.
Therefore, C = BTherefore, C = B°°A (A (compositecomposite of A and B).of A and B).
22. April 14, Applied Discrete Mathematics 22
Representing Relations Using MatricesRepresenting Relations Using Matrices
This gives us the following rule:This gives us the following rule:
MMBB°°AA = M= MAAοοMMBB
In other words, the matrix representing theIn other words, the matrix representing the
compositecomposite of relations A and B is theof relations A and B is the BooleanBoolean
productproduct of the matrices representing A and B.of the matrices representing A and B.
Analogously, we can find matrices representing theAnalogously, we can find matrices representing the
powers of relationspowers of relations::
MMRRnn = M= MRR
[n][n]
(n-th(n-th Boolean powerBoolean power).).
23. April 14, Applied Discrete Mathematics 23
Representing Relations Using MatricesRepresenting Relations Using Matrices
Example:Example: Find the matrix representing RFind the matrix representing R22
, where the, where the
matrix representing R is given bymatrix representing R is given by
=
001
110
010
RM
Solution:Solution: The matrix for RThe matrix for R22
is given byis given by
==
010
111
110
]2[
2 RR
MM
24. April 14, Applied Discrete Mathematics 24
Representing Relations Using DigraphsRepresenting Relations Using Digraphs
Definition:Definition: AA directed graphdirected graph, or, or digraphdigraph, consists of, consists of
a set V ofa set V of verticesvertices (or(or nodesnodes) together with a set E of) together with a set E of
ordered pairs of elements of V calledordered pairs of elements of V called edgesedges (or(or arcsarcs).).
The vertex a is called theThe vertex a is called the initial vertexinitial vertex of the edge (a,of the edge (a,
b), and the vertex b is called theb), and the vertex b is called the terminal vertexterminal vertex ofof
this edge.this edge.
We can use arrows to display graphs.We can use arrows to display graphs.
25. April 14, Applied Discrete Mathematics 25
Representing Relations Using DigraphsRepresenting Relations Using Digraphs
Example:Example: Display the digraph with V = {a, b, c, d},Display the digraph with V = {a, b, c, d},
E = {(a, b), (a, d), (b, b), (b, d), (c, a), (c, b), (d, b)}.E = {(a, b), (a, d), (b, b), (b, d), (c, a), (c, b), (d, b)}.
aa
bb
ccdd
An edge of the form (b, b) is called aAn edge of the form (b, b) is called a loop.loop.