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.00048
20.999980.499810.00048
3(1 I)10.74830.12506
410.874430.28104
510.937150.42868
6(2 I)10.968860.55619
710.984490.65995
810.992550.74103
9(3 I)10.996350.80364
1010.998240.85181
1110.999040.8888
12(4 I)10.99940.91624
1310.999670.9378
1410.999830.9534
15(5 I)10.999930.96562
1610.999930.97423
1710.999970.98073
18(6 I)10.999980.98572
1910.999980.98929
2010.999990.99194
21(7 I)10.999990.99402
2210.999990.99572
23110.99685
24(8 I)110.9977
25110.99841
26110.99899
27(9 I)110.99939
28110.99967
29110.9999
30(10 I)111



And again, with +1/256 to each chance.
TurnLv 1Lv 2Lv 3
1100.00038
210.504550.00038
3(1 I)10.755390.13064
410.878490.28962
510.939360.43995
6(2 I)10.969770.56772
710.985130.66973
810.992530.7503
9(3 I)10.996250.81032
1010.998260.85803
1110.999050.89337
12(4 I)10.999540.92103
1310.999790.94087
1410.999860.95676
15(5 I)10.999930.96782
1610.999960.97629
1710.999990.98266
18(6 I)10.999990.98731
1910.999990.99098
20110.99334
21(7 I)110.99494
22110.99627
23110.99723
24(8 I)110.99794
25110.99865
26110.99909
27(9 I)110.99942
28110.9997
29110.99986
30(10 I)111