146k views
0 votes
6

c.find the domain and range of the function that assigns to a bit string the number of ones minus the number of zeros in the string

1 Answer

5 votes
Let bitstrings have a maximum length of L bits.
and f(x)=number of one-bits less number of zero-bits.
x=length of bitstring in bits.

Case 1: x=L, all L bits are ones
Then f(x)=L
Case 2: x=L, all L bits are zeroes
Then f(x)=-L

Then
dom f(x)=[0,L]
range f(x) = [-L,L]


User Geinmachi
by
8.0k points

No related questions found

Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.

9.4m questions

12.2m answers

Categories