1.1 Description:

In statistics, the lowercase σ (sigma) generally denotes the population standard deviation. Standard deviation quantifies how far, on average, each value in a data set deviates from the mean (μ). The smaller σ is, the more tightly the data cluster around μ; a larger σ indicates greater spread.

\[ \sigma \;=\; \sqrt{\frac{1}{N}\,\sum_{i=1}^{N}\bigl(x_i - \mu\bigr)^2} \]

Example. For the integers 1–4:

\[ \mu \;=\; \frac{1+2+3+4}{4}\;=\;2.5 \quad\Longrightarrow\quad \sigma \;=\;\sqrt{\frac{(1-2.5)^2+(2-2.5)^2+(3-2.5)^2+(4-2.5)^2}{4}} \approx 1.118 \]

The Java program delivered in this project automates this calculation and displays every intermediate step for full transparency.

1. Introduction

1.1 Description

The Standard-Deviation Calculator is a compact Java Swing application that computes the population standard deviation (σ) of every integer in the range [a, b]. It reveals each intermediate step so students can document their methodology in lab reports.

1.2 Persona

Name: Julia Chen – 20-year-old Mechanical-Engineering student.

1.2 Persona – Joe Ramirez

Age 23
Major Electrical Engineering (B.Eng.)
Location Montreal, Canada
Tech Stack macOS 14, OpenJDK 21, IntelliJ IDEA Edu

Background. Joe is in his final undergraduate year and currently works as a teaching assistant for a first-year “Engineering Computation” course. He frequently prepares tutorial slides and lab demos where students must calculate statistical measures, but many of his tutees struggle to interpret the black-box outputs of conventional calculators.

Goals & Motivations

Pain Points

Typical Use Scenario

Joe launches the Standard-Deviation Calculator before a lab session, inputs the dataset bounds a = 5, b = 30, and presses Evaluate. The application streams the mean, variance, and each squared deviation into a scrollable log. Joe clicks Save Steps, drags the exported .txt file into Overleaf, and instantly embeds the derivation in his slide deck. During class, when a student suggests a different range, Joe simply edits the numbers, re-runs, and projects the updated steps live—eliminating chalkboard arithmetic.

Personality Snapshot

Trait Level / Note
Tech EnthusiasmHigh – builds hobby IoT projects
Teaching PassionVery High – enjoys mentoring peers
Patience for ErrorsModerate – wants instant, clear feedback
Design SensitivityPrefers minimalist UIs over cluttered dashboards
“If students can see every calculation unfold, they stop guessing and start understanding.”

2. Implementation

2.1 GUI in Swing

The single-window interface (JFrame) uses BorderLayout:

2.2 Input

Live document listeners flag non-numeric keys; if a > b, a dialog offers to swap the bounds.

2.3 Output

3. Requirements

3.1 Software Requirements Specification

IDRequirementRationale / Note
FR-01The system shall compute the population standard deviation σ for the integer range [a, b].Core functionality.
FR-02The system shall display each intermediate step (partial sums, mean μ, variance σ², final σ) in chronological order.Transparency for learning.
UR-01The GUI shall validate numeric input in real time and highlight errors.Reduces user frustration.
UR-02Error dialogs shall propose corrective actions (e.g., “Swap bounds?”).Helpful feedback mandate.
IR-01The implementation shall rely solely on core Java 21 and Java Swing—no external libraries.“From scratch” rule.
QR-01The codebase shall compile with javac on any JDK 21 without IDE-specific tooling.Tool-agnostic build.
QR-02The system shall throw a custom InvalidBoundException when a > b.Explicit exception handling.
PR-01For |b − a| ≤ 106, total computation time shall be < 500 ms on a 2 GHz CPU.Performance ceiling.
PR-02Peak RAM usage shall remain below 100 MB.Ensures laptop compatibility.
UR-03The GUI shall offer a Save Steps export option.Stakeholder request.
QR-03The test suite shall achieve ≥ 95 % statement coverage.Quality assurance.

3.2 Example Inputs and Results

Input (a, b)σ Result
1, 51.414 213 562
10, 203.162 277 660
100, 15014.577 379 736

4. Conclusion

The revised design focuses exclusively on standard-deviation computation, meeting the “from scratch” requirement while delivering step-by-step transparency for undergraduate users like Julia Chen.

5. Citation

Cite any external statistical references or algorithmic derivations here using IEEE, APA, or your program’s preferred format.