Q:

Distributing damage across units in an army

I'm working on a game similar to the web game Utopia, insofar as players have a number of units with different values for attack and defense.
Question: how do I distribute damage across units when a conflict plays out?
Let's say I have two units:

Infantry: 3 attack, 3 defense
Cavalry: 5 attack, 1 defense

Let's say the player has 100 infantry (300 attack, 300 defense) and 50 cavalry (250 attack, 50 defense); the player now gets hit with an attack of 100 points of damage.
How do I resolve this in a way that doesn't force players to understand damage and micro-optimize, also given that I'm not going to store individual units' health values after the conflict?

If I distribute damage to weakest units first, 33 infantry will die; but players will spam cavalry and keep a small number of "fodder" infantry around to absorb damage.
If I distribute damage to strongest units first, 50 cavalry die; but players will spam infantry, thinking that stronger units are "not worth it" because they always die.
If I distribute damage randomly (eg. some infantry get 1 damage, some get 2, some get 3 and die), I will likely end up with players thinking that conflict is not effective, because a number of units took damage but didn't die (and I don't keep track of damaged units -- they heal afterward).

Is there a distribution algorithm I can use that doesn't have any of these side-effects and appears "fair" to the player? If not, how can I make this make sense so players understand how this should work, without me hindering certain types of strategies?
I wrote an answer to a question here that looks similar, but I explicitly didn't tackle the problem of fairly distributing damage without sabotaging different strategies.

A:

I'd base the system on three basic principles:

each unit type has different HP values that affects its mortality rate.
all damage done is lethal (otherwise, just multiply by a scaling factor)
each squad takes total damage in proportion to the number of individuals. 

Example: Your starting army army
1400 infantry   (ea. 50 HP)
500  cavalry    (ea. 100 HP)
500  conscripts (ea. 20 HP)
100  elites     (ea. 200 HP)
2500 total      (total HP pool 150k)

for an enemy army with incoming damage: 30k, Your damage numbers are:

infantry takes 30k* 14/25 damage, and 336 die
cavalry takes 30k* 5/25 damage, and 60 die
conscripts take 30k * 10 / 25 damage and 300 die
elites take 30k * 1 / 25 damage and 6 die

Further considerations:

You'll have to handle when an entire subgroup gets annihilated, applying remaining damage to the rest of the army. For example, in the previous example, if the enemy army did 60k damage, your conscripts would take enough damage to kill 600 guys but there were only 500 to begin this. You have to redistribute the 100 extra damage across the remaining army. Alternatively, just split damage into smaller rounds (like 30 rounds of 2k damage each) and deal with the smaller amounts of overkill per round. You'll have to use floats for the intermediate damage otherwise your elites may just never take enough damage per round to take any casualties.
This answer doesn't cover how to calculate the total incoming damage.

