DISCRETE COMPUTATIONAL STRUCTURES CSE 2353 Material for Second Test Spring 2006.

Slides:



Advertisements
Similar presentations
Chapter 2 Revision of Mathematical Notations and Techniques
Advertisements

Relations Relations on a Set. Properties of Relations.
Recursive Definitions and Structural Induction
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Basic Structures: Sets, Functions, Sequences, Sums, and Matrices
Copyright © Cengage Learning. All rights reserved. CHAPTER 5 SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION SEQUENCES, MATHEMATICAL INDUCTION, AND RECURSION.
Representing Relations Using Matrices
Induction and recursion
CMSC 250 Discrete Structures Number Theory. 20 June 2007Number Theory2 Exactly one car in the plant has color H( a ) := “ a has color”  x  Cars –H(
Proof Must Have Statement of what is to be proven.
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 12 Number theory Mathematical induction Proof by induction Examples.
Theoretical Computer Science COMP 335 Fall 2004
Chapter 12 Digital Logic Circuit Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Induction and recursion
Relations Chapter 9.
Chapter 9 1. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing.
Methods of Proof & Proof Strategies
MATH 224 – Discrete Mathematics
Induction and recursion
Discrete Mathematics, 1st Edition Kevin Ferland
Discrete Mathematics, Part II CSE 2353 Fall 2007 Margaret H. Dunham Department of Computer Science and Engineering Southern Methodist University Some slides.
Chapter 9. Chapter Summary Relations and Their Properties Representing Relations Equivalence Relations Partial Orderings.
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
Engineering 1040: Mechanisms & Electric Circuits Spring 2014 Number Systems.
Chapter 5 Existence and Proof by contradiction
Chapter 9. Section 9.1 Binary Relations Definition: A binary relation R from a set A to a set B is a subset R ⊆ A × B. Example: Let A = { 0, 1,2 } and.
CS 103 Discrete Structures Lecture 10 Basic Structures: Sets (1)
DISCRETE COMPUTATIONAL STRUCTURES CSE 2353 Fall 2011 Most slides modified from Discrete Mathematical Structures: Theory and Applications.
Mathematical Induction
Discrete Mathematics and Its Applications Sixth Edition By Kenneth Rosen Chapter 8 Relations 歐亞書局.
DISCRETE COMPUTATIONAL STRUCTURES
DISCRETE COMPUTATIONAL STRUCTURES CSE 2353 Fall 2005.
Relations and their Properties
Mathematical Preliminaries
CompSci 102 Discrete Math for Computer Science March 1, 2012 Prof. Rodger Slides modified from Rosen.
Sets and Subsets Set A set is a collection of well-defined objects (elements/members). The elements of the set are said to belong to (or be contained in)
Copyright © Cengage Learning. All rights reserved. CHAPTER 8 RELATIONS.
Foundations of Discrete Mathematics Chapter 4 By Dr. Dalia M. Gil, Ph.D.
DISCRETE COMPUTATIONAL STRUCTURES CSE 2353 Fall 2010 Most slides modified from Discrete Mathematical Structures: Theory and Applications by D.S. Malik.
CS 103 Discrete Structures Lecture 13 Induction and Recursion (1)
Foundations of Discrete Mathematics Chapters 5 By Dr. Dalia M. Gil, Ph.D.
DISCRETE COMPUTATIONAL STRUCTURES
Problem Statement How do we represent relationship between two related elements ?
Chapter 9. Chapter Summary Relations and Their Properties n-ary Relations and Their Applications (not currently included in overheads) Representing Relations.
Chapter 8: Relations. 8.1 Relations and Their Properties Binary relations: Let A and B be any two sets. A binary relation R from A to B, written R : A.
Mathematical Induction Section 5.1. Climbing an Infinite Ladder Suppose we have an infinite ladder: 1.We can reach the first rung of the ladder. 2.If.
Chapter 1 Number Systems Digital Electronics. Topics discussed in last lecture Digital systems Advantages of using digital signals over analog. Disadvantages.
1 Melikyan/DM/Fall09 Discrete Mathematics Ch. 7 Functions Instructor: Hayk Melikyan Today we will review sections 7.3, 7.4 and 7.5.
Mathematical Induction
CS104:Discrete Structures Chapter 2: Proof Techniques.
DISCRETE COMPUTATIONAL STRUCTURES CS Fall 2005.
CompSci 102 Discrete Math for Computer Science March 13, 2012 Prof. Rodger Slides modified from Rosen.
1 CMSC 250 Chapter 3, Number Theory. 2 CMSC 250 Introductory number theory l A good proof should have: –a statement of what is to be proven –"Proof:"
Chapter 5. Section 5.1 Climbing an Infinite Ladder Suppose we have an infinite ladder: 1.We can reach the first rung of the ladder. 2.If we can reach.
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
Chapter 2 1. Chapter Summary Sets (This Slide) The Language of Sets - Sec 2.1 – Lecture 8 Set Operations and Set Identities - Sec 2.2 – Lecture 9 Functions.
DISCRETE COMPUTATIONAL STRUCTURES CSE 2353 Fall 2011 Most slides modified from Discrete Mathematical Structures: Theory and Applications.
DISCRETE COMPUTATIONAL STRUCTURES CSE 2353 Spring 2009 Most slides modified from Discrete Mathematical Structures: Theory and Applications.
Introduction to Set Theory (§1.6) A set is a new type of structure, representing an unordered collection (group, plurality) of zero or more distinct (different)
Chapter 5 1. Chapter Summary  Mathematical Induction  Strong Induction  Recursive Definitions  Structural Induction  Recursive Algorithms.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Unit-III Algebraic Structures
Learn about relations and their basic properties
Equivalence Relations
Relations Chapter 9.
Chapter 2: Integers and Mathematical Induction
Relations and Digraphs
DISCRETE COMPUTATIONAL STRUCTURES
DISCRETE COMPUTATIONAL STRUCTURES
DISCRETE COMPUTATIONAL STRUCTURES
Presentation transcript:

DISCRETE COMPUTATIONAL STRUCTURES CSE 2353 Material for Second Test Spring 2006

CSE 2353 OUTLINE 1.Sets 2.Logic 3.Proof Techniques 4.Integers and Inductions 5.Relations and Posets 6.Functions 7.Counting Principles 8.Boolean Algebra

Discrete Mathematical Structures: Theory and Applications 3 Proof Technique: Learning Objectives  Learn various proof techniques  Direct  Indirect  Contradiction  Induction  Practice writing proofs  CS: Why study proof techniques?

Discrete Mathematical Structures: Theory and Applications 4 Proof Techniques  Theorem  Statement that can be shown to be true (under certain conditions)  Typically Stated in one of three ways  As Facts  As Implications  As Biimplications

Discrete Mathematical Structures: Theory and Applications 5 Proof Techniques  Direct Proof or Proof by Direct Method  Proof of those theorems that can be expressed in the form ∀ x (P(x) → Q(x)), D is the domain of discourse  Select a particular, but arbitrarily chosen, member a of the domain D  Show that the statement P(a) → Q(a) is true. (Assume that P(a) is true  Show that Q(a) is true  By the rule of Universal Generalization (UG), ∀ x (P(x) → Q(x)) is true

Discrete Mathematical Structures: Theory and Applications 6 Proof Techniques  Indirect Proof  The implication p → q is equivalent to the implication ( ∼ q → ∼ p)  Therefore, in order to show that p → q is true, one can also show that the implication ( ∼ q → ∼ p) is true  To show that ( ∼ q → ∼ p) is true, assume that the negation of q is true and prove that the negation of p is true

Discrete Mathematical Structures: Theory and Applications 7 Proof Techniques  Proof by Contradiction  Assume that the conclusion is not true and then arrive at a contradiction  Example: Prove that there are infinitely many prime numbers  Proof:  Assume there are not infinitely many prime numbers, therefore they are listable, i.e. p 1,p 2,…,p n  Consider the number q = p 1 p 2 …p n +1. q is not divisible by any of the listed primes  Therefore, q is a prime. However, it was not listed.  Contradiction! Therefore, there are infinitely many primes

Discrete Mathematical Structures: Theory and Applications 8 Proof Techniques  Proof of Biimplications  To prove a theorem of the form ∀ x (P(x) ↔ Q(x )), where D is the domain of the discourse, consider an arbitrary but fixed element a from D. For this a, prove that the biimplication P(a) ↔ Q(a) is true  The biimplication p ↔ q is equivalent to (p → q) ∧ (q → p)  Prove that the implications p → q and q → p are true  Assume that p is true and show that q is true  Assume that q is true and show that p is true

Discrete Mathematical Structures: Theory and Applications 9 Proof Techniques  Proof of Equivalent Statements  Consider the theorem that says that statements p,q and r are equivalent  Show that p → q, q → r and r → p  Assume p and prove q. Then assume q and prove r Finally, assume r and prove p  Or, prove that p if and only if q, and then q if and only if r  Other methods are possible

Discrete Mathematical Structures: Theory and Applications 10 Other Proof Techniques  Vacuous  Trivial  Contrapositive  Counter Example  Divide into Cases

Discrete Mathematical Structures: Theory and Applications 11 Proof Basics You can not prove by example

Discrete Mathematical Structures: Theory and Applications 12 Proofs in Computer Science  Proof of program correctness  Proofs are used to verify approaches

CSE 2353 OUTLINE 1.Sets 2.Logic 3.Proof Techniques 4.Integers and Induction 5.Relations and Posets 6.Functions 7.Counting Principles 8.Boolean Algebra

Discrete Mathematical Structures: Theory and Applications 14 Learning Objectives  Learn about the basic properties of integers  Explore how addition and subtraction operations are performed on binary numbers  Learn how the principle of mathematical induction is used to solve problems  CS  Become aware how integers are represented in computer memory  Looping

Discrete Mathematical Structures: Theory and Applications 15 Integers  Properties of Integers

Discrete Mathematical Structures: Theory and Applications 16 Integers

Discrete Mathematical Structures: Theory and Applications 17 Integers

Discrete Mathematical Structures: Theory and Applications 18 Integers

Discrete Mathematical Structures: Theory and Applications 19 Integers  The div and mod operators  div  a div b = the quotient of a and b obtained by dividing a on b.  Examples:  8 div 5 = 1  13 div 3 = 4  mod  a mod b = the remainder of a and b obtained by dividing a on b  8 mod 5 = 3  13 mod 3 = 1

Discrete Mathematical Structures: Theory and Applications 20 Integers

Discrete Mathematical Structures: Theory and Applications 21 Integers

Discrete Mathematical Structures: Theory and Applications 22 Integers

Discrete Mathematical Structures: Theory and Applications 23 Integers  Relatively Prime Number

Discrete Mathematical Structures: Theory and Applications 24 Integers  Least Common Multiples

Discrete Mathematical Structures: Theory and Applications 25 Representation of Integers in Computer  Electrical signals are used inside the computer to process information  Two types of signals  Analog  Continuous wave forms used to represent such things as sound  Examples: audio tapes, older television signals, etc.  Digital  Represent information with a sequence of 0s and 1s  Examples: compact discs, newer digital HDTV signals

Discrete Mathematical Structures: Theory and Applications 26 Representation of Integers in Computers  Digital Signals  0s and 1s – 0s represent low voltage, 1s high voltage  Digital signals are more reliable carriers of information than analog signals  Can be copied from one device to another with exact precision  Machine language is a sequence of 0s and 1s  The digit 0 or 1 is called a binary digit, or bit  A sequence of 0s and 1s is sometimes referred to as binary code

Discrete Mathematical Structures: Theory and Applications 27 Representation of Integers in Computers  Decimal System or Base-10  The digits that are used to represent numbers in base 10 are 0,1,2,3,4,5,6,7,8, and 9  Binary System or Base-2  Computer memory stores numbers in machine language, i.e., as a sequence of 0s and 1s  Octal System or Base-8  Digits that are used to represent numbers in base 8 are 0,1,2,3,4,5,6, and 7  Hexadecimal System or Base-16  Digits and letters that are used to represent numbers in base 16 are 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E, and F

Discrete Mathematical Structures: Theory and Applications 28 Representation of Integers in Computers

Discrete Mathematical Structures: Theory and Applications 29 Representation of Integers in Computers  Two’s Complements and Operations on Binary Numbers  In computer memory, integers are represented as binary numbers in fixed- length bit strings, such as 8, 16, 32 and 64  Assume that integers are represented as 8-bit fixed-length strings  Sign bit is the MSB (Most Significant Bit)  Leftmost bit (MSB) = 0, number is positive  Leftmost bit (MSB) = 1, number is negative

Discrete Mathematical Structures: Theory and Applications 30 Representation of Integers in Computers

Discrete Mathematical Structures: Theory and Applications 31 Representation of Integers in Computers  One’s Complements and Operations on Binary Numbers

Discrete Mathematical Structures: Theory and Applications 32 Representation of Integers in Computers

Discrete Mathematical Structures: Theory and Applications 33 Mathematical Deduction

Discrete Mathematical Structures: Theory and Applications 34 Mathematical Deduction  Proof of a mathematical statement by the principle of mathematical induction consists of three steps:

Discrete Mathematical Structures: Theory and Applications 35 Mathematical Deduction  Assume that when a domino is knocked over, the next domino is knocked over by it  Show that if the first domino is knocked over, then all the dominoes will be knocked over

Discrete Mathematical Structures: Theory and Applications 36 Mathematical Deduction  Let P(n) denote the statement that then n th domino is knocked over  Show that P(1) is true  Assume some P(k) is true, i.e. the k th domino is knocked over for some  Prove that P(k+1) is true, i.e.

Discrete Mathematical Structures: Theory and Applications 37 Mathematical Deduction  Assume that when a staircase is climbed, the next staircase is also climbed  Show that if the first staircase is climbed then all staircases can be climbed  Let P(n) denote the statement that then n th staircase is climbed  It is given that the first staircase is climbed, so P(1) is true

Discrete Mathematical Structures: Theory and Applications 38 Mathematical Deduction  Suppose some P(k) is true, i.e. the k th staircase is climbed for some  By the assumption, because the k th staircase was climbed, the k+1 st staircase was climbed  Therefore, P(k) is true, so

Discrete Mathematical Structures: Theory and Applications 39 Mathematical Deduction

Discrete Mathematical Structures: Theory and Applications 40 Mathematical Deduction  We can associate a predicate, P(n). The predicate P(n) is such that:

Discrete Mathematical Structures: Theory and Applications 41 Prime Numbers

Discrete Mathematical Structures: Theory and Applications 42 Prime Numbers

Discrete Mathematical Structures: Theory and Applications 43 Prime Numbers Example: Consider the integer 131. Observe that 2 does not divide 131. We now find all odd primes p such that p 2  131. These primes are 3, 5, 7, and 11. Now none of 3, 5, 7, and 11 divides 131. Hence, 131 is a prime.

Discrete Mathematical Structures: Theory and Applications 44 Prime Numbers

Discrete Mathematical Structures: Theory and Applications 45 Prime Numbers  Factoring a Positive Integer  The standard factorization of n

Discrete Mathematical Structures: Theory and Applications 46 Prime Numbers  Fermat’s Factoring Method

Discrete Mathematical Structures: Theory and Applications 47 Prime Numbers  Fermat’s Factoring Method

CSE 2353 OUTLINE 1.Sets 2.Logic 3.Proof Techniques 4.Integers and Induction 5.Relations and Posets 6.Functions 7.Counting Principles 8.Boolean Algebra

Discrete Mathematical Structures: Theory and Applications 49 Learning Objectives  Learn about relations and their basic properties  Explore equivalence relations  Become aware of closures  Learn about posets  Explore how relations are used in the design of relational databases

Discrete Mathematical Structures: Theory and Applications 50 Relations  Relations are a natural way to associate objects of various sets

Discrete Mathematical Structures: Theory and Applications 51 Relations  R can be described in  Roster form  Set-builder form

Discrete Mathematical Structures: Theory and Applications 52 Relations  Arrow Diagram  Write the elements of A in one column  Write the elements B in another column  Draw an arrow from an element, a, of A to an element, b, of B, if (a,b)  R  Here, A = {2,3,5} and B = {7,10,12,30} and R from A into B is defined as follows: For all a  A and b  B, a R b if and only if a divides b  The symbol → (called an arrow) represents the relation R

Discrete Mathematical Structures: Theory and Applications 53 Relations

Discrete Mathematical Structures: Theory and Applications 54 Relations  Directed Graph  Let R be a relation on a finite set A  Describe R pictorially as follows:  For each element of A, draw a small or big dot and label the dot by the corresponding element of A  Draw an arrow from a dot labeled a, to another dot labeled, b, if a R b.  Resulting pictorial representation of R is called the directed graph representation of the relation R

Discrete Mathematical Structures: Theory and Applications 55 Relations

Discrete Mathematical Structures: Theory and Applications 56 Relations  Directed graph (Digraph) representation of R  Each dot is called a vertex  If a vertex is labeled, a, then it is also called vertex a  An arc from a vertex labeled a, to another vertex, b is called a directed edge, or directed arc from a to b  The ordered pair (A, R) a directed graph, or digraph, of the relation R, where each element of A is a called a vertex of the digraph

Discrete Mathematical Structures: Theory and Applications 57 Relations  Directed graph (Digraph) representation of R (Continued)  For vertices a and b, if a R b, a is adjacent to b and b is adjacent from a  Because (a, a)  R, an arc from a to a is drawn; because (a, b)  R, an arc is drawn from a to b. Similarly, arcs are drawn from b to b, b to c, b to a, b to d, and c to d  For an element a  A such that (a, a)  R, a directed edge is drawn from a to a. Such a directed edge is called a loop at vertex a

Discrete Mathematical Structures: Theory and Applications 58 Relations  Directed graph (Digraph) representation of R (Continued)  Position of each vertex is not important  In the digraph of a relation R, there is a directed edge or arc from a vertex a to a vertex b if and only if a R b  Let A ={a,b,c,d} and let R be the relation defined by the following set: R = {(a,a ), (a,b ), (b,b ), (b,c ), (b,a ), (b,d ), (c,d )}

Discrete Mathematical Structures: Theory and Applications 59 Relations  Domain and Range of the Relation  Let R be a relation from a set A into a set B. Then R ⊆ A x B. The elements of the relation R tell which element of A is R-related to which element of B

Discrete Mathematical Structures: Theory and Applications 60 Relations

Discrete Mathematical Structures: Theory and Applications 61 Relations

Discrete Mathematical Structures: Theory and Applications 62 Relations

Discrete Mathematical Structures: Theory and Applications 63 Relations  Let A = {1, 2, 3, 4} and B = {p, q, r}. Let R = {(1, q), (2, r ), (3, q), (4, p)}. Then R −1 = {(q, 1), (r, 2), (q, 3), (p, 4)}  To find R −1, just reverse the directions of the arrows  D(R) = {1, 2, 3, 4} = Im(R −1 ), Im(R) = {p, q, r} = D(R −1 )

Discrete Mathematical Structures: Theory and Applications 64 Relations

Discrete Mathematical Structures: Theory and Applications 65 Relations  Constructing New Relations from Existing Relations

Discrete Mathematical Structures: Theory and Applications 66 Relations  Example:  Consider the relations R and S as given in Figure 3.7.  The composition S ◦ R is given by Figure 3.8.

Discrete Mathematical Structures: Theory and Applications 67 Relations

Discrete Mathematical Structures: Theory and Applications 68 Relations

Discrete Mathematical Structures: Theory and Applications 69 Relations

Discrete Mathematical Structures: Theory and Applications 70 Relations

Discrete Mathematical Structures: Theory and Applications 71 Relations

Discrete Mathematical Structures: Theory and Applications 72 Relations

Discrete Mathematical Structures: Theory and Applications 73 Relations

Discrete Mathematical Structures: Theory and Applications 74 Relations

Discrete Mathematical Structures: Theory and Applications 75 Relations

Discrete Mathematical Structures: Theory and Applications 76 Relations

Discrete Mathematical Structures: Theory and Applications 77 Relations

Discrete Mathematical Structures: Theory and Applications 78 Relations

Discrete Mathematical Structures: Theory and Applications 79 Relations

Discrete Mathematical Structures: Theory and Applications 80 Partially Ordered Sets

Discrete Mathematical Structures: Theory and Applications 81 Partially Ordered Sets

Discrete Mathematical Structures: Theory and Applications 82 Partially Ordered Sets

Discrete Mathematical Structures: Theory and Applications 83 Partially Ordered Sets

Discrete Mathematical Structures: Theory and Applications 84 Partially Ordered Sets  Hasse Diagram  Let S = {1, 2, 3}. Then P(S) = { , {1}, {2}, {3}, {1, 2}, {2, 3}, {1, 3}, S}  Now (P(S),≤) is a poset, where ≤ denotes the set inclusion relation. The poset diagram of (P(S),≤) is shown in Figure 3.22

Discrete Mathematical Structures: Theory and Applications 85 Partially Ordered Sets

Discrete Mathematical Structures: Theory and Applications 86 Partially Ordered Sets  Hasse Diagram  Let S = {1, 2, 3}. Then P(S) = { , {1}, {2}, {3}, {1, 2}, {2, 3}, {1, 3}, S}  (P(S),≤) is a poset, where ≤ denotes the set inclusion relation  Draw the digraph of this inclusion relation (see Figure 3.23). Place the vertex A above vertex B if B ⊂ A. Now follow steps (2), (3), and (4)

Discrete Mathematical Structures: Theory and Applications 87 Partially Ordered Sets

Discrete Mathematical Structures: Theory and Applications 88 Partially Ordered Sets  Hasse Diagram  Consider the poset (S,≤), where S = {2, 4, 5, 10, 15, 20} and the partial order ≤ is the divisibility relation  In this poset, there is no element b ∈ S such that b  5 and b divides 5. (That is, 5 is not divisible by any other element of S except 5). Hence, 5 is a minimal element. Similarly, 2 is a minimal element

Discrete Mathematical Structures: Theory and Applications 89 Partially Ordered Sets  Hasse Diagram  10 is not a minimal element because 2 ∈ S and 2 divides 10. That is, there exists an element b ∈ S such that b < 10. Similarly, 4, 15, and 20 are not minimal elements  2 and 5 are the only minimal elements of this poset. Notice that 2 does not divide 5. Therefore, it is not true that 2 ≤ b, for all b ∈ S, and so 2 is not a least element in (S,≤). Similarly, 5 is not a least element. This poset has no least element

Discrete Mathematical Structures: Theory and Applications 90 Partially Ordered Sets  Hasse Diagram  There is no element b ∈ S such that b  15, b > 15, and 15 divides b. That is, there is no element b ∈ S such that 15 < b. Thus, 15 is a maximal element. Similarly, 20 is a maximal element.  10 is not a maximal element because 20 ∈ S and 10 divides 20. That is, there exists an element b ∈ S such that 10 < b. Similarly, 4 is not a maximal element. Figure 3.24

Discrete Mathematical Structures: Theory and Applications 91 Partially Ordered Sets  Hasse Diagram  20 and 15 are the only maximal elements of this poset  10 does not divide 15, hence it is not true that b ≤ 15, for all b ∈ S, and so 15 is not a greatest element in (S,≤)  This poset has no greatest element Figure 3.24

Discrete Mathematical Structures: Theory and Applications 92 Partially Ordered Sets

Discrete Mathematical Structures: Theory and Applications 93 Partially Ordered Sets

Discrete Mathematical Structures: Theory and Applications 94 Partially Ordered Sets

Discrete Mathematical Structures: Theory and Applications 95 Partially Ordered Sets

Discrete Mathematical Structures: Theory and Applications 96 Partially Ordered Sets

Discrete Mathematical Structures: Theory and Applications 97 Partially Ordered Sets

Discrete Mathematical Structures: Theory and Applications 98 Partially Ordered Sets

Discrete Mathematical Structures: Theory and Applications 99 Partially Ordered Sets

Discrete Mathematical Structures: Theory and Applications 100 Application: Relational Database  A database is a shared and integrated computer structure that stores  End-user data; i.e., raw facts that are of interest to the end user;  Metadata, i.e., data about data through which data are integrated  A database can be thought of as a well-organized electronic file cabinet whose contents are managed by software known as a database management system; that is, a collection of programs to manage the data and control the accessibility of the data

Discrete Mathematical Structures: Theory and Applications 101 Application: Relational Database  In a relational database system, tables are considered as relations  A table is an n-ary relation, where n is the number of columns in the tables  The headings of the columns of a table are called attributes, or fields, and each row is called a record  The domain of a field is the set of all (possible) elements in that column

Discrete Mathematical Structures: Theory and Applications 102 Application: Relational Database  Each entry in the ID column uniquely identifies the row containing that ID  Such a field is called a primary key  Sometimes, a primary key may consist of more than one field

Discrete Mathematical Structures: Theory and Applications 103 Application: Relational Database  Structured Query Language (SQL)  Information from a database is retrieved via a query, which is a request to the database for some information  A relational database management system provides a standard language, called structured query language (SQL)

Discrete Mathematical Structures: Theory and Applications 104 Application: Relational Database  Structured Query Language (SQL)  An SQL contains commands to create tables, insert data into tables, update tables, delete tables, etc.  Once the tables are created, commands can be used to manipulate data into those tables.  The most commonly used command for this purpose is the select command. The select command allows the user to do the following:  Specify what information is to be retrieved and from which tables.  Specify conditions to retrieve the data in a specific form.  Specify how the retrieved data are to be displayed.