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.9962700.00043
210.499240.00043
3(1 I)10.748020.12433
410.872680.27875
510.936760.42923
6(2 I)10.968150.5567
710.9840.65846
810.992150.74167
9(3 I)10.996050.80425
1010.997990.85271
1110.999010.88825
12(4 I)10.999480.91635
1310.999770.93758
1410.999830.95374
15(5 I)10.999920.96554
1610.999970.97404
1710.999990.9804
18(6 I)10.999990.9853
19110.98914
20110.99199
21(7 I)110.99399
22110.99558
23110.99669
24(8 I)110.99759
25110.99817
26110.99878
27(9 I)110.99921
28110.99953
29110.99975
30(10 I)111



And again, with +1/256 to each chance.
TurnLv 1Lv 2Lv 3
1100.00038
210.502330.00038
3(1 I)10.753570.12762
410.87660.28679
510.938260.43558
6(2 I)10.969990.56342
710.985030.6658
810.992710.74819
9(3 I)10.99630.80866
1010.998120.8561
1110.999110.89207
12(4 I)10.999560.91933
1310.999830.93977
1410.999930.95525
15(5 I)10.999980.96691
1610.999990.97535
1710.999990.98177
18(6 I)10.999990.98654
19110.98999
20110.99263
21(7 I)110.99474
22110.99627
23110.99735
24(8 I)110.9982
25110.99877
26110.99915
27(9 I)110.9995
28110.99974
29110.99984
30(10 I)111