<<Vilcretas`

A={29,58,59,11,22,47};
R1={{58,58},{29,59},{22,47},{47,22},{11,58},{11,47},{59,47},{22,59},{58,11},{22,58}};
R2={{58,58},{29,59},{59,59},{58,47},{11,11},{11,47},{22,11},{11,59},{59,11},{47,47}};

MR1=MatrizRelBin[R1,A,A][[1]];
MR2=MatrizRelBin[R2,A,A][[1]];

MR=UnionBooleana[UnionBooleana[ComplementoBooleano[MR1][[1]], MR2]
[[1]], Transpose[InterseccionBooleana[MR2,Transpose[MR1]][[1]]]]

A={9,106,132,18,28,44,72,61,94,2};

R={{2,2},{2,18},{2,94},{9,9},{9,106},{18,2},{18,18},{18,94},{28,28},{44,44},{44,61},{61,44},{61,61},{72,72},{94,2},{94,18},{94,94},{106,9},{106,106},{132,132}};

ClasesEquivalencia[R,A]

A = Range[-30, 1000,18];
B=Range[-30, 1000, 4];
PC[A,B]//Length

<<TutoriasED`

RelacionComposicion[R1_,R2_]:=Module[{Composicion={},i,j},For[i=1,i≤Length[R2],For[j=1,j≤Length[R1],If[R2[[i,2]]==R1[[j,1]],Composicion=Append[Composicion,{R2[[i,1]],R1[[j,2]]}]];j++];
i++];DeleteDuplicates[Composicion]]

A={100,8,55,34,81,1,39,87,53,16};

B={13,62,21,66,44,88,93,95,80,16};

H={22,64,5,18,95,72,52,44,98,10};

R1={{8,88},{100,80},{53,80},{100,44},{87,93},{53,16},{8,93},{87,13},{1,62},{100,93}};

R2={{16,22},{95,98},{88,10},{66,5},{80,72},{21,22},{88,44},{62,72},{80,22},{66,72}};

R=RelacionComposicion[R2,R1]//Sort

MR1=MatrizRelBin[R1,A,B][[1]];
MR2=MatrizRelBin[R2,B,H][[1]];

R=RelBinMatriz[ProductoBooleano[MR1,MR2][[1]],A,H]

respuestas={{100,22},{34,10},{53,22},{39,64},{87,95},{1,72}};

existeElementoRelBin[R, respuestas]