   # Trace the action of Algorithm 6,1,1 on the variables I, j, found, and answer for m = 3, n = 3, and sets A and B represented as the arrays a [ 1 ] = u , a [ 2 ] = v , a [ 3 ] = w ; b [ 1 ] = w ; b [ 2 ] = u . ### Discrete Mathematics With Applicat...

5th Edition
EPP + 1 other
Publisher: Cengage Learning,
ISBN: 9781337694193

#### Solutions

Chapter
Section ### Discrete Mathematics With Applicat...

5th Edition
EPP + 1 other
Publisher: Cengage Learning,
ISBN: 9781337694193
Chapter 6.1, Problem 36ES
Textbook Problem
1 views

## Trace the action of Algorithm 6,1,1 on the variables I, j, found, and answer for m = 3, n = 3, and sets A and B represented as the arrays a [ 1 ] = u , a [ 2 ] = v , a [ 3 ] = w ; b [ 1 ] = w ; b [ 2 ] = u .

To determine

Trace the action of Algorithm 6.1.1 on the variables i, j, found, and answerfor m = 3, n = 3, and sets Aand Brepresented as the arrays. a=u, a=v, a=w, b=w, b=u,andb =v

### Explanation of Solution

Given information:

For m = 3, n = 3, and sets A and B represented as the arrays

a=u,a=v,a=w,b=w,b=u,and b=v.

Calculation:

Input:

m=3

n=3

a=u

a=v

a=w

b=w

b=u

b=v

We also initialize i as 1 and we initialize answer as AB.

 i 1 j found answer A⊆B

Next, the algorithm will enter the outer while-loop.

We first assign the value 1 to j and the value “no” to found.

 i 1 1 j 1 found no answer A⊆B A⊆B

Since a=uw=b, the value of found is not changed in the first iteration of the inner while-loop.

We increase the value of j by 1.

Since a=u=b, we change the value of found to “yes”

 i 1 1 1 j 1 2 found no yes answer A⊆B A⊆B A⊆B

Since found is set to “yes”, the inner while-loop stops executing and we then increase i by 1.

Next, we start the second iteration of the outer while-loop, which re-initializes j as 1 and found as no

 i 1 1 1 2 j 1 2 1 found no yes no answer A⊆B A⊆B A⊆B A⊆B

Since a=vw=b, the value of found is not changed in the first iteration of the inner while-loop.

We increase the value of j by 1.

Since a=vu=b, the value of found remains “no”

 i 1 1 1 2 2 j 1 2 1 2 found no yes no no answer A⊆B A⊆B A⊆B A⊆B A⊆B

We increase the value of j by 1.

Since a=u=b, we change the value of found to “yes”

 i 1 1 1 2 2 2 j 1 2 1 2 3 found no yes no no yes answer A⊆B A⊆B A⊆B A⊆B A⊆B A⊆B

Since found is set to “yes”, the inner while-loop stops executing and we then increase i by 1

### Still sussing out bartleby?

Check out a sample textbook solution.

See a sample solution

#### The Solution to Your Study Problems

Bartleby provides explanations to thousands of textbook problems written by our experts, many with advanced degrees!

Get Started

Find more solutions based on key concepts
Let y2 = 2x + 1. a. Sketch the graph of this equation. b. Is y a function of x? Why? c. Is x a function of y? W...

Applied Calculus for the Managerial, Life, and Social Sciences: A Brief Approach

Convert the expressions in Exercises 31-36 to positive exponent form. 13x4+0.1x23

Finite Mathematics and Applied Calculus (MindTap Course List)

Use the guidelines of this section to sketch the curve. y = ex/x2

Single Variable Calculus: Early Transcendentals, Volume I

For a = 2i + 3j − 4k and b = −i + 2j − k, a · b = 0 8 10 12

Study Guide for Stewart's Multivariable Calculus, 8th

What is the goal of a single-case experimental research design?

Research Methods for the Behavioral Sciences (MindTap Course List)

For f(x) = x2 and g(x) = 2x + 1, (f g)(x), = a) 2x2 + 1 b) (2x)2 + 1 c) (2x + 1)2 d) x2(2x + 1)

Study Guide for Stewart's Single Variable Calculus: Early Transcendentals, 8th

Age of Haddock The age T, in years, of a haddock can be thought of as a function of its length L, in centimeter...

Functions and Change: A Modeling Approach to College Algebra (MindTap Course List)

Multiply. (sin4)2

Trigonometry (MindTap Course List) 