technical
-
Proof by Contraposition
•
2 min read
In mathematics, we often want to prove statements of the form P→QP\rightarrow Q, which reads “PP implies QQ.” Such a statement is true if QQ is true whenever PP is true, that is, when PP being true “forces” QQ to be true. An alternate but equivalent statement is the contrapositive ¬Q→¬P\neg Q\rightarrow \neg P, which…
-
Gas Station Problem
•
5 min read
In this post,I’d like to share the proof of a property of finite sequences that popped up when I was solving the Gas Station Leetcode problem a while back. It’s one of those statements that feels like it should be true, but you just don’t know until you prove it. The Original Problem There are…
-
Floyd’s Cycle Detection (Tortoise and Hare)
•
3 min read
Suppose we have a simple linked list and want to determine whether it contains a cycle. The most straightforward solution would be to traverse the linked list and store the values you see. If you ever see the same value twice, then there must be a loop. Otherwise, if you get through the entire list…
-
Boyer-Moore Majority Vote Algorithm
•
3 min read
Suppose we have a list of nn votes and we want to count which candidate received the most votes. The straightforward approach would be to iterate over the list, maintaining a count for the number of votes each candidate received, and then, once all of the votes have been processed, check and see which candidate…
-
Reservoir Sampling
•
3 min read
Suppose we’re running a raffle in which nn people enter and kk winners are selected. How would we select the winners once we have all the entrants? Well, we’d just do something like drawing kk names from a hat. Here, the fundamental operation is uniformly sampling kk items from a population of size nn, and…
-
What are containers?
•
1 min read
Containerization is the operating-system-level or application-level virtualization of resources so that applications can run in isolated environments called containers. Each container packages an application together with its configuration files, libraries, and dependencies, which ensures that it behaves the same regardless of where it is deployed. This “build once, run anywhere” property of containers makes them…
-
What is a content management system?
•
1 min read
A content management system (CMS) is a software application that simplifies the creation, management, and publishing of digital content. Rather than manually writing HTML, CSS, and JavaScript to build web pages, a CMS allows user to add, organize, design, and update content through a user-friendly interface. By allowing users to skip implementing website fundamentals from…
-
What is a virtual host service?
•
2 min read
A virtual machine is a system that is emulated on top of a physical machine. Virtual machines still function as if they are real, but their access to resources such as memory storage are virtualized, meaning that they don’t have direct access to the hardware. Virtual machines believe and act as if they are regular…
