Docsity

Solutions to Math 2513 Class Problem: Bit Strings, Assignments of Mathematics

Toggle sidebar
bg1
Class Problem
Math 2513
Tuesday, July 5
Problem. (a) List all of the bit strings of length 2.
(b) List all of the bit strings of length 8 which start with 0111 and end with 2 consecutive 0’s.
(c) List all of the bit strings of length 8 which contain exactly two 1’s and those 1’s are separated by
at least two 0’s.
Definition: Let nbe a natural number. A bit string of length nis a sequence of nbits where a bit
has two possible values either 0 or 1. For example, 111000110010 is a bit string of length 12.
SOLUTION:
(a) The set of bit strings of length two is {00,01,10,11}.
(b) The set of all bit strings of length 8 which start with 0111 and end with 2 consecutive 0’s is
{01110000,01110100,01111000,01111100}.
(c) The set of bit strings of length 8 which contain exactly two 1’s and those 1’s are separated by at
least two 0’s is
10010000,10001000,10000100,100000010,10000001,
01001000,01000100,01000010,01000001,
00100100,00100010,00100001,
00010010,00010001,
00001001.
This set has 15 elements.

Partial preview of the text

Download Solutions to Math 2513 Class Problem: Bit Strings and more Assignments Mathematics in PDF only on Docsity!

Class Problem

Math 2513

Tuesday, July 5

Problem. (a) List all of the bit strings of length 2. (b) List all of the bit strings of length 8 which start with 0111 and end with 2 consecutive 0’s. (c) List all of the bit strings of length 8 which contain exactly two 1’s and those 1’s are separated by at least two 0’s.

Definition: Let n be a natural number. A bit string of length n is a sequence of n bits where a bit has two possible values either 0 or 1. For example, 111000110010 is a bit string of length 12.

SOLUTION:

(a) The set of bit strings of length two is { 00 , 01 , 10 , 11 }. (b) The set of all bit strings of length 8 which start with 0111 and end with 2 consecutive 0’s is

{ 01110000 , 01110100 , 01111000 , 01111100 }.

(c) The set of bit strings of length 8 which contain exactly two 1’s and those 1’s are separated by at least two 0’s is

10010000 , 10001000 , 10000100 , 100000010 , 10000001 , 01001000 , 01000100 , 01000010 , 01000001 , 00100100 , 00100010 , 00100001 , 00010010 , 00010001 ,

This set has 15 elements.