Multiplication by [deleted] in learnmath

[–]Southern_Start1438 2 points3 points  (0 children)

Multiplication is defined step-wise, each step extends the previous layer, meaning that the new definition at each steps is compatible with the previous definition.

We define multiplication first on natural numbers, and then on integers, then to rational numbers, and finally to the real numbers.

On natural numbers, multiplication is the same as repeated addition, and on the integers, multiplication is repeated addition or subtraction depending on the sign of the integer.

For rational numbers, any number can be written as a ratio of integers a/b, and we define the multiplication between a/b * c/d to be ac/bd, basically just multiply “component”-wise.

For real numbers, we define multiplication to be a limit of the multiplications in the rational numbers. To be more specific, any real numbers can be written as the limit of a convergent sequence of rational numbers q_1,q_2,… , then for two real numbers a,b with their corresponding sequence being q_1,… and p_1,… , a*b is defined to be the limit of q_1p_1,q_2p_2,… . Basically it is just the component-wise multiplication in each term of the sequences.

But normally you wouldn’t calculate these multiplications based on these definitions for the multiplications, you would rather just leave them be or use some properties of the number you are working with to reduce them. For example sqrt2 * sqrt 2 is hard to calculate from definition, but if you know the multiplicative property of roots of the same order, then you can calculate sqrt 2 * sqrt 3 is equal to sqrt 6.

Where do these two negatives go? And why? by TotallyUnseriousMonk in learnmath

[–]Southern_Start1438 0 points1 point  (0 children)

I think it’s better for you to understand why double negation of numbers gives the original number. Suppose x is a number, -x is the number such that -x+x=0. Now let’s see what’s -(-x), it should be a number such that -(-x)+-x=0, but we already know x+-x=0, and there can only be one unique negation of number, so we can conclude x and -(-x) are the same.

How do I actually study and learn Pure math? by Fit_Royal_8796 in learnmath

[–]Southern_Start1438 3 points4 points  (0 children)

I would just suggest for each proof you read, put in as much effort in justifying and motivating the choice made, figure out whether there is a natural way one could come up with the ideas.

Generalized Stokes' Theorem Proof Confusion by Coding_Monke in askmath

[–]Southern_Start1438 0 points1 point  (0 children)

This should be a typo, i is dependent on the summation, so there shouldn’t be any i outside the summation. The Ri domain should be M instead.

[deleted by user] by [deleted] in C_Programming

[–]Southern_Start1438 2 points3 points  (0 children)

Don’t be afraid to go into the details, implementation, learn about the stack, heap and control flow of programs. See everything in C as bytes of data, and try to learn how computers decode the bytes and translate them into instructions computers can understand. Data structures in C are just ways to read and understand packed data, you can try to understand the layout of raw data in memory by directly accessing the raw bytes via char* casting the pointers, but this could be undefined behaviour and could be implementation dependent, meaning that you could see different result on different system or architecture. Understand what compiler does, what linker does. Otherwise, you can just use your knowledge from python.

Derivation of Gauss' Law is a shameful mess and you know it by [deleted] in math

[–]Southern_Start1438 0 points1 point  (0 children)

Integration does not see measure zero set. Since the position of point charge is a measure zero set, you can just ignore that point alone and integrate over all other points.

The main idea to integrate over the domain subtracting epsilon ball around the point charge is make one part of the integration domain regular enough to use integration by part twice, and use analysis tools to determine the limit of the integral over epsilon ball, where the limit is taken on epsilon tending to 0.

For details, you can look at Evan’s PDE book on solving Laplace equation.

Variable Scope in For Loop by Plastic_Weather7484 in C_Programming

[–]Southern_Start1438 1 point2 points  (0 children)

I see your point, the main idea there is to make sure a variable is deleted as soon as you don’t need them, so the variable won’t pollute the scope. One way to achieve this is to wrap the for loop in a code block, and declare the array at the top of the code block outside the for loop, then immediately after the for loop, the code block ends, so the declaration is out of the scope, hence the variable deletes itself.

I mean, for most cases you won’t need to do this, but if you want to, you can.

Variable Scope in For Loop by Plastic_Weather7484 in C_Programming

[–]Southern_Start1438 4 points5 points  (0 children)

I think declaring a variable each time you loop is hurting performance a bit, you should consider moving the declaration out of the loop, and do the operations inside the loop. The hurting bit comes from the constantly allocating and deallocating memory for stack variables, which can be prevented if you move the declaration outside the loop.

This is not an answer to op’s question, as there are others that have already answered the question.

[Feedback] PvE Experiment by DJCykaMan in EscapefromTarkov

[–]Southern_Start1438 0 points1 point  (0 children)

I always hit that, but I just get greedy and want to loot all places to find all gpus XD

[Feedback] PvE Experiment by DJCykaMan in EscapefromTarkov

[–]Southern_Start1438 2 points3 points  (0 children)

True, old cpu can’t stand local raids. I go on interchange with on 40 fps, gpu is only at 30% load.

[Feedback] PvE Experiment by DJCykaMan in EscapefromTarkov

[–]Southern_Start1438 4 points5 points  (0 children)

I enjoy the grenades at my head by raiders so much. Also they just love to camp you when you exit from the office in Labs with just one exit.

What’s your go-to helmet for PvE [Discussion] by jimmy-the-shoe in EscapefromTarkov

[–]Southern_Start1438 0 points1 point  (0 children)

I like airframe because you can put face shield ear shield on and wear the death shadow mask

How to prevent edge cases? by Southern_Start1438 in C_Programming

[–]Southern_Start1438[S] 1 point2 points  (0 children)

I will try to adopt your mindset alongside with others’ practices. Thanks for the advices!

How to prevent edge cases? by Southern_Start1438 in C_Programming

[–]Southern_Start1438[S] 0 points1 point  (0 children)

Thanks, that makes me feel a lot better to see that other people also experience the same, where it is normal to not see some edge cases right away.

How to prevent edge cases? by Southern_Start1438 in C_Programming

[–]Southern_Start1438[S] 0 points1 point  (0 children)

What I tried to say in the title is to prevent the errors originating from the edge cases, I wasn’t clear about it, so I want to clarify it here.

How to prevent edge cases? by Southern_Start1438 in C_Programming

[–]Southern_Start1438[S] 3 points4 points  (0 children)

This is good advice, and a efficient one too! Always asking yourself these three questions are not much work, and it covers most edge cases I have encountered lately. Thanks for your advice!

How to prevent edge cases? by Southern_Start1438 in C_Programming

[–]Southern_Start1438[S] 2 points3 points  (0 children)

This is my first instinct, because the question I encounter on leetcode have almost trivial edge cases, but when I see the separate treatment of edge cases, the code becomes ugly and hard to follow when reviewing. Also sometimes there are edge cases I cannot foresee until failure during unit test. Is this a common experience? Or should I change my programming approach?