Home

Calculating Pi Using xQc

January 15, 2025 → Febuary 28, 2025
  • Basic Explaination

    This was a rather funny idea I had one day: Could you calculate pi by how many times a streamer says “chat”? Let me explain. There is an equation for a normal distribution, also called a bell curve, that includes pi in its equation. So if we calculate everything else in the equation then in theory we could calculate pi! So we just need data that would fit this bell curve and in this case it comes from a streamer saying the word “chat.” I decided to go with the most popular streamer, xQc as he has plenty of videos available and also says “chat” often. I had some experience before with AI, as I used to experiment with it in high school on my own, so I knew immediately we were going to be dealing with either an LSTM or CNN. I decided to go with the CNN as I thought that it would be easier, and faster, to train. This means that the data we are analyzing is going to have to be images, more specifically, log mel spectrograms. I collected this data by building an AI capable of detecting when xQc says chat. I collected over 20,000 samples from several videos posted and hand labeled them. I then trained a CNN AI model on this data. After weeks of tedious work, I got it working. I then plotted this data and rearranged the original equation such that I was solving for PI. After averaging the individual calculations for PI together I got 3.600 for my value of pi, which is not too far off from 3.1415! I had about a 14% error.