How do you calculate the pre-flop odds of making a hand after the river card? For example, what are the odds of making a set if you hold a pocket pair after the river card? What are the odds of making a straight if you hold A3 after the river card.
Each scenario is different. Some are straightforward (or at least feasible) to calculate mathematically. For those that are not, it is simplest to iterate all hand combinations (using a computer) since the total number of combinations is not that large.
For your first example, if you hold a pocket pair then there are two cards (out of the remaining 50) that will make you a set. To not make a set, you'd need to avoid these two cards five times in a row, for which the odds are:
(48/50) * (47/49) * (46/48) * (45/47) * (44/46)
which is 80.82%. So the odds that you do make a set by the river are the remaining 19.18%.
Note that this 19.18% includes the possibility of making four-of-a-kind using your pocket pair or a full house which include your pocket pair as part of a 'set'. Both the 80.82% and the 19.18% also include (for example) straights and flushes. So if you mean 'a set or better', or 'a set but nothing more', then those are different questions and much more complicated to calculate.
The question of making a straight with A3 is also harder. You need to consider 5-high, 6-high and 7-high straights, as well as Ace-high straights. What about straights which don't include either of your hole cards - do they count? And again, do you mean 'a straight or better' or 'a straight but nothing more'? If the latter, what about a straight flush?
The problem with many of these "What are the chances of that?" questions is that they are not strictly defined, so it's hard to give a proper answer. But usually, if you can define the question sufficiently clearly, the approach is either to use probability (as with the 'set' example above) or brute force with the help of a computer.