I have following problem:
I have five elements $\{a,b,c,d,e\}$. I have to form ordered group of three elements out of these five elements. at least one or both of $a$ and $b$ should appear in the group formed. Also elements can be repeated. What will be the nicer / neat / systematic way, possibly made-up but neat formula to get the desired count?
How can I come up with final count? I can guess all the possibilities that I have to consider, but I am not able to come up with nice formula to put all these possibilities together. These are the possibilities I am able to come up with:
- With $a$ included in the group, there will be $5\times 5$ groups.
- With $b$ included in the group, there will be $5\times 5$ groups.
- However out of these $5\times 5 + 5\times 5$, I need to subtract count of groups including both $a$ and $b$.
- Again I have to subtract count of groups where we have permuted among same group due to repetition of some specific element. For example {a,a,c} will be counted twice. But I should count once only.
How I do deal with last two points? Do I have to resort to manual counting?