Homework 1 - PowerPoint PPT Presentation

1 / 5
About This Presentation
Title:

Homework 1

Description:

1. Define recursively the set A of all bit strings that have as many ones as zeros. ... Hint: To show the result, you may need to establish some lemmas first. ... – PowerPoint PPT presentation

Number of Views:124
Avg rating:3.0/5.0
Slides: 6
Provided by: chengch
Category:
Tags: homework | lemmas

less

Transcript and Presenter's Notes

Title: Homework 1


1
Homework 1
2
Problems
  • 1. Define recursively the set A of all bit
    strings that have as many ones as zeros.
  • Ex 10, 1010, 1001, 1110000,
  • Counter Ex 0, 001, 100, 10011,
  • 2. Define two functions one, zero 0,1 ? N to
    count the number of ones and zeros, respectively,
    of an input bit string.
  • ex one(1100) 2 zero(1100) zero(100111) 2.
  • 3. Show the correctness of your definition of A
    by proving the followings
  • 3.1 for all x in A, one(x) zero(x). use
    structural induction
  • 3.2. if x is a bit string which has as many ones
    as zeros then x ? A.

3
Exercises
  • 4. Define recursively the set B of all bit
    strings that have more ones than zeros. (You may
    use A defined previously though it is not
    necessary. Hint Analyze how a member of B can be
    formed as the concatenation of two members of B
    and possibly some other bits.)
  • Ex 1, 110, 101, 11110.
  • Counter Ex 0, 10, 001, 100, 0011,
  • 5. Show the correctness of your definition of B
    by proving the followings
  • 5.1 for all x in B, one(x) gt zero(x). use
    structural induction
  • 5.2. if x is a bit string which has more ones
    than zeros then x ? B.

4
  • 6. The set N of natural numbers is defined as a
    subset of 1 as follows
  • Basis e ?N
  • closure if x ? N then 1?x ? N.
  • Given the domain N, we define the plus function
    as follows
  • for all x,y ?N
  • basis (x, e) x
  • recursion (x, 1y) 1 ? (x,y).
  • To convince you that is a correction defintion
    of plus, prove by induction that for all x,y,z
    ? N
  • 6.1 is associative i.e., (x, (y,z)) (
    (x,y), z).
  • 6.2 is commutative (x,y) (y,x).
  • Hint To show the result, you may need to
    establish some lemmas first.

5
  • 7. Let B be a set of strings over an alphabet S.
    We say B is transitive if BB ? B and reflexive if
    e?B.
  • Prove that for any set of strings A, A is the
    smallest reflexive and transitive set containing
    A. That is, show that
  • 7.1. A is a reflexive and transitive set
    containing A, and
  • 7.2. if B is any other reflexive and transitive
    set containing A, then A ? B.
  • Note A is defined to be e U A U A2 U A3 U
Write a Comment
User Comments (0)
About PowerShow.com