I have this two sets:
$A = \{\emptyset, \{\emptyset\}, \{\{\emptyset\}, \emptyset\}\}$
$B = \{\{x, \{x, y\}\} | x \in A, y \in A\}$
Now I want to list all possible elements that are in $B$. How do I do this?
I have this two sets:
$A = \{\emptyset, \{\emptyset\}, \{\{\emptyset\}, \emptyset\}\}$
$B = \{\{x, \{x, y\}\} | x \in A, y \in A\}$
Now I want to list all possible elements that are in $B$. How do I do this?
If I'm not mistaken you can do this: (I will replace [EmptySet] with ES
because I have troubles formatting it here)
a = { ES, {ES}, {{ES}, ES}};
b = {#, {#, #2}} & @@@ Tuples[a, {2}];
% // Column
{ES, {ES, ES}} {ES, {ES, {ES}}} {ES, {ES, {{ES}, ES}}} {{ES}, {{ES}, ES}} {{ES}, {{ES}, {ES}}} {{ES}, {{ES}, {{ES}, ES}}} {{{ES}, ES}, {{{ES}, ES}, ES}} {{{ES}, ES}, {{{ES}, ES}, {ES}}} {{{ES}, ES}, {{{ES}, ES}, {{ES}, ES}}} }
Or even more clear way:
b2 = Table[{x, {x, y}}, {x, a}, {y, a}] // Flatten[#, 1] &;
b2 == b
True