Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 2 (6 points) Let A be a set of symbols (called alphabet), and let len be the function that maps any string (tuple) of

image text in transcribed

Question 2 (6 points) Let A be a set of symbols (called alphabet), and let len be the function that maps any string (tuple) of symbols in A to the length of that string (i.e., the number of its symbols). In other words: len A : A* NU{0}, where for any k NU{0} and $1.- Sk Ak: len A(31 --- Sk)= k. For example, if the alphabet is A = {a,b, ..., z}, then len A (abracadabra) = 11. Note that the empty string has length 0, so len A() = 0 for any alphabet A. (a) Suppose A = {0, 1}. Is len a surjective? Is it injective? Justify your answers. (b) Give a set A such that lena is bijective. Explain why len A is bijective for your given set A. Question 3 (6 points) Consider the set of all non-empty bit-strings: {0,13+ ={0,134 k=1 Prove that the set {0,1}+ x N is countable. (This set contains all pairs (B,x), where B is a non- empty bit-string, and x is a positive integer. For example, (1011011, 73) is an element of that set.) To answer the question, you can assume without proof that there is a sub-routine printBinStrings (k), which returns a list of all strings in {0,1}\, and then terminates. For example, printBinStrings (2) returns the list (00,01, 10, 11)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Databases With Application To GIS

Authors: Philippe Rigaux, Michel Scholl, Agnès Voisard

1st Edition

1558605886, 978-1558605886

More Books

Students also viewed these Databases questions