   Chapter 8.3, Problem 34ES ### 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

# The documentation for the computer language Java recommends that when an equals method” is defined for an object, it be an equivalence relation. That is, if R is defined as follows: x   R   y   ⇔ x . e q u a l s ( y ) equals for all objects in the class, then R should be an equivalence relation. Suppose that in trying to optimize some of the mathematics of a graphics application, a programmer creates an object called a point, consisting of two coordinates in the plane. The programmer defines an equals method as follows: If p and q are any points, then p . e q u a l s ( q ) ⇔ the distance from p to q is less than or equal to c where c is a small positive number that depends on the resolution of the computer display. Is the programmer’s equals method an equivalence relation? Justify your answer.

To determine

To justify if the programmer’s equals method is an equivalence relation.

Explanation

Given information:

The documentation for the computer language Java recommends that when an “equals method” is defined for an object, it be an equivalence relation. That is, if R is defined as follows:

x R y ⇔ x.equals ( y ) for all objects in the class ,

Then R should be an equivalence relation. Suppose that in trying to optimize some of the mathematics of a graphics application, a programmer creates an object called a point, consisting of two coordinates in the plane. The programmer defines an equals method as follows: If p and q are any points, then

p.equals(q) ⇔ the distance from p to q is less than or equal to c

Where c is a small positive number that depends on the resolution of the computer display

Calculation:

P=All objects in the classR={(p,q)P×P|distance from p to q is less than or equal to c}

Let c be some small positive number

Reflexive:

Let xP

Since the distance from an object to itself is always 0 and since 0c (as c is positive), (x,x)R.

Since (x,x)R for all xP,R is indeed reflexive.

Symmetric:

Let us assume that (x,y)R

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