<<Vilcretas`

<<TutoriasED`

GrafoString["BIENVENIDOS"]

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}};
(*RelacionComposicion[R2,R1]*)
MR1 =MatrizRelBin[R1,A,B][[1]];
MR2 =MatrizRelBin[R2,B,H][[1]];
MR = RelBinMatriz[ProductoBooleano[MR1,MR2,lista->True],A,H]

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

relacion = {{1,72},{8,10},{8,44},{53,22},{53,72},{100,22},{100,72}};

existeElementoRelBin[relacion, respuestas]

Table[i->ElementRelBinQ[relacion,i],{i, respuestas}]

Clear[A,R1,R2]

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}};

Clear[MR1,MR2]

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

Clear[MR]

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={46,31,40,66,30,37};
R={{46,46},{46,40},{31,46},{31,37},{31,30},{40,40},{40,30},{66,40},{66,46},{66,30},{30,37},{30,66},{30,46},{37,37},{37,31}};

MatrizRelBin[R,A,A]

(({{1, 0, 1, 0, 0, 0}, {1, 0, 0, 0, 1, 1}, {0, 0, 1, 0, 1, 0}, {1, 0, 1, 0, 1, 0}, {1, 0, 0, 1, 0, 1}, {0, 1, 0, 0, 0, 1}}))

GrafoRelBin[R,A]

Grafo[R,dirigido->True]

A=Range[-30,996,18];
B=Range[-30,998,4];

Length[PC[A,B]]

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}};

relaciones = RelacionComposicion[R2,R1]

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

existeElementoRelBin[relaciones, respuestas]

A=Range[20]

Clear[A,R]

R = RelBin["a^3-b^3>=96&&Mod[a+b,11]==0", A,A]

Length[DominioRelBin[R]]