Information gain compares candidate questions by exact subtraction. Feature A and Feature B are both rendered so the comparison is visible.
Information gain
Gain subtracts the weighted child impurity from the parent impurity. Feature A has exact gain 1/18.
gainA=1/18
Why compare exact gains
Feature B leaves weighted impurity at 1/2 and gain 0. The larger exact gain picks the split.
gainA=1/18>0
Summary
Feature A wins this exact comparison because 1/18 is greater than 0.
A chosen