Wikipedia:Reference desk archive/Mathematics/2006 October 5
From Wikipedia, the free encyclopedia
< October 4 | <<Sep | October | Nov>> | October 6 > |
---|
|
||||||||
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions at one of the pages linked to above. | ||||||||
Contents |
[edit] Constructing an sequence/equation to fit a sent of given arbitary numbers
I have series of five two-digit numbers that were selected at random. What is the easiest way to find an equation so that each of the numbers is a solution. Relatedly-- what is the easiest way to find a function that would define the sequence of those numbers (so that first few numbers in the sequence are those given?
Why do you ask? well. Lost is an amazing tv show, and I thought it would be most fun to use an equation in my class that is linked to The Numbers uses on Lost. I've done this by hand at some point in the past, but the precise method escapes me. I've got a computer program that can do it, but the round-off errors cause me to get results that are "close, but not exact".
--Alecmconroy 09:29, 5 October 2006 (UTC)
- You'll need at least a 5th-degree polynomial for that. Take a look at polynomial interpolation. ☢ Ҡi∊ff⌇↯ 10:56, 5 October 2006 (UTC)
- If A, B, C, D and E are five numbers, the equation (x–A)(x–B)(x–C)(x–D)(x–E) = 0 has solution set {A,B,C,D,E}. --LambiamTalk 16:49, 5 October 2006 (UTC)
- Define f(n) by
(E-4D+6C-4B+A)*n*(n-1)*(n-2)*(n-3)/24 + (D-3C+3B-A)*n*(n-1)*(n-2)/6 + (C-2B+A)*n*(n-1)/2 + (B-A)*n + A
- Then f(0) = A, f(1) = B, f(2) = C, f(3) = D, f(4) = E, and f(5) gives the next number in the sequence. -- Four Dog Night 22:42, 5 October 2006 (UTC)
- I done this months ago. Basically what you are looking for is an equation that:
- f(0)=A
- f(1)=B
- f(2)=C
- f(3)=D
- f(4)=E
- I'll see if I can dig up the equations.
Here it is
#!/usr/bin/python from simplematrix import * seq=[ 4 , 8 , 15 , 16 , 23 , 42 ] list=[] for x in range(len(seq)): list.append((x,seq[x])) print list lenseq=len(list) print "lenseq=",lenseq mlist=[] for datum in list: (x,y)=datum row=[] for p in range(lenseq): row.append(x**p) row.append(y) mlist.append(row) A=matrix(mlist) A.display() B=A.copy() B.gauss() print "B=" B.display() C=B.last_Vvec() print "C=" C.display()
solving
- where
- and
- and
- and
- and
- and
Solving the equation using Computer Algebra System is a nightmare
a0 = y0 25*y0 y4 4*y3 a1 = (4*y1) - (3*y2) - ----- - -- + ---- 12 4 3 35*y0 13*y1 19*y2 11*y4 7*y3 a2 = ----- - ----- + ----- + ----- - ---- 24 3 4 24 3 3*y1 7*y3 5*y0 y4 a3 = ---- - (2*y2) + ---- - ---- - -- 2 6 12 4 (y0 + y4 - (4*(y1 + y3)) + (6*y2)) a4 = ---------------------------------- 24
- 202.168.50.40 23:07, 5 October 2006 (UTC)
Given a finite set and a function you can get a polynomial of degree at most that assumes those values:
Can you believe that Wikipedia-TeX doesn't support friggin' \substack? A damn shame. One minute to compose a flippant response, ten to try to get the formula to look OK and the spacing is still crap. It doesn't even support \lvert and \rvert. –Joke 02:05, 6 October 2006 (UTC)
-
- There is no special about polynomials, you can also solve this using this non-polynomial equation.
-
- solving
[edit] Thanks and another related question!
Wow! thanks for the excellent answers. Based on your advice, I've constructed the answer to the two questions I posed earlier, given my specific set of arbitrary numbers: 4,8,15,16,23,42. If you watch the show Lost that is all the rage, these numbers are supposed to have deep spiritual significance to Life, The Universe, and Everything (the sixth one in particular).
For anyone interested, the equation that has those six numbers as a solution was:
- x6 − 108x5 + 4405x4 − 87270x3 + 881464x2 − 4239552x + 7418880 = 0
That was simple enough, and I can't believe I missed how to construct it.
The second question, however, has proven more elusive. I found a correct formula that will define the sequence in question:
- S(n) = (1 / 40)(2400 − 4896n + 3670n2 − 1175n3 + 170n4 − 9n5)
Everything looks good, until I try to extrapolate out what the "next" numbers in the sequence are. The seventh number should be 46-- so far so good. The eighth number, however, is -52, and successive numbers after that shoot off to negative infinity. So, it seems I've encountered another example where math and computers have given me exactly what I asked for-- but not what I actually wanted. Therefore, let me reformulate the question:
How do I find a formula for a strictly increasing sequence of arbitrary natural numbers?
I have an answer if I'm willing to let myself use recursive definitions and the absolute value function, but, it's sort of a cop-out, because we're going to use piece-wise definition, I might as well just define a piecewise function that gives me the sequence, rather than going through a bunch of magic to make it look like it's a single equation, when really, there are piecewise functions hidden in the absolute value signs.
Any suggestionf for how I could accomplish this new goal? --Alecmconroy 10:52, 7 October 2006 (UTC)
- Try
-
- S(n) + (n − 1)(n − 2)(n − 3)(n − 4)(n − 5)(n − 6)f(n)
- where f is some random function (the constant 1, for example). Fredrik Johansson 11:42, 7 October 2006 (UTC)
-
- That would buy me strictly increasing, but I still have the problem of ensuring positive integer solutions. And of course, it'd be nice if I could find a fifth order polynomial that could do this. --Alecmconroy 12:48, 7 October 2006 (UTC)
- I see you're putting this on Lostpedia. Fine, but what really is the point? There are many interpolating polynomials/functions based on arbitrary data (like Fredrik says, you can choose "some random function" to do the job for you), and unless you make this more specific (which you can't, since you're only given the six Lost numbers), it's not going to "mean" very much.
- Coincidentally, if you haven't been following the Lost Experience game, go watch the Sri Lanka video (find it on Lostpedia), it gives a canon explanation for what exactly these numbers are for. Dysprosia 11:49, 7 October 2006 (UTC)
-
- Dysprosia, you make a good point. Over the time I was working on this problem, I did on occasion ask myself "Why am I doing this again???". Theere are a couple answers here. The first is that, at this point, it really has nothing to do wth Lost anymore. When I first heard the numbers, I wondered if there was some important pattern to them, as did everyone. But by now, I think everyknow knows the essentially just made them up. But, between seeing the numbers and having that realization, I got the question "How do I find equations for arbitrary sequences of numbers) in my head, and once I realized I didn't know the answer, it drove me crazy trying to find it.
-
- The second answer, which is much more trivial, is that there is one tiny small possibility that this could have some bearing on the actual show Lost. They've got lot of years ahead of them yet, and they'll need to fill it up with a lot of mythology. If at some point they decide they need to have a seventh number, or have a SIMPLE equation for the numbers on a blackboard somewhere, then the creators of the show might call up a mathematician who would do the exact same thing I'm doing in order to try to figure out what the seventh number "should" be. In which case, I will be able to say "I called it!" and brag for all eternity. But, that's really not at issue-- the real issue is, I have an obsessive need to learn the solutions to interesting math problems.
-
- About Lostopedia-- yeah, I went ahead an posted the equations I've found to there, just so anyone who's interesting could take a peek. I figured they could always rip it down if nobody finds it interesting but me. hehehe.
- --Alecmconroy 12:33, 7 October 2006 (UTC)
[edit] arithmetic sequences of integers and prime powers.
I'm wondering about possible generalizations and variants of Dirichlet's theorem that (a,b)=1 means {|a+kb|} contains infinitely many primes. Supposing (a,b)=1, and n is a fixed integer greater than 1. One question is: Must {|a+kb|} contain infinitely many nth powers of primes? If not, for which n, if any, and is it a function of a and b(aside from relative primehood)? Thanks.Rich 10:41, 5 October 2006 (UTC)
- For a start, see quadratic residue. For all primes in the same residue class mod b, the nth powers lie again in one residue class mod b. E.g., there are no primes whose squares are 2 or 3 mod 5, but all primes of the form 5k+2 (infinitely many) have squares of the form 5k+4.--gwaihir 12:08, 5 October 2006 (UTC)
Thanks, that's a good answer.Rich 12:49, 5 October 2006 (UTC)
[edit] Plim's v. lim
What is the difference, in practice, of a probability limit and a normal limit? How does knowing a plim help? ChowderInopa 14:06, 5 October 2006 (UTC)
- Uhh, some series converge in probability but not almost surely or pointwise almost surely or pointwise. It is a weaker notion. See convergence of random variables and come back if you have any more questions. What do you mean by "in practice"? –Joke 01:30, 6 October 2006 (UTC)