Sums of sines and cosines
Introduction
In signal processing applications you will inevitably stumble across a summation of cosines (or sines), where the argument of the cosines form an arithmetic progression. Specifically, let's consider summations of the form:
$$S_N(\theta) = \sum_{n=0}^{N-1} \cos(n \theta)$$
This looks rather intractable a first, but . . .
Summing weighted geometric series
Introduction
In various applications you may be confronted with summing a series that takes on the form $$\sum_{n=0}^{\infty} np^n$$. In this post we will explore a couple different ways to sum up this series, along with some extensions.
To warm up, let's start with the geometric series $$S = \sum_{n=0}^\infty p^n$$ (for . . .
Divisibility of a binary number by 3
In middle school you probably learned a simple "trick" to check whether a number is divisible by 3. Sum up the digits (recursively, if needed) and the original number is divisible by 3 if the computed sum is divisible by 3. Here is a twist: what if you only had access to the binary representation of the number? This could be the case in a . . .
Moments of the Exponential Distribution
The exponential probability distribution is very well understood and characterized. While there are many ways to derive the moments of the exponential distribution, there is one I enjoy in particular, so I am sharing it below. It relies on two simple concepts: integration by parts and recursion.
Problem setup
The exponential . . .
Min and Max of Independent Random Variables
When working with random variables, you might be confronted with the need to compute the distributions or statistics (e.g. mean) related to the $$\min$$ and $$\max$$ of those random variables. This could come up in the context of queuing theory, failure analysis, extreme value theory, etc. While you can find a large body of literature related . . .
Squaring a number that ends in 5
A simple math trick
This is a neat arithmetic trick to keep in your back pocket. I learned it back in high school and it stayed with me. It goes as follows:
Let's say you want to square a number that ends in 5. Separate the 5 from the remaining digits in the number. Let $$n$$ represent the number formed by those digits. For example, if the number you want to . . .