<s>[INST] How many sets of digits are there so each digit would belong to the corresponding set? Given nine sets:
$X_1 \{2,3,9\}, X_2 \{1, 2, 3, 5, 6, 7, 8, 9\}, X_3 \{3, 9\}, X_4 \{1, 2, 3, 7, 9\}, X_5 \{1, 2, 3, 4, 5, 7, 9\}, X_6 \{2, 3, 6, 7\}, X_7 \{1, 6, 7, 9\} , X_8 \{1, 3, 4, 6, 7, 8, 9\}, X_9 \{2, 9\} $
How many sets of different digits $(a_1, a_2, a_3, a_4, a_5, a_6, a_7, a_8, a_9 )$ are there so $a_i \in x_i $ ?
Have tried using combinatorical formules, seems like there are too many variants.
 [/INST] Consider only $X_1$, $X_3$, and $X_9$.  $a_1$ can be 2, 3, or 9.  If $a_1=2$, then $a_9=9$ so $a_3=3$.  If $a_1=3$, then $a_3=9$ so $a_2=2$.  Finally if If $a_1=9$, then $a_3=3$ and $a_9=2$.
The possibilities for $(a_1, a_3, a_9)$ are $(2,3,9)$, $(3,9,2)$, or $(9,3,2)$.
Since 2, 3, 9 are "used up" you can repeat the process with $X_4$, $X_6$, and $X_7$.
The possibilities for $(a_4, a_6, a_7)$ are $(1,6,7)$, $(1,7,6)$, or $(7,6,1)$.
Now 1, 6, 7 are also "used up".  Last considering $X_2$, $X_5$, and $X_6$ gives the possibilities for $(a_2, a_5, a_8)$ are $(5,4,8)$ or $(8,5,4)$.
The total number is $3\times 3 \times 2 = 18$.
</s>