Count Four-Digit PINs With No Repeated Adjacent Digits

Last updated: November 29, 2026

Quick Overview

A card PIN policy rejects any 4-digit PIN where two adjacent digits are the same. How many PINs are allowed, what fraction of random PINs are rejected, and how does that compare with a rule that bans any repeated digit?

Capital One
Statistics & Math
Software Engineer
Capital One
November 29, 2026
Software Engineer
Online Assessment
Statistics & Math
Easy

0

0

0 solved


A card PIN policy rejects any 4-digit PIN where two adjacent digits are the same. How many PINs are allowed, what fraction of random PINs are rejected, and how does that compare with a rule that bans any repeated digit?

A quick counting question of the kind that shows up in Capital One online assessments and early screens, framed around card PIN rules. The interviewer checks the multiplication principle and whether you can reason about the security tradeoff of shrinking the PIN space.

What the Interviewer Expects
  • Apply the multiplication principle position by position
  • Get 7,290 allowed PINs
  • Compute the rejection rate of 27.1%
  • Compare with 5,040 PINs having all distinct digits
  • Comment on how restrictions change guessing risk
Key Topics to Cover
multiplication principle
complement counting
permutations
combinations
security tradeoffs
How to Approach This
  1. Define your hypotheses (H0 and H1) clearly before performing any test.
  2. Calculate required sample size BEFORE running an experiment, using power analysis.
  3. Remember the Central Limit Theorem: sample means become approximately normal with large n.
  4. Watch for Simpson's paradox. Always segment data by key dimensions.
  5. Distinguish between statistical significance and practical significance.
Possible Follow-up Questions
  • How many PINs contain at least one 0?
  • How many PINs have digits in strictly increasing order?
  • If attackers try the 20 most common PINs first, does this rule help?
  • How would you count PINs that also ban sequences like 1234?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Browse Statistics Questions
Sample Answer
Clarify

A PIN is an ordered string of 4 digits, 0 to 9, leading zeros allowed, so there are 104=10,00010^4=10{,}000 in total. Rule A: no two adjacent digits equal (so 1213 is allowed, 1123 is not). Rule B, for compar...

Approach

Build the PIN left to right and count choices. For complements, count the allowed set and subtract from the total, which is far easier than counting the many ways to have a repeat. Then interpret the ...


Submit Your Answer
Markdown supported