Revision Notes
Cambridge A Level Computer Science (9618): Data Integrity – Revision Notes
Condensed notes on validation checks, check digits, verification, parity and checksums for Cambridge AS Computer Science 9618 6.2, with a self-test.
- Subject
- Computer Science
- Level
- AS LEVEL
- Topic
- Topic 6: Security, privacy and data integrity
- Author
- Marlbridge Academic Team
- Updated
- Reviewed by
- Harris Khan (what this means)
Aligned to Cambridge A Level Computer Science (9618), 2026. Official specification .
Syllabus page (what it covers and how it is assessed): Cambridge A Level Computer Science.
Syllabus points this page covers
9618 (AS Level)
- 6.2 Data Integrity
Found an error? Report a correction.
Need help with this topic? Request a free trial class for A Level Computer Science (9618).
Quick-recall notes for 6.2 Data Integrity (AS content, Paper 1). The Data Integrity study guide has the full explanations, pseudocode and worked examples; the Data Integrity practice questions give exam-style practice. For 6.1, see the Data Security revision notes.
The two ideas
- Validation: the computer checks that data is reasonable and allowed, using rules. It cannot tell whether the data is correct.
- Verification: data is compared with its original to check it was entered or transferred without change.
- Both protect integrity (data that is accurate, complete and consistent); neither guarantees it.
Validation checks
| Check | Tests | Pseudocode idea |
|---|---|---|
| Range | Between two limits | Mark >= 0 AND Mark <= 100 |
| Limit | One limit only | Quantity >= 1 |
| Length | Number of characters | LENGTH(Code) = 6 |
| Format | Pattern of characters | Check each MID(Code, Index, 1) against the pattern |
| Presence | Not empty | Name <> "" |
| Existence | Found in a set of allowed values | Linear search of a table or array |
| Check digit | Last digit matches one calculated from the others | Recalculate and compare |
Typical input loop: REPEAT ... INPUT ... UNTIL valid condition. The loop must repeat while the data is invalid, so the UNTIL condition is the valid one.
Check digit method (weighted)
- Multiply each digit by its weight.
- Add the products.
- Find the remainder after dividing by the modulus (e.g. 10 or 11).
- Apply the rule to get the check digit (e.g. 10 − remainder, with 10 written as 0).
- On entry, recalculate and compare with the digit typed.
Catches: a single wrong digit; most transpositions. A weak scheme (weights 1 and 3, modulus 10) misses a swap of neighbouring digits that differ by 5.
Verification: data entry
| Method | How | Weakness |
|---|---|---|
| Visual check | User compares screen with source document | Relies on the person spotting the error |
| Double entry | Data entered twice; computer compares the two | Slower; an identical mistake made twice is not caught |
Verification: data transfer
| Method | How | Detects | Does not detect |
|---|---|---|---|
| Parity (byte) | Parity bit makes the number of 1s even (or odd); receiver recounts | An odd number of changed bits | An even number of changed bits; cannot locate the bit |
| Parity block | Parity bit per byte plus a parity byte for the columns | Locates a single changed bit at the failing row and column, so it can be corrected | Some patterns of several errors |
| Checksum | Value calculated from the whole block, sent with it, recalculated by receiver | Most changes to the block | Changes that leave the calculated value the same, e.g. two bytes swapped when the method is a plain sum |
If a check fails during transfer, the receiver requests that the data be sent again.
Parity quick method
- Decide even or odd from the question.
- Count the 1s in each row; mark rows that break the rule.
- Count the 1s in each column, including the parity byte; mark columns that break the rule.
- The changed bit is where the failing row and column cross.
Key terms
| Term | Meaning |
|---|---|
| Data integrity | Data is accurate, complete and consistent |
| Parity bit | Extra bit added to make the count of 1s even or odd |
| Parity byte | Byte whose bits give the parity of each column in a block |
| Transposition error | Two characters entered in the wrong order |
| Checksum | Value calculated from a block of data, sent with it for checking |
Exam traps
- “Validation checks that data is correct”: wrong. It checks the data is sensible.
- One boundary is a limit check, not a range check.
- Existence means “is in the list”; presence means “is not blank”.
- A single parity bit cannot locate an error; a parity block can.
- In a REPEAT loop, the UNTIL condition is the condition for valid data.
- Include the parity byte when counting a column.
- Visual check and double entry are for entry; parity and checksum are for transfer. Do not mix the lists.
Self-test
- State the difference between validation and verification.
- A field must contain a whole number of at least 18. Which check is this?
- Give an example of data that passes a range check but is still wrong.
- Which check would reject a product code that is not in the product table?
- Write the UNTIL condition for an input loop that accepts a month from 1 to 12.
- Using weights 1, 3, 1, 3, 1, 3 and check digit (10 − (total MOD 10)) MOD 10, find the check digit for 381604.
- Why does double entry not catch every error?
- A byte using even parity arrives with five 1s. What can the receiver conclude?
- Why can a parity check on a single byte miss an error?
- What extra information does a parity block give?
- Describe how a checksum is used.
- Give one limitation of a checksum that simply adds the bytes.
Answers
- Validation checks that data is reasonable/allowed by rules; verification checks that data matches its original after entry or transfer.
- Limit check.
- Any suitable, e.g. age 34 entered instead of 43 when the range is 0 to 120.
- Existence check.
UNTIL Month >= 1 AND Month <= 12- 3 + 24 + 1 + 18 + 0 + 12 = 58; 58 MOD 10 = 8; 10 − 8 = 2.
- If the same mistake is made both times (for example copied wrongly from the form), the two entries match.
- An error has occurred in transmission (an odd number of bits changed), so the byte should be sent again.
- If two bits change, the number of 1s is even again and the parity is still correct.
- It identifies the column as well as the byte, so a single wrong bit can be located and corrected.
- The sender calculates a value from the block and sends it; the receiver recalculates and compares; if they differ, the block is sent again.
- If two bytes are swapped, the sum (and so the checksum) is unchanged.
Related resources
-
Study guides
Cambridge A Level Computer Science (9618): Data Security
Security, privacy and integrity compared, network threats, and how each protective measure works and fails, for Cambridge AS Computer Science 9618 6.1.
Computer Science · Cambridge · AS Level
Read guide -
Practice questions
Cambridge A Level Computer Science (9618): Data Security – Practice Questions
Original questions with mark-scheme answers on privacy, malware, phishing, pharming and security measures for Cambridge AS Computer Science 9618.
Computer Science · Cambridge · AS Level
Try questions -
Revision notes
Cambridge A Level Computer Science (9618): Data Security – Revision Notes
Condensed notes on security, privacy and integrity, network threats and protective measures for Cambridge AS Computer Science 9618 6.1, with a self-test.
Computer Science · Cambridge · AS Level
Revise topic
Get free revision emails (optional)
Occasional emails with practice questions, worked explanations and links to free resources for the qualification and subjects you choose. No spam, and you can unsubscribe from any email. The free tools on this site never need an email.