Should I put an apostrophe to indicate a plural or past tenses?

The Cambridge guide to English usage by Pam Peters has a long discussion on the usage of the apostrophe in the case of plural nouns. For what concerns your example, under the section Apostrophes, it says:

Single letter in lower case still usually mark the plural with apostrophes, as in Dot the i's and cross the t's

The purpose is that of highlighting that you have the plural of a word composed of a single letter. However, under the section Letters as words there is the following remark:

Yet even the apostrophe is unnecessary if italics are used and the plural s itself is in roman.

Though the above remark is probably meant for ordinary text, in mathematics variables are commonly typeset in italics, and I think that the above remark can be applied as well.

According to the above, I'd say that the apostrophes in your first example cannot be considered wrong, but they are actually unnecessary.

In LaTeX, I'd then write your first example as

if we combine the $x$s and $y$s

Instead, in the past tense of your second example the apostrophe marks the elision of the letter e, and in this case it is required: xored -> xor'd.


The plural.

Pluralization with apostrophes is relatively common as you have noticed, but some authors find it distasteful and some readers find it jarring. Still, it is widespread enough not to be viewed as erroneous, so it is up to you to form your own view on the matter. One work-around is to enclose the variable in quotes, for instance,

If we combine the ‘x’s and the ‘y’s, we obtain ...

This has the disadvantage of introducing inconsistency with unpluralized variables.

Notice that there are many ‘a’s but only one b.

A second option is simply not to use the apostrophe, but if your italic type is similar to your Roman type (or if it is merely an oblique of the Roman), then it may introduce ambiguities.

Compare the many cs with the C-sum, cs.

This can also cause problems for blind users who rely on screen readers.

Alternatively, it may be preferable to rewrite the sentence entirely.

By taking each x in turn, we find that ...


The past (specifically the preterite) tense.

Historically, in English, -'d (or -'t) is how the preterite tense was spelt on all (regular) weak Germanic verbs, with the use of -ed (sometimes -èd in older works) only a relatively recent phenomenon. (It is logical, since we only pronounce the ‘d’ anyway, and using -ed leads to confusion, between words such as learned and learned.)

For instance if you read any Shakespeare, you will see he preferred to use -'d.

What's in a name? That which we call a rose
By any other word would smell as sweet;
So Romeo would, were he not Romeo call'd,
Retain that dear perfection which he owes
Without that title.

As you say, it remains relatively common in modern English where an author has taken a noun, formed it into a verb, and then rendered it into the preterite tense.

The bottleneck was where he pop'd the variable off the stack.

If we wanted to write this with -ed, we would have to spell it as popped (as poped is pronounced like pope'd). But the assembly instruction is pop, not popp, so this could lead to ambiguity or confusion.