   Chapter 8.2, Problem 56ES ### Discrete Mathematics With Applicat...

5th Edition
EPP + 1 other
ISBN: 9781337694193

#### Solutions

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

5th Edition
EPP + 1 other
ISBN: 9781337694193
Textbook Problem
1 views

# Write a computer algorithm to test whether a relation R defined on a finite set A is transitive, where A = { a [ 1 ] , a [ 2 ] , ... a [ n ] }

To determine

To write a computer algorithm to test whether a relation R defined on a finite set A is transitive or not, where A={a,a,...,a[n]}.

Explanation

Given information:

A={a,a,...,a[n]}.

Calculation:

We need to create an algorithm that will check if some relation is transitive. The input will be a relation R on a set A={a|1|,a|2|,...,a|n|}

Input:

A={a,a,...,a[n]},R[a relation on the set A]

For each pair of elements (a,b)R and (b,c)R, we will need to check if (a,c)R. if we find some (a,b)R and (b,c)R such that (a,c)R, then the algorithm will need to return that the relation is not transitive, else the algorithm will need to return that the relation is transitive.

Algorithm body:

j:=1

k:=1

if (a[i],a[j])R and (a|j|,a|k|)R and (a|i|,a|k|)R then

k:=k+1

j:=j+1

i:=i+1

Finally, the algorithm will return the answer, which is “transitive” or “not transitive”

### 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 