Question: 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,

 The documentation for the computer language Java recommends that when an

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: xRy 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 resolutions of the computer display. Is this programmer's equals method an equivalence relation? Justify your

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!