There are two situations in which A and B are in one or two sticks.
A and B have two situations in two or three sticks.
A and B have two situations in three or four sections.
There are six kinds of * * *, so the probability is 6/24 = 1/4.