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.9962400.00049
210.497020.00049
3(1 I)10.748280.12294
410.873410.2795
510.937360.42864
6(2 I)10.96830.5565
710.983890.65865
810.991930.73961
9(3 I)10.996260.8035
1010.998130.85203
1110.999080.88903
12(4 I)10.999540.91633
1310.999790.93727
1410.999910.95302
15(5 I)10.999970.96492
1610.999980.97395
1710.999980.98058
18(6 I)110.98576
19110.98952
20110.9919
21(7 I)110.99436
22110.99581
23110.997
24(8 I)110.9978
25110.99845
26110.99899
27(9 I)110.99938
28110.99965
29110.99985
30(10 I)111



And again, with +1/256 to each chance.
TurnLv 1Lv 2Lv 3
1100.00033
210.502870.00033
3(1 I)10.755080.12853
410.878810.28697
510.940810.43809
6(2 I)10.969990.56619
710.984870.66825
810.992370.74784
9(3 I)10.996360.81029
1010.99830.85787
1110.999070.89331
12(4 I)10.999670.92034
1310.999790.94091
1410.999870.95591
15(5 I)10.999930.96756
1610.999960.97612
1710.999980.98242
18(6 I)10.999990.98697
1910.999990.99019
20110.99302
21(7 I)110.99489
22110.9961
23110.99708
24(8 I)110.99806
25110.99876
26110.99922
27(9 I)110.9995
28110.99971
29110.99987
30(10 I)111