Jump to content

Wikipedia:Reference desk/Mathematics

From Wikipedia, the free encyclopedia
Welcome to the mathematics section
of the Wikipedia reference desk.
Select a section:
Want a faster answer?

Main page: Help searching Wikipedia

   

How can I get my question answered?

  • Select the section of the desk that best fits the general topic of your question (see the navigation column to the right).
  • Post your question to only one section, providing a short header that gives the topic of your question.
  • Type '~~~~' (that is, four tilde characters) at the end – this signs and dates your contribution so we know who wrote what and when.
  • Don't post personal contact information – it will be removed. Any answers will be provided here.
  • Please be as specific as possible, and include all relevant context – the usefulness of answers may depend on the context.
  • Note:
    • We don't answer (and may remove) questions that require medical diagnosis or legal advice.
    • We don't answer requests for opinions, predictions or debate.
    • We don't do your homework for you, though we'll help you past the stuck point.
    • We don't conduct original research or provide a free source of ideas, but we'll help you find information you need.



How do I answer a question?

Main page: Wikipedia:Reference desk/Guidelines

  • The best answers address the question directly, and back up facts with wikilinks and links to sources. Do not edit others' comments and do not give any medical or legal advice.
See also:

September 2

[edit]

Coin flip

[edit]

This has to be a really dumb question but it seems slightly paradoxical. Say you are going to bet $1 on a coin flip. One way to look at this is you plunk down your $1, the coin is flipped, and if heads you get back $2 (your original bet plus $1 winnings), net result +1. If tails, you lose your $1, net result -1. So the expected value is 0.5(+1) + 0.5(-1) which is 0, not surprising.

Another way to see the same proposition is you start with nothing and the coin is flipped. If heads, you receive $2. If tails, you receive $(-1) (i.e. you now have to pay $1). So the expectation is 0.5*2 + 0.5*(-1)= 0.5.

What has happened? It's the same proposition both ways, I think. Is there a systematic way to tell which analysis is the right one? The second calculation has to be wrong, but it's not obvious how. Thanks. 2601:644:8581:75B0:0:0:0:C030 (talk) 22:12, 2 September 2024 (UTC)[reply]

The first way, you gain net $1 for a win; the second way, you gain $2. (The dollar in escrow does not change that.) They are not the same bet. —Tamfang (talk) 23:37, 2 September 2024 (UTC)[reply]
The calculations by themselves are both correct, but (as noted by Tamfang), they represent different betting propositions. Assume the coin comes up tails. In the first version your loss is the $1 paid in advance, in the second you pay $1 afterwards for losing the bet. So that amounts to the same loss. But now assume the coin comes up heads. In the first you pay $1 in advance and then receive $2. In the second version you just receive $2 without having to make an advance payment. That is clearly more advantageous. To make your second version equivalent to the first, replace "you receive $2" by "you receive $1".  --Lambiam 06:00, 3 September 2024 (UTC)[reply]
To supplement to the arithmetical explanations above: It's not a paradox, and since you know which answer is right, you know the basic analysis is to step through it slowly and carefully. This may not be possible in a real-world cash transaction, and this is how quick change scams work (and similar for some street gambling scams) -- in other words, it's not a dumb question, it's not obvious, and if you can think of a truly easy generalized way to work this stuff out for people in real-time social situations, you'll have done a huge service for humanity. (See video examples of the quick change scam from Noah Da Boa and The Real Hustle.) (Right now, most people online say just not to give change to strangers -- the best way to win is not to play.) SamuelRiv (talk) 18:23, 3 September 2024 (UTC)[reply]
Incidentally, one way to see that they are different is to determine the (maximum) amount you would be willing to pay to be in the second position instead of the first. (I get $0.50) Tito Omburo (talk) 20:10, 3 September 2024 (UTC)[reply]

Thanks everyone, I must not have been thinking clearly. Another way to see it is imagine playing twice, winning one and losing one. You end up with $1 instead of with $0. 2601:644:8581:75B0:0:0:0:C030 (talk) 22:34, 3 September 2024 (UTC)[reply]

September 5

[edit]

Anomalous result

[edit]

Solve for x:

  • = x - 1.

Here's my approach, step by step:

  • Square both sides:
x + 1 = - 2x + 1
  • Cancel 1's:
x = - 2x
  • Collect x's:
- 3x = 0
  • Factorise:
x (x - 3) = 0
  • Solution:
x = 0 or 3.

So far, so good. Or so it seems.

Plug 3 back into the original equation:

  • = 3 - 1
  • = 2 = 3 - 1. Correct

Plug 0 back into the original equation:

  • = 0 - 1
  • = 1 =/= 0 - 1. Incorrect.

I've gone over this a dozen or more times but cannot see what really basic error I must be making.

Any ideas? -- Jack of Oz [pleasantries] 22:06, 5 September 2024 (UTC)[reply]

You didn't do anything really wrong, but just discovered that 0 is an "Extraneous solution to the problem. As our article says, they "result from performing operations that are not invertible for some or all values of the variables involved, which prevents the chain of logical implications from being bidirectional."
The problem is that squaring is not a one-to-one function, so its inverse, square-rooting needs to be carefully defined. That is, -5 and 5 squared are both 25. So we must pick one of them as "the" square root if we want to define a function, something that spits out just one value "5" when fed "25". If we defined "square root" as Euler did and said either are square roots, then 0 is perfectly good solution. In modern terms it would amount to solving ± = x - 1John Z (talk) 23:19, 5 September 2024 (UTC)[reply]
You proved that implies or Indeed, if (the only true solution), it is the case that or You appear to assume that the converse implication also holds, but this assumption is unwarranted. The false solution is introduced by the squaring operation; it adds solutions of the equation A simpler puzzle based on the same issue is the following:
  • Solve for the equation
  • Square both sides:
  • Plug for into the original equation:
  • What gives?
What we found is the solution of the equation  --Lambiam 23:17, 5 September 2024 (UTC)[reply]
Wow, that really is basic. But not obvious. I've been aware forever that the sq rt sign is always taken to be the positive root only of X unless modified by a - or ± in front; whereas, the words "the square root of X" mean both positive and negative roots. What I've never quite focussed on is the dangers of squaring, if I can put it that way. Squaring both sides of an equation is a tool we all learn early in our algebraic studies, but I don't remember this particular hazard ever being brought to my attention. But then, my most recent formal mathematical studies were in 1984 [before my younger son was born; he's now produced three grandchildren for me].
Thanks for a very enlightening set of answers. -- Jack of Oz [pleasantries] 20:16, 6 September 2024 (UTC)[reply]
Resolved

September 6

[edit]

Distance to a line segment

[edit]

I am unsure if this is better in Maths or in Computing, but I've chosen Maths.

In a standard planar (x,y) world, a line segment is defined by two endpoints P1=(x1,y1) and P2=(x2,y2).

A third point (anywhere, not necessarily off the line segment extension) is A=(xa,ya).

It is easy to calculate the distance from A to P1 and from A to P2. Sometimes one will be the answer for which part of the line segment is closest to A.

But if A is "perpendicularly within P1~P2", then the closest part of P1~P2 will be somewhere on that line segment.

Is there a standard algorithm for determining the coordinates of the closest part of the line segment to A?

--SGBailey (talk) 22:59, 6 September 2024 (UTC)[reply]

I don't know if it's "standard", but it's not too hard to work out. Let D be the square distance between P1 and P2, so D = (x2-x1)2 + (y2-y1)2. Let E be twice the (signed) area of the triangle P1P2A, so E = x1y2 - x1ya - x2y1 + x2ya + xay1 - xay2. Note that if D=0 then the result is undefined, if E=0 then the result is just A, if x1=x2 then y=ya, and if y1=y2 then x=xa; these facts can be used as checks. Then, using Cramer's rule and a few tricks I'm pretty sure I wouldn't be able to fully explain, I get x = xa + (y2-y1)E/D, y = ya - (x2-x1)E/D. Geometrically, you know that the vector PA is perpendicular to P1P2, which means P can be written A + mP1P2, where P1P2 is normal to P1P2; we can take this as (-(y2-y1), x2-x1). You can then solve for m by finding the area of the triangle P1P2A in two ways. Note that if you just want the distance to the line it's a lot easier, just divide twice the area of the triangle, |E|, by the length of the segment P1P2. I'm assuming here that you want the closest point to the line P1P2, since there's no guarantee that the result P will be between P1 and P2, and if not it technically won't be on the segment P1P2. --RDBury (talk) 05:51, 7 September 2024 (UTC)[reply]
Here is an analytic approach. The line through the distinct points and can be parametrically represented by
(The usual equation for the line can be obtained by eliminating from this equation.)
The vector connecting a generic point on the line to a point not on the line is then given by
The length of this vector is minimized when its square is, which is given by the quantity
Now solve for and substitute the result in the parametric equation and you have the coordinates of the nearest point. Note: if is on the line, this procedure may lead to division by zero.
(If done by hand, it helps to first rewrite the parametric equation as
Also, alternatively, to avoid differentiation, rewrite the equation for in the form The value of minimizing is then given by )
 --Lambiam 06:47, 7 September 2024 (UTC)[reply]
One advantage to this method is that it works just as well in multiple dimensions. A more general version is: Given k points P1, ... Pk, and l points Q1, ... Ql in Rn, with k+l≤n-1, find a formula for the points P and Q where P is on the affine space determined by the Pi's, Q is on the affine space determined by the Qi's, and P and Q are a close as possible to each other. It might be easier if the affine planes were given by systems of equations instead of as affine hulls. --RDBury (talk) 07:31, 7 September 2024 (UTC)[reply]
PS. It might be worth mentioning that when you solve for lambda, the resulting point P will be the one where AP⊥P1P2, so you're basically just proving what was assumed in the original question. This holds for any smooth curve and even smooth surfaces; if P is the closest point to A on a smooth curve/surface, then PA is perpendicular to the tangent line/plane at P. --RDBury (talk) 01:53, 9 September 2024 (UTC)[reply]

Thanks. That is probably resolved, but I need to study the replies. -- SGBailey (talk) 18:02, 8 September 2024 (UTC)[reply]


September 11

[edit]

120 being the smallest highly composite number

[edit]

120 (number) says it is the "smallest highly composite number", but the OEIS contradicts this. Is there any definition of "highly composite number" that would make this true? Batrachoseps (talk) 02:29, 11 September 2024 (UTC)[reply]

It is specifically called the smallest highly composite number not adjacent to any prime. This is a true statement, if perhaps a bit confusingly phrased. Double sharp (talk) 03:08, 11 September 2024 (UTC)[reply]
I have rephrased the statement to clarify it. Double sharp (talk) 03:09, 11 September 2024 (UTC)[reply]
Thanks for rephrasing it. I had interpreted the sentence to mean "120 is the smallest highly composite number" and "120 is the first multiple of six with no adjacent prime number". Batrachoseps (talk) 03:12, 11 September 2024 (UTC)[reply]


September 13

[edit]

Prove or disprove: These numbers are composite for all n>=2 such that these numbers are positive

[edit]

Prove or disprove: These numbers are composite for all n>=2 such that these numbers are positive

118.170.47.16 (talk) 08:18, 13 September 2024 (UTC)[reply]

Re   #3:
Re   #4:
Re   #6:
Re   #7:
Re   #8:
Re #23:
Re #24:
Re #30:
Re #36:
These are all special cases of the difference of two nth powers.  --Lambiam 10:23, 13 September 2024 (UTC)[reply]
Do your own homework. SamuelRiv (talk) 15:34, 13 September 2024 (UTC)[reply]
Based on other posts with this type of number theoretic-focused content coming from IPs in the same geographic area (north Taiwan), I'm pretty sure this isn't meant to be homework. WP:CRUFT, perhaps, but this is the Reference Desk, and it seems to me that it's a lot less of an issue to have it here than elsewhere. GalacticShoe (talk) 16:52, 13 September 2024 (UTC)[reply]
For all of these which are not listed as always composite, I tested and didn't find any primes.
  1. is divisible by when is even, when , and when , so if there is such a prime then .
  2. is divisible by when is odd, when , and when , so if there is such a prime then .
  3. Always composite: can be factorized.
  4. Always composite: can be factorized.
  5. Always composite: is divisible by when is even, when , and when .
  6. Always composite: can be factorized.
  7. Always composite: can be factorized.
  8. Always composite: can be factorized.
  9. is divisible by when is odd, when , when , and when , so if there is such a prime then .
  10. is divisible by when is even, when , when , and when , so if there is such a prime then .
  11. is divisible by when and when , and it becomes a difference of squares if is even, so if there is such a prime then .
  12. Always composite: is divisible by when is odd, and it becomes a difference of squares if is even.
  13. is divisible by when is even, so if there is such a prime then is odd.
  14. is divisible by when is odd and when , and it becomes a difference of cubes if , so if there is such a prime then .
  15. Always composite: is divisible by when is odd and when is even.
  16. Always composite: is divisible by when is odd, and it becomes a difference of squares if is even.
  17. Always composite: is divisible by when is odd and when is even.
  18. Always composite: can be factorized.
  19. is divisible by when is even, when , when , when , when , and when , so if there is such a prime then .
  20. is divisible by when is odd, when , and when , so if there is such a prime then .
  21. is divisible by when is even, when , and when so if there is such a prime then .
  22. Always composite: is divisible by when is odd, and it becomes a difference of squares if is even.
  23. Always composite: can be factorized.
  24. Always composite: can be factorized.
  25. Always composite: is divisible by when is odd and when is even.
  26. is divisible by when is odd, when , and when , so if there is such a prime then .
  27. Always composite: is divisible by when is odd and when is even.
  28. Always composite: is divisible by when is odd, and it becomes a difference of squares if is even.
  29. Always composite: is divisible by when is odd, and it becomes a difference of squares if is even.
  30. Always composite: can be factorized.
  31. Always composite: is divisible by when is odd and when is even.
  32. Always composite: is divisible by when is odd and when is even.
  33. is divisible by when is odd, when , when , and when , so if there is such a prime then .
  34. Always composite: is divisible by when is odd, and it becomes a difference of squares if is even.
  35. Always composite: is divisible by when is odd and when is even.
  36. Always composite: can be factorized.
  37. is divisible by when is odd, when , and when , so if there is such a prime then .
  38. Always composite: is divisible by when is odd and when is even.
  39. is divisible by when is odd, when , and when , so if there is such a prime then .
  40. Always composite: is divisible by when is even, when , and when .
  41. Always composite: is divisible by when is odd, and it becomes a difference of squares if is even.
  42. Always composite: is divisible by when is odd, and it becomes a difference of squares if is even.
GalacticShoe (talk) 08:10, 15 September 2024 (UTC)[reply]
I'm guessing this is about the best one can do without actually discovering that some of the values are prime. I did some number crunching on the first sequence 5n+788 with n<1000. All have factors less than 10000 except for n = 87, 111, 147, 207, 231, 319, 351, 387, 471, 487, 499, 531, 547, 567, 591, 639, 687, 831, 919, 979. You can add more test primes to the list, for example if n%30 = 1 then 5n+788 is a multiple of 61, but nothing seems to eliminate all possible n. Wolfram Alpha says the smallest factor of 587+788 is 1231241858423, so it's probably not feasible to carry on without something more sophisticated than trial division. --RDBury (talk) 19:12, 15 September 2024 (UTC)[reply]

Lines carrying rays

[edit]

Not quite sure where to ask this but I decided to put it here. I apologize if this doesn't belong here.

I was recently reading about hyperbolic geometry and when reading the article Limiting parallel, I came across the statement "Distinct lines carrying limiting parallel rays do not meet." What exactly does it mean for a line to carry a ray? Is this standard mathematical terminology? TypoEater (talk) 18:14, 13 September 2024 (UTC)[reply]

Yes, this is the place for such a question, though you might also complain at Talk:Limiting parallel that the phrase is unclear. —Tamfang (talk) 22:51, 13 September 2024 (UTC)[reply]
I find the whole article unclear and confusing. Is it me?  --Lambiam 23:54, 13 September 2024 (UTC)[reply]


September 15

[edit]