Generic Functions - Discrete Mathematics - Lecture Slides, Slides of Discrete Mathematics

During the study of discrete mathematics, I found this course very informative and applicable.The main points in these lecture slides are:Generic Functions, Sample Functions, Unique Element, Arrow Diagrams for Functions, Equality of Functions, Identity Function, Logarithmic Function, Encoding and Decoding, Hamming Distance Function, Euler Function

Typology: Slides

2012/2013

Uploaded on 04/27/2013

aslesha
aslesha 🇮🇳

4.4

(14)

160 documents

1 / 20

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Discrete Mathematics
Lecture 7
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14

Partial preview of the text

Download Generic Functions - Discrete Mathematics - Lecture Slides and more Slides Discrete Mathematics in PDF only on Docsity!

Discrete Mathematics

Lecture 7

Generic Functions

  • A function f: X  Y is a relationship between elements of X to elements of Y, when each element from X is related to a unique element from Y
  • X is called domain of f, range of f is a subset of Y so that for each element y of this subset there exists an element x from X such that y = f(x)
  • Sample functions:
    • f : R  R, f(x) = x^2
    • f : Z  Z, f(x) = x + 1
    • f : Q  Z, f(x) = 2

Generic Functions

  • Encoding and decoding of characters
  • Hamming distance function: number of

differences between two encodings

  • Boolean functions: f : {0, 1}n^  {0, 1}
  • Well-defined functions
  • Euler function: ϕ(n) is the number of

positive integers less than n, which are

mutually prime with n

Exercises

  • Show that if p is a prime number, then ϕ(p n) = p n^ – p n-
  • Prove that there infinitely many integers for which Euler’s function is a perfect square
  • Show that ϕ(pq) = ϕ(p-1) ϕ(q-1) if p and q are distinct primes
  • Determine which of the following is true:
    • if A ⊆ B, then f(A) ⊆ f(B)
    • f(A ∪ B) = f(A) ∪ f(B)
    • f(A ∩ B) = f(A) ∩ f(B)
    • f(A - B) = f(A) - f(B)

FSA by Transition Diagram

s0 s1 s

1

1

1

0

0 0

FSA by Next-State Table

a b c

U Z Y Y

X V V V

Y Z V Y

Z Z Z Z

Designing FSA

  • Design an FSA that accepts all strings of 0’s and

1’s such that the number of 1’s is divisible by 3

  • Design an FSA that accepts the set of strings that

contain exactly one 1

  • Design an FSA with alphabet {a, b} which accepts

strings that end on the same two characters

  • Simulating an FSA using software

One-to-One Functions

  • Function f : X  Y is called one-to-one

(injective) when for all elements x 1 and x 2

from X if f(x 1 ) = f(x 2 ), then x 1 = x 2

  • Determine whether the following functions

are one-to-one:

  • f : R  R, f(x) = 4x – 1
  • g : Z  Z, g(n) = n 2
  • Hash functions

Inverse Functions

  • If f : X  Y is a bijective function, then it is

possible to define an inverse function f-1^ : Y

 X so that f -1^ (y) = x whenever f(x) = y

  • Find an inverse for the following functions:
    • String-reverse function
    • f : R  R, f(x) = 4x – 1
  • Inverse function of a bijective function is a

bijective function itself

Exercises

  • Let c (^) m,n be the number of onto functions

from a set of m elements to a set of n

elements. Find a relationship between cm,n,

c m-1,n and c m-1,n-

  • Let F: Z × Z  Z and G: Z × Z  Z, F(n,

m) = 3 n 6 m^ and G(n, m) = 3 n 5 m. Is F one-to-

one, is G one-to-one?

Pigeonhole Principle

  • There is no FSA that accepts the following language: L = {s = akb k, for positive k}
  • Generalized Pigeonhole Principle: For any function f : X  Y acting on finite sets, if n(X) > k * N(Y), then there exists some y from Y so that there are at least k + 1 distinct x’s so that f(x) = y
  • There are 42 students who are to share 12 computers. Each student uses exactly 1 computer and no computer is used by more than 6 students. Show that at least 5 computers are used by 3 or more students.

Exercises

  • Let f : X  Y and n(X) = n(Y), then f is bijective iff f is surjective
  • Let A be a set of 6 integers less than 13. Show that there must be two disjoint subsets of A whose sum of elements adds up to the same number
  • Given 52 distinct integers, show that there must be two whose sum or difference is divisible by 100
  • Show that if 101 integers are chosen from 1 to 200 inclusive, there must be two with the property that one is divisible by the other
  • Suppose a 1 , a 2 , …, a (^) n is a sequence of n integers none of which is divisible by n. Show that at least one difference a (^) i
    • a (^) j is divisible by n

Cardinality

  • Cardinality refers to the size of the set
  • Finite and infinite sets
  • Two sets have the same cardinality when there is bijective function associating them
  • Cardinality is is reflexive, symmetric and transitive
  • Countable sets: set of all integers, set of even numbers
  • Set of real numbers
  • Computability of functions

Exercises

  • Show that the set of irrational numbers is

dense

  • Show that a power set has always a greater

cardinality than the original set