
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
Li Ping passes through 3 intersections with traffic lights on his way home from school. According to traffic regulations, if he encounters a red light at an intersection, he must stop and wait; if he does not encounter a red light at an intersection, he can pass through directly. After long-term observation, it is found that the probability of encountering a red light at the first intersection is $\frac{1}{2}$, and the probabilities of encountering red lights at the second and third intersections increase successively. The probability of not encountering a red light at all three intersections is $\frac{1}{24}$, and the probability of encountering red lights at all three intersections is $\frac{1}{4}$. It is also given that whether Li Ping encounters a red light at each intersection is independent of the others.  
$(1)$ Find the probability that Li Ping encounters a red light for the first time at the third intersection on his way home.  
$(2)$ Let $X$ be the number of intersections where Li Ping encounters a red light on his way home. Find the mathematical expectation $E(X)$.

Present the answer in LaTex format: \boxed{Your answer}
user