×
Log in to StudySoup
Get Full Access to Math - Textbook Survival Guide
Join StudySoup for FREE
Get Full Access to Math - Textbook Survival Guide

2E Determine which characteristics of an algorithm

Discrete Mathematics and Its Applications | 7th Edition | ISBN: 9780073383095 | Authors: Kenneth Rosen ISBN: 9780073383095 37

Solution for problem 2E Chapter 3.1

Discrete Mathematics and Its Applications | 7th Edition

  • Textbook Solutions
  • 2901 Step-by-step solutions solved by professors and subject experts
  • Get 24/7 help from StudySoup virtual teaching assistants
Discrete Mathematics and Its Applications | 7th Edition | ISBN: 9780073383095 | Authors: Kenneth Rosen

Discrete Mathematics and Its Applications | 7th Edition

4 5 1 313 Reviews
26
1
Problem 2E

?2E Determine which characteristics of an algorithm described in the text (after Algorithm 1) the following procedures have and which they lack. a) procedure ?double?(n ? ?: positive integer) while n? ? > 0 n??? 2?n b) procedure ?divide?(n ? ? : positive integer) while n? ? > 0 m? := 1/?n?. n? := ?n? ?–? 1 c) procedure ?sum?(?n:? positive integer) sum? := 0 while i<10 sum := sum – i d) procedure ?choose?(?a,? b ? :? integers). x? := either ?a? or ?b

Step-by-Step Solution:

Solution In this question we have to determine the characteristics of given algorithm and the following procedures they have and which they lack. Step 1 Given that a) p rocedure double( positive integer) while n > 0 n 2n This algorithm is not finite since n is a positive number and the while loop will run forever in this algorithm. b) procedure divide(n : positive integer) while n 0 m := 1/n. n := n – 1 At n = 0 line m := 1/n cannot be executed so eventually the case would be that this algorithm is not effective. Also this algorithm lacks correctness since m := 1/n keeps the algorithm from arriving at correct answer.

Step 2 of 2

Chapter 3.1, Problem 2E is Solved
Textbook: Discrete Mathematics and Its Applications
Edition: 7
Author: Kenneth Rosen
ISBN: 9780073383095

Discrete Mathematics and Its Applications was written by and is associated to the ISBN: 9780073383095. Since the solution to 2E from 3.1 chapter was answered, more than 381 students have viewed the full step-by-step answer. This full solution covers the following key subjects: procedure, sum, while, Positive, Integer. This expansive textbook survival guide covers 101 chapters, and 4221 solutions. This textbook survival guide was created for the textbook: Discrete Mathematics and Its Applications, edition: 7. The answer to “?2E Determine which characteristics of an algorithm described in the text (after Algorithm 1) the following procedures have and which they lack. a) procedure ?double?(n ? ?: positive integer) while n? ? > 0 n??? 2?n b) procedure ?divide?(n ? ? : positive integer) while n? ? > 0 m? := 1/?n?. n? := ?n? ?–? 1 c) procedure ?sum?(?n:? positive integer) sum? := 0 while i<10 sum := sum – i d) procedure ?choose?(?a,? b ? :? integers). x? := either ?a? or ?b” is broken down into a number of easy to follow steps, and 85 words. The full step-by-step solution to problem: 2E from chapter: 3.1 was answered by , our top Math solution expert on 06/21/17, 07:45AM.

Unlock Textbook Solution

Enter your email below to unlock your verified solution to:

2E Determine which characteristics of an algorithm

×
Log in to StudySoup
Get Full Access to Math - Textbook Survival Guide
Join StudySoup for FREE
Get Full Access to Math - Textbook Survival Guide
×
Reset your password