All five of these problems use the same basic principles. The most important one is that when you make a sequence of $n$ choices, and the $k$-th choice can be made in $w_k$ ways, the there are $w_1w_2\dots w_n$ different ways to make the whole sequence of choices. This explains (as explained in the first problem) why there are $n!$ different ways to line up $n$ objects. It’s also important to know without having to think too hard about it that any set of $n$ things has $\binom{n}k$ $k$-sized subsets.
Imagine that the students are sitting in a row. When the waitress places a sandwich before each student, she’s simply arranging the sandwiches in a line, so the question is just asking how many different ways there are to arrange four things in a line. That’s $4!$: there are $4$ ways to choose which sandwich goes first, then $3$ ways to choose which of the $3$ remaining sandwiches hits the table next, then $2$ ways to pick the third sandwich, and only $1$ way (some choice!) to pick the last, for a total of $4\cdot3\cdot2\cdot1=4!$ ways.
Yes, there are $5!$ ways to arrange the $5$ people in a line; the reasoning is as in the first problem. If the women are to be on the ends, there are $3!$ ways to arrange the $3$ men in the middle, but there are also $2$ ways to place the women: either woman can be at either end of the line. Thus, there are $2\cdot3!=12$ such lineups altogether.
We use the same kind of reasoning yet again. There are $12$ possible choices for president. Once the president is chosen, there are $11$ possible choices for vice president, since the president and vice president cannot be the same person. But there is no such restriction on the secretary or the treasurer: each of them can be any of the $12$ people, so each can be chosen in $12$ ways. The grand total is therefore $12\cdot11\cdot12\cdot12=11\cdot12^3$.
There are three cases, depending on whether one, two, or three yellow flags are used.
- Suppose that just one yellow flag is used, so that we’re arranging $5$ flags. There are $\binom52$ ways to choose which $2$ positions in the string of $5$ will contain the red flags. That leaves $3$ open positions, and there are $\binom32$ ways to pick $2$ of them for the $2$ green flags. The lone yellow flag will then fill the remaining slot $-$ no choice there. The total number of such $5$-flag signals is therefore $\binom52\binom32=10\cdot3=30$.
- Suppose that two yellow flags are used. We reason in exactly the same way. There are $\binom62$ ways to choose the $2$ positions to be filled by red flags, and then there are $\binom42$ ways to choose which $2$ of the remaining $4$ slots will get the green flags; the yellow flags get the leftovers. The total number of such $6$-flag signals is therefore $\binom62\binom42=15\cdot6=90$.
- I’ll leave it to you to finish off the problem by calculating the number of $7$-flag signals; just follow the same reasoning. When you’re done, add up the numbers from the three cases to get the final answer.
There are $13$ denominations altogether, from ace through king, so there are $13$ ways to choose the denomination of the triplet. The pair has to be of a different denomination, so there are $12$ ways to pick its denomination. Thus, there are $13\cdot12$ possible types of full house. However, each type (e.g., three $10$’s and two jacks) can occur in several different ways. There are $4$ cards of each denomination, one for each of the four suits, so once its denomination is known, there are $\binom43$ ways to choose the three cards for the triplet. Similarly, there are $\binom42$ ways to choose two cards of the pair’s denomination. Thus, each type of full house comprises $\binom43\binom42$ different full houses of that type, and the grand total of possible full houses is $$13\cdot12\cdot\binom43\binom42=13\cdot12\cdot4\cdot6=3744\;.$$