Tag Archives: Mathematics

Sunday Mathematics #3 — Complex Numbers: When Real Numbers Are Not Enough

Article content

Most of us first encounter complex numbers through a slightly uncomfortable equation:

x² + 1 = 0

Therefore:

x² = −1

But no real number squared gives −1.

Mathematics solved this by extending the number system and defining:

i = √−1

A complex number can therefore be written as:

z = a + bi

where:

  • a is the real part
  • b is the imaginary part
  • i² = −1

At first glance, this can look like a mathematical trick.

It isn’t.

Complex numbers are one of the most useful mathematical abstractions in science, engineering and computing.


1. From a Number Line to a Number Plane

Real numbers live on a one-dimensional number line.

Complex numbers give us a two-dimensional plane:

z = a + bi ↔ (a, b)

The horizontal axis represents the real component and the vertical axis represents the imaginary component.

For example:

z = 3 + 4i

can be represented by the point (3,4).

Its magnitude is:

|z| = √(3² + 4²) = 5

Its angle or phase is:

θ = tan⁻¹(4/3)

So a complex number can represent both:

Magnitude + Direction

This is where complex numbers become extraordinarily useful.


2. Cartesian and Polar Forms

The same complex number can be represented in different ways.

Cartesian form

z = a + bi

Polar form

z = r(cos θ + i sin θ)

where:

r = √(a² + b²)

Using Euler’s formula:

e^(iθ) = cos θ + i sin θ

we get:

z = re^(iθ)

This is a remarkably powerful representation.

Instead of thinking only about two numbers, we can think in terms of:

Amplitude + Phase

And amplitude and phase appear everywhere in physical and computational systems.


3. Euler’s Formula — A Beautiful Mathematical Bridge

One of the most famous equations in mathematics is:

e^(iπ) + 1 = 0

It connects five fundamental mathematical constants:

0, 1, e, i and π

But Euler’s formula is much more than mathematical beauty.

e^(iθ) = cos θ + i sin θ

provides a bridge between:

exponentials ↔ trigonometry ↔ rotation ↔ oscillation

That bridge is extremely useful when studying waves, signals, electrical systems, communications and control systems.


4. Complex Numbers and Rotation

Suppose:

z = re^(iθ)

Multiplying it by:

e^(iφ)

gives:

z’ = re^(i(θ+φ))

In simple terms, multiplication by a complex exponential can rotate a point.

This gives us a very elegant mathematical mechanism for representing rotations.

Instead of repeatedly manipulating sine and cosine equations, many rotation and oscillation problems become multiplication problems.

This idea appears in graphics, robotics, signal processing, physics and engineering.


5. Electrical Engineering and AC Circuits

One of the classic applications of complex numbers is alternating-current circuit analysis.

Electrical quantities such as voltage and current oscillate.

Instead of repeatedly working with expressions such as:

V(t) = V₀ cos(ωt + φ)

engineers can represent oscillating quantities using complex numbers and phasors.

Circuit impedance can be represented as:

Z = R + jX

where:

  • R = resistance
  • X = reactance
  • j represents √−1 in electrical engineering

The magnitude tells us the overall opposition to current, while the phase captures the relationship between voltage and current.

A difficult time-domain problem can often become a much simpler algebraic problem.


6. Signal Processing and Fourier Analysis

Suppose we have audio, vibration, radar, network or sensor data.

A signal that looks complicated in the time domain may actually contain combinations of simpler frequencies.

Fourier analysis decomposes signals into these frequency components.

Complex exponentials provide an elegant representation:

e^(iωt) = cos(ωt) + i sin(ωt)

This idea forms part of the mathematical foundation behind tools such as:

Fourier Transform

Discrete Fourier Transform (DFT)

Fast Fourier Transform (FFT)

These are used across:

  • Audio processing
  • Image processing
  • Telecommunications
  • Radar
  • Medical imaging
  • Vibration analysis
  • Sensor analytics
  • Spectral analysis
  • Scientific computing

Complex numbers therefore help us move between:

Time Domain ↔ Frequency Domain


7. Communication Systems

Modern communication systems depend heavily on amplitude and phase.

Wireless systems can encode information by changing these properties of a carrier signal.

For example, in Quadrature Amplitude Modulation (QAM), symbols can naturally be represented as points on a complex plane.

Think of a transmitted symbol as:

z = I + jQ

where:

  • I = In-phase component
  • Q = Quadrature component

The constellation of these complex-valued points represents digital information.

So when your phone communicates using sophisticated wireless networks, complex-number mathematics is operating underneath many layers of abstraction.


8. Control Systems

Complex numbers also appear naturally when studying the stability and behaviour of dynamic systems.

Engineers examine poles and zeros in the complex plane.

A pole might look like:

s = σ + jω

The real component can tell us about growth or decay.

The imaginary component relates to oscillation.

This makes the complex plane extremely useful for reasoning about:

Stability + Oscillation + Damping + System Response

Applications range from industrial automation to aerospace, robotics and power systems.


9. Quantum Mechanics

Complex numbers are fundamental to quantum mechanics.

Quantum states are represented using complex-valued wave functions.

A simplified representation might be:

ψ = a + bi

The directly observable probability is not simply ψ itself.

Instead, quantities involving its magnitude, such as:

|ψ|²

play a central role.

Here complex numbers are not merely a convenient calculation technique—they are embedded deeply in the mathematical framework used to describe quantum systems.


10. Computer Graphics and Robotics

Complex numbers can represent rotations elegantly in two dimensions.

If a point is represented by:

z = x + iy

multiplication by:

e^(iθ)

rotates the point through an angle θ.

This provides a compact way of understanding transformations.

For 3D rotations, related mathematical ideas extend into structures such as quaternions, widely used in robotics, aerospace systems, simulations and computer graphics.


11. Complex Numbers in Data Science and AI

Most introductory machine-learning models operate on real-valued data.

But complex-valued representations become useful when the underlying information naturally contains phase, frequency, waves or spectral characteristics.

Examples can arise in:

  • Signal classification
  • Radar analytics
  • Wireless communications
  • Medical imaging
  • MRI reconstruction
  • Audio processing
  • Computer vision
  • Spectral methods
  • Scientific machine learning
  • Complex-valued neural networks

This highlights an important lesson for data science:

The mathematical representation should follow the structure of the problem.

If the phenomenon contains magnitude and phase, forcing everything prematurely into purely real-valued representations can sometimes hide useful structure.


12. A Small Python Example

Python supports complex numbers directly.

z = 3 + 4j

print(z.real)
print(z.imag)
print(abs(z))

The result is:

Real part = 3

Imaginary part = 4

Magnitude = 5

Scientific Python libraries such as NumPy can also perform complex-valued numerical computations, Fourier transforms and linear algebra.

So the journey from:

i = √−1

to computational engineering is surprisingly short.


The Bigger Lesson

Complex numbers demonstrate something important about mathematics.

Sometimes mathematics advances not by solving a problem inside the existing system, but by expanding the system itself.

Natural numbers were not enough.

We introduced integers.

Integers were not enough.

We introduced rational numbers.

Rational numbers were not enough.

We introduced real numbers.

And real numbers were not enough.

We introduced complex numbers.

What initially looks “imaginary” can eventually become indispensable for describing reality.


WHY → WHAT → WHERE → WHEN → HOW

For learning complex numbers, I would approach the topic in this order:

WHY? Real numbers alone cannot conveniently represent every mathematical and physical phenomenon.

WHAT? A complex number combines real and imaginary components: a + bi.

WHERE? Signals, circuits, communications, control systems, physics, graphics, robotics and scientific computing.

WHEN? Especially when the problem involves oscillation, rotation, frequency, magnitude and phase.

HOW? Complex algebra, Euler’s formula, polar representation, Fourier analysis—and computational tools such as Python, NumPy, MATLAB and scientific libraries.

AI can increasingly help us with the HOW.

But understanding the WHY and WHAT remains essential if we want to know whether the answer actually makes sense.


Sunday Mathematics

The objective of this series is not mathematics for examinations.

It is mathematics for computer science, data science, AI, engineering, technology and decision-making—connecting equations with the systems around us.

Sunday Mathematics #3: Complex Numbers

From √−1 to signals, circuits, wireless communication, quantum mechanics, robotics and AI.

Sometimes the numbers we call imaginary help us understand the real world.

HSOPC — Harwani Systems https://www.harwanisystems.in/

TechAndTrain https://www.techandtrain.com/

Neil Harwani — LinkedIn https://www.linkedin.com/in/neil27/

Email: Neil@HarwaniSystems.in

Narrative and concept: Neil Harwani

Creation help: ChatGPT

#SundayMathematics #Mathematics #ComplexNumbers #DataScience #ArtificialIntelligence #Engineering #ComputerScience #SignalProcessing #FourierTransform #ElectricalEngineering #MachineLearning #QuantumComputing #Robotics #STEM #Education

Mathematics for Computer Science and Data Science – Sunday Mathematics: #2

Mathematics for Computer Science and Data Science

Why, What, Where, When and How These Concepts Matter

Post #1 on Sunday Mathematics here.

Data Science is much more than learning Python, SQL, or Machine Learning libraries. Mathematics provides the foundation that helps us understand why algorithms work, when to use them, and how to interpret results correctly. The following areas form the mathematical backbone of modern Data Science, AI, Computer Science, and GeoAI.


1. Linear Algebra – The Language of Data

Why?

Most datasets, images, videos, documents, and neural networks are represented as matrices and vectors.

What?

  • Vectors and matrices
  • Eigenvalues and eigenvectors
  • Matrix decompositions (SVD, QR, LU)
  • Dimensionality reduction (PCA)

Where?

  • Machine Learning
  • Deep Learning
  • Recommendation Systems
  • Computer Vision
  • Search Engines

Example

A photograph is simply a matrix of pixel values. PCA compresses large datasets while retaining important information.


2. Probability and Statistics – Managing Uncertainty

Why?

Real-world data is noisy and uncertain. Probability helps us quantify uncertainty and make informed decisions.

What?

  • Probability distributions
  • Bayes Theorem
  • Hypothesis testing
  • Confidence intervals
  • Regression models

Where?

  • Risk analysis
  • Medical diagnosis
  • Forecasting
  • Business analytics

Example

When Netflix recommends a movie, it predicts the probability that you will like it.


3. Calculus and Optimization – Learning from Data

Why?

Machine Learning models learn by minimizing errors.

What?

  • Derivatives and gradients
  • Partial derivatives
  • Gradient Descent
  • Convex optimization
  • Lagrange multipliers

Where?

  • Neural Networks
  • Deep Learning
  • Reinforcement Learning
  • Operations Research

Example

Training a neural network is like repeatedly walking downhill on an error landscape until the lowest error point is reached.


4. Discrete Mathematics – Logic of Computing

Why?

Computers work using logic, sets, graphs, and discrete structures rather than continuous mathematics.

What?

  • Mathematical logic
  • Set theory
  • Relations and functions
  • Graph theory
  • Combinatorics

Where?

  • Algorithms
  • Databases
  • Cybersecurity
  • Network analysis

Example

Social media friendship networks are graphs where people are nodes and relationships are edges.


5. Time Series Analysis – Understanding Change Over Time

Why?

Many datasets evolve with time.

What?

  • AR, MA, ARIMA models
  • Autocorrelation
  • Seasonality
  • Fourier Analysis
  • Spectral analysis

Where?

  • Stock markets
  • Weather forecasting
  • IoT sensors
  • Demand prediction

Example

Retail companies forecast future sales using historical sales patterns and seasonal trends.


6. Geospatial Mathematics – Understanding Location

Why?

Many decisions depend on “where” things happen.

What?

  • Coordinate systems
  • Map projections
  • Spatial interpolation
  • Spatial topology
  • Geodesic calculations

Where?

  • GPS systems
  • Urban planning
  • Agriculture
  • Disaster management
  • GeoAI

Example

Google Maps uses geospatial mathematics to determine shortest routes and travel times.


7. Category Theory – Mathematics of Abstraction

Why?

As systems become complex, we need higher-level ways to describe relationships and transformations.

What?

  • Objects and morphisms
  • Functors
  • Natural transformations
  • Monoids and monads

Where?

  • Functional programming
  • Distributed systems
  • Data pipelines
  • Advanced AI architectures

Example

Modern software frameworks use composable components that follow principles inspired by category theory.


How Everything Connects

A typical Data Science project uses all these areas:

  1. Linear Algebra stores and transforms data.
  2. Statistics helps understand uncertainty.
  3. Calculus & Optimization train models.
  4. Discrete Mathematics powers algorithms and data structures.
  5. Time Series Analysis handles temporal data.
  6. Geospatial Mathematics adds location intelligence.
  7. Category Theory helps design scalable systems and abstractions.

Final Takeaway

Think of Data Science as building a smart city:

  • Linear Algebra = roads and infrastructure.
  • Statistics = traffic measurements and uncertainty.
  • Calculus = optimization of routes.
  • Discrete Mathematics = traffic rules and network design.
  • Time Series = predicting future traffic.
  • Geospatial Mathematics = maps and navigation.
  • Category Theory = the architectural blueprint connecting everything together.

Together, these mathematical foundations transform raw data into knowledge, predictions, decisions, and intelligent systems.

Brief, practical examples for each major category in the mind map, illustrating how these mathematical concepts are actually used in computer science and data science:

1. Discrete Mathematics

  • Mathematical Logic: Designing the conditional logic (if/else statements) in a software program or optimizing SQL queries.
  • Set Theory and Relations: Managing relational databases, where a database JOIN operation is directly based on the intersection of two sets.
  • Graph Theory: Social network analysis (e.g., how Facebook suggests friends) or GPS navigation apps finding the shortest route using Dijkstra’s algorithm.
  • Combinatorics: Calculating the number of possible password combinations to evaluate cybersecurity strength.

2. Calculus and Optimization

  • Differential Calculus: Gradient Descent in machine learning, which calculates gradients (derivatives) to update weights and minimize error during neural network training.
  • Integral Calculus: Computing the Area Under the ROC Curve (AUC) to measure the performance of a classification model.
  • Mathematical Optimization: Tuning a Support Vector Machine (SVM) classifier to find the optimal hyperplane that separates two classes with the maximum margin.

3. Linear Algebra

  • Vectors and Matrices: Representing an image as a matrix of pixel values so a computer can process it.
  • Eigenvalues and Eigenvectors: Google’s PageRank algorithm, which uses the dominant eigenvector of a web-link matrix to rank webpages in search results.
  • Matrix Decompositions: Singular Value Decomposition (SVD) used in Netflix-style recommendation systems to uncover latent user preferences.
  • Dimensionality Reduction: Principal Component Analysis (PCA), which shrinks a dataset with 100 features down to 3 key features to make it easier to visualize and train.

4. Probability and Statistics

  • Probability Theory: Naive Bayes Classifiers calculating the probability that an incoming email is “Spam” based on the words it contains.
  • Probability Distributions: Using a Poisson Distribution to model and predict the number of users logging into a server during peak hours.
  • Statistical Inference: Running an A/B Test on a website to see if a blue button yields a statistically significant increase in clicks compared to a red button.
  • Regression Analysis: Using Logistic Regression to predict a binary outcome, such as whether a bank customer will default on a loan (Yes/No).

5. Geospatial Mathematics

  • Coordinate Systems and Projections: Converting raw GPS latitude and longitude coordinates into a flat, 2D map projection in Google Maps.
  • Spherical Geometry: Using the Haversine formula to calculate the actual flight path distance between London and New York over the Earth’s curved surface.
  • Spatial Analysis and Interpolation: Kriging to estimate pollution levels at an unmeasured city block based on data from surrounding air-quality sensors.
  • Topology and Spatial Relations: Defining geofences, such as an app triggering a notification when a delivery driver enters a 1-mile radius buffer around your house.

6. Category Theory

  • Fundamental Structures: Ensuring function composition in code is associative (e.g., making sure f(g(x)) behaves reliably in functional programming languages like Haskell or Scala).
  • Functors and Transformations: Using a .map() function in JavaScript or Python to transform every element inside a list without altering the list’s overall structure.
  • Monads and Monoids: Using a Monad to safely handle “Null” values or side effects (like API calls) without crashing a program or using Monoids in big data frameworks (like MapReduce) to parallelize data aggregation.

7. Time Series Analysis

  • Stochastic Processes: Modeling stock price movements as a Random Walk to simulate future market risks.
  • Time Series Modeling: An ARIMA model predicting next month’s electricity demand based on historical usage patterns over the last 5 years.
  • Frequency Domain Analysis: Using Fourier Transforms to clean audio data by converting the sound wave into frequencies and filtering out background hiss/noise.
  • Evaluation and Decomposition: Splitting retail sales data into its baseline trend, seasonal holiday spikes, and random noise to understand true business growth.

Concept Credit: Neil Harwani

Creation Help: ChatGPT, XMind and Gemini

📢 Stay informed:

Top 100 mathematics keywords for Data Science – Part 1

Whoever is teaching you data science without teaching you Mathematics especially optimization is not teaching it right to you. That’s my biggest learning from Master of Data Science at IIT Gandhinagar – it will take you good 2 years to learn the related mathematics in all four major areas below. It’s not possible to learn this mathematics in few weeks even months, it will take a year or two. Here are the top 100 mathematical keywords commonly used in Data Science, Machine Learning, and AI (sourced from ChatGPT):


1. Probability & Statistics

  1. Probability
  2. Random Variable
  3. Expectation (Mean)
  4. Variance
  5. Standard Deviation
  6. Skewness
  7. Kurtosis
  8. Probability Density Function (PDF)
  9. Cumulative Distribution Function (CDF)
  10. Bayes’ Theorem
  11. Conditional Probability
  12. Joint Probability
  13. Likelihood
  14. Maximum Likelihood Estimation (MLE)
  15. Prior Probability
  16. Posterior Probability
  17. Hypothesis Testing
  18. Null Hypothesis (H0H_0)
  19. Alternative Hypothesis (HAH_A)
  20. p-value
  21. Confidence Interval
  22. T-test
  23. Chi-square Test
  24. ANOVA (Analysis of Variance)
  25. Z-score
  26. Central Limit Theorem (CLT)
  27. Law of Large Numbers
  28. Binomial Distribution
  29. Poisson Distribution
  30. Normal Distribution
  31. Gaussian Distribution
  32. Exponential Distribution
  33. Log-normal Distribution

2. Linear Algebra

  1. Vector
  2. Matrix
  3. Scalar
  4. Tensor
  5. Eigenvalues
  6. Eigenvectors
  7. Determinant
  8. Singular Value Decomposition (SVD)
  9. Principal Component Analysis (PCA)
  10. Covariance Matrix
  11. Orthogonality
  12. Dot Product
  13. Cross Product
  14. Matrix Multiplication
  15. Rank of a Matrix
  16. Trace of a Matrix
  17. Identity Matrix
  18. Inverse Matrix
  19. Transpose of a Matrix
  20. Diagonalization
  21. Gram-Schmidt Process

3. Calculus & Optimization

  1. Derivative
  2. Partial Derivative
  3. Gradient
  4. Hessian Matrix
  5. Jacobian Matrix
  6. Chain Rule
  7. Gradient Descent
  8. Stochastic Gradient Descent (SGD)
  9. Learning Rate
  10. Loss Function
  11. Cost Function
  12. Objective Function
  13. Convex Function
  14. Concave Function
  15. Local Minimum
  16. Global Minimum
  17. Local Maximum
  18. Global Maximum
  19. Lagrange Multipliers
  20. Optimization
  21. Regularization
  22. L1 Regularization (Lasso)
  23. L2 Regularization (Ridge)

4. Machine Learning Metrics & Functions

  1. Accuracy
  2. Precision
  3. Recall
  4. F1-score
  5. ROC Curve
  6. AUC (Area Under Curve)
  7. Confusion Matrix
  8. True Positive (TP)
  9. True Negative (TN)
  10. False Positive (FP)
  11. False Negative (FN)
  12. Logarithm (Log)
  13. Exponential Function
  14. Softmax Function
  15. Sigmoid Function
  16. Activation Function
  17. Cross-Entropy Loss
  18. Mean Squared Error (MSE)
  19. Mean Absolute Error (MAE)
  20. Hinge Loss
  21. Kullback-Leibler Divergence
  22. Entropy
  23. Information Gain

These 100 mathematical keywords form the foundation of Data Science, Machine Learning, and AI.

Short list of good courses / links / books on Mathematics, Operating Systems and AIML / ChatGPT – Part 1

Here is a short list of good courses / links / books on Mathematics, Operating Systems and AIML / ChatGPT – Part 1:

Email me: Neil@HarwaniSystems.in