Cheexorgeny

2022-01-05

Find out these functions' domain and range. To find the domain in each scenario, identify the collection of elements that the function assigned values to. a) the function that assigns to each nonnegative integer its last digit. b) the function that assigns the next largest integer to a positive integer. c) the function that assigns to a bit string the number of one bits in the string. d) the function that assigns to a bit string the number of bits in the string.

Medicim6

Step 1
Consider the provided question,
A function f from A to B has the property that each element of A has been assigned to exactly one element of B.
A is the domain of f.
The range is the set of all images of elements of A.
Step 2
(a) Given: The function that assigns to each non negative integer its last digit.
The domain is then the set of all non negative integers.
Domain $=\left\{0,1,2,3,4,\dots \right\}=N$
The range is the set of all possible digits.
Range $=\left\{0,1,2,3,4,5,6,7,8,9\right\}$
Step 3
(b) Given: The function that assigns the next largest integer to a positive integer.
The domain is then the set of all positive integers.
Domain $=\left\{0,1,2,3,4,\dots \right\}=N-\left\{0\right\}$
The range is the set of all next largest integers of positive integers. The smallest possible integer is 1 and the corresponding next largest integer is 2, thus 2 is the smallest next largest integer.
Range $=\left\{2,3,4,\dots \right\}=N-\left\{0,1\right\}$
Step 4
(c) Given: The function that assigns to a bit string the number of one bits in the strings.
The domain is then the set of all bits strings.
Domain $=\left\{\lambda ,0,1,00,01,10,11,000,001,010,011,\cdots \right\}$
Step 5
(d) Given: function that assigns to a bit string the number of bits in the string.
The domain is then the set of all bit strings.
Domain $=\left\{\lambda ,0,1,00,01,10,11,000,001,010,011,\cdots \right\}$
The range is the set of all possible number of bits in a string. The number of bits is always a non-negative integer, since the empty string contains 0 bits, and all the other strings contain a positive amount of bits.
Range $=\left\{0,1,2,3,\cdots \right\}=N$

Thomas White

a) The domain is the set of nonnegative integers, and the range is the set of digits (0 through 9).
b) The domain is the set of positive integers, and the range is the set of integers greater than 1.
c) The domain is the set of all bit strings, and the range is the set of nonnegative integers.
d) The domain is the set of all bit strings, and the range is the set of nonnegative integers (a bit string can have length 0).
Remember:
Bit String: is a string contains ones and zeros, for example: 101, 10001, 1101001.

karton

a) Domain = N becuase it takes nonnegative integers as input. The Range is the set
$\left\{0,1,2,3,4,5,6,7,8,9\right\}$, assuming we are counting numbers in base 10.
b) Domain $=N-\left\{0\right\}=\left\{1,2,3,4,\cdots \right\}$ The range is $N-\left\{0,1\right\}=\left\{2,3,4,\cdots \right\}$
c) Here we need to decide what we mean by a bit string. Usually, this means strings of finite
length. For example, we would like to include 0101 as well as 11010010. They have different
lengths, but nontheless we want the function to be able to do something with both of these.
One such way of representing strings of length d is to define the set ${S}_{d}=\left\{0,1{\right\}}^{d}$ as the cartesian product of $\left\{0,1\right\}$ with itself d times. In order to look at all possible sets of this form, we consider the union of all of these. In other words, the domain is the set
$X=\bigcup _{d=1}^{\mathrm{\infty }}{S}_{d}=\bigcup _{d=1}^{\mathrm{\infty }}\left\{0,1{\right\}}^{d}$
The range is all possible output values of this function. In this case, the range is simply N. If we consider the codomain as N, then this function is onto. If on the other hand we had considered the codomain as R or Z, then this function would not be onto.
Here’s a question to think about. Is this function one-to-one? If so, prove it. If not, show
that it isn’t one-to-one. In order to do this, find an $x\ne y\in X$, with f(x) = f(y).
d) The domain is the same as in part (c). The range would be $N-\left\{0\right\}$, since with our choice of the domain, the smallest string has length 1.

Do you have a similar question?