Chapter 15
Mathematical Modeling, AI and Emerging Applications
Bachelors Program in Computer Applications
Mathematical Foundations
•
Bachelor
Mathematical Modeling, AI and Emerging Applications
Introduction
Mathematical modeling is the disciplined use of mathematical language to represent, analyse and improve a real system. A model may describe traffic flow, disease transmission, customer demand, energy consumption, financial risk, software performance or the behaviour of an artificial-intelligence system. The model is not the system itself. It is a purposeful simplification designed to answer a question under stated assumptions.
For computer applications students, mathematical modeling connects programming, data analysis, algorithms and decision-making. A useful model must be more than computationally convenient: it should be interpretable, empirically testable, sensitive to important assumptions and governed responsibly. Contemporary applications increasingly combine models with machine learning, cryptography, quantum information and digital twins. These technologies create opportunities, but also introduce risks involving privacy, bias, security, explainability, safety and accountability.
A sound modeling process therefore has both technical and social dimensions. It asks not only “Can the system be predicted?” but also “What data and assumptions produced the prediction?”, “Who may be affected?”, and “Who is responsible when the model is wrong?”
Learning Objectives
After completing this chapter, students should be able to:
Explain the purpose, structure and lifecycle of mathematical models.
Formulate simple deterministic, probabilistic, discrete-time and optimization models.
Validate models using data, error measures, residual analysis and sensitivity analysis.
Distinguish mechanistic, statistical and machine-learning approaches.
Explain selected mathematical foundations of AI, cryptography, quantum computing and digital twins.
Evaluate model transparency, fairness, privacy, security and accountability.
Communicate model results, limitations and recommendations to technical and non-technical audiences.
1. The Nature and Lifecycle of a Mathematical Model
A real system contains entities, relationships, inputs, outputs, constraints and uncertainty. A model selects the features relevant to a particular purpose. For example, a simple model of online sales may represent sales as a function of price, advertising expenditure and season, while ignoring individual browsing histories.
A model commonly contains:
Variables: measurable quantities such as demand, temperature or processing time.
Parameters: fixed or estimated quantities controlling system behaviour, such as a growth rate.
Inputs: factors supplied to the model.
Outputs: predicted, estimated or optimized quantities.
Constraints: conditions that must be respected.
Assumptions: simplifications about the system or data.
Objective: the question or decision the model is intended to support.
A useful lifecycle is:
Define the problem and decision context.
Identify variables, data sources and stakeholders.
Formulate relationships and assumptions.
Estimate unknown parameters.
Implement and test the model.
Validate against independent evidence.
Perform sensitivity and uncertainty analysis.
Deploy with monitoring and governance.
Review and revise when the system or evidence changes.
Iterative mathematical modeling lifecycle
Figure: Iterative mathematical modeling lifecycle
Figure: Mathematical modeling is an iterative lifecycle rather than a one-time calculation.
1.1 Types of Models
A deterministic model produces the same output whenever its inputs and parameters are unchanged. A stochastic model includes random variables or probability distributions and therefore represents uncertainty explicitly. A static model describes one point in time; a dynamic model describes change over time. A mechanistic model is based on a proposed causal mechanism, whereas an empirical or statistical model summarizes observed relationships. Many modern systems are hybrid: a physical model may be combined with a machine-learning correction.
The choice depends on purpose. A mechanistic model can support explanation and extrapolation when its assumptions are credible. A data-driven model may predict accurately in a well-represented data range but behave unreliably when conditions change.
2. Formulating Models with Equations
2.1 Discrete-Time Growth
Suppose a population changes once per time period according to a constant proportional growth rate. The model is:
Pt+1 = (1 + r)Pt
Here, Pt is the population at period t, r is the dimensionless growth rate per period, and Pt+1 is the next population. The model assumes a constant rate, no capacity limit and a sufficiently meaningful time interval. It is not appropriate when resources constrain growth.
A bounded alternative is the logistic model:
dP/dt = rP(1 - P/K)
Here, t is time, r is the intrinsic growth rate per unit time, and K is the carrying capacity in the same population units as P. When P is much smaller than K, growth is approximately exponential; as P approaches K, growth slows.
2.2 A Simple Demand Model
A linear demand model may be written as:
Q = a - bP + cA + dS + ε
Q is demand in units, P is price, A is advertising expenditure, S represents seasonal or other explanatory factors, a,b,c,d are parameters, and ε is an error term. The signs of parameters should reflect the domain theory: normally b > 0, so that the price contribution -bP reduces demand. Units must be respected: for example, if P is measured in currency per item and Q in items, then b has units of items per currency unit.
This equation describes association unless a suitable causal design supports a causal interpretation. A rise in advertising and demand does not by itself prove that advertising caused the entire rise; seasonal demand, competitor actions or economic conditions may also matter.
2.3 Optimization
Many applications seek the best feasible decision rather than merely a prediction. A general constrained optimization problem is:
minimize f(x) subject to gi(x) ≤ 0, i = 1, …, m hj(x) = 0, j = 1, …, p
The vector x contains decision variables, f(x) is the objective function, and gi and hj represent inequality and equality constraints. “Best” depends on the objective: cost, delay, energy use, risk or a weighted combination. A solution is meaningful only relative to the feasible set and the selected objective.
Worked Example: Resource Allocation
A small software firm has 100 developer-hours available. Feature A requires 4 hours and yields an estimated value of 7 units; Feature B requires 2 hours and yields 3 units. Let x and y be the numbers of A and B delivered. The integer optimization model is:
maximize V = 7x + 3y subject to 4x + 2y ≤ 100 x ≥ 0, y ≥ 0, x and y integers
The value per hour is 7/4 = 1.75 for A and 3/2 = 1.5 for B. Since both values are positive and A has the greater value per hour, a feasible candidate is x = 25, y = 0, using all 100 hours and producing value 175. Could a mixture improve this? Replacing 4 hours of A with two B features changes value from 7 to 6, so it reduces value. Thus the optimum is 25 A features and no B features under the stated assumptions. This conclusion would change if there were minimum commitments, dependencies, risk differences or non-linear value.
3. Calibration, Validation and Uncertainty
Calibration estimates model parameters using available data. Validation tests whether the model provides adequate performance for its intended use, preferably on data not used for calibration. A model can fit historical observations very closely yet generalize poorly; this is overfitting.
For observed values yi and predictions ŷi, with n observations, common error measures include:
MAE = (1/n)∑|yi - ŷi|
RMSE = √[(1/n)∑(yi - ŷi)2]
MAE is in the same units as the target and gives each absolute error proportional influence. RMSE is also in target units but penalizes large errors more strongly because errors are squared before averaging. Neither metric alone establishes that a model is suitable; the acceptable error depends on consequences and context.
For non-negative observations, mean absolute percentage error is sometimes used:
MAPE = (100/n)∑ |(yi - ŷi)/yi|
MAPE is undefined when any yi = 0 and can behave badly when actual values are close to zero. Therefore it should not be used uncritically.
Residual analysis examines ei = yi - ŷi. A suitable regression model often has residuals with no systematic pattern, although statistical assumptions must be checked rather than assumed. For classification, accuracy can be misleading with imbalanced classes. A confusion matrix distinguishes true positives, true negatives, false positives and false negatives. Precision and recall are:
Precision = TP/(TP + FP)
Recall = TP/(TP + FN)
The appropriate metric depends on the cost of errors. In medical screening, missing a true case may be more serious than producing a false alarm; in other contexts, false positives may be more costly.
Sensitivity and Uncertainty Analysis
Sensitivity analysis asks how outputs change when inputs or parameters change. A local sensitivity of output y = f(x) to parameter θ can be represented by the partial derivative ∂y/∂θ, when differentiability is appropriate. A dimensionless elasticity is:
E_θ = (θ/y)(∂y/∂θ)
It approximates the percentage change in y caused by a one-percent change in θ, near a specified operating point. Sensitivity does not prove causation and may vary across the input range.
Uncertainty can arise from measurement noise, missing data, parameter estimation, model structure and future conditions. A scenario analysis evaluates named alternatives; a probabilistic analysis assigns distributions to uncertain inputs and examines the resulting output distribution. Reporting a single prediction without its uncertainty can create false precision.
4. Mathematical Foundations of Artificial Intelligence
Artificial intelligence uses representations, algorithms and data to perform tasks associated with perception, prediction, generation or decision-making. Mathematics does not eliminate the need for domain knowledge; it provides formal tools for expressing objectives and assessing error.
4.1 Vectors, Matrices and Geometry
A data record may be represented by a feature vector x ∈ ℝd. A linear prediction is:
ŷ = wᵀx + b
where w is a weight vector, b is an intercept and wᵀx is the dot product. A linear classifier may use the sign of this score to assign one of two classes. Features should be defined consistently and, where appropriate, standardized so that scale does not unintentionally dominate distance or optimization.
4.2 Loss and Optimization
A learning algorithm chooses parameters θ to minimize a loss over training examples:
J(θ) = (1/n)∑ L(f_θ(xi), yi) + λR(θ)
Here, f_θ is the model, L measures prediction loss, R(θ) is a regularization term, and λ ≥ 0 controls the trade-off between fit and model complexity. Regularization can reduce overfitting but may introduce bias. Gradient-based methods update parameters approximately as:
θk+1 = θk - η∇J(θk)
where η > 0 is the learning rate and ∇J is the gradient. The method is useful when the objective is differentiable or can be approximated by a differentiable function. Poor scaling, an unsuitable learning rate or a non-convex objective can prevent a good solution.
Neural networks compose transformations such as:
h = σ(Wx + b)
where W is a weight matrix, b a bias vector and σ an activation function applied componentwise. Deep networks learn multiple representations, but high predictive accuracy does not automatically imply causal understanding, fairness or transparency.
4.3 Probability and Bayesian Updating
A probabilistic model represents uncertainty through distributions. Bayes’ theorem is:
P(H|D) = [P(D|H)P(H)]/P(D)
H is a hypothesis and D is observed data. P(H) is the prior probability, P(D|H) the likelihood, P(H|D) the posterior probability and P(D) the evidence. The equation is applicable when these probabilities are coherently defined. It formalizes learning from evidence, but the prior and likelihood must be justified.
5. Cryptography, Quantum Computing and Digital Twins
5.1 Cryptographic Mathematics
Modern public-key cryptography relies on mathematical problems that are easy to compute in one direction but difficult to reverse without secret information. In RSA, two large primes are multiplied to form n = pq. Security depends on the practical difficulty of factoring n for appropriately chosen parameters. A simplified RSA construction selects an exponent e relatively prime to φ(n), computes a private exponent d satisfying:
e d ≡ 1 (mod φ(n))
where, for distinct primes, φ(n) = (p - 1)(q - 1). The public key contains (n,e), while d is secret. Real deployments require standardized padding, secure key generation and carefully reviewed libraries; textbook RSA alone is not a secure encryption scheme.
Cryptographic hashing maps arbitrary input to a fixed-length digest. A secure hash aims for preimage resistance, second-preimage resistance and collision resistance. Hashes support integrity checks and digital signatures, but a hash by itself does not provide confidentiality.
5.2 Quantum Computing
A classical bit is either 0 or 1. A qubit is represented by a unit vector in a two-dimensional complex vector space:
|ψ⟩ = α|0⟩ + β|1⟩, |α|² + |β|² = 1
The complex amplitudes α and β determine measurement probabilities in the computational basis. Measurement returns 0 with probability |α|² and 1 with probability |β|². Superposition is not equivalent to observing both classical values simultaneously, and quantum algorithms must exploit interference and entanglement to obtain useful results.
Quantum computing is relevant to cryptography because Shor’s algorithm, on a sufficiently capable fault-tolerant quantum computer, could threaten widely used public-key systems based on factoring or discrete logarithms. Grover’s algorithm can provide a quadratic speedup for unstructured search, which affects the choice of symmetric-key security levels. These are theoretical and engineering considerations, not evidence that current consumer computers can break all cryptography.
5.3 Digital Twins
A digital twin is a computational representation of a physical or organizational system, connected to data over time. It may combine sensor streams, simulation, state estimation and predictive analytics. A simple state-space representation is:
xt+1 = f(xt, ut, wt)
yt = h(xt, vt)
Here, xt is the hidden system state, ut a control input, yt an observation, f the state-transition function, h the observation function, and wt and vt process and measurement noise. Units and sampling intervals must be consistent. A digital twin is more than a static 3D visualization: it requires an explicit relationship between the real system, data and computational model.
Applications include predictive maintenance, smart buildings, logistics, manufacturing and healthcare. Risks include sensor failure, cyberattack, poor synchronization, inappropriate extrapolation and unauthorized use of operational data.
6. Governance, Transparency and Responsible Use
A model’s technical performance is only one dimension of quality. Responsible modeling requires:
Validity: outputs answer the intended question under credible assumptions.
Reliability: results are stable enough for the operational context.
Transparency: data sources, objectives, assumptions, limitations and major processing steps are documented.
Explainability: affected users can receive an understandable reason for a result where appropriate.
Fairness: performance and error rates are examined across relevant groups; fairness criteria may conflict and require a justified choice.
Privacy: data collection and use are minimized, secured and legally authorized.
Security: models, data, interfaces and supply chains are protected against manipulation.
Accountability: named people or institutions retain responsibility; “the algorithm decided” is not an adequate governance arrangement.
Human oversight: high-impact decisions require review, appeal and intervention mechanisms.
Transparency is not identical to publishing source code. A transparent system should make its purpose, data provenance, model class, evaluation design, uncertainty, limitations and decision authority understandable to relevant stakeholders. Explanations should not be misleading post hoc stories. Documentation tools such as model cards, data sheets, audit logs, version control and change registers support traceability.
Fairness must be defined in relation to a decision and context. Suppose a binary classifier is used for two groups. Equal false-positive rates, equal false-negative rates and equal positive predictive values are distinct goals; they cannot always be achieved simultaneously when groups differ in base rates or score distributions. Consequently, fairness is a socio-technical judgment, not merely a single numerical test.
Privacy-preserving approaches include access control, aggregation, pseudonymization, differential privacy and federated learning. Each has limitations. Pseudonymized data may remain re-identifiable, and federated learning does not automatically prevent inference attacks. Governance must therefore address the whole data lifecycle.
7. Detailed Applied Case: Illustrative Predictive Maintenance System
Background
Consider a fictional manufacturing company operating pumps in a water-treatment plant. Unexpected pump failure causes service interruption and expensive emergency repairs. The company proposes a predictive-maintenance model using vibration, temperature, pressure and operating-hours data.
Problem
The plant must decide whether to schedule inspection within the next seven days. A missed failure is costly, but unnecessary inspections also consume staff time and may interrupt production. Historical failure labels are incomplete because some pumps were replaced before failure and sensor readings were occasionally missing.
Analysis
The team first defines the prediction target precisely: “failure requiring intervention within seven days,” rather than the vague term “abnormal pump.” It identifies the observation time, prediction horizon and decision owner. Engineers propose physically meaningful features such as temperature change, vibration summaries and pressure deviation. Data scientists examine missingness, sensor calibration and whether maintenance records were available for all pumps.
A baseline model predicts no failure and is evaluated before more complex models. Candidate models are trained on earlier periods and tested on a later period, reducing leakage from future information. Because failures are rare, accuracy is not sufficient. Recall, precision, false-alarm workload and expected cost are reported.
Suppose, for a test period, the model produces 18 true positives, 6 false positives, 12 false negatives and 164 true negatives. Then:
Precision = 18/(18 + 6) = 0.75
Recall = 18/(18 + 12) = 0.60
The model correctly identifies 60% of recorded failures and three quarters of its alerts are confirmed failures. These figures do not prove operational value: failures may be under-recorded, and the costs of the four outcomes differ.
Approach and Solution
The company uses the model as a prioritization tool, not an automatic shutdown mechanism. Alerts include the main contributing measurements, data-quality warnings and a confidence interval or calibrated probability where available. A maintenance engineer reviews alerts, records the decision and can override the recommendation. The system logs model version, input snapshot and action taken.
Sensitivity analysis tests sensor drift, alternative failure definitions and alert thresholds. A governance review checks whether monitoring could expose employees or contractors unfairly, and access to operational data is restricted. The model is re-evaluated after changes in pump type, operating conditions or maintenance policy.
Outcome
In the illustrative scenario, emergency failures decline during a controlled pilot, but the model is not declared universally valid. The company retains the baseline comparison, documents uncertainty and continues collecting higher-quality labels. It discovers that a sensor replacement changed the feature distribution; monitoring detects this shift and triggers review.
Learning Points
The case demonstrates that model development includes problem definition, data quality, metrics, human workflow, monitoring and accountability. A mathematically sophisticated classifier cannot compensate for ambiguous targets or unreliable labels. Deployment changes the system: once workers respond to alerts, the data-generating process itself changes.
8. Communicating Models Professionally
A professional model report should state the decision purpose, population or system boundary, variables and units, assumptions, data provenance, method, validation design, performance metrics, uncertainty, failure cases and governance controls. Charts should distinguish observations from predictions and avoid implying greater precision than the data support.
Technical audiences may need equations, parameter estimates, residual plots and reproducible code. Decision-makers may need expected costs, operational thresholds and alternatives. Affected users may need plain-language explanations and an appeal route. These are different communication requirements, but none should conceal material limitations.
A good presentation separates:
what the model estimates;
what evidence supports it;
what assumptions make it plausible;
what it does not establish; and
what action, if any, is authorized.
9. Challenges and Contemporary Directions
Models face distribution shift when future data differ from training data. Feedback loops occur when predictions influence the outcomes later used for training. Data imbalance can produce unequal error rates. Complex models may be difficult to audit, while simple models may omit important non-linearities. Cyberattacks can target training data, model parameters, prompts or deployed interfaces.
Contemporary practice is moving toward hybrid modeling, combining domain equations with machine learning; uncertainty-aware AI; privacy-preserving computation; robust and adversarial evaluation; foundation models; edge AI; and post-quantum cryptography. These developments should be assessed by evidence rather than novelty. A new method is valuable only when it improves the relevant decision under acceptable cost, risk and governance conditions.
Best-Practice Checklist
Before deploying a mathematical or AI-enabled model, ask:
Is the decision objective explicit and legitimate?
Are variables, units, assumptions and system boundaries documented?
Is the data representative of the intended use?
Were calibration and validation separated appropriately?
Are error costs, uncertainty and subgroup performance reported?
Has sensitivity to plausible assumptions been tested?
Are privacy, security, fairness and legal requirements addressed?
Is there human accountability, monitoring and an appeal process?
Can the model be withdrawn or revised safely?
Can the results be explained to the people who rely on or are affected by them?
Chapter Summary
Mathematical modeling converts a real-world question into a structured representation involving variables, parameters, assumptions, objectives and constraints. Models may be deterministic or stochastic, static or dynamic, mechanistic or empirical. Their lifecycle includes formulation, calibration, validation, sensitivity analysis, deployment and revision.
Linear and logistic models illustrate how equations express change and relationships, while optimization models support resource allocation under constraints. MAE, RMSE, precision and recall provide different views of performance; no metric is universally sufficient. Sensitivity and uncertainty analysis prevent false precision and reveal dependence on assumptions.
AI rests on vectors, matrices, probability, loss functions and optimization. Cryptography uses number theory and computational hardness; quantum computing represents states with complex amplitudes and may affect future security; digital twins connect computational state models to physical systems and sensor data. Across all applications, responsible practice requires validity, transparency, privacy, security, fairness, human oversight and accountability. The central professional skill is not merely producing a prediction, but developing and communicating a model whose purpose, evidence and limitations are clear.
Key Terms
Mathematical model: A purposeful mathematical representation of a real system.
Variable: A quantity that can take different values in a model.
Parameter: A fixed or estimated quantity controlling model behaviour.
Assumption: A stated simplification or condition on which a model depends.
Deterministic model: A model that gives the same output for identical inputs and parameters.
Stochastic model: A model that represents randomness or uncertainty.
Calibration: Estimating model parameters from data.
Validation: Testing whether a model is adequate for its intended purpose.
Overfitting: Fitting training data so closely that performance on new data deteriorates.
Residual: The difference between an observed value and its prediction.
Sensitivity analysis: Study of how output changes when inputs or parameters change.
Optimization: Systematic selection of the best feasible decision according to an objective.
Regularization: A method that penalizes complexity to reduce overfitting.
Precision: The proportion of positive predictions that are true positives.
Recall: The proportion of actual positives that are detected.
Digital twin: A data-connected computational representation of a physical or organizational system.
Cryptographic hash: A fixed-length digest designed to provide integrity-related security properties.
Qubit: The basic unit of quantum information, represented by a normalized complex state.
Model governance: Policies and controls for responsible development, deployment and oversight of models.
Review Questions
5 Short Answer Questions
Distinguish a parameter from a variable in a mathematical model.
Why should a model’s assumptions be documented?
State one important difference between MAE and RMSE.
What does regularization attempt to control in machine learning?
Why is a digital twin more than a three-dimensional visualization?
5 Long Answer Questions
Explain the lifecycle of mathematical modeling from problem definition to monitoring and revision.
Compare mechanistic, statistical and machine-learning models, including a suitable application for each.
Explain calibration, validation, overfitting and uncertainty using a predictive-maintenance example.
Describe the mathematical ideas underlying public-key cryptography and quantum computing.
Discuss transparency, fairness, privacy and accountability as requirements for responsible AI.
3 Analytical / Application Questions
A classifier produces 30 true positives, 10 false positives, 20 false negatives and 140 true negatives. Calculate its precision and recall, and explain which metric should be prioritized if missed cases are especially costly.
Formulate an optimization model for selecting two types of software tasks when developer time, budget and task dependencies impose constraints. Define all variables, objective and constraints.
Design a validation and governance plan for a digital twin used to predict failures in a critical infrastructure system. Include data quality, uncertainty, cybersecurity, human oversight and model-monitoring requirements.
Multiple Choice Questions with Answers
Question 1
Which statement best describes mathematical model validation?
A. Estimating parameters using the same data used for training
B. Testing whether the model is adequate for its intended purpose
C. Increasing the number of variables in the model
D. Removing all uncertainty from the model
Correct Answer: B. Testing whether the model is adequate for its intended purpose
Question 2
In the model Pt+1 = (1+r)Pt, what does r represent?
A. The population at the next period
B. The carrying capacity
C. The proportional growth rate per period
D. The measurement error
Correct Answer: C. The proportional growth rate per period
Question 3
Which metric penalizes large prediction errors more strongly because it squares them before averaging?
A. MAE
B. RMSE
C. Recall
D. Precision
Correct Answer: B. RMSE
Question 4
If a classifier has 18 true positives and 6 false positives, its precision is:
A. 0.60
B. 0.67
C. 0.75
D. 0.90
Correct Answer: C. 0.75
Question 5
In gradient descent, the update θk+1 = θk - η∇J(θk) generally moves parameters:
A. In the direction of increasing objective value
B. Opposite the gradient of the objective
C. Randomly without reference to the objective
D. Only toward integer values
Correct Answer: B. Opposite the gradient of the objective
Question 6
What is the principal purpose of regularization in a learning objective?
A. To encourage control of model complexity
B. To guarantee causal conclusions
C. To remove the need for validation data
D. To make every prediction identical
Correct Answer: A. To encourage control of model complexity
Question 7
In a qubit state |ψ⟩ = α|0⟩ + β|1⟩, the condition |α|² + |β|² = 1 ensures that:
A. Both outcomes must be observed simultaneously
B. The probabilities of the two computational-basis outcomes sum to one
C. The amplitudes are always real numbers
D. The qubit is equivalent to two classical bits
Correct Answer: B. The probabilities of the two computational-basis outcomes sum to one
Question 8
Which statement about a cryptographic hash is correct?
A. It automatically provides confidentiality for plaintext
B. It is designed to map arbitrary input to a fixed-length digest
C. It requires the recipient to know the private decryption key
D. It guarantees that collisions are mathematically impossible
Correct Answer: B. It is designed to map arbitrary input to a fixed-length digest
Question 9
A digital twin is best characterized as:
A. A static image of a physical asset
B. A data-connected computational representation of a system
C. A database containing only historical invoices
D. A random simulation without observations
Correct Answer: B. A data-connected computational representation of a system
Question 10
Why can accuracy be misleading for a highly imbalanced classification problem?
A. Accuracy cannot be calculated for binary outcomes
B. A model can appear accurate by mostly predicting the majority class
C. Accuracy always equals recall
D. Accuracy measures only computational speed
Correct Answer: B. A model can appear accurate by mostly predicting the majority class