Say there is a data table $D$ that we cannot see, with $M$ columns. We are given exact cross-tabulation frequencies for all ${M \choose 2}$ pairs of columns, that is how often each combination of two values occurs.
From the cross-tabulations, we can derive a set of possible rows $R$ of $D$ and maximum frequencies for each possible row.
How can we reconstruct the original table $D$? If there is not enough information to do so, how can we construct a possible table $D'$ that has the same cross-tab frequencies? In this case, is it possible to count the number of possible tables?
(Edit: As Vor noted, define a table as an unordered collection of rows. A permutation of the rows of a table yields the same table.)
For example, if $D$ has rows:
X A j
Y A k
X B j
X B j
We have three sets of cross-tab frequencies:
X A 1
X B 2
Y A 1
Y B 0
X j 3
X k 0
Y j 0
Y k 1
A j 1
A k 1
B j 2
B k 2
I would like an algorithm which will take the cross-tab frequencies as input and output the original table or a possible original table.