2.1 Naming Some "cool-sounding" name. 2.2 Brainstorming Explicit specifications: - The device generates a random number of bytes between 1 and 3, inclusive. - The device then generates number of bits according to the number of bytes generated previously. - For each bit, 1 and 0 have equal probability to be generated. - The program output the largest number of successively generated 1s. Implicit specifications: - Is the device generates a random integer or float(real number)? - What does the simulation do if only 0s or 1s just happen to be generated? 2.3 Research Nouns/Things: - Bit = A fundamental unit having just two possible values, as either of the binary digits 0 or 1. - Byte = A sequence of 8 adjacent bits. - Number of successively generated 1s. - Counter of number of bits processed. Verbs/Behaviors: - Generates a random integer between 1 and 3. - Generates each bit with equal probability of being 0 or 1. 2.4 Outlining 1) Initialize the largest number of successively generated 1s found so far (called currentMax1s for simplicity) to zero. 2) Initialize the current number of successively generated 1s (currentLength) to be zero. 3) Initialize the number of bits generated so far (numBits) to zero. 4) Generate a random number of bytes between 1 and 3, inclusive. 5) Let the total number of bits to be generated (TotalNumBits) be 8 times the number of bytes generated. 6) Generate a bit. 7) Increase numBits by one. 8) If not finish (numBits <= TotalNumBits) then 8.1) If this bit is 1 then 8.1.1) Increase currentLength by one. 8.1.2) If currentLength is greater than currentMax1s, then let currentMax1s = currentLength. 8.2) Else (That is, this bit is 0) 8.2.1) Reset currentLength to zero. 8.3) Repeat from 6) 9) Print currentMax1s as the result.