Math is done except for the parts I skipped; I can add them if someone wants to see.
The basic formula for DPS is [damage * attacks per second], so the following chart is true:
50 damage, 0.5 AS, 25 DPS
100 damage, 0.5 AS, 50 DPS
50 damage, 1.0 AS, 50 DPS
100 damage, 1.0 AS, 100 DPS
150 damage, 1.5 AS, 225 DPS
Crit needs to be added in. Using a Crit Modifier of 100%, then whenever a crit occurs, it deals double the original damage, so the following chart must be true:
100 damage, 1.0 AS, 0% crit, 100 DPS
100 damage, 1.0 AS, 50% crit, 150 DPS
100 damage, 1.0 AS, 100% crit, 200 DPS
Averaging the crit bonus and applying it to the attack damage is one way to look at the formula. My interpretation gives the modified DPS formula: [damage * {[critical strike chance * modifier] + 1} * attacks per second]
The three previous examples can be pictured as:
100 * {[0.00*1.00]+1} * 1.0 = 100
100 * {[0.50*1.00]+1} * 1.0 = 150
100 * ([1.00*1.00]+1} * 1.0 = 200
Therefore, the modified formula for DPS (assuming 100% crit mod) is [AD * {[Crit% * CritDmg]+1} * AS].
However, to calculate what item would give the most DPS, we need to figure out how much of each stat a certain amount of gold gives. By doing the division, stat per gold can be figured out.
BF Sword: 45 AD, 1650 gold, 0.02727 AD per gold
Recurve Bow: 40% AS, 1050 gold, 0.03810 AS per gold
Cloak of Agility: 18% Crit, 830 gold, 0.02169 Crit per gold
However, to figure out which purchase would be most efficient, we need to normalize the three items and determine how much our DPS would increase with each purchase. For the most accurate determination, you could use the raw stat per gold values and calculate the line equations from a massive spreadsheet, but I'm doing this by hand so assume that stat gains are purchased with 1000 gold.
0.02727 AD per gold with 1000 gold = 27.27 AD
0.03810 AS per gold with 1000 gold = 38.10 AS%
0.02169 Crit per gold with 1000 gold = 21.69 Crit%
We'll soon take our formula for DPS and plug in [stat + the amount above] three times, one for each of the three stats, and determine which purchase gives us the largest increase in DPS. This is where I made and used my program, but I'll write out the longhand until I reach 100% Crit. The thing to do before beginning the chart is convert AS% into actual [Attacks Per Second]. Most champions have a base Attacks Per Second of 0.625, so 1% AS improves Attacks Per Second by 0.00625. In this case, 38.10% AS is converted into [0.00625 * 38.10] = 0.238 attacks per second.
After modifying Crit% to fit my formula (1.00 is 100% Crit%), the stat gains are as follows:
27.27 AD
0.238 ApS
0.2169 Crit
Assuming base values of 50 AD, 0.5 AS, and 0% crit, we can begin! I'll write the first iteration in longhand, the second in shorthand, and then write the rest in condensed format.
50 AD, 0.5 AS, 0% Crit, 25 DPS before any purchase
(Parenthesis indicate the stat change)
Buying AD raises your DPS to [ (50+27.27) * {[0.00*1.00]+1} * 0.5] = 38.635
Buying AS raises your DPS to [50 * {[0.00*1.00]+1} * (0.5+0.238) ] = 36.9
Buying Crit raises your DPS to [50 * {[ (0.00+0.2169)*1.00]+1} * 0.5] = 30.4225
Therefore, 38.6 DPS is the highest, so the most efficient purchase (if your stats were 50AD / 0.5AS / 0%) is a BF Sword (or just AD in general).
Now since the best thing to get is AD, assume you made a purchase to raise your AD by an easy number to calculate; whenever I increase a stat, I use 10 AD, 0.1 AS, and 10% Crit so that the next calculations are easier. You're basically just plugging in random stat values and determining what stat is optimal to purchase for your configuration, but I'm going through in a set pattern to determine a good estimate for the ratio that you should keep your AD:AS:Crit% at. Therefore, assume that your AD has raised by 10 from the last example and continue in this pattern.
60 AD, 0.5 AS, 0% Crit, 30 DPS
AD = 43.635 DPS
AS = 44.28 DPS
Crit = 36.507 DPS
AS is the best purchase.
I'm going to continue to do the math, but the quick summary before showing it all is that Crit becomes the most efficient purchase at around 120 AD, caps at 100% at 240 AD, and AS always trails AD by about a factor of 105 (so 170 AD ≈ 1.6 AS).
(As a side note, notice thoughout the math that the same fake item purchases worth 1000 gold continue to increase your DPS more and more as your stats increase; AD is multiplicative and this is why you need to feed your AD Carry as much as you can early so that he can start scaling exponentially by midgame.)
60, 0.6, 0, 36
52.362, 50.28, 43.8084, buy AD
70, 0.6, 0, 42
58.362, 58.66, 51.1098, buy AS
70, 0.7, 0, 49
68.089, 65.66, 59.6281, buy AD
80, 0.7, 0, 56
75.089, 75.04, 68.1464, buy AD
90, 0.7, 0, 63
82.089, 84.42, 76.6647, buy AS
90, 0.8, 0, 72
93.816, 93.42, 87.6168, buy AD
100, 0.8, 0, 80
101.816, 103.8, 97.352, buy AS
100, 0.9, 0, 90
114.543, 113.8, 109.521, buy AD
110, 0.9, 0, 99
123.543, 125.18, 120.4731, buy AS
110, 1.0, 0, 110
137.27, 136.18, 133.859, buy AD
120, 1.0, 0, 120
147.27, 148.56, 146.028, buy AS
120, 1.1, 0, 132
161.997, 160.56, 160.6308, buy AD
130, 1.1, 0, 143
172.997, 173.94, 174.0167, CRIT IS MOST EFFICIENT
Notice how at 130 AD and 1.1 AS, Crit becomes the most efficient buy. This means that, in an optimal world, you should have ~130 AD and ~1.1 AS before getting even 1% Crit. Now the formula gets more complex, and I'm going to skip a lot because it's annoying to calculate the whole formula on Microsoft Calculator. Again, all this math is assuming a 100% Crit Modifier, so the mastery and IE should be considered as they give a 160% modifier together. All this means is that Crit becomes a better buy than it normally would, so you should grab Crit a bit earlier in an optimal world.
130, 1.1, 10, 157.3
190.2967, 191.334, 188.3167, buy AS
... skip ...
200, 1.8, 60, 576
654.5376, 652.16, 654.084, buy AD
... skip ...
[the following calculation assumes crit can exceed 100%, but the math still holds such that the conclusion remains true]
240, 2.1, 90, 957.6
1066.4073, 1066.128, 1066.9176, BUY CRIT
So at 240 AD and 2.1 AS, capping Crit at 100% is the most efficient purchase. Therefore, you should have ~0% Crit at 130 AD and you should have ~100% Crit at 240 AD. Shortly after, you'll cap at 2.500 Attacks Per Second (around 280-290 AD), and assuming that you have IE and the 10% Crit Mod mastery, you're going to be capped on AS, Crit%, and CritDmg, and the only purchase you can make is AD. The first time I calculated it, 120 AD and 240 AD were the benchmarks, and this time it's 130 AD and 240 AD. I think the culprit is due to the slight change in the BF Sword (50@1850 to 45@1650).
I still feel like I should note that all of these calculations assume pure auto attacks against a target dummy. Other considerations include when to get ARP, how abilities scale (most scale on AD), MS, Downtime between auto attacks (orbwalking and kiting), GA/QSS, Lifesteal, etc. All of these calculations assume an optimal world and don't consider unique passives, unique actives, or item completions: at the end of these calculations, the test character has 5 BF Swords, 7 Recurve Bows, and 5 Cloaks of Agility at the same time.
In most cases, the ADC will have 6/8 of the following items at the end of a long game: Berserker Greaves, Infinity Edge, Phantom Dancer, Trinity Force, Last Whisper, Guardian Angel, Quicksilver Sash, and The Bloodthirster. A common build order is Zerk, BT, PD, LW, GA, IE.
Alright, I'm all forums'ed out for a bit. If you have any questions, post them here and I'll get back to you.