This is more of a "understanding statistics" question than a poker question.
Faced with a question of, for example, "What are the odds of making a diamond royal flush by the river", the answer must encompass the players hole cards (5/52)*(4/51) and the cards coming on the flop turn and river. However, there are several different ways from a probability perspective that the royal could be hit. You could flop it, you could turn it (flop 2 + turn), you could flop 2, blank the turn but river it, or you could flop 1, turn the draw and river it.
So your formula has to account for the fairly easy flop it solution, plus the flop 2 (so 2 of 3 cards hit and 1 miss) plus turn, plus every other permutation...
How do you represent that, mathematically?