mathgirl
mathgirl
Math Girl
24 posts
Hello! My name is Ben (she/they) and I am a physics major/math minor with a passion for math problems. Here you will find detailed explorations into many questions that illustrate interesting math concepts. Please send in math questions, I love trying to answer them! Fellow mathemeticians are encouraged to comment and add onto my work. My main blog is gelatinocomics
Last active 60 minutes ago
Don't wanna be here? Send us removal request.
mathgirl · 1 year ago
Text
Fun fact: by just using imaginary numbers, some Evil Math, and 101 rotating vectors You Can Create a shitty approximation of a fish.
75K notes · View notes
mathgirl · 3 years ago
Text
When Carl Friedrich Gauss, a mathematician so extra that there’s a loooong wikipedia entry titled “List of things named after Carl Friedrich Gauss”, was seven years old, his schoolteacher made the class add all integers from 1 to 100 (1+2+3+…+99+100). In this way, the students could practice addition in the time-honoured school tradition of learning math by getting bored to death, and the schoolteacher, presumably, could be left in peace for like an hour.
In a matter of seconds Gauss had an answer for him: 5050. See, he noticed a pattern:
Tumblr media
and 50 times 101 is 5050. Done and done.
I’m not sure if history recorded the schoolteacher’s reaction, but technically the exercise failed. Seven-year-old Gauss did NOT, in fact, practice addition. He practiced his right to be lazy instead, and that’s how progress is made.
412 notes · View notes
mathgirl · 3 years ago
Text
Orbital simulations
Tumblr media
Today I’d like to share something I did as a project for a computational physics class. I had just learned how to solve ordinary differential equations (ODEs) in python, which gave me the tools to explore lots of physics questions: if I could describe the forces in a system using differential equations, I could set up my system in whatever configuration I want and see what happens when I let it go.
I decided to try this using the equations for Newtonian gravity between celestial bodies. I went the extra mile and learned how to animate my results, to better visualize how objects move through space. I also had the chance to try out some unusual configurations of objects, including ones that are chaotic and ones that use all three dimensions. Keep reading to see the equations and the neat animations they create!
One object
Let’s take a look at how gravity works on a single object first. We’ll write this as the acceleration due to gravity, or the second time derivative of our object’s position vector.
Tumblr media
This is the simplest case, where we assume our object is orbiting around a stationary object at the origin with mass M. Our object’s acceleration always points toward the center, and gets stronger the closer to the center it is.
Now, in order to compute the motion of our object with that acceleration, we need to write it as a group of ordinary differential equations (ODEs). We’ll be using just two dimensions for now, so we’ll split up the equations for X and Y motion. We’ll need a summary of the object’s state at any given point: its x position, y position, x velocity, and y velocity. We need to provide the derivative of each of those state variables. Take a look and confirm that these all make sense given the acceleration above:
Tumblr media
With this information, the ODE solver can work its magic: if we provide it with an initial state for our object to start at, it will integrate the above equations and show us how the state variables change. It’s basically a motion simulator!
In the following animation, our object is represented by the blue circle, and the black circle is the stationary mass at the center. I started my object away from the center, with a small upward velocity. The result is an elliptical orbit!
Tumblr media
You could easily play around with the variables and see what changes. I set all the constants to unit values, but what if the mass at the center was greater? What if you start your object with a greater velocity? You might even see different types of trajectories under certain conditions. For example, if you go fast enough, the object will escape the system entirely!
But enough of that, let’s get real. Objects in real life don’t just stay stationary at the origin. They get accelerated by gravity too. Let’s see what happens when we let two objects move under each other’s gravity.
Two objects
The situation gets more complicated now that we need to keep track of the motion of two objects. We’ll call them objects 1 and 2, and their accelerations depend on the location of the other one:
Tumblr media Tumblr media
It’s a lot to keep track of, but it’s not so complicated when we look at just the x and y directions. All we’re concerned with is the difference of the two objects’ coordinates. Here’s how it looks for object 1:
Tumblr media
Using the same method as earlier, we generate a set of ODEs for every state variable, of which there are now 8 instead of 4. Instead of showing you all that, I’ll cut to the chase and show you the result when we set two objects of equal mass in motion.
Tumblr media
When I give each object a small initial velocity in opposite directions, they dance around each other like so. They each have an elliptical orbit about their common center of gravity. You’ll see motion like this in the orbit of any two objects of similar mass, such as Pluto and Charon, or a binary star system. On the other hand, if we modify the variables so that one object is much more massive than the other, you’d end up with something that looks more like our first animation, but with the heavy object only moving slightly.
Three objects
Why stop at two? We can include as many objects as we want! We’ll just have to... re-write all our differential equations again. Yeah, you might be seeing now that this method isn’t sustainable for ever increasing numbers of objects. The acceleration of a single object in our system will now depend on the location of two others. It’s as simple as adding up the acceleration due to gravity from each object:
Tumblr media
Or for a single component:
Tumblr media
Furthermore, a third object means that motion can now happen outside the plane, so three dimensions are necessary to fully explore all the configurations. Three objects and three spatial coordinates means that my ODE solver needs a whopping 18 state variables, but it can handle the work just fine. I feed it all the differential equations and decide on some initial conditions to let it try.
How about we arrange three equal masses on the edge of a circle, equal distances apart? If we set them all off with the same radial speed, they should simply follow each other in a circular path, or maybe even dance around each other in elliptical paths like our previous animation. Here are the results of that:
Tumblr media
Despite such a promising start, the motion ends up chaotic! It turns out that, for all but very specific initial conditions, three equal masses will never exhibit stable motion. My idea was sound: three objects positioned in a circle with the same radial speeds should result in simple orbit, but it’s an unstable equilibrium, and the slightest deviation (such as uncertainty in the initial conditions or the numerical solution) will result in chaos. If you want to read more about this phenomenon, the three-body problem is a well known topic in physics.
Don’t give up yet, there are still ways we can create a stable orbit using three objects. Think about the sun-earth-moon system: two small objects can orbit one large object with no problems. Choose one object to be our “planet”. Let’s increase the “sun” object’s mass by 100 times, and reduce the “moon” object’s mass by 100 times, then arrange them just so and let them go.
Tumblr media
Another similar idea: have one small “planet” orbiting around two large binary “stars” that are orbiting each other.
Tumblr media
With the right choice of masses, we can achieve stable orbits. We must only look to nature for examples.
Into the third dimension
Tumblr media
We can get even crazier with our configurations of three objects if we leap out of the plane. Here’s one example called the Sitnikov Problem, which states that if two objects of equal mass orbit around each other, a third smaller mass can oscillate perpendicular to their plane of motion, threading their center of gravity like a needle.
Since we’ve already set up our ODE solver with three spatial dimensions, it’s not hard to choose the initial conditions that make this work. We’ll just need a little fancier plot to show it off.
Tumblr media
If you think carefully about this configuration, you’ll probably notice that it’s an unstable equilibrium. The central mass must stay exactly on its line, or else it will be pulled away. Thankfully the computer can handle this just fine, since the central mass’s x and y coordinates can simply remain at zero.
The way I set it up, the two large masses are orbiting along a circular path. But if we change their speed so they orbit on elliptical paths, an interesting behavior arises: the central mass’s motion becomes chaotic. Still constrained to its line, but unpredictable. This is due to the way its gravitational potential changes as the large masses move in and out.
Tumblr media Tumblr media
Pictured above is the position of the central mass over time. Indeed, testing confirms that its motion is sensitive to initial conditions, and thus fits the definition of chaos. Fun!
In conclusion...
My takeaway from this project is that differential equations are a very powerful tool for exploring the behavior of physical phenomena. Every simulation above is based on the differential equation for gravitational force, but you could create similar simulations for any dynamical system your heart desires.
Additionally, my increasingly complicated differential equations made me wonder: if I wanted to simulate a large number of objects interacting under gravity, what method would I use? What approximations would I make to simplify the calculations? Lots of interesting ideas there.
24 notes · View notes
mathgirl · 4 years ago
Text
This is a really nice explanation! I was interested in getting to the bottom of this problem myself, so I decided to draw it up as a graph to visualize it a little differently:
Tumblr media
Each dot (vertex) represents a room, with an extra one labeled zero for the outside, and each line (edge) represents a direct opening between those two rooms. This is a mathematical “graph,” defined by its vertices and edges, that represents any way you can move from one room to another. For example, room 1 is connected to rooms 2, 3, and 4, and has two openings to 0, the outside.
What we’re looking for in this graph is something called an Eulerian path (or an Eulerian trail)-- a continuous line drawn along the edges of this graph that visits each edge exactly once. We need to know whether it’s even possible to find an Eulerian path in this graph. From Wikipedia, here’s the relevant bit we need to know this:
An undirected graph has an Eulerian trail if and only if exactly zero or two vertices have odd degree, and all of its vertices with nonzero degree belong to a single connected component.
Some vocabulary:
Undirected graph: a graph where the edges don’t come with a specified direction. Our graph is undirected, since you can move between rooms (or along the lines) in any direction you like.
Degree: the number of edges connected to a vertex. For example, vertex 1 has a degree of 5 since that’s how many lines are coming out of it, while vertex 0 has a degree of 9. A vertex with odd degree would have an odd number as its degree.
Connected component: A piece of a graph where you can travel between any two vertices by some path, directly or indirectly. Since our graph is one connected shape and there are no separate pieces floating around, we can ignore this part.
Count up the degree of each vertex on our graph, and you’ll see that they have degrees of 5, 5, 4, 5, 4, and 9 for the outside. There are four vertices with an odd degree. This isn’t exactly zero or two, and therefore, our theorem tells us that there is no Eulerian path in this graph. Therefore, there is no way to travel through each opening exactly once.
This is exactly what @chongoblog​ just explained very clearly and concisely! But well, if you like lingo, there you go. Next time you see a problem like this, try drawing its corresponding graph! It may make the problem easier to process.
I need to credit our old friend Euler for doing the heavy lifting on this problem. As it happens, he famously tackled a very similar problem long ago, known as the Seven Bridges of Königsberg, which actually laid the foundation for modern graph theory! It was a question about whether you could plan a path around the city that crosses each of its seven bridges exactly once.
Tumblr media
Why don’t you try drawing the graph to this one and see if you can find the answer?
Haters be like
Tumblr media
“It’s totally possible to make a path that goes through every door exactly once”
256K notes · View notes
mathgirl · 4 years ago
Text
I love this addition! Isn't it crazy that we can use such unimaginably huge numbers to rule out the possibility of something so simple happening by random chance?
Do you think, in the whole history of Minecraft, any two players have ever generated the same random seed and therefore started on the exact same world, just by chance?
I thought about this while watching random seed minecraft speedrun attempts, where runners will constantly generate new worlds and try to beat the game in a random new world each time. I’m going to investigate the probability, but it would involve a guess about just how many new worlds are randomly generated every day. Any ideas?
364 notes · View notes
mathgirl · 4 years ago
Text
So it seems we’re all getting answers that basically round to zero. Your approximation is mostly dominated by the 1/e^n term, which is very small for n as large as 2 billion. @galois-groupie​ attempted an approximation as well, which resulted in another negligible result. And I opted to try this Taylor approximation that wikipedia provided for the generalized birthday problem:
Tumblr media
(note that this is the probability of getting two same birthdays, not the probability of all unique birthdays, so it’s the opposite of the result you guys found. Plugging in 2^48 for d and 2 billion for n gives a result that rounds to 1.)
So what does this mean for Minecraft? I think it’s safe to say that the chance of every randomly generated seed being unique is negligibly small, meaning it’s certain that two people somewhere have rolled the same seed. In fact, there are probably lots of seed soulmates out there. If you believe, then there’s a chance your favorite speedrunner may have stumbled across your own world seed while they were going for the world record.
I think the reason the result is so clear hearkens back to the birthday problem itself. Out of 365 possible birthdays you can have, the chance of two people sharing a birthday ramps up really fast for every person you introduce to the group.
Tumblr media
This makes sense if you think about the number of pairs of people in a group, since that’s what you’re really checking when looking for a match. For every person you add, the web of pairs grows more complex. In the case of Minecraft, the number of pairs you can draw between 2 billion worlds is absolutely enormous. I just guessed those numbers, but I’m sure you’d get a similar result no matter what reasonable estimate you make.
This was a fun exercise! Thanks for the help. And good luck finding your Minecraft soulmate.
Tumblr media
Do you think, in the whole history of Minecraft, any two players have ever generated the same random seed and therefore started on the exact same world, just by chance?
I thought about this while watching random seed minecraft speedrun attempts, where runners will constantly generate new worlds and try to beat the game in a random new world each time. I'm going to investigate the probability, but it would involve a guess about just how many new worlds are randomly generated every day. Any ideas?
364 notes · View notes
mathgirl · 4 years ago
Text
Sources are telling me that Minecraft has sold over 200 million copies. Some of those copies are owned by avid players who have generated hundreds or even thousands of new worlds during their lives. I’d imagine many more copies are owned by people who haven’t spent much time on it, and only created one or two new worlds, or even zero.
I’m gonna take a wild guess and say the average number of new worlds generated in any given Minecraft game is 10. With 200 million copies sold, this estimates that 2 billion worlds have been generated and played in.
The Minecraft fan wiki tells me that in Java edition, there are 2^48 possible seeds that can generate meaningful, unique worlds. (To keep things simple, I’m ignoring differences between bedrock and java editions here.)
The question I’m asking is: what are the chances that two players have ever generated the exact same seed by chance? Or inversely: what are the chances that every seed generated so far has been unique? This is equivalent to the Birthday Paradox, which I’d love to discuss in detail, but I’ll try to keep it brief.
The birthday paradox asks the question: in a room full of people, what are the chances that two people share the same birthday? You can think of a person’s birthday like some random value from 1 to 365 that is assigned to them (excluding February 29 for the sake of simplicity; sorry leap year babies). Any two people have a pretty low chance of having the same birthday, but this problem is called a paradox because the answer isn’t intuitive, and the odds are higher than you’d expect. In a room of 23 people, there’s a more than 50% chance that two individuals share a birthday.
Rather than going over the math here, I’ll let you check it out on wikipedia, but it basically boils down to this: add people to the group one-by-one, and check the likelihood of everyone in the group having a different birthday. The first person is alone, and therefore has a 100% chance of having a unique birthday. Add a second person. In order for their birthday to be unique, it has to fall on one of the 364 days that aren’t the first person’s birthday, giving them a very high 364/365 chance of having a unique birthday. The pool of possible unique birthdays shrinks again for the third person, but they still have a 363/365 chance of being unique. And so on.
I won’t get into the pigeonhole principle, fascinating as it is, since it isn’t relevant to our Minecraft problem. Hopefully you can see that if you replace the days of the year with possible random seeds, and replace people in a room with randomly generated seeds, it’s the same exact question.
Wikipedia helpfully shows us how to calculate the probability that a group of n people all have unique birthdays, and gives us this formula:
Tumblr media
Just replace 365 with our total potential number of seeds (2^48) and interpret n as the number of randomly generated worlds, and we’re well on the way to finding the chance that every generated world has been unique.
Er... the only problem is, these are quite big numbers to be calculating factorials and binomial coefficients for. I’m kind of scared to ask a machine to do that for me. Luckily, Wolfram Alpha has a built in birthday paradox calculator, but... it’s not quite up to the task either.
Tumblr media
Um... help?
(This can be done with some kind of approximation, and I’ll try to tackle it later if nobody else gives it a shot)
Do you think, in the whole history of Minecraft, any two players have ever generated the same random seed and therefore started on the exact same world, just by chance?
I thought about this while watching random seed minecraft speedrun attempts, where runners will constantly generate new worlds and try to beat the game in a random new world each time. I'm going to investigate the probability, but it would involve a guess about just how many new worlds are randomly generated every day. Any ideas?
364 notes · View notes
mathgirl · 4 years ago
Text
Do you think, in the whole history of Minecraft, any two players have ever generated the same random seed and therefore started on the exact same world, just by chance?
I thought about this while watching random seed minecraft speedrun attempts, where runners will constantly generate new worlds and try to beat the game in a random new world each time. I'm going to investigate the probability, but it would involve a guess about just how many new worlds are randomly generated every day. Any ideas?
364 notes · View notes
mathgirl · 4 years ago
Text
Tumblr media
9K notes · View notes
mathgirl · 4 years ago
Note
explain to me how gears are machined!
wohaohowhao. gears are impossibly difficult to fabricate. way, way beyond what people might expect looking at them. “oh, it is just a shape, it is simple” - imbeciles. morons
this will be VERY LONG and i am doing most of you idiots a favor by putting this here:
Keep reading
7K notes · View notes
mathgirl · 4 years ago
Video
You can give kinetic energy to an object but you can’t control what it does with it!
tumblr
You can cook a chicken by slapping it at 3725.95 mph, an impossible task by any human means. If you do succeed however, you will not only cook the chicken but also decimate its entire structure, causing a violent explosion. This is a simulation of the slap using FEA. 
source
57K notes · View notes
mathgirl · 4 years ago
Text
all of the numbers that are divisible by 17 sound so absurd. 51? 68? 85? ridiculous. 102? absolutely not. and don't even get me started on 119
131K notes · View notes
mathgirl · 4 years ago
Text
Visualizing item storage
When I’m estimating the amount of resources I’ll need for a build in Minecraft, it helps to remember just how big a stack of blocks really is. A “stack” in Minecraft is 64 items, which is very conveniently a power of 2, so it divides up nicely. A stack of items can fit in an 8x8 square, or a 4x4x4 cube.
Tumblr media
[ID: A screenshot of two block formations in a Minecraft grassland biome. On the left is a horizontal square of polished diorite and polished granite, eight blocks wide and color coded into four-by-four quadrants. On the right is a cube four blocks wide, made of alternating horizontal stripes of polished diorite and polished granite. Each formation is labeled with its dimensions. End ID]
(As a neat visual trick, notice how you can “split up” the 8x8 square and stack the pieces together to make the 4x4x4 cube. Powers of 2 are fun like that.)
It’s not really a lot when you look at it like that! That’s why I always remember to bring lots of stacks when I’m working on a big project in survival mode.
While I was in my creative world, I decided to see what a bigger collection of items would look like. Let’s say you have a standard chest filled up completely with stacks of blocks... what would that look like if you take them all out?
A standard chest has 27 slots, so the maximum number of blocks it can hold is 27 * 64 = 1,728. Extra conveniently, 27 is another nice cube number, and we already know what a single stack of blocks looks like. So imagine taking some of those 4x4x4 cubes (64 blocks) and stacking those into a 3x3x3 cube, and you’ll see what a chest full of blocks looks like:
Tumblr media
[ID: A screenshot of a large cube made of polished diorite and polished granite in a Minecraft grassland biome. Each edge is twelve blocks long, and it is divided into cubes of alternating material four blocks wide each. It is labeled with its dimensions. End ID]
(A double chest would just contain twice as many blocks as this, so you can imagine stacking another one of these on top of itself. Not interesting enough for me to build a whole other cube. Moving on!)
This is quite a lot of blocks to fit inside a tiny little chest. It has a really big storage density! In fact, if you are so bold, you might say that the chest has a density factor of 1,728, since it can fit that many blocks inside a one-block space.
But we can go denser.
A shulker box has the same storage capacity as a standard chest, but it can be placed inside a chest. Imagine a standard chest full of shulker boxes, each completely filled with stacks of blocks. What would that look like if you empty it all out?
Well, a full shulker box would contain the same amount as a full chest: 64 * 27 = 1,728 blocks, or the 12x12x12 cube pictured above. Our chest can fit 27 of these filled shulker boxes, making our new total a whopping 64 * 27 * 27 = 46,656. Notice that 27 is still a cube number. So to build this monstrosity, we do the same thing as before: arrange these massive blocks into a 3x3x3 cube like so.
Tumblr media
[ID: A screenshot of a giant cube made of polished diorite and polished granite in a Minecraft savannah biome. Each edge is 36 blocks long, and it’s divided into cubes of alternating material twelve blocks wide each. It is labeled with its dimensions. The cube stands next to a savannah mountain, which is a little taller than it. End ID]
(Mountain for scale. This is getting ridiculous.)
You sure could build a lot of stuff with that!
To my knowledge, this is the greatest possible storage density in the game, at 46,656 blocks stored in a one-block space. But if you’re counting items rather than blocks, there are even greater possibilities: for example, a gold nugget can be “stored” in a gold ingot, which can in turn be stored in a gold block. The storage density of gold nuggets would then be many orders higher if you store them in the form of gold blocks. I’ll leave it as an exercise to the reader to find out just how many nuggets you can store in one chest.
21 notes · View notes
mathgirl · 4 years ago
Text
Wow, I haven’t really been using this blog much huh? Sorry to all the new followers that are coming in-- I have a few posts in mind, I just haven’t gotten around to writing them!
If you want more content, send some asks maybe? Math questions or questions about my personal background, whatever you want (I love talking about my time in college)
Also I’ve been playing minecraft again, so maybe expect some math posts about that? I saw a post a while ago about how to find a stronghold using just two ender pearls, and I want to expand on that because it’s a clever method that involves some trig. Fun!
0 notes
mathgirl · 5 years ago
Photo
Tumblr media
I’m thinking about this comment I saw on a math video
(here it is, it’s very interesting if a little terrifying)
465 notes · View notes
mathgirl · 5 years ago
Text
Tumblr media
No exaggeration here
Tumblr media
328 notes · View notes
mathgirl · 5 years ago
Text
One of the striking things about math education for me is that most of the common objections to how the material is taught have really simple answers, but I have never in my life heard a math instructor provide those answers.
For example, something you hear a lot is: “why am I losing points for not showing my work when I got the correct answer?”, or even “why are we being told to use this procedure at all when the answers are so obvious?”.
There answer to both of those questions, of course, is: “Because what’s actually being taught is a problem-solving method that works for big and complicated problems as well as small and simple ones. We practice it with the simple ones first so that you can easily compare your intuitive solution with the results of applying the method and know whether you did it right. That way, when we get to the complicated ones where the intuitive approach doesn’t work, you can have confidence that you practised the method correctly.”
Not once in two decades of schooling did I hear that rationale offered – if an instructor deigned to address the objections at all, their response typically boiled down to some variation of “because this is how it’s done”.
Like, what’s difficult about this?
8K notes · View notes