0

I have function $f: A \rightarrow B$ and sets $X \subseteq A$ and $Y \subseteq B$. I need to compute the number of all possible functions $f$ where $f(X) \supseteq Y$.

I know that count of all possible functions where $f(X) \subseteq Y$ is $|Y|^{|X|}|B|^{|A|-|X|}$ . I think that solution is $|B|^{|X|}|B|^{|A|-|X|}$. Am I right?

Joe75
  • 1

1 Answers1

1

Your answer can't possibly be right, because it doesn't depend on what $Y$ is. Clearly if you make $Y$ larger, the set of functions you're counting becomes smaller, so the answer must depend on $Y$. In fact, your answer is just equal to $|B|^{|A|}$, which counts all functions $f:A\to B$, without any restriction that $f(X)\supseteq Y$.

I don't expect that there's any particularly simple answer to this question. In the special case that $X=A$ and $Y=B$, you are counting surjections from $A$ to $B$, and this already requires a fairly complicated (and non-closed form) formula (see the answers to Calculating the total number of surjective functions).

Eric Wofsey
  • 342,377
  • so I have two cases - if $X = A$ and $Y = B$ (than I counting all surjectiions), or $|X| < |A|$ and $|Y| < |B|$ ?? – Joe75 Nov 13 '16 at 11:57
  • 1
    Assuming that the sets involved are finite, this question is a duplicate of this one. I just posted an ugly answer to the earlier question. – Brian M. Scott Nov 13 '16 at 19:15