# Proving that a dataset has all combinations of some features

What is the best way to prove / show that a dataset has all combinations of nominal values for a known group of features? For example, if attributes A and B can take on values from the set {low, med, high}, then the following dataset has all their combinations:

A      B
low    low
low    med
low    high
med    low
med    med
med    high
high   low
high   med
high   high


EDIT: I mean to show mathematically that this is the case.

• how to define "prove/show", are you trying to ask an algorithm to search the data set that contains certain pattern? – Haitao Du Jul 21 '16 at 17:47
• Fair enough. I was asked to perform association rule mining on such a dataset, which of course will not provide any reasonable results. I can tell that all combinations exist exactly once by looking at the data, and want to justify that mining association rules on such dataset makes no sense, but I can't find a way to formally show that the dataset has this structure. – Diogo Franco Jul 21 '16 at 17:54
• How large is the data set? – Matthew Drury Jul 21 '16 at 17:55
• A few thousand lines and 6 attributes. – Diogo Franco Jul 21 '16 at 18:05
• Just tally the features. – whuber Jul 21 '16 at 18:46

You're wanting to show that given features $X_1,\ldots,X_k$, you have the Cartesian product $X_1\otimes \cdots \otimes X_k$.
What I would do is see how many levels $n_1$ of $X_1$ there are, how many levels of $n_2$ of $X_2$ there are, and so on. Then the cardinality of $X_1\otimes \cdots \otimes X_k$ should be $\prod_{i=1}^kn_i$. (For a proof of this, see Theorem 1.2.14 in Statistical Inference by Casella and Berger.) Then see if the number of rows in your data set is equal to $\prod_{i=1}^kn_i$. This method assumes that there are no duplicates in your data set.