A computer is an electronic device that accepts data (raw facts) as input, processes it according to a set of stored instructions (a program), and produces meaningful information as output. The cycle is summarised as Input → Process → Output (the IPO model), supported by storage.
Major application areas relevant to a statistics student:
A researcher records the heights of 500 students in a spreadsheet (input), the computer calculates the mean and standard deviation (process), and prints a histogram (output) — a complete IPO cycle.
An ATM takes your card and PIN (input), checks the balance and debits the account (process), and dispenses cash plus a receipt (output).
The ALU and CU together form the Central Processing Unit (CPU).
When you type 2 + 3 on a calculator: keypad = input unit, the chip's ALU adds, the CU
sequences the steps, the register = memory, and the display = output unit.
In R, the statement mean(c(4, 8, 6)) uses the keyboard (input), RAM holds the vector
(memory), the CPU computes the average (ALU + CU), and the console prints 6 (output).
The CPU ("the brain of the computer") executes program instructions. It has three parts: the ALU (arithmetic such as +, −, ×, ÷ and logic such as <, >, =), the Control Unit (fetch–decode–execute cycle), and registers (tiny, very fast storage inside the CPU).
CPU speed is measured in gigahertz (GHz) — billions of cycles per second. Modern CPUs
are multi-core (several processing units on one chip) enabling parallel computation, which R can
exploit through packages like parallel.
| Input devices | Output devices |
|---|---|
| Keyboard, mouse, scanner, microphone, webcam, touch screen, barcode reader | Monitor, printer, speaker, projector, plotter |
Some devices are both input and output — e.g. a touch screen, or a modem (modulates outgoing and demodulates incoming signals).
| Primary memory | Secondary memory | |
|---|---|---|
| Examples | RAM, ROM, cache | Hard disk (HDD), SSD, USB drive, CD/DVD |
| Volatile? | RAM volatile (lost on power-off); ROM non-volatile | Non-volatile (retains data) |
| Speed | Very fast | Slower |
| Purpose | Temporary working store for the CPU | Permanent / long-term storage |
1 Byte = 8 bits; 1 KB = 1024 B; 1 MB = 1024 KB; 1 GB = 1024 MB; 1 TB = 1024 GB.
A dataset of 1,000,000 numeric values stored as 8-byte doubles needs about \(1{,}000{,}000 \times 8 = 8{,}000{,}000\) bytes ≈ 7.63 MB of RAM — comfortably handled by a modern laptop.
RAM is volatile: if R is holding a large data frame and the power fails, the object is lost unless it
was saved to a secondary device with saveRDS() or write.csv().
A programming language is a formal set of rules for writing instructions a computer can execute. Languages are classified by closeness to hardware:
| Language | Typical application |
|---|---|
| R | Statistics, data analysis, visualisation |
| Python | General programming, data science, machine learning |
| C / C++ | System software, high-performance computing |
| Java | Enterprise & Android applications |
| SQL | Database querying |
A compiler translates the whole program at once (C, C++); an interpreter translates and runs line-by-line (R, Python) — which is why you get immediate results in the R console.
A file is a named collection of related data stored on a device (e.g.
data.csv, report.docx). A folder (directory) is a container
that organises files and sub-folders into a tree (hierarchical) structure.
The file extension indicates the type and the program that opens it:
.csv (comma-separated data), .xlsx (Excel), .R (R script),
.txt (plain text), .docx (Word), .pdf (portable document).
The path C:\Stats\survey\heights.csv means: drive C → folder Stats →
sub-folder survey → file heights.csv.
In R, the working directory is the default folder for reading/writing files.
Check it with getwd() and change it with setwd("C:/Stats/survey") — then
read.csv("heights.csv") finds the file without a full path.
Software is the set of programs and associated data that tell the hardware what to do. It is broadly of two kinds:
Software is also classified by licensing:
Windows is system software (it manages the machine); MS-Excel running on top of it is application software.
R is open-source application software for statistics; the C compiler that R itself is built with is system software (a language translator).
An operating system (OS) is system software that manages hardware and software resources and provides services to applications. Core functions: process management, memory management, file management, device (I/O) management, security and a user interface.
| Feature | Windows | Linux |
|---|---|---|
| Licence | Proprietary (Microsoft) | Open-source (free) |
| Interface | Mainly graphical (GUI) | Powerful command line + GUI |
| Cost | Paid | Free |
| Common use | Personal computing, offices | Servers, data science, supercomputers |
| Stability / security | Good | Very high; widely used for hosting R/Python pipelines |
R runs identically on Windows and Linux — a script written on a Windows laptop runs unchanged on a Linux server, because R is cross-platform.
Cloud data-analysis platforms (e.g. RStudio Server, Posit Cloud) typically run on Linux, so familiarity
with basic Linux commands (ls, cd, pwd) is useful for analysts.