Composition of relation

70 Views Asked by At

This is a follow to a question I had previously asked but got no clarification.

Suppose you wish to find $R^2$ for the relation defined $xRy$ iff $x-y=c$.

I know that $R^2$ is $x-y=2c$, but I'm not sure how that's calculated. If your relation is based on a function then wouldn't this be okay to say: $f(x)= x-y-c$ and so $f(f(x))$ would be a way to calculate it? Although this was my first thought, it turned out that $f(f(x))=x-2y=2c$ which of course is wrong. So how would you define $R^n$ for example?

It is said that it can be calculated using the Boolean product of your matrix, but I don't see how.