Archive of posts in 2022
The longest all- substring of a random bit string
Given your probability of breaking the combo at each note, what is the probability distribution of your max combo in the rhythm game chart? I considered the problem seriously!
- Categories: math
- Tags: long paper, rhythm game, algorithm, probability
I made this, for the number of days in a week is prime
The number of days in a week is prime, so we cannot utilize weekly periods to help us remember periodical events unless the period is a multiple of 7. However, there may be something that we need to get reminded of which happens once per two days or three days. For example, I wash my hair once per two days and wash my clothes once per eight days. To solve the problem, I wrote a Ruby program to help remind me of those routines.
- Categories: programming
- Tags: selfhosting, linux, ruby
Using ntfy to warn me when my computer is discharging
I use udev and systemd to send a notification to my phone via ntfy automatically whenever my laptop is discharging.
- Categories: programming
- Tags: selfhosting, linux
How to construct mechanics in higher dimensions?
We can derive the equation of motion for mechanical systems in a Galileo universe with time dimensions and space dimensions by generalizing the principle of relativity and Hamilton’s principle.
- Categories: physics
- Tags: from zhihu, classical mechanics, imagination
When a supersonic airplane flies over your head
Suppose a supersonic airplane has Mach number . It flies horizontally. At some time, it flies past over your head at height . Then, the distance between you and it when you have just heard it is .
- Categories: physics
- Tags: from zhihu
Finding curvature radius physically
Sometimes the curvature radius of a curve can be found by using physical methods although it seems that you must use calculus to find it. In this article, the curvature radius of the curve at the point where the curvature radius is smallest is found by using physical methods without using calculus (with only high school knowledge). The answer is that the smallest curvature is exactly , and the point with smallest curvature is the vertex.
- Categories: physics
- Tags: from zhihu
A whirling point charge
In the vacuum, inside a fixed ring of radius with fixed charge uniformly distributed, there is a point charge with charge and mass moving in the plane of the ring due tue the electrostatic force. It moves in the small region around the center of the ring, and the motion is periodic along a closed curve. The area of the region enclosed by the curve is . Denote the distance from the center to the point charge as , and . Find the magnetic induction at the center of the ring.
- Categories: physics
- Tags: from zhihu
Solving ODE by recursive integration
By recursively integrating according to from , we can get the solution of the ODE with initial conditions as the limit of the sequence of functions.
An example of non-uniform elements: heavy elastic rope
To illustrate the concept about non-uniform elements, we study a simple problem: suppose a uniform heavy elastic rope has mass , original length , and stiffness , and find the mass distribution and length of it when hung vertically. We can use the element method to solve this problem, but the elements are non-uniform in terms of length. The elements add up to get the total length .
- Categories: physics
- Tags: from zhihu
Kinetic energy, momentum, and angular momentum of rigid bodies
In this article, we will find that the inertia matrix naturally appears when we calculate the kinetic energy or the angular momentum of a rigid body. Then, we introduce the concept of principal inertia . We also study how the inertia matrix changes under translations and rotations and how those transformations may lead to conclusions that can help us simplify the calculation of inertia matrices.
- Categories: physics
- Tags: rigid body, linear algebra, classical mechanics, from zhihu