Skip to main content

Larry's Blog 🌊

math, code and fun



Virtual Environment: Why and How?

Posted: April 22, 2023 #Python
This post is based on a Youtube video by teclado, which I belive, is the clearest explanation of virtual environment for python available online. Table of Contents: Why do we need virtual environment for Python projects? Python versions on your Mac Default python directory Install virt...

Selection Sort

Posted: December 9, 2022 #Algorithms
The selection sort algorithm sorts an array by repeatedly finding the minimum element (considering ascending order) from the unsorted part and putting it at the beginning. The algorithm maintains two subarrays in a given array. But be noted that we don’t create two arrays, but operate the whole ...

Radix Sort

Posted: December 9, 2022 #Algorithms
This post is based on Geeksforgeeks, Brilliant and Interview Kickstart. The lower bound for the comparison based sorting algorithm (Merge Sort, Heap Sort, Quick-Sort .. etc) is $O(n \log n)$. They cannot do better than that. Counting sort is a linear time sorting algorithm that sort in $O(n+k)$ ...

Counting Sort

Posted: December 9, 2022 #Algorithms
This post is based on two posts by Geeksforgeeks and interviewcake. First thing first, what’s counting sort? Counting sort is a sorting technique based on keys between a specific range. It works by counting the number of objects having distinct key values (a kind of hashing). Then do some ar...

Bucket Sort

Posted: December 9, 2022 #Algorithms
This post is based on Geeksforgeeks and Javapoint. Bucket sort is mainly useful when input is uniformly distributed over a range. By custom, this range usually is from 0 to 1. For example, consider the following problem: Sort a large set of floating point numbers which are in range from 0.0 to...

If X Then Y - Sufficiency and Necessity

Posted: November 11, 2022 #Math123
If Then Format If then is one of the most important and common logic format we see everyday. When we see if X, then Y, the relation can be represented symbolically as: \[X \rightarrow Y\] This is a cause and effect relation, a logically equivalent one is called its contrapositive: \[\neg Y \r...

Proof of Trigonometry Limit Theorem

Posted: October 5, 2022 #Math123
The trigonometry limit theorem $\lim_{x \rightarrow 0} \sin x / x$ is so important that it is sometimes called the fundamental trig limit theorem in calculus. This post is about the proof of this theorem. Read more

Compare 99 to the power of 100 and 100 to the power of 99

Posted: October 4, 2022 #Math123
There are a lot of ways to compare these two numbers. Today, we are going to use a bit knowledge from calculus to do our job. Read more

The Definition of Natural e as A Sum of Binomial

Posted: September 24, 2022 #Math123
For a binomial of $(1+ 1/n)^n$, when $n$ goes to infinity, we conclude that the sum of the binomial approaches natural number $e$. This post elaborates how we reach this conclusion. Read more

Basic Definitions and Theorems about Number Theory

Posted: September 3, 2022 #Math123
Trivia Definitions Let $a$ and $b$ be integers with $a \neq 0$. We say $a$ divides $b$, denoted by $a \mid b$, if there exists an integer $c$ such that $b=ac$. And we say that $a$ is a divisor (or factor) of $b$, and $b$ is a multiple of $a$. If $a$ does not divide $b$, we write $a ∤ b$. If $...
« Prev (1) 2 3 4 5 Next »