In: Computer Science
What is the minimum and maximum number of zeros in a 4-bit string? Use roster notation and find the range of f. (The first elements in the range is f(0,0,0,0) = 0)
Maximum number of zeros means maximum number of times zero appear in 4- bit string
And minimum number of zeros means minimum number of times zero appear in 4-bit string.
Number of ways you can put zeros in 4 bit string for {0,1} is given below
0 0 0 0
0 0 0 1
0 0 1 0
0 0 1 1
0 1 0 0
0 1 0 1
0 1 1 0
0 1 1 1
1 0 0 0
1 0 0 1
1 0 1 0
1 0 1 1
1 1 0 0
1 1 0 1
1 1 1 0
1 1 1 1
For 4 bit string there are 16 possibilities
2^4=16
For first element in the range is 0 so for every different possibilities it start with 0 so minimum number of 0 =1
f(0,1)4={0000,0001,0010,0011,0100,0101,0110,0111}
f(0,0,0,0)=0000 minimum zero is 1 and maximum zero is 4 times
f(0,0,0,1)=0001 min zero=1 max zero =3
f(0,0,1,0)=0010 min zero =1 max zero =3
f(0,0,1,1)=0011 min zero =1 max zero =2
f(0,1,0,0)=0100 min zero =1 max zero = 3
f(0,1,0,1)=0101 min zero =1 max zero =2
f(0,1,1,0)=0110 min zero =1 max zero =2
f(0,1,1,1)=0111 min zero =1 max zero =1