# The Weighting Pre‐processing

Learn how we can implement and run weighting pre-processing.

We use the function `get_state`

from the lesson Visual Exploration of the Qubit State.
It takes the angle `theta`

and returns a valid quantum state. An angle of $0$ denotes the state $|0\rangle$, which is the
probability of $100\%$ measuring `0`

. An $\pi$ denotes the state $|1\rangle$, the probability of $100\%$ measuring `1`

.

Accordingly, we multiply the overall probability we calculate at **line 14** with `pi`

to specify an angle up to $\pi$ in **line 17**. Since the correlation coefficients are between `-1`

and `1`

and most of our coefficients are negative, a value of $\mu$ towards `-1`

implies that the passenger died. Thus, we reverse the angles by calculating `(1-mu)*pi`

.

Get hands-on with 1200+ tech skills courses.