a. $(letter)(letter+digit+\epsilon)^5$
b. Program $\rightarrow$ begin d semi $X$ end $A$
$X \rightarrow d \ semi X$ $B$
$X \rightarrow sY$$C$
$Y \rightarrow semi \ sY$$D$
$Y \rightarrow \epsilon$ $E$
Variable 
First 
Follow 
Program 
begin 
$ 
$X$ 
$d,s$ 
end 
$Y$ 
$semi$, $\epsilon$ 
end 
Here First$(Y)$ contains $\epsilon$ so we need to add $Y \rightarrow \epsilon$ at follow$(Y)$
Variable 
begin 
$d$ 
semi 
$s$ 
end 
$ 
Program 
$A$ 





$X$ 

$B$ 

$C$ 


$Y$ 


$D$ 

$Y \rightarrow \epsilon$ 
