KF Math Thread - Discuss Math

  • 🐕 I am attempting to get the site runnning as fast as possible. If you are experiencing slow page load times, please report it.
Anyone else find this throws them for a loop? If so, why? If not, also why? The maths is trivial. I have no problem following it. But the implications are bizarre. It's a kind of mental illusion where you appear to have the same event described differently by two contradictory mathematical models, implying that maths is aware of past events. But the awareness is on the part of the person not the maths, that's the illusion.
It's one of those things that caused me an issue at first, and I actually had to think a while to get over it. It's maybe a smarter person's version of the "how would you feel if you didn't have breakfast" meme. Once you do, though, it's easy, and it makes a lot of other things make more sense, too.

If you have ever done gambling PvP for profit, like poker, a lot of the profit is in people literally refusing to even understand Bayesian logic (although like you point out a frequentist approach gets you to exactly the same result).

It's almost insane if you ever try to explain the Monty Hall "paradox" (which isn't) to someone who literally can't grasp it. Or worse, and possibly even dumber when it's a person who COULD grasp it, when they absolutely refuse to understand it.

It's also hilarious if they actually get mad while being totally wrong. I used to post variants of Monty Haul to 4chan and it would instantly ignite a huge thread of idiots arguing about it, being right, being wrong, trolling and pretending to be wrong, etc.

And I like you actually did a Monte Carlo simulation of it. It's the sort of thing that makes it absolutely clear that it's true, but then you have to think "why?"

THE MOAR YOU KNOW the better your luck is.
 
It's one of those things that caused me an issue at first, and I actually had to think a while to get over it. It's maybe a smarter person's version of the "how would you feel if you didn't have breakfast" meme. Once you do, though, it's easy, and it makes a lot of other things make more sense, too.

If you have ever done gambling PvP for profit, like poker, a lot of the profit is in people literally refusing to even understand Bayesian logic (although like you point out a frequentist approach gets you to exactly the same result).

It's almost insane if you ever try to explain the Monty Hall "paradox" (which isn't) to someone who literally can't grasp it. Or worse, and possibly even dumber when it's a person who COULD grasp it, when they absolutely refuse to understand it.

It's also hilarious if they actually get mad while being totally wrong. I used to post variants of Monty Haul to 4chan and it would instantly ignite a huge thread of idiots arguing about it, being right, being wrong, trolling and pretending to be wrong, etc.

And I like you actually did a Monte Carlo simulation of it. It's the sort of thing that makes it absolutely clear that it's true, but then you have to think "why?"

THE MOAR YOU KNOW the better your luck is.
It's definitely something I need to think about a little more to really make it intuitive and click for me. The maths side is trivial to work out. The underlying concept / meaning I sort of get but I'm not quite there yet. I find probability the most interesting area of mathematics to me personally. I really should blow the cobwebs off my mathematics knowledge and re-learn a lot of this stuff.
 
It's definitely something I need to think about a little more to really make it intuitive and click for me. The maths side is trivial to work out. The underlying concept / meaning I sort of get but I'm not quite there yet. I find probability the most interesting area of mathematics to me personally. I really should blow the cobwebs off my mathematics knowledge and re-learn a lot of this stuff.
To pick a practical example, imagine you're playing holdem and worried the other guy has pocket aces. The odds of that are slim (randomly the odds of getting dealt pocket aces is 1 in 221) (obviously the odds are different if you yourself have one or two aces or have none and there are one two or three aces on the flop), so you assume they don't. Do you continue assuming the odds are that slim after they raise you repeatedly?

This is sort of a basic principle. Your calculation of the odds is improved by taking account of new information.

To make it more obvious, suppose you speculate a random player who NEVER raises without the absolute best hand. He raises. What are the odds he has the absolute best hand?

They suddenly shot to 100%.
 
To pick a practical example, imagine you're playing holdem and worried the other guy has pocket aces. The odds of that are slim (randomly the odds of getting dealt pocket aces is 1 in 221) (obviously the odds are different if you yourself have one or two aces or have none and there are one two or three aces on the flop), so you assume they don't. Do you continue assuming the odds are that slim after they raise you repeatedly?

This is sort of a basic principle. Your calculation of the odds is improved by taking account of new information.

To make it more obvious, suppose you speculate a random player who NEVER raises without the absolute best hand. He raises. What are the odds he has the absolute best hand?

They suddenly shot to 100%.
See, that wouldn't work against me because I don't know what is a pocket ace, what the flop is, or even what beats what in poker. So all the information you derive from me raising is in fact false. I'd probably be the world's best bluffer at poker, because there are good odds that I genuinely think my crap hand is a winner.

But I see where you're going with this in principle. ;) Thanks for the explanation.
 
If they switch there is no logical difference between having picked the other door in the first place.
That's the secret - "switching" and "picking" a door are two subtly different inputs.

When you switch you already have a door pre-selected. Thus the 2/3rd odds.

When you pick, you don't have the prior state of the pre-selected door. This is the secret sauce of why the problem is so counter-intuitive, because most people see it as a stateless problem, when it is actually very heavily dependant on you having made an initial choice, and Monty revealing the goat. That's a stateful computation.
 
Some complex geometry using scalar multiples and phase shifts of the natural log spiral. My original goal was to model some closed-eye visuals I saw on shrooms.

radial_001a.webpradial_001b.webpradial_001c.webp
radial_001d.webpradial_001e.webpradial_001f.webp

The complex plane has always fascinated me. It's a real mindfuck once you realize infinities appear everywhere in nature, taking the form of circles—simple expressions of infinity.
 
See, that wouldn't work against me because I don't know what is a pocket ace, what the flop is, or even what beats what in poker.
I'm using it as an oversimplified example, since that player doesn't exist, but it's a lot easier to grasp the concept that if something ONLY happens when a certain condition is met, that thing happening makes it an absolute certainty that the underlying condition is, in fact, met.

The other forms of inference are merely recognizing that the probability (that you know about) has changed with the new information, not to 100% or 0% but to something greater or lesser.

Imagine a die rolled and hidden under a box. You can guess any number at random, or even exactly the same number every time, and have exactly the same chance of getting the right number. What the die actually is is already determined, but you have no useful information about it. Now if you know it's loaded to roll a 6 more often, you'd guess 6 every time. You wouldn't always be right, but you couldn't improve your chances with any other strategy.
 
See, that wouldn't work against me because I don't know what is a pocket ace, what the flop is, or even what beats what in poker. So all the information you derive from me raising is in fact false. I'd probably be the world's best bluffer at poker, because there are good odds that I genuinely think my crap hand is a winner.

But I see where you're going with this in principle. ;) Thanks for the explanation.
It may help to reframe how you think of probability around the concept of the random variable. For an event to have a "chance" of happening, there inherently needs to be some degree of uncertainty in our minds as to whether that event will actually occur. In other words, we need to ask ourselves "Is this event probable or inevitable?". If an event is inevitable, then the probability of it happening is 100% (when such event will occur in time is a whole other can of worms).

This can get a bit philosophically murky at times, but mathematically it's pretty straightforward if you accept that a person can't have knowledge of the infinite past and future (see Heisenberg's uncertainty principle). Thus, we often can make only educated guesses (based on probabilities) that an event will happen. "God only knows."
If we have some sort of advance knowledge of what outcomes happen when (e.g. what sits behind door 2 in the gameshow), then we're no longer making choices at random.

In the case of the gameshow, it's important to remember we're strictly modelling the chances of a desired outcome (car vs goat); we want to focus on the outcome of each action taken. For the host opening a door after you pick your first door, the outcome is guaranteed by the original wording of the problem to be a goat being revealed. For our first door choice, it's out of 3 choices. We can treat the 2 doors we didn't pick as a group/block with a 2/3 chance of having the car behind one of them. 1/3 + 2/3 = 3/3.

In this "block", the host will reveal a goat in that block 100% of the time, so the chances of each outcome in the 2/3 block remain the same (the block either has the car or it doesn't). Since you only have one remaining door choice you could switch to in that block, this 2/3 block can only be chosen in one way (you switch to it or don't).

It's a bit like answering "no preference/neutral" on a survey in that it's basically the same as voting for each choice once or not voting at all.
 
Last edited:
  • Winner
Reactions: Overly Serious
In this "block", the host will reveal a goat in that block 100% of the time, so the chances of each outcome in the 2/3 block remain the same (the block either has the car or it doesn't). Since you only have one remaining door choice you could switch to in that block, this 2/3 block can only be chosen in one way (you switch to it or don't).
It also doesn't need to be 100% of the time. Obviously in the case of two goats, the choice will be effectively random (at least from our perspective), but if there's a car/goat in the 2/3 and the host is biased to switch to the goat more or less than randomness would indicate, it still changes the optimal strategy from indifference to either "always switch" or "never switch."

It still gives you information, even if the advantage or disadvantage is much smaller.
 
Electrical circuit simulators (mostly gimmick stuff to check exercises if you are studying, not really for serious work):
Wow, thanks for this! I really struggle with circuit stuff, so these websites will be a good source for practice problems.
When I was still planning on a physics PhD, I spoke to one of the professors in my department about wanting to do theoretical. This fella looked me straight in the eye and said "In America, all people care about is experimental, you'll never get funding".
It's best to do mathematical physics if you want to work in physics because you'll be able to adapt to different areas very easily and there will be higher demand for you.
 
Wow, thanks for this! I really struggle with circuit stuff, so these websites will be a good source for practice problems.
Glad I can help. I also used them for checking exercises.
Because it's totaly worth having a +$1000 yearly subscription on NI Multisim or Matlab Simulink for just checking some homework...
 
  • Like
Reactions: Space Police
And I like you actually did a Monte Carlo simulation of it. It's the sort of thing that makes it absolutely clear that it's true, but then you have to think "why?"
Paul Erdős had to see a Monte Carlo simulation of Monty Hall before he was truly convinced. Kind of hard to blame anyone for thinking it's counterintuitive.
 
  • Winner
Reactions: AnOminous
Julia is an incredible modern tool for scientific computation, both numeric and symbolic. It's a real breath of fresh air coming from 90s fuckware like MATLAB (which has given me a lot of grief nearly every time I use it, if not obvious).

Julia hasn't got the graphical interface or the wealth of ready-to-use models MATLAB has, but it's very sleek, performant, and easy to use. For example, it has first class support for running most code transparently on your GPU.

Just uttering the name Julia got Mathworks to cut Matlab license prices for my uni by an order of magnitude.

I can't stress enough how much more enjoyable it is to work with Julia, in more ways than one. Bar niche symbolic computation (Wolfram's geometry theorem solver is really cool but I can't find a use for it other than solving elementary school exercises; and you can use proof assistants and SMT solvers for most other things I find), Julia is second to none. I urge everyone to try it out, and preferably transition to it eventually, so that we may live in a world free from Mathwork, et al's extortion and sexual violence against researchers and engineers alike.
 
Julia is an incredible modern tool for scientific computation, both numeric and symbolic. It's a real breath of fresh air coming from 90s fuckware like MATLAB (which has given me a lot of grief nearly every time I use it, if not obvious).

Julia hasn't got the graphical interface or the wealth of ready-to-use models MATLAB has, but it's very sleek, performant, and easy to use. For example, it has first class support for running most code transparently on your GPU.

Just uttering the name Julia got Mathworks to cut Matlab license prices for my uni by an order of magnitude.

I can't stress enough how much more enjoyable it is to work with Julia, in more ways than one. Bar niche symbolic computation (Wolfram's geometry theorem solver is really cool but I can't find a use for it other than solving elementary school exercises; and you can use proof assistants and SMT solvers for most other things I find), Julia is second to none. I urge everyone to try it out, and preferably transition to it eventually, so that we may live in a world free from Mathwork, et al's extortion and sexual violence against researchers and engineers alike.
I've mentioned SageMath elsewhere here and will name it again:
Mission: Creating a viable free open source alternative to Magma, Maple, Mathematica and Matlab.
 
  • Like
Reactions: Briarthorn Addict
For a good dose of wannabe Mathematics humor, visit r/collatz, the subreddit for people trying to come up with a proof for the Collatz conjecture and getting absolutely nowhere with it. A lot of the posts are people looking for 'feedback' with their proofs that suffer from elementary logical errors.

These people would probably have a better shot at brute-forcing a counter-example than successfully providing a proof that doesn't suffer the 'I will prove the Collatz conjecture is true by assuming that it is true" classic.
 
One of the things that disturbs me about Mathematics education is how it's viewed as something you should learn if you want to make money. In my view, it's probably the most incorrect take on why Mathematics is important.

It's why STEMLords are so retarded to me, anyone who brags about how much money they are going to make as a result of their degree probably missed the entire point behind why their subject (and probably its Mathematical application) is important.

More broadly, anyone who studied Math purely in its application (or for the purpose of its application) didn't really study Mathematics at all.
 
I know you can emulate TI graphing calculators in a web browser, "legally" given that you provide the ROM to initiate it: https://www.cemetech.net/projects/jstified/

But there's also these slop sites that have done the hard work of pirating the image for you:
This private information is unavailable to guests due to policies enforced by third-parties.


Those sites appear to be running a different emulator, with TI-84 Plus CE (Color Edition) 5.7.2.0016.

I want to rip one of these off and insert it into a web application to run locally. But I probably wouldn't bother unless I can define BASIC programs (or more) in JavaScript strings that will be loaded when the image loads. Otherwise, you're working with a blank slate ("RAM Cleared") every time.
 
  • Like
Reactions: Sandnigger Mudhut
I know you can emulate TI graphing calculators in a web browser, "legally" given that you provide the ROM to initiate it: https://www.cemetech.net/projects/jstified/

But there's also these slop sites that have done the hard work of pirating the image for you:
This private information is unavailable to guests due to policies enforced by third-parties.


Those sites appear to be running a different emulator, with TI-84 Plus CE (Color Edition) 5.7.2.0016.

I want to rip one of these off and insert it into a web application to run locally. But I probably wouldn't bother unless I can define BASIC programs (or more) in JavaScript strings that will be loaded when the image loads. Otherwise, you're working with a blank slate ("RAM Cleared") every time.
BASIC is super easy to parse, you could roll your own
 
Self-bumping because I need some external advise here.
I've been thinking about fragmentation, (like when using a hard disk or using your own memory allocator), and I've been approaching the problem from a math perspective.

We describe any data storage device as a 'tape', with an associated length L. We assume that for a given tape, there's some minimum sizes region that we can use, (so a block on a disk, or a byte / word in memory depending on what you're doing).
When we consider the state of a tape, we can express the state of the tape using a notation reminiscent of non-commutative multiplication. So a tape of length 150 with 50 units used followed by free would be U^50 * F^100. We use this approach to capture the behavior of adjacent Free/Used regions being combined into a larger one, so U^25 * U^25 * F^100 = U^50 * F^100.
One more thing up front, we are only considering optimizing usage/writes, because freeing the tape will almost always be random access.

When we use m units of a length N>=m free region, we can do one of three things:
1. Left split, F^N -> U^m*F^(N-m)
2. Right split, F^N -> F^(N-m)*U^m
3. Middle split, F^N -> F^a*U^m*F^b for a + b + m = N (we can quickly reduce this to the other two, and I think you'll trust me when I say it's almost never a good idea, but I'm including it for completeness)
For the sake of convention, I'm going to prefer left splits, but whatever I discuss can be just as well applied with right splits by appropriately permuting our expressions.

Suppose now we want to 'allocate' or 'write' some number of units (m) on a given tape, how do we do so in order to minimize the fragmentation of the tape and do so efficiently?
I've broken the problem into some discrete cases based on heuristics and instinct. These cases assume that m can fit into the tape somewhere, otherwise that's a different problem altogether.

1. A space of exactly length m exists -> Use the first one
2. The tape is in a state U^x*F^(N - x) -> Use the beginning of the free region, preserving the bipartite split
This is where things start to get hairy
We take our size m, and we find an m' = 2^p for some p >= m, so we find the power of two >= m
3. We take all of our free regions, and break them into size classes based on powers of two, so a region of size 1 is in a class by itself, a region of 2 and a region of 3 are in the same class, 4, 5, 6, 7 in another, etc.
We search our size classes in descending order, and we select the largest free space that can accommodate m' and fill the beginning.
4. This is the worst one. For some measure of tape fragmentation phi, we find the transformation tau on the tape T such that phi(tau(T)) - phi(T) is minimized.

My problem is defining the fragmentation function. I've considered using the entropy of the free and used regions of the tape, I've considered having a measure involving the minimum and maximum free sizes in the tape, etc, combinations of those put into a vector to find some sort of phase space, but I'm stumped.
I chose the approach to step 3, because I thought that looking for regions slightly larger than our initial size that fit into binary size classes would lead to patterns in the usage and fragmentation that wouldn't preclude us from re-using gaps later.

Still unsure of this though, curious to see what you guys come up with.
 
  • Thunk-Provoking
Reactions: Belisarius Cawl
One of the things that disturbs me about Mathematics education is how it's viewed as something you should learn if you want to make money. In my view, it's probably the most incorrect take on why Mathematics is important.

It's why STEMLords are so retarded to me, anyone who brags about how much money they are going to make as a result of their degree probably missed the entire point behind why their subject (and probably its Mathematical application) is important.

More broadly, anyone who studied Math purely in its application (or for the purpose of its application) didn't really study Mathematics at all.
chad-vs-virgin-liberal-arts-science-engineering-student.webp
Anyway, you should read The Man Who Counted:
“I believe you are slightly mistaken, Vizier,” Beremiz replied quickly, “and I would be honored if you would allow me to clarify this insignificant error, and therefore I beg the generous caliph, our soul and master, to allow me permission to continue speaking.”

“It seems to me there is a certain wisdom in Vizier Nahum ibn-Nahum’s criticism,” replied the caliph. “I believe that a clarification of the matter is absolutely required. So speak. What you say will shape the opinions of those who listen to you here.”

There was a long silence in the room. Then the Man Who Counted spoke: “Learned men, O King of the Arabs, know that mathematics arose from the awakening of the human soul. But it was not born with utilitarian purposes. The first impulse of this science was the desire to solve the mystery of the universe. Its development came, therefore, from the effort to penetrate and understand the infinite. And even now, after centuries of trying to part the heavy veil, it is the search for the infinite that moves us forward. The material progress of man depends on abstract investigations and on present-day scientists, and the material progress of humanity in the future will depend on these men of science who work toward purely scientific ends, without considering the practical application of their theories.”

Beremiz paused briefly and then continued, with a smile, “When the mathematician makes his calculations or looks for new relations among numbers, he does not look for truth with a practical purpose. To cultivate science only for its practical purpose is to despoil the soul of science. The theory that we study today, and that appears to us impractical, might have implications in the future that are unimaginable to us. Who can imagine the repercussions of an enigma through the centuries? Who can solve the unknowns of the future with the equations of the present? Only Allah knows the truth. And it is possible that the theoretical investigations of today may provide, within one or two thousand years, precious practical uses.

“It is important to bear in mind that mathematics, besides solving problems, calculating areas, and measuring volumes, also possesses much more elevated purposes. Because it is so valuable in the development of intelligence and reason, mathematics is one of the surest ways for a man to feel the power of thought and the magic of the spirit.

“Mathematics is, in conclusion, one of the eternal truths and, as such, raises the spirit to the same level on which we contemplate the great spectacles of nature and on which we feel the presence of God, eternal and omnipotent. As I have said, O illustrious Vizier Nahum ibn-Nahum, you have made a slight error. I count the verses of a poem, calculate the height of a star, measure the size of a country or the force of a torrent, and thus I apply the formulas of algebra and the principles of geometry, without concerning myself with the profit I might earn from my calculations and studies. Without dreams or imagination, science is impoverished. It is lifeless.”
(Book was written in 1938, not long before computing suddenly catapulted number theory into immense practical significance after centuries of uselessness)
 
Back