This file will simulate the chances of your party getting hit with a tier three knowledge bomb after a certain number of turns. You start at tier zero, and the chances of leveling up each round are as follows:
0 => 1: 255/256
1 => 2: 50%
2 => 3: 25%

Basically, the AI learns what monsters are immune to after you hit level 3 and they will stop casting spells that have no chance of working.

TurnLv 1Lv 2Lv 3
10.9960100.00055
210.497530.00055
3(1 I)10.749930.12409
410.875990.28094
510.937270.4304
6(2 I)10.968030.55871
710.98420.65898
810.992030.74109
9(3 I)10.99570.804
1010.997810.85346
1110.998860.88877
12(4 I)10.999410.91655
1310.999690.93709
1410.99980.95335
15(5 I)10.999890.96551
1610.999930.97421
1710.999950.98065
18(6 I)10.999990.98575
19110.98992
20110.99256
21(7 I)110.99442
22110.99588
23110.99706
24(8 I)110.99794
25110.99865
26110.99911
27(9 I)110.99944
28110.9997
29110.99982
30(10 I)111



And again, with +1/256 to each chance.
TurnLv 1Lv 2Lv 3
1100.00032
210.506050.00032
3(1 I)10.755660.12988
410.876650.28985
510.938450.43857
6(2 I)10.96940.56447
710.984660.66724
810.992360.74814
9(3 I)10.996150.80973
1010.998120.85759
1110.999150.89304
12(4 I)10.999580.92031
1310.999810.94048
1410.999890.95494
15(5 I)10.999980.96672
1610.999990.97557
1710.999990.98201
18(6 I)110.98671
19110.9902
20110.99294
21(7 I)110.99479
22110.99641
23110.99738
24(8 I)110.99816
25110.99869
26110.99912
27(9 I)110.99941
28110.99968
29110.99989
30(10 I)111