Discrete Mathematics with Graph Theory (3rd Edition) 224

Discrete Mathematics with Graph Theory (3rd Edition) 224 -...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 222 Solutions to Exercises Exercises 8.2 1. [BB] Let addition be the basic operation. We need n subtractions, n squarings (each equivalent to two basic operations), n - 1 additions, and one square root (the equivalent of 20 basic operations). Hence, f(n) = n + 2n + n -1 + 20 = 4n + 19. 2. The multiplication of a = (an-Ian-2 ... alao)lO by the single digit b requires initially the multiplica- tion of band ao, one operation. Then we multiply b and al and perhaps add a carry from the first step. Since two single-digit additions may be needed in this carry (e.g. 89 x 7), at most three operations are required in the multiplication of band al and, similarly, in the multiplication of b and each ai, i ;:::: 1. An upper bound for the total number of operations required is 1 + 3(n - 1) = 3n - 2. 3. [BB] Consider the division of a number a, which has at most two digits, by a single-digit number b, where a < lOb. Since the quotient q has just one digit, the division counts as one operation, the product...
View Full Document

Ask a homework question - tutors are online