Fitness trajectories in partial A, B, and full AB (XOR) environments. (A) Evolution of random populations of cells in A, B and XOR environments shown in red, blue, and black respectively. Grey curve shows the averaged fitness trajectory for evolution in a XOR environment with the presence of HGT. Maximum fitness is averaged over 64 simulations for evolution in A and B environments, and over 32 simulations for evolution in a XOR environment. HGT rate here is at 5·10-5 and average fragment size is 4 triplets. (B) Evolutionary trajectory under "dual-step" evolution, where population of evolved cells in A and B environments show remarkably fast adaptation to environment AB (64 simulations). HGT confers an additional acceleration of adaptation to new settings. (B, inserts) Maximum fitness curves for 8 out of 64 individual simulations with (B, left insert) and without (B, left insert) HGT are shown in grey. One curve is highlighted with dark grey for clarity.