How to Calculate Modular Exponentiation
Modular exponentiation is a exponentiation performed over modulus. It is used in many cryptographic algorithms. Modular exponentiation accepts three input integers, say x, y and n and computes...
View ArticlePrimality Testing — Part 4. Fermat’s Little Theorem and A Probabilistic Approach
Previous posts on primality testing are all trying to factor the input number. For a very large number with few hundreds of bits, it is difficult to compute in that manner. This post introduce a...
View ArticleBig Integer Arithmetic
Most of computer applications operates on small integers which can be represented by 32 bit integers. However, there are times we’ll need to deal with extremely big integers which can only be...
View ArticleBit Set
One specific usage of bits is to represent sets. Suppose we have a set of N elements {e1, e2, …, en}, and we want to select a subset of K (K <= N) elements. We can use a bit pattern to represent the...
View ArticleLinear Regression
This is some notes taken when I summarize the things learned after taking Andrew Ng’s machine learning course at coursera. Introduction Regression is a technique to model relationships among variables....
View ArticleLogistic Regression
This is some notes taken when I summarize the things learned after taking Andrew Ng’s machine learning course at coursera. Introduction Linear regression predicts continuous values. At times, we need...
View ArticlePerformance Metrics for Binary Classification
Binary classification classifies samples as either 0 (negative) or 1(positive). Depending on which class/label the sample data belongs to and its predication result, each sample fits in a cell of the...
View ArticleNaive Bayes
Bayes’ Theorem Let’s start from Bayes’ theorem, also referred as Bayes’ law or Bayes’ rule. P(A|B) = P(B, A) / P(B) = P(B|A) * P(A) / P(B) = P(B|A) * P(A) / (P(B|A) * P(A) + P(B|^A) * P(^A)) P(A):...
View ArticleSupport Vector Machine Concept: VC Dimension
Given a set of n samples , we want to label them as either -1 or 1. In total, there are possible label combinations. A class of learning machines H can be used to label the samples. If for each label...
View Article