liveBook · Manning

Parity

Parity is the classification of an integer or bit string as even or odd according to whether its value is divisible by two.

How 2 Manning books explain it

Quantum Programming in Depth

Parity is the property of being even or odd, here determined for a computational-basis state by the parity of its bit values.

How it is used
Classifies basis states and extracts correlations from quantum superpositions through joint measurements.
How deep it goes
Defines parity, explains state-preserving measurement, and implements testing, but stops short of general measurement theory.
Examples
Uses two-qubit parity states, Q# measurement operations, state-preservation tests, and an N-queens oracle.
What you can do after
Apply parity measurements to identify a state class while preserving its superposition.

Read how Quantum Programming in Depth explains parity →

Learn C++ by Example

Parity is the classification of an integer as odd or even.

How it is used
Classifies generated numbers as odd or even while demonstrating transformations and output in a C++ example.
How deep it goes
Defines modulo-2 testing and demonstrates it in a ranges pipeline, without developing a formal theory of parity.
Examples
Uses triangle numbers, dot-and-star markers, repeating output, and final-digit frequency counts.
What you can do after
Apply it via C++ remainder checks and ranges transformations to label numbers as odd or even.

Read how Learn C++ by Example explains parity →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.