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.9963800.00047
20.999970.497150.00047
3(1 I)10.748180.12546
410.874630.28027
510.936590.42782
6(2 I)10.968650.5546
710.984650.65832
810.992480.73992
9(3 I)10.99650.80221
1010.998210.85014
1110.999080.8877
12(4 I)10.999540.91619
1310.999750.93773
1410.999880.95303
15(5 I)10.999940.96523
1610.999980.97365
1710.999980.98079
18(6 I)110.98559
19110.9894
20110.99223
21(7 I)110.99421
22110.99579
23110.99706
24(8 I)110.99782
25110.99849
26110.99898
27(9 I)110.99945
28110.99965
29110.99993
30(10 I)111



And again, with +1/256 to each chance.
TurnLv 1Lv 2Lv 3
1100.00043
210.502130.00043
3(1 I)10.752530.12987
410.877920.28876
510.939620.43989
6(2 I)10.970380.56564
710.985490.66725
810.992790.74902
9(3 I)10.996240.81088
1010.998150.85863
1110.999020.89492
12(4 I)10.999590.9212
1310.999850.94053
1410.999930.95557
15(5 I)10.999970.96682
16110.9756
17110.98192
18(6 I)110.98667
19110.99021
20110.9928
21(7 I)110.99472
22110.99629
23110.99715
24(8 I)110.99809
25110.99862
26110.99899
27(9 I)110.99937
28110.99964
29110.99986
30(10 I)111