Given four numbers {1,2,3,4}, how to find all possible two-way associations/relations between them? I calculate them manually as in below (50 in total) but I would like to know whether a mathematical formula exists to find them? And how about generalizing the formula for n given numbers?
{1} --> {2}, {2} --> {1},
{1} --> {3}, {3} --> {1}
{1} --> {4}, {4} --> {1}
{2} --> {3}, {3} --> {2}
{2} --> {4}, {4} --> {2}
{3} --> {4}, {4} --> {3}
{1} --> {2,3}, {2,3} --> {1},
{1} --> {2,4}, {2,4} --> {1},
{1} --> {3,4}, {3,4} --> {1},
{2} --> {1,3}, {1,3} --> {2},
{2} --> {1,4}, {1,4} --> {2},
{2} --> {3,4}, {3,4} --> {2},
{3} --> {1,2}, {1,2} --> {3},
{3} --> {1,4}, {1,4} --> {3},
{3} --> {2,4}, {2,4} --> {3},
{4} --> {1,2}, {1,2} --> {4},
{4} --> {1,3}, {1,3} --> {4},
{4} --> {2,3}, {2,3} --> {4},
{1} --> {2,3,4}, {2,3,4} --> {1},
{2} --> {1,3,4}, {1,3,4} --> {2},
{3} --> {1,2,4}, {1,2,4} --> {3},
{4} --> {1,2,3}, {1,2,3} --> {4},
{1, 2} --> {3, 4}, {3, 4} --> {1, 2},
{1, 3} --> {2, 4}, {2, 4} --> {1, 3},
{1, 4} --> {2, 3}, {2, 3} --> {1, 4},