This document defines the mathematical foundation for the Collapse Archetype Quiz scoring system. The system aggregates user responses across multiple questions to determine which of the 19 collapse archetypes best matches the respondent's perspective and behavioral patterns.
The total score for archetype A after n questions is:
S(A) = Σ(i=1 to n) w_i × p_i(A)
Where:
S(A)= Total score for archetype Aw_i= Weight of question i (default = 1.0)p_i(A)= Points awarded to archetype A from answer selected for question in= Total number of questions
To enable comparison across quizzes with different numbers of questions:
S_norm(A) = S(A) / Σ(i=1 to n) w_i
This produces a normalized score representing average points per weighted question.
Step 1: Calculate all archetype scores
For each archetype A in ARCHETYPES:
S(A) = Σ points from user answers
Step 2: Identify maximum score
S_max = max{S(A) | A ∈ ARCHETYPES}
Step 3: Determine tie threshold
τ = S_max × (1 - ε)
Where ε (epsilon) is the tie tolerance (recommended: 0.05 for 5% tolerance)
Step 4: Collect dominant archetypes
DOMINANT = {A | S(A) ≥ τ}
When |DOMINANT| > 1, present all tied archetypes to the user, acknowledging complexity:
"You exhibit characteristics of multiple collapse archetypes:
1. [Archetype A] (Score: X)
2. [Archetype B] (Score: Y)
3. [Archetype C] (Score: Z)"
Rationale: Human psychology rarely fits perfectly into single categories. Multiple matches reflect genuine complexity.
If a single result is required, differentiate using the 6-dimensional trait system:
1. Calculate trait dimension scores for each tied archetype
2. Compare user's implicit trait profile against archetype profiles
3. Select archetype with highest cosine similarity in trait space
As a fallback, use deterministic alphabetical ordering by archetype ID:
RESULT = min{A.id | A ∈ DOMINANT} (alphabetically first)
Each archetype maps to a profile across these dimensions:
-
Awareness (A): Recognition of collapse realities
- Scale: Low (0.0) → High (1.0)
-
Affect (Af): Emotional valence toward collapse
- Scale: Negative (-1.0) → Neutral (0.0) → Positive (1.0)
-
Agency (Ag): Perceived capacity to act
- Scale: Low (0.0) → High (1.0)
-
Time Orientation (T): Temporal focus
- Values: Past (-1.0) | Present (0.0) | Future (1.0)
-
Relationality (R): Social context orientation
- Values: Individual (0.0) | Group (1.0)
-
Posture (P): Behavioral stance
- Values: Passive (0.0) | Active (1.0)
Encoding from spec.md table:
ostrich: {A: 0.2, Af: 0.0, Ag: 0.2, T: 0.0, R: 0.0, P: 0.0}
blissed-out-yogi: {A: 0.9, Af: 0.8, Ag: 0.5, T: 0.0, R: 0.0, P: 0.0}
illusionist: {A: 0.5, Af: 0.0, Ag: 0.9, T: 0.0, R: 1.0, P: 1.0}
normalizer: {A: 0.2, Af: 0.0, Ag: 0.5, T: 0.0, R: 1.0, P: 0.0}
prepper: {A: 0.9, Af: 0.0, Ag: 0.9, T: 1.0, R: 0.0, P: 1.0}
prophet-of-doom: {A: 0.9, Af: -0.7, Ag: 0.5, T: 1.0, R: 0.0, P: 1.0}
alt-right-collapse-bro: {A: 0.5, Af: -0.7, Ag: 0.9, T: 1.0, R: 1.0, P: 1.0}
evangelical-nationalist: {A: 0.9, Af: 0.8, Ag: 0.5, T: 1.0, R: 1.0, P: 1.0}
apocaloptimist: {A: 0.9, Af: 0.8, Ag: 0.9, T: 1.0, R: 0.0, P: 1.0}
trickster: {A: 0.5, Af: 0.0, Ag: 0.9, T: 0.0, R: 0.0, P: 1.0}
woke-lefty-socialist: {A: 0.9, Af: -0.7, Ag: 0.9, T: 1.0, R: 1.0, P: 1.0}
salvager: {A: 0.5, Af: 0.0, Ag: 0.9, T: 0.0, R: 0.0, P: 1.0}
sacred-keeper: {A: 0.9, Af: 0.8, Ag: 0.5, T: -1.0, R: 1.0, P: 0.0}
everyday-hustler: {A: 0.5, Af: 0.0, Ag: 0.9, T: 0.0, R: 0.0, P: 1.0}
already-collapsed: {A: 0.9, Af: -0.7, Ag: 0.2, T: 0.0, R: 0.0, P: 0.0}
extracted: {A: 0.2, Af: 0.0, Ag: 0.2, T: 0.0, R: 0.0, P: 0.0}
child-witness: {A: 0.2, Af: 0.0, Ag: 0.2, T: 0.0, R: 0.0, P: 0.0}
opportunist-elite: {A: 0.9, Af: 0.0, Ag: 0.9, T: 1.0, R: 0.0, P: 1.0}
conspiracy-theorist: {A: 0.5, Af: -0.7, Ag: 0.5, T: 0.0, R: 0.0, P: 0.0}
When using Strategy B for tie-breaking, compute cosine similarity between user's inferred trait vector and archetype trait vectors:
similarity(U, A) = (U · A) / (||U|| × ||A||)
Where:
U= User's 6-dimensional trait vector (inferred from answers)A= Archetype's trait profile vector·= Dot product||·||= Euclidean norm
Expanded formula:
similarity(U, A) =
(U_A × A_A + U_Af × A_Af + U_Ag × A_Ag + U_T × A_T + U_R × A_R + U_P × A_P) /
sqrt(U_A² + U_Af² + U_Ag² + U_T² + U_R² + U_P²) × sqrt(A_A² + A_Af² + A_Ag² + A_T² + A_R² + A_P²)
Archetype Scores Object:
{
"ostrich": 8,
"blissed-out-yogi": 3,
"prepper": 12,
...
}Trait Profile Object:
{
"awareness": 0.9,
"affect": 0.0,
"agency": 0.9,
"time": 1.0,
"relationality": 0.0,
"posture": 1.0
}Time Complexity:
- Score aggregation: O(n × m) where n = questions, m = average answers per question
- Dominant archetype determination: O(k) where k = number of archetypes (19)
- Overall: O(n × m + k) → Linear in quiz length
Space Complexity:
- O(k) for archetype scores
- O(k × 6) for trait profiles
- Overall: O(k) → Constant for fixed archetype set
Optimization Techniques:
- Pre-compute archetype trait profile norms during initialization
- Use hash maps for O(1) score lookup
- Early termination if dominant archetype emerges with >50% of remaining points impossible for others
- Cache normalized scores if recalculation is needed
Case 1: Zero Variance (All Scores Equal)
IF max(S) - min(S) < δ THEN
RETURN "Balanced Profile" archetype or prompt user for clarification questions
Where δ is a minimum variance threshold (e.g., 0.1)
Case 2: No Scores Recorded
IF all S(A) = 0 THEN
RETURN error: "No valid answers recorded"
Case 3: Single Question Quiz
Valid scenario: Return archetypes with any points from the single answer
Case 4: Negative Scores (if using negative scoring)
S_adjusted(A) = max(0, S(A)) // Floor at zero
Unit Test Cases:
- Perfect match: All answers point to single archetype
- Exact tie: Two archetypes with identical scores
- Near tie: Scores within 5% of each other
- Dominant winner: One archetype with >2x score of others
- Uniform distribution: Equal scores across all archetypes
- Edge values: Zero scores, maximum possible scores
- Single question: Quiz with only one question
- Empty quiz: No questions answered
Invariants to Verify:
Σ S(A) = Σ Σ points from all answers(conservation of points)S_norm(A) ≥ 0for all A (non-negativity)|DOMINANT| ≥ 1(at least one dominant archetype)max{S(A)} ∈ DOMINANT(maximum score always included)
For displaying results as a radar/spider chart with 6 dimensions:
Step 1: Calculate archetype trait profile (already defined in 3.2)
Step 2: Transform to polar coordinates (for each of 6 axes):
For dimension d ∈ {1, 2, 3, 4, 5, 6}:
θ_d = (d - 1) × (2π / 6) // Angle in radians
r_d = trait_value_d // Radius (normalized 0-1)
x_d = r_d × cos(θ_d)
y_d = r_d × sin(θ_d)
Step 3: Calculate polygon area (for visual comparison):
Area = (1/2) × |Σ(i=1 to 6) (x_i × y_{i+1} - x_{i+1} × y_i)|
Where indices wrap: x_7 = x_1, y_7 = y_1
Calculate percentages for each archetype:
percentage(A) = (S(A) / Σ S(all)) × 100
Sort archetypes by score descending for display.
Measure certainty of archetype match:
confidence = (S_max - S_second) / S_max
Where:
S_max= Highest archetype scoreS_second= Second-highest archetype score
Interpretation:
- confidence ≥ 0.5: Strong match (>50% separation)
- 0.2 ≤ confidence < 0.5: Moderate match
- confidence < 0.2: Weak match (consider multiple archetypes)
Quiz Setup:
- 5 questions
- Each answer awards 1 point to one archetype
- User answers: Q1→A1(ostrich), Q2→A2(prepper), Q3→A1(prepper), Q4→A3(prepper), Q5→A2(ostrich)
Score Calculation:
S(ostrich) = 1 + 0 + 0 + 0 + 1 = 2
S(prepper) = 0 + 1 + 1 + 1 + 0 = 3
S(all others) = 0
Dominant Archetype:
S_max = 3
τ = 3 × (1 - 0.05) = 2.85
DOMINANT = {prepper} (only archetype ≥ 2.85)
Confidence:
confidence = (3 - 2) / 3 = 0.333 (moderate match)
User answers award:
S(prepper) = 5
S(apocaloptimist) = 5
S(opportunist-elite) = 4.9
S(all others) < 4
With ε = 0.05:
S_max = 5
τ = 5 × 0.95 = 4.75
DOMINANT = {prepper, apocaloptimist, opportunist-elite}
Result: Display all three as co-dominant archetypes, or use trait-based differentiation if single result required.
To implement variable importance for questions:
questions: [
{id: 1, weight: 1.0, ...},
{id: 2, weight: 1.5, ...}, // 50% more important
{id: 3, weight: 0.5, ...} // Half as important
]Update scoring:
S(A) = Σ(i=1 to n) w_i × p_i(A)
System supports adding/removing archetypes without algorithm changes:
- Archetype scores stored in dynamic dictionary
- Only archetypes with points > 0 need consideration
- No hardcoded archetype lists in core logic
Support questions where multiple answers can be selected:
S(A) = Σ(i=1 to n) w_i × Σ(j in selected_answers_i) p_ij(A)
- Core scoring aggregation function
- Dominant archetype determination with tie handling
- Archetype trait profile data structure
- Cosine similarity calculation for trait-based differentiation
- Score normalization function
- Confidence metric calculation
- Radar chart coordinate transformation
- Input validation and error handling
- Unit tests for all edge cases
- Performance benchmarking
- Documentation of mathematical decisions
Key Assumptions:
- Point values are non-negative integers or floats
- At least one answer per question awards non-zero points
- Archetype IDs are unique and consistent across data structures
- Trait dimensions are independent (orthogonal in conceptual space)
- Users answer all questions (no partial quiz handling in basic version)
Recommended Constants:
- Tie tolerance (ε): 0.05 (5%)
- Minimum variance threshold (δ): 0.1
- Default question weight: 1.0
- Confidence thresholds: [0.2, 0.5] for [weak, moderate, strong]
This scoring system provides a mathematically rigorous, transparent, and extensible foundation for the Collapse Archetype Quiz. The algorithm balances simplicity for maintainability with sophistication for accurate psychological profiling. Tie-handling embraces the complexity of human psychology while providing clear fallback mechanisms when single results are required.
The six-dimensional trait system adds depth without complicating the core scoring logic, enabling rich visualizations and secondary differentiation when needed.
All mathematical operations are computationally efficient (linear time complexity), ensuring responsive performance even with large question sets.