I have a few questions regarding Cartesian products that will help me optimize a complicated SQL query I'm working on.
Suppose I have 52 playing cards, and I want to know how many combinations of pairs (first two cards) a dealer can draw at the beginning. Obviously, this would be less than $52*52$ since the dealer cannot draw the same card twice. So, to me it seems the answer is $(52*52) - 52$, since there's 52 "pairs" of the same card, in other words $52*51$.
However, I'd like to better understand the math behind this so I can apply it to any number of cards and any size sets:
Given n cards, how many ordered sets of y cards can be created? For example, if I had 100,000 cards, how many unique sets of 10 cards could I make?
Given n cards, how many unordered sets of y cards can be created? For example, if I had 100 cards, how many unique unordered sets of 3 could I make?
What's the mathematical formula that represents both these answers? Thanks!