Discrete Mathematics with Applications 4th Edition

Published by Cengage Learning
ISBN 10: 0-49539-132-8
ISBN 13: 978-0-49539-132-6

Chapter 7 - Functions - Exercise Set 7.2 - Page 415: 22

Answer

a-D is not one-to-one b-D is onto

Work Step by Step

$D:S\rightarrow \mathbb{Z} (S\,is\,the\,set\,all\,strings\,of\,0\,s\,and\,1\,s)\\ D(s) =the number\,of\,1\,s\,in\,s\,minus\,the\,number\,of 0\,s\,in\,s \\ a-\\ A\,function\,\,D: S \rightarrow \mathbb{Z}\,is\,not\,\,\,one-to-one\,\Leftrightarrow \\ \exists \,\,x_{1}\,and\,x_{2}\,\,in\,\,S\,\,such\,that\,\, D(x_{1}) = D(x_{2})\,\,and x_{1} \neq x_{2}.\\ we\,can\,see\,that\,D(100)=l(010)=-1\,\,and\,100\neq 010 \\ so\,D\,is\,not\,one-to-one\\ b-\\ l: S \rightarrow \mathbb{Z}\,\,is\,\,onto\,\Leftrightarrow \,\\ \forall y\,in\,\mathbb{Z} ,\exists x \in S\,such\,that\, l(x) = y.\\ proof:\\ if\,y=0\,there\,is\,s=10 \,such\,that\,D(10 )=0\\ if\,y=n> 0\\ let\,s=1111...1\,(n\,times.)\,such\,that\,D(1111...1 )=n \\ if\,y=n< 0\\ let\,s=0000...0\,(n\,times.)\,such\,that\,D(0000...0 )=n \\ so\,D\,is\,onto $
Update this answer!

You can help us out by revising, improving and updating this answer.

Update this answer

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.