\code{
\func{Prior-Sample}{\v{bn}}{an event sampled from \v{bn}}
    \firstinputs{bn}{a belief network specifying joint distribution $\pv(X_1,\ldots,X_n)$}
\bodysep
    \setq{\v{\x}}{an event with $n$ elements}
    \k{for} $i = 1$ \k{to} $n$ \k{do}
          \setq{$\v{x_i}$}{a random sample from $\pv(X_i | \parents(X_i))$}
               given the values of $\Parents(X_i)$ in \v{\x}
    \k{return} \v{\x}
}
