Discrete Structures: Sets and Their Properties, Slides of Computer Science

A course outline for CSC102 - Discrete Structures at the Computer Science Department of CUI, Lahore Campus. It covers the basics of sets, including set terminologies, sets of sets, power sets, cartesian products, and set notation with quantifiers. Applications of sets in areas like databases, data types, and finite state machines are also discussed.

Typology: Slides

2020/2021

Uploaded on 03/09/2021

ayesha-tariq-5
ayesha-tariq-5 ๐Ÿ‡ต๐Ÿ‡ฐ

5 documents

1 / 51

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CSC102 - Discrete Structures
By
Mahwish Waqas
Department Of Computer Science, CUI
Lahore Campus
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33

Partial preview of the text

Download Discrete Structures: Sets and Their Properties and more Slides Computer Science in PDF only on Docsity!

CSC102 - Discrete Structures By Mahwish Waqas

Department Of Computer Science, CUI

Lahore Campus

Course Outline

  • Sets
    • Set Terminologies
    • Sets of sets
    • Power Set
    • Cartesian Product
    • Set notation with Quantifier

Set

  • A set is an unordered collection of objects.
  • The objects in a set are called the elements , or members , of the set.
  • A set is said to contain its elements. Example:
    • Z is the set of integers.
    • Cities in the Pakistan: {Lahore, Karachi, Islamabad, โ€ฆ }
    • Sets can contain non-related elements: {3, a, red, Gilgit } Properties:
  • Order does not matter
    • {1, 2, 3, 4, 5} is equivalent to {3, 5, 2, 4, 1}
  • Sets do not have duplicate elements
    • Consider the list of students in this class
    • It does not make sense to list somebody twice

Set Membership

  • a is an element of the set A , denoted by a โˆˆ A.
  • a is not an element of the set A , denoted by a โˆ‰

A.

Sets (example)

  • Example: V: {a,e,i,o,u} a โˆˆ V b โˆ‰ V I: {0,1,2,โ€ฆ,99} 50 โˆˆ I 100 โˆ‰ I S: {a,2,class} 2 โˆˆ S room โˆ‰ S

Specifying a Set

  • Capital letters (A, B, Sโ€ฆ) for sets
  • Italic lower-case letter for elements ( a, x, y โ€ฆ)
  • Easiest way: list all the elements
    • A = { 1 , 2 , 3 , 4 , 5 }, Not always feasible!
  • May use ellipsis (โ€ฆ): B = { 0 , 1 , 2 , 3 , โ€ฆ}
  • May cause confusion. C = { 3 , 5 , 7 , โ€ฆ}. Whatโ€™s next?
  • If the set is all odd integers greater than 2 , it is 9
  • If the set is all prime numbers greater than 2 , it is 11

Important Sets

  • Set of natural numbers
    • ๐ = { 1 , 2 , 3 ,โ€ฆ}
  • Set of integers
    • ๐™ = {โ€ฆ,- 2 ,- 1 , 0 , 1 , 2 ,โ€ฆ}
  • Set of positive integers
    • ๐™
      • = { 1 , 2 , 3 ,โ€ฆ}
  • Set of rational numbers
    • ๐ = {p/q | p โˆˆ ๐™, q โˆˆ ๐™, and q โ‰  0 }
  • Set of real numbers
    • ๐‘

Examples

โ€ข S 1 = { N, Z, Q, R }

  • S 1 has 4 elements, each of which is a set.
  • S 2 = {x | x โˆˆ N and โˆƒk k โˆˆ N , x = k 2 }
  • Set of squares of natural numbers

Equality of Sets (examples)

  • { 1 , 2 , 3 } and { 3 , 2 , 1 } { 1 , 2 , 3 } = { 3 , 2 , 1 }
  • ๐™
    • and { 0 , 1 , 2 ,โ€ฆ} ๐™
      • โ‰  { 0 , 1 , 2 ,โ€ฆ}

The Universal Set

  • U is the universal set โ€“ the set containing all objects or elements (or the โ€œuniverseโ€), and of which all other sets are subsets
  • For the set {- 2 , 0. 4 , 2 }, U would be the real numbers
  • For the set { 0 , 1 , 2 }, U could be the N, Z, Q, R depending on the context
  • For the set of the vowels of the alphabet, U would be all the letters of the alphabet

Empty Set (example)

  • Example:
  • S = {x | x โˆˆ ๐‘
    • and x < 0 } S = { } = ร˜
  • A set that has no elements called empty set , or null set.
  • ร˜ and {ร˜} ร˜ โ‰  {ร˜}

Sets Of Sets

  • Sets can contain other sets
  • S = { { 1 }, { 2 }, { 3 } }
  • T = { { 1 }, {{ 2 }}, {{{ 3 }}} }
  • V = { { { 1 }, {{ 2 }} }, { {{ 3 }} }, { { 1 }, {{ 2 }}, {{{ 3 }}} } } V has only 3 elements!
  • Note that 1 โ‰  { 1 } โ‰  {{ 1 }} โ‰  {{{ 1 }}}
  • They are all different

Subset and Equality

  • A โІ B, โˆ€ x (x โˆˆ A โ†’ x โˆˆ B) and
  • B โІ A, โˆ€ x (x โˆˆ B โ†’ x โˆˆ A) then
  • A = B, โˆ€ x (x โˆˆ A โ†” x โˆˆ B)

Subset (example)

  • Q and R Q โІ R
  • N and Z N โІ Z
  • A = {x | x โˆˆ ๐™
    • and x< 10 } B = {x | x โˆˆ ๐™
      • , x is even and x< 10 } B โІ A