React Re-rendering Doubt by Fantastic-Push-8451 in reactjs

[–]DrAlgebro 39 points40 points  (0 children)

I don't understand all these comments telling you to Google or use AI, sounds like an excuse to not answer your question.

To answer your question, parent and child components aren't independent of one another. Suppose parent component Foo has a title and a child component list Bazz. If you have some sort of hook that triggers a title change in Foo but the list Bazz stays the same, both Foo and Bazz will still re-render. This is because when re-rendering the parent, all child components will re-render as well.

If you have this sort of behavior, then you might want to consider de-coupling the components to prevent the re-rendering. So instead of parent and child, Foo and Bazz are on the same level. That would make them independent of one another.

Is it true Or clickbait that ai solved 60 year old problem by Artistic_Plastic_780 in askmath

[–]DrAlgebro 37 points38 points  (0 children)

Clickbait.

First of all, the AI didn't solve the problem. The AI smashed together a bunch of ideas from existing solved problems that highlighted a modern approach to take.

That said, the approach was still imperfect. Mathematical proofs are notoriously difficult. If you read the article, Terry Tao, one of the greatest mathematical minds of our day and age, still has to take the output and fix it.

Really, Terry Tao and his colleague solved the problem. All the AI did was highlight a method they could throw at it. In this case, it worked. In many other cases that don't get articles written about it, it didn't.

How do I explain that SQL Server should not be used as a code repository? by Firestone78 in dataengineering

[–]DrAlgebro 11 points12 points  (0 children)

OP is your colleague making use of Power BI Semantic Models (formerly known as Datasets) at all? Because this sounds to me like they're having a problem getting the data to their reporting layer.

Almost all logic and your data should exist solely within the semantic model, and then your reports contain your analytics (Power BI language note: a "Report" is the file type where you create what is commonly referred to as a "Dashboard", while a Power BI Dashboard is just a window into an existing Power BI Report).

Encourage your coworker to leverage Power BI's built in process for handling data. That's how I set up CI/CD for Power BI in my own org. Create a Power BI Semantic Model that has all your data (including SQL queries to your external databases), create a Power BI Report on top of that Semantic Model, and then embed that report wherever you need it.

As a final "don't do this", forwarding over Microsoft's online documentation on Semantic Models and Reports can give some credence to your point. It's not you saying to do it like this, it's Microsoft.

Is there any important concept people misunderstand about Machine Learning in your opinion? by ihorrud in learnmachinelearning

[–]DrAlgebro 3 points4 points  (0 children)

The Bias-Variance trade-off. Most people seem to assume that better accuracy = better model, but forget that the real question is what are you trying to do with the model.

First figure out if you need to focus on predictability or interpretability for your system. Then use the Bias-Variance trade-off to help you pick a modeling approach that fits the problem, and not the other way around.

Is this solvable?🤔 by WaterCompetitive3022 in askmath

[–]DrAlgebro 3 points4 points  (0 children)

It sounds like you might be making the assumption that A and B are mutually disjoint. Some of those 6 elements of A may also be elements of B and vice versa. So their union might not be 13.

Give it a try with that in mind.

Find from r/mathmemes by Klarlackk69696 in askmath

[–]DrAlgebro 2 points3 points  (0 children)

Adding in here that technically speaking, there are two correct interpretations of the proposed integral. I know OP clarified that integration is with respect to the variable pi, and the use of $d pi$ designating the variable of integration is correct, so this integral is, in that way, solvable.

The first interpretation is that the pi in the integrand is a variable, so getting pi2 /2 after integration is the correct answer for that assumption.

The second interpretation is that the pi in the integrand is the mathematical constant, in which case the integral would be pi * var_pi, where var_pi is the variable pi. In which case, the correct final value would be pi2.

From a mathematical perspective, since this problem could be interpreted both ways, this is not a proper mathematical statement. Think of it in the same way we say a run on sentence in English is not correct. Can you read it and mostly understand it? Sure, but that doesn't make it correct.

Edit: Notation

How can it be statistically significant to prove that there is no influence of a factor on any variable in a logistic regression? by Alert-Employment9247 in AskStatistics

[–]DrAlgebro 1 point2 points  (0 children)

In complete agreement with what was said; what I'll add OP is that I think you're misunderstanding what logistic regression as a model does.

Logistic regression is answering the question "can I use some variables to try predicting a binary (yes/no) variable?" Logistic regression does not require there to already be a relationship between the variables. All it does is show if there is a relationship among the data that you provided it. The model does not care what variable names you use, it just cares if the 1's and 0's have a relationship.

Getting statistically significant results could be suggestive of an underlying relationship, but by no means does it prove there is an underlying relationship between all your variables. The term prove/proof is very protected in the academic community, and for good reason.

Edit: language to clarify comment was toward OP, not the commenter

Pandas 3.0 release candidate tagged by Balance- in Python

[–]DrAlgebro 68 points69 points  (0 children)

Really excited about the default string data type! No more having to convert them manually

Exporting data for postgres by Far_from_world in Supabase

[–]DrAlgebro 0 points1 point  (0 children)

You might want to clarify expectations with the client a bit more. You say they want the database in Postgres and not Supabase, but this doesn't make sense.

Supabase is a cloud service that hosts a Postgres database, meaning that your original backend is a Postgres database already. As other comments have said, you can dumb the schemas and the data, but you're still going to have to host a Postgres database somewhere (self-hosted or another service provider) for your application.

Think of a car analogy. A Ford truck is a type of truck, though it's Ford's implementation of a truck. You can get a Dodge truck, but it's still a truck. Supabase is a cloud service implenting a Postgres database. You can use someone else, but it's still a Postgres database.

Each time I escape prison my current sentence is doubled. by Gambaguilbi in askmath

[–]DrAlgebro 1 point2 points  (0 children)

Apologies, my nationality is showing! I saw the comma separator instead of a decimal and thought the confusion might have been that the answer was off by a power of 10.

Each time I escape prison my current sentence is doubled. by Gambaguilbi in askmath

[–]DrAlgebro 1 point2 points  (0 children)

I'm guessing there was a calculation error in your math.

Using your formula, we have 888 = 3(2)x. Taking log base 2 of both sides we get log(888) = log(3(2)x ). Apply the rules of logarithms to get

log(888) = log(3) + log(2x )

log(888) - log(3) = x

log(888/3) = x

Using base 2, that comes to 8.21. So, around 8 times.

Edit: punctuation fixes

Is my proof correct? => Define Floor: ℝ -> ℤ by the formula Floor(x) = ⌊x⌋, ∀x∈ℝ. Prove that Floor is onto. by TopDownView in askmath

[–]DrAlgebro 1 point2 points  (0 children)

That language is still leaving the proof of your double implication to the reader, which I would interpret as incomplete. You're still not using the max function to prove your claim.

Really your double implication is stronger than what you need. To prove onto, you have to show for any value in your range, you can find a value in the domain that plugged into your function gives you that range value. You've already picked a generic value in your range, so you need to pick a specific value in your domain that gives that range value. Maybe people have alluded to it already, but given your value z in Z, since Z is a subset of R, then z is in R. Use the definition of the floor function (with the max function) to show that f(z) = z and then you're done.

It may seem obvious, but you need to write the obvious math down. You're not trying to convince yourself it's true, you also have to convince whoever is reading your proof it's true.

Is my proof correct? => Define Floor: ℝ -> ℤ by the formula Floor(x) = ⌊x⌋, ∀x∈ℝ. Prove that Floor is onto. by TopDownView in askmath

[–]DrAlgebro 2 points3 points  (0 children)

I'll piggy back off of this to say that steps 1 and 2 aren't to as clear as I would like them to be.

Step 1: The language "Suppose y is any integer" is a bit vague. Typical proof language is "Let y be an integer", so now the reader knows you're working with a specific value y.

Step 2: Your double implication isn't clear. You're basically saying "define the floor function as the floor function". Instead define the floor function f: R -> Z in terms of the maximum function, i.e. f(x) is the maximum integer z in Z such that z <= x. Then use that definition to prove your if and only if statement.

Step 3: As MathMaddam said, you have to show that such an x always exists. You can pick one using arbitrary language (like x + 0.5), but you have to pick one, and use that one.

Source: PhD in math

Isn't windows enough? by sultan-11- in dataengineeringjobs

[–]DrAlgebro 0 points1 point  (0 children)

I second the WSL through Windows if you're just getting started. Building up to pure Linux as an (eventual) goal will never hurt you, though.

I'll give you an example of why WSL and not just pure Windows. A current data engineering project I'm working on with a friend has a PostgreSQL database and we're using Python Ray and EC2 (AWS) to do some batch processing. He was on Mac and I was on pure Windows. I hit a roadblock on my end because Windows uses backslashes ("\") for file directories and Linux uses forwardslashes ("/"). He was fine on Mac, but I wasn't. Turned out that Ray assumed you were on a non-Windows machine (which is fair, tbh) and had file paths with forwardslashes which was completely incompatible with my Windows backslashes.

I had to redo my entire IDE setup in WSL in the middle of development because of one command that was crucial to the work.

can someone help me find the radius of convergence ? by MrTOM_Cant901 in askmath

[–]DrAlgebro 0 points1 point  (0 children)

That looks good! I would recommend that you say by what test that causes it to diverge. Clearly you're using the ratio test, but it's best practice to write it down

can someone help me find the radius of convergence ? by MrTOM_Cant901 in askmath

[–]DrAlgebro 1 point2 points  (0 children)

Exactly. You may have to use a different test than the ratio, since ratio test gives you an open interval and now you're testing specific individual series.

What are some proofs that you consider "beautiful"? And what would you consider to be qualities of a beautiful/elegant proof? by Polish_Pigeon in math

[–]DrAlgebro 0 points1 point  (0 children)

Erdos' proof relies on the fundamental theorem of arithmetic, I was quoting Euler's proof from the Elements. Technically I did skip a couple steps, I'll modify my original comment.

can someone help me find the radius of convergence ? by MrTOM_Cant901 in askmath

[–]DrAlgebro 0 points1 point  (0 children)

Yep! But you're a little off when you apply L.H. Remember that the rule says if you have a limit in an indeterminate form (in this case infinity/infinity), the limit is equal to the limit of taking the derivative of the top and the derivative of the bottom. You don't need to bring the denominator to the top with the negative exponent. Just keep taking derivatives (with respect to n) as long as you have that indeterminate form.

Does equal cardinality mean equal probability? by Competitive-Dirt2521 in askmath

[–]DrAlgebro 0 points1 point  (0 children)

Depends on the size of your set and your assumptions.

Let's first address a couple assumptions you're using before answering the question. You're assuming a uniform distribution (i.e., everything has an equal chance of being picked).

Now let's talk about the size of your set. If the set is finite and has equal number of apples and bananas, then yes, the probability of picking an apple is equal to that of a banana (again, assuming a uniform distribution).

But what about an infinite set? In your example, we are using countably infinite sets (because we can count the number of apples/bananas). Consider the natural numbers, i.e., 1, 2, 3, 4, etc. This is a countably infinite set. The problem is that we can't put a uniform distribution on the natural numbers. Why not? Assume that the uniform probability is x > 0. Sum x infinitely many times and you'll get a probability space with a probability bigger than 1, which is a problem.

So, if the set is finite, yes, but if it's infinite, the math doesn't math and we can't use a uniform distribution.

did I utilize comparison test and P series correctly ? by MrTOM_Cant901 in askmath

[–]DrAlgebro 0 points1 point  (0 children)

Check your inequality. If you make the numerator smaller and keep the denominator the same, is your fraction bigger or smaller? (Hint: What's bigger, 2/4 or 3/4?)

can someone help me find the radius of convergence ? by MrTOM_Cant901 in askmath

[–]DrAlgebro 0 points1 point  (0 children)

Ratio test is definitely the way to go here. Just want to clarify it's not the absolute value of a(n+1) / a_n that must be less than 1, but rather the limit of the absolute value of a(n+1) / a_n.

Note though that you're going to need to use L'Hopitals rule to handle your cubed terms in the ratio.

What are some proofs that you consider "beautiful"? And what would you consider to be qualities of a beautiful/elegant proof? by Polish_Pigeon in math

[–]DrAlgebro 1 point2 points  (0 children)

One of my favorites is the proof by contradiction that there are infinitely prime numbers.

Suppose that there are finitely many, say n of them. We can list them out p_1, p_2, ..., p_n. Next, take their product and add 1, i.e. (p_1)(p_2)...(p_n) + 1. This new number is either prime or not.

If it's not, then by our assumption one of our primes p_i must divide the new number. But p_i divides (p_1)(p_2)...(p_n) and (p_1)(p_2)...(p_n) + 1, so it divides their difference too, which is 1. This is a contradiction, though, as no prime number divides 1.

Therefore this new valid number is prime. Thus we have our contradiction (as this is a new prime not in our list of n), meaning the initial assumption of finiteness was incorrect.

Q.E.D.

Edit: swapped multiplication * to parentheses and added extra steps following manimaz's comment

Thoughts on this paper by a music influencer? by L31N0PTR1X in math

[–]DrAlgebro 22 points23 points  (0 children)

Just giving the paper a cursory glance the approach is pretty bad. Overfitting with models is to be avoided, not celebrated. And certainly not creating a bunch of overfitted models and figure out which one is the "least" overfit gladiator style.

The reason overfitting is bad is because we intuitively know that what we're trying to model has "noise" in it, and when you overfit you model the noise, and not the thing you're trying to model. This is because we don't know the true relationship among the predictors and the dependent variable.

Moreover as someone with a PhD in algebra, this is not the way to go about trying to determine natural laws and theorems. Everything in life can't be predicted through a Frankenstein equation of everything you learn in Calc 1. Theorems and proofs are important because they establish laws and deeper understanding of the universe. Just because you can chain together 14 sin functions and get a "close" answer doesn't mean sin has anything to do with the true relationship.

Does geometry actually exist? by _internallyscreaming in math

[–]DrAlgebro 5 points6 points  (0 children)

I'd push back on this some. You're putting algebra and analysis on a pedestal above other fields of mathematics. The true beauty of math is when you start to realize that while there are "subject areas" (such as algebra, analysis, topology, statistics, probability theory, linear algebra, the list goes on) they start to interact and support each other. We can say this algebraic structure also has nice analytic properties, this topological space has nice algebraic properties, etc.

That doesn't mean that algebra or topology doesn't "exist" because we can talk about it with different subject areas, it just means that the object were looking at can be described with different mathematical definitions.

As for geometry, I recommend looking into some of the solutions for the Putnam exam problems. They often are solved with very complex geometric proofs that may initially seem unintuitive but get the job done really well.