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.995900.00054
210.497080.00054
3(1 I)10.749110.12572
410.874060.28105
510.936920.42973
6(2 I)10.968730.55721
710.984670.66
810.992190.74111
9(3 I)10.996210.80487
1010.99830.85134
1110.999120.88867
12(4 I)10.999560.91612
1310.999790.93745
1410.999920.95308
15(5 I)10.999970.96435
1610.999990.97317
1710.999990.97992
18(6 I)10.999990.98515
19110.98922
20110.99208
21(7 I)110.99428
22110.99587
23110.99701
24(8 I)110.99778
25110.9984
26110.99893
27(9 I)110.99928
28110.99956
29110.99981
30(10 I)111



And again, with +1/256 to each chance.
TurnLv 1Lv 2Lv 3
1100.00041
210.500040.00041
3(1 I)10.753010.12704
410.877730.28585
510.939180.43757
6(2 I)10.969580.56427
710.985010.66748
810.992460.74862
9(3 I)10.996390.81044
1010.998310.85794
1110.999070.89282
12(4 I)10.999510.91975
1310.999760.93989
1410.999850.9555
15(5 I)10.999920.96678
1610.999960.97578
1710.999990.98185
18(6 I)110.98648
19110.99031
20110.99287
21(7 I)110.99498
22110.99628
23110.99718
24(8 I)110.99802
25110.99856
26110.99907
27(9 I)110.99941
28110.9997
29110.99986
30(10 I)111