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.9961300.00045
210.497360.00045
3(1 I)10.749720.12416
410.878050.27975
510.939070.42919
6(2 I)10.968980.55819
710.984410.66065
810.99240.74135
9(3 I)10.99620.80313
1010.998030.85017
1110.998950.8873
12(4 I)10.999510.91559
1310.999790.93629
1410.999910.9526
15(5 I)10.999940.9644
1610.999970.97334
1710.999980.98
18(6 I)10.999990.98518
1910.999990.989
20110.99182
21(7 I)110.99392
22110.99549
23110.9968
24(8 I)110.99776
25110.99838
26110.99888
27(9 I)110.99928
28110.99972
29110.99989
30(10 I)111



And again, with +1/256 to each chance.
TurnLv 1Lv 2Lv 3
1100.0006
210.504930.0006
3(1 I)10.754990.12952
410.879260.28731
510.939560.43776
6(2 I)10.969820.56586
710.984690.66887
810.992210.74951
9(3 I)10.995920.80997
1010.998010.85631
1110.998880.89286
12(4 I)10.999330.91992
1310.99970.94043
1410.999850.95598
15(5 I)10.999940.96711
1610.999990.97552
1710.999990.9815
18(6 I)110.98635
19110.99008
20110.99278
21(7 I)110.99439
22110.99595
23110.99716
24(8 I)110.99792
25110.99856
26110.99908
27(9 I)110.99937
28110.99961
29110.99988
30(10 I)111