Skilled player (1416)
Joined: 10/27/2004
Posts: 1978
Location: Making an escape
I saw "sin(pi)" and my mind went "senpai" and internet I hate you dearly.
A hundred years from now, they will gaze upon my work and marvel at my skills but never know my name. And that will be good enough for me.
Player (36)
Joined: 9/11/2004
Posts: 2630
sin(pi) is a zero. Just like harem anime protagonists. SHOTS FIRED.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
OmnipotentEntity wrote:
= sqrt((1 + i)(1 - i)) = sqrt(1 + i) sqrt(1 - i)
This made me curious about whether the product of square roots rule holds for complex numbers. What I thought would be just a quick corroboration via google resulted more in confusion and doubt than anything else. The product of square roots rule for real numbers assumes that the numbers are non-negative, as for example stated here. For complex numbers it becomes more confusing, with some questions at Stack Exchange asking why doesn't multiplying square roots of imaginary numbers follow the rule, and another trying to prove that it does, with confusing answers.
Player (42)
Joined: 12/27/2008
Posts: 873
Location: Germany
Warp wrote:
The product of square roots rule for real numbers assumes that the numbers are non-negative, as for example stated here. For complex numbers it becomes more confusing, with some questions at Stack Exchange asking why doesn't multiplying square roots of imaginary numbers follow the rule, and another trying to prove that it does, with confusing answers.
Well, what I'll write is similar to one of the SE answers, but I hope it will help. The confusion is mostly because the square root function has properties in the complex numbers that are a bit different from those in the real numbers. To begin with, the real numbers are totally ordered, while the complex numbers are not. That means you cannot choose a subset of complex numbers and call them "non-negative". Because of that, the definition of the real square root of x, the unique real number whose square gives x and is non-negative, cannot be used for complex numbers, because it assumes the existence of a total order, which does not exist in the complex case. That does not mean you cannot define the complex square root, but it will have some weird properties. If you write the complex number in polar form, you get an amplitude and a phase. The square root of the complex number is given by the square root of the amplitude and half the phase. The big issue is that there are two ways to halve the phase. Think about the angle of 30 degrees. Because two angles that differ by 360 are identical, there are two ways to halve 30 degrees, you can use 15 degrees or 195 degrees, because 2*195 = 390 = 360 + 30. So, if the complex number is not zero, you always have two choices for the square root. We usually call this general phenomenon "ramification". If you look at the problem purely algebraically, then the product formula is in fact true. That's because you can read it as "if x is the square root of a, and y is the square root of b, then xy is the square root of ab". This proposition is true, and in fact very easy to prove, you just need to use the fact that multiplication of complex numbers is multiplicative. Now, one property that the real square root has is continuity. The reason that you read that this formula is not true is because if you try to define the complex square root continuously, you get a lot of problems. One way to try to do it is choose the phase of a complex number z to be between 0 and 360 degrees, and set sqrt(z) to have half that, between 0 and 180. Now, look at the square root of 1, it's 1. But if you look at a number 1-ie, where e is very small, by the rules you should choose the phase as something close to 360, so sqrt(1-e) is in fact something close to -1. Because of this, the definition of the square root is not continuous. You can try to fix the problem by using phases from -180 to 180 degrees, but that only transfers the discontinuous point (actually, the entire half-line) from 1 to -1. It can be proved that you can never define the square root to be continuous in the whole complex plane, it will always have a branch cut. If you understand sqrt(a) as the value of the function discussed previously, because of the branch you can always find two values a and b for which sqrt(ab)=sqrt(a)sqrt(b) fails. There is a way to define the square root while keeping continuity though, you can define it as a Riemann surface, which is a way to complete the surface "going around the branch". It has some weird properties, for example if you take a closed path around the origin, the phase you choose for the square root is changed (this is what we call [url=https://en.wikipedia.org/wiki/Monodromy]monodromy), but depending on what you understand for "sqrt(a)", the product rule can be true or false, depending on your definition. An even weirder way to define it is to take the square root as a multivalued function, (or, equivalently, by a reduction of the Riemann surface at the points whose square gives the same complex number), it in fact is continuous, and gives a manifold that's isomorphic to the Möbius strip. In this multivalued function case, the product formula is true. TL;DR: For many cases, mathematical notation is not precise and you should not assume that by simply writing sqrt(z) for complex z there is a unique definition. For this case, there are many possible and reasonable definitions. Because of this, "Is sqrt(ab)=sqrt(a)sqrt(b) for complex a and b?" is not a good question. To understand this, it's important to study the mathematical concepts and understand the relations between them.
Player (36)
Joined: 9/11/2004
Posts: 2630
You are correct that it does not hold for all cases. But it does hold for this case. So let's talk about it. When does sqrt(wz) = sqrt(w)sqrt(z) and when does it not. Complex numbers are of the form r e with r and θ real, and where the arg(z) = θ is periodic on 2π. (ie, e = ei(θ + 2kπ) with Integer k). And where θ itself is in (-π, π]. This last part seems as if it doesn't matter, because it's periodic on 2π, but we use it by convention that this is the "true" value of θ because it gives us a single, unambiguous representation. This means that for any complex number z (except 0), that sqrt(z) has two distinct possible values. sqrt(z) = sqrt(r e) = sqrt(r) sqrt(e) = sqrt(r) sqrt(ei(θ + 2kπ)) = sqrt(r) ei(θ/2 + kπ) Because the exponent of a general complex number is periodic on 2π, but this complex number is periodic on π, there are two different values that this number is oscillating between, depending on which representation is chosen. But we demand that the sqrt have only a single value. We want these things to be functions. So we've defined sqrt(z) to be the value of z with the smaller magnitude theta. The one that has a value on (-π/2, π/2]. This is called the principal sqrt. So when does sqrt(wz) = sqrt(w)sqrt(z)? When the arg(sqrt(wz)) = arg(sqrt(w)sqrt(z)). arg(sqrt(wz)) = arg(sqrt(w)sqrt(z)) arg(sqrt(rw ew rz ez)) = arg(sqrt(rw ew) sqrt(rz ez)) arg(sqrt(rw rz) sqrt(ei(θw + θz))) = arg(sqrt(rw) sqrt(ew) sqrt(rz) sqrt(ez)) arg(sqrt(ei(θw + θz))) = arg(sqrt(ew) sqrt(ez)) arg(ei(θw + θz)/2) = arg(sqrt(ew/2) sqrt(ez/2)) (θw + θz + 2πk)/2 = θw/2 + θz/2 In this last line (θw + θz + 2πk)/2 represents the arg of the combined sqrt. This value is constrained to (-π/2, π/2] because it's the direct output of the sqrt operation. The k may be -1, 0, or 1 depending on if θw + θz is on the range (-π, π] (so k = 0), or if the addition moved the total off of the canonical range and it is strayed into (-3π, -π] (so k = 1), or (π, 3π] (so k = -1). However, θw/2 + θz/2 does not require fixup, it is composed of addition of two values on the range (-π/2, π/2] so it has a range (-π, π]. So ultimately, if arg(w) + arg(z) = arg(wz) then sqrt(wz) = sqrt(w)sqrt(z). Otherwise, the value found of the will not be the principal sqrt. It will be the the value of the second branch and differ from the principal by a factor of e = -1.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Amaraticando
It/Its
Editor, Player (159)
Joined: 1/10/2012
Posts: 673
Location: Brazil
This forum needs a LaTeX renderer.
Active player (500)
Joined: 11/19/2007
Posts: 128
Here's a problem I saw recently. Not sure if it was posted before. A plane has 100 seats, numbered from 1 to 100. The 100 passengers board the plane in numerical order, i.e. the passenger whose seat is number 1 boards first, then the passenger whose seat is number 2 boards the plane and so on. The first passenger chooses a seat at random and sits there. For all the remaining passengers, if their seat is not taken, they take their own seat, otherwise they choose a seat at random from the remaining vacant seats. What is the probability that the final passenger sits in his own seat? ('at random' here means such that each choice of seat is equally likely)
Editor, Expert player (2073)
Joined: 6/15/2005
Posts: 3282
NxCy wrote:
A plane has 100 seats, numbered from 1 to 100. The 100 passengers board the plane in numerical order, i.e. the passenger whose seat is number 1 boards first, then the passenger whose seat is number 2 boards the plane and so on. The first passenger chooses a seat at random and sits there. For all the remaining passengers, if their seat is not taken, they take their own seat, otherwise they choose a seat at random from the remaining vacant seats. What is the probability that the final passenger sits in his own seat?
For this problem, it's not too hard to find the answer. The answer is 1/2, as follows: At some point, someone other than the last person will choose either seat 1 or 100. If seat 100 is chosen, then the last person does not take their own seat. Otherwise, if seat 1 is chosen by the kth (possibly 1st) passenger, then there is some sequence (possibly of length 1 or 2) where person 1 sits in seat i1, whose person sits in seat i2, ..., whose person sits in seat k, whose person sits in seat 1, and all intervening seats are filled with their corresponding passengers. In that case, the remaining passengers take their seats, and so the last person takes their own seat. Since seats 1 and 100 when open can be chosen with equal probability at all stages, then the answer is 1/2.
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
blackpenredpen recently dealt in a youtube video with what could be considered a challenge. He first gave a simplified version of the challenge: 1/(3*4) + (1*2)/(3*4*5) + (1*2*3)/(3*4*5*6) + (1*2*3*4)/(3*4*5*6*7) + ... = ? Then he gave the original challenge, which was: 17/(75*76) + (17*18)/(75*76*77) + (17*18*19)/(75*76*77*78) + (17*18*19*20)/(75*76*77*78*79) + ... = ?
Editor, Expert player (2073)
Joined: 6/15/2005
Posts: 3282
Warp wrote:
blackpenredpen recently dealt in a youtube video with what could be considered a challenge. He first gave a simplified version of the challenge: 1/(3*4) + (1*2)/(3*4*5) + (1*2*3)/(3*4*5*6) + (1*2*3*4)/(3*4*5*6*7) + ... = ? Then he gave the original challenge, which was: 17/(75*76) + (17*18)/(75*76*77) + (17*18*19)/(75*76*77*78) + (17*18*19*20)/(75*76*77*78*79) + ... = ?
Telescoping sums is the way to go, for this and similar questions. However, there is a way to do the original challenge (and the simplified version) that is better than in the blackpenredpen video. The way he does it, he uses partial fractions to rewrite 1/(n*(n+1)*(n+2)) as (1/2)[1/n - 2/(n+1) + 1/(n+2)], for which the terms cancel by telescoping sums. While this is very useful in general, you would not want to do this on the original challenge, which has 59 fractions! The key is to note that each term has consecutive numbers multiplied together in the denominator. Thus we only need to decompose 2/(n*(n+1)*(n+2)) = 1/(n*(n+1)) - 1/((n+1)*(n+2)), which telescopes. So on the simplified version, we would have: 1/(3*4) + (1*2)/(3*4*5) + (1*2*3)/(3*4*5*6) + (1*2*3*4)/(3*4*5*6*7) + ... = 2/(2*3*4) + 2/(3*4*5) + 2/(4*5*6) + ... = 1/(2*3) - 1/(3*4) + 1/(3*4) - 1/(4*5) + ... = 1/6. This can be applied to the original challenge as well: 17/(75*76) + (17*18)/(75*76*77) + (17*18*19)/(75*76*77*78) + (17*18*19*20)/(75*76*77*78*79) + ... = (17*18*...*74)[1/(18*19*...*76) + 1/(19*20*...*77) + ... ] = (17*18*...*74)(1/58)[1/(18*19*...*75) - 1/(19*20*...*76) + 1/(19*20*...*76) - 1/(20*21*...*77) + ...] = (17*18*...*74)(1/58)[1/(18*19*...*75)] = 17/(58*75) = 17/4350, which is way faster than trying to find a 59-fraction partial fraction decomposition.
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
Coincidentally blackpenredpen posted another way to solve it. Link to video
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
Is there a closed-form expression, or elementary function, that takes as parameter a nonnegative integer and gives as result an integer such that the binary representation of that integer has a given amount of 0 "bits" appended (or prepended) to each of the original "bits"? It doesn't matter if the 0-bits appear before or after each bit (as long as it's the same for all of them). So let's assume we want to append (or prepend) three 0-bits between each of the bits of the original value. Thus (all these in values in base-2): 02 becomes 00002 (ie. just 0) 12 becomes 10002 102 becomes 100000002 112 becomes 100010002 1012 becomes 1000000010002 etc. Or, alternatively, if it's easier, 02 becomes 00002 (ie. 0) 12 becomes 00012 (ie. 12) 102 becomes 000100002 (ie. 100002) 112 becomes 000100012 (ie. 100012) 1012 becomes 0001000000012 (ie. 1000000012) etc. The formula should be modifiable so that rather than three 0's, it could be some other amount.
Active player (500)
Joined: 11/19/2007
Posts: 128
I have a fairly ugly function that may or may not be what you're looking for. Apologies in advance for the poor notation. You can add zeros to the end of digits by multiplying each digit by powers of 10. Let f(N, x) be the number x with N zeroes added to the right of each digit. You can construct f using a series: f(N, x) = sum from r=1 to infinity of [ 10^(r(N+1) - 1)*g(r, x) ], where g(r, x) gives you the r'th digit of x and ideally g(r, x) = 0 once r is greater than the total number of digits in x. Alternatively, you can just write it as a finite sum up to the number of digits in x. What is g? With a bit of playing around I got it in terms of the floor function: g(r, x) = floor(x/10^(r-1)) - 10*floor( floor(x/10^(r-1)) / 10) Overall... f(N, x) = sum from r=1 to infinity of [ 10^(r(N+1) - 1)*[ floor(x/10^(r-1)) - 10*floor( floor(x/10^(r-1)) / 10) ] ] Adding zeros to the left of a number is really the same problem: just add zeros to the right of the digits but start from the 2nd digit instead (and then stick the very first digit on the end, e.g. by multiplying everything by 10 and adding the first digit).
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
By "closed-form" expression I was explicitly excluding infinite sums, or sums where the amount of terms somehow depends on the input value.
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
In another forum I participated in a discussion about the dot-product of vectors. I commented how serendipitously and usefully, from the point of view of geometry problems and computations, the dot-product of two vectors is the sum of the products of their components, which is also the same value as the products of the magnitudes of the vectors and the cosine of the angle between them (a fact that's sometimes really useful in many geometric problems, and is really handy because you don't need to do any trigonometry to calculate it). Somebody commented about the "law of cosines." I commented that the law of cosines is something else entirely. However, a couple of seconds later I started to doubt. What was the law of cosines once again? When I checked what it was, I started doubting even more. Perhaps the law of cosines isn't actually completely unrelated to the dot product? There are some similarities. Is there a relation between the two?
Player (42)
Joined: 12/27/2008
Posts: 873
Location: Germany
Yes, they are related. Take two vectors A and B and evaluate the dot product of A+B with itself. Expanding the product you get the square if magnitude of A+B in terms of the magnitude of A and B and the cosine if their relative angle. Geometrically, that's equivalent to a relation between three sides of a triangle and the cosine of one of the angles, the law of cosines. Also, using the fact that the cosine is always between 1 and -1 you can derive the Cauchy-Schwarz inequality, which holds in more general vector spaces.
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
More coincidences. I presented elsewhere the simple problem that I did here before: "It takes Mark 3 hours to walk from town A to town B, and it takes Julia 5 hours to walk from town B to town A. Assuming they start walking at the same time, and walk at a constant speed, how long does it take for them to meet?" After the answers I noted that the generic formula for the answer, (X*Y)/(X+Y), works for any pair of times X and Y. Somebody noted that that's actually the formula for the total resistance of two resistors in parallel. We couldn't figure out if that's just amazing coincidence, or if there's a correlation between the two. I guessed that it's not coincidence. Then I started wondering if the generic equation for parallel resistors, eg. for n resistors in parallel: 1/R=1/R1+1/R2+1/R3+...+1/Rn could be posed as a similar problem as above.
Skilled player (1416)
Joined: 10/27/2004
Posts: 1978
Location: Making an escape
That's also the formula for two capacitors in series.
A hundred years from now, they will gaze upon my work and marvel at my skills but never know my name. And that will be good enough for me.
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
I got it: The problem can be posited like this: "A water hose can fill a container in 3 hours. Another water hose can fill it in 5 hours. How long does it take to fill the container if both hoses are used at the same time?" This can be extended to any number of hoses, and I'm assuming the resistors-in-parallel formula can be used (even though I haven't thought about how to prove that). It's also probably conceptually closer to the resistors scenario.
Player (36)
Joined: 9/11/2004
Posts: 2630
For future reference, in EE that operation (the reciprocal of sums of reciprocals) has a shorthand notation in somewhat common use: A || B It has all of the properties that you would expect of an infix operator over the complex plane: it's commutative, associative, and follows the distributive property. A || B = B || A (A || B) || C = A || (B || C) C (A || B) = AC || AB It's also not just a coincidence that all of these problems have the form of sums of reciprocals.
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
OmnipotentEntity wrote:
C (A || B) = AC || AB
I think you typoed there. An interesting version of the problem could be posed by using an infinite amount of hoses/resistors (although using the hoses version is more misleading because it doesn't immediately become apparent what formula you need to use): Suppose one hose can fill the container in 1 hour. Another hose can fill it in 4 hours. A third hose in 9 hours. A fourth hose in 16 hours, and so on and so forth (going through the square numbers). How long does it take to fill the container if you use this infinite amount of hoses all at the same time? Which reminds me of: What's the answer to the problem posed in xkcd #356?
Editor, Expert player (2073)
Joined: 6/15/2005
Posts: 3282
Warp wrote:
Suppose one hose can fill the container in 1 hour. Another hose can fill it in 4 hours. A third hose in 9 hours. A fourth hose in 16 hours, and so on and so forth (going through the square numbers). How long does it take to fill the container if you use this infinite amount of hoses all at the same time?
Well, we just get 1+1/4+1/9+1/16+... = pi2/6, the number of containers filled per hour. So to fill one container, it takes 6/pi2 hours, or approximately 36.5 minutes.
Warp wrote:
Which reminds me of: What's the answer to the problem posed in xkcd #356?
According to explain xkcd, the question comes from a "Google Labs Aptitude Test" in 2004:
Randall explained in a speech at Google five days before this comic was released, that he was nerd sniped, in a way, by that problem in this test (see problem 10 on page 2), and got quite irritated when he ultimately found that it was actually a modern physics research problem, requiring very advanced math, far more complicated than the other puzzles.
The answer is 4/pi - 1/2, but unfortunately I cannot begin to explain to you how to get this value, even if I wanted to.
Post subject: Tricky math question.
Joined: 9/12/2014
Posts: 541
Location: Waterford, MI
A story problem that goes like this: Jane was counting her savings with the belief that 4 20s make 100. So every time she finds 4 20 dollar bills, she adds 100 to her calculator. She ends up with 2180. However, she realized that 5 20s make 100 and not 4. How much money does her savings actually have?
Banned User
Joined: 3/10/2004
Posts: 7698
Location: Finland
There's already a thread for math problems.
Masterjun
He/Him
Site Developer, Skilled player (1988)
Joined: 10/12/2010
Posts: 1185
Location: Germany
I merged the threads. About the problem: If there's supposed to be only a single solution, it requires quite some assumptions (or I just didn't understand the question). Say there are no $20 bills at all, and 218 $10 bills -> the calculator says $2180 and she actually has $2180. Say she has 21 of (4*$20) blocks (plus some correctly counted $80), -> the calculator says $2100+$80 = $2180 and she actually has $1680+$80 = $1760.
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)