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.9958200.00046
210.497880.00046
3(1 I)10.748030.12511
410.874180.28043
510.936020.42957
6(2 I)10.967750.55395
710.984030.65715
810.991930.73832
9(3 I)10.995960.80226
1010.997870.85057
1110.99890.88718
12(4 I)10.999450.91544
1310.999710.93686
1410.999870.95229
15(5 I)10.999920.9652
1610.999960.9738
1710.999970.98039
18(6 I)10.999970.98553
1910.999990.98932
20110.9921
21(7 I)110.9943
22110.99573
23110.99671
24(8 I)110.99766
25110.99834
26110.999
27(9 I)110.99936
28110.99967
29110.99989
30(10 I)111



And again, with +1/256 to each chance.
TurnLv 1Lv 2Lv 3
1100.00037
210.505850.00037
3(1 I)10.75540.12981
410.878130.28842
510.938410.43937
6(2 I)10.969780.56626
710.984820.66786
810.992530.74835
9(3 I)10.996280.81065
1010.998190.85851
1110.999150.89415
12(4 I)10.999660.92125
1310.999830.94058
1410.999940.95585
15(5 I)10.999960.9672
1610.999970.97559
1710.999980.98206
18(6 I)10.999990.98688
1910.999990.99069
20110.99318
21(7 I)110.99507
22110.99642
23110.99753
24(8 I)110.99827
25110.99874
26110.99912
27(9 I)110.99952
28110.9998
29110.99991
30(10 I)111