Convergence almost sure and strong law of large number Let $\{B_n\}$ and $\{X_n\}$ random variables i.i.d., at $(\Omega, \mathcal{F}, P)$.
(a) Suppose that $P(B_1 = 1) = p = 1 - P(B_1 = 0).$ Define
$$\hat{p}_n(\omega):=\frac{card\{j | 1 \leq j \leq n , \  B_j(\omega)=1  \}}{n}, \ \ \ \ \omega \in \Omega, \ n \in \mathbb{N}.$$
where card stands for cardinality. Show that $\hat{p}_n \to p$ almost sure.
(b) Suppose $F$  is the common distribution of $X_n$, $n \in \mathbb{N}$. Let
$$A_x^{(j)}:=\{\omega \in \Omega | X_j(\omega) \leq x\}, \ \ \ x \in \mathbb{R}, \ j \in \mathbb{N},$$
and
$$F_x^{(n)}(\omega):=\frac{1}{n}\sum_{j=1}^{n}1_{A_x^{(j)}}(\omega), \ \ \ \omega \in \Omega, \ n \in \mathbb{N}.$$
Show that, for every $x \in \mathbb{R}$, $F_x^{(n)} \to F(x)$ almost sure.
For (b) we will use the strong law of large number. For this it is sufficient to show that $E[F_x^{(n)}]=F(x)$ (this value is finite as the function is bounded by $0$ and $1$).
Then,
\begin{align*}
        E[F_x^{(n)}] &= E[\frac{1}{n}\sum_{j=1}^{n}1_{A_x^{(j)}}]\\
        &= \frac{1}{n} \sum_{j=1}^{n} E[1_{A_x^{(j)}}]\\
        &=\frac{1}{n} \sum_{j=1}^{n} P[A_x^{(j)}]\\
        &=\frac{1}{n} \sum_{j=1}^{n} P[ X_j \leq x]\\
        &=\frac{1}{n} \sum_{j=1}^{n} P[ X_1 \leq x] \tag{i.d.}\\
        &=P[ X_1 \leq x]=F(x). 
    \end{align*}
For the strong law of large number, it follows that $F_x^{(n)} \to F(x)$ almost sure.
I have problems with the first part. I think I did the second part correctly. I think that the first part is similar to the second part but I maybe I did not understand very well what is $\hat{p}_n(\omega)$. Any idea?

The notation is the only thing obfuscating these from being handled directly by the law of large numbers.
For the first part, write $\hat{p_n} = \frac{1}{n}\sum_{j = 1}^{n}B_j$. Since $B_j$ are i.i.d., by law of large numbers, $\hat{p_n} \to E(B_1)$ a.s. as $n \to \infty$.
For the second part, write $A_{x}^{(j)} = \{X_j \leq x\}$. So $F_{x}^{(n)} = \frac{1}{n}\sum_{j = 1}^{n}1_{\{X_j \leq x\}}$. Again since $1_{\{X_j \leq x\}}$ are i.i.d., by law of large numbers, $F_{x}^{(n)} \to E(1_{\{X_1 \leq x\}}) = P(X_1 \leq x)$ a.s. as $n \to \infty$.
