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.99600.00046
20.999990.497870.00046
3(1 I)10.749020.12438
410.875930.28202
510.937940.43084
6(2 I)10.969140.5558
710.98420.65995
810.992310.74019
9(3 I)10.996160.8038
1010.998210.85208
1110.999130.88861
12(4 I)10.999590.91713
1310.999770.93739
1410.999870.95287
15(5 I)10.999930.96476
1610.999980.97359
1710.999980.98059
18(6 I)10.999990.9856
19110.98945
20110.99214
21(7 I)110.99419
22110.99564
23110.99676
24(8 I)110.99759
25110.99821
26110.9988
27(9 I)110.99927
28110.99961
29110.99982
30(10 I)111



And again, with +1/256 to each chance.
TurnLv 1Lv 2Lv 3
1100.00039
210.503760.00039
3(1 I)10.752940.12633
410.878110.28698
510.939430.4367
6(2 I)10.969850.56485
710.985080.66683
810.992480.74668
9(3 I)10.996140.80955
1010.998070.85822
1110.998980.89433
12(4 I)10.999530.92065
1310.999730.94054
1410.999910.95523
15(5 I)10.999970.96709
1610.999990.97532
1710.999990.98167
18(6 I)110.98671
19110.99022
20110.99297
21(7 I)110.99486
22110.99631
23110.99744
24(8 I)110.99807
25110.99865
26110.999
27(9 I)110.99939
28110.9997
29110.99988
30(10 I)111