Wikipedia:Reference desk/Mathematics
| |||||||||
How to ask a question
| |||||||||
|
| ||||||||
After reading the above, you may
. Your question will be added at the bottom of the page. | |||||||||
How to answer a question
|
|
May 15
Poisson Process
With a sequence of iid exponential variables with parameter . With definition of sequence:
Which of these two process is a poisson process with parameter?
Hessam 09:22, 15 May 2006 (UTC)
- How come this sounds so much like a homework problem? Could the reason be that it is a homework problem? If it is a multiple-choice test in which at least one answer is correct, then there is an easy way of eliminating one incorrect answer by considering P[At = 0] and P[Bt = 0]. --LambiamTalk 13:12, 15 May 2006 (UTC)
No it's not a multiple choice problem. With considering both on 0 position we can get nothing. There should be another reason in 3 other conditions of poisson process. I have no idea. No other idea?! Hessam 22:47, 15 May 2006 (UTC)
:-((
Hessam 08:00, 16 May 2006 (UTC)
- I don't know what the "3 other conditions of poisson process" are. I know the condition given under Poisson process. Taking N0 = 0, we have P[Nt = 0] = exp(–λt).
- Let us see if B fits. Assume t > 0. We have P[Bt = 0] = P[inf{n ∈ Z : Sn ≥ t} = 0] = P[S0 ≥ t] = P[0 ≥ t] = 0. No, this doesn't agree with exp(–λt). So B is out.
- Next we try A again with t > 0. Now P[At = 0] = P[sup{n ∈ Z : Sn ≤ t} = 0] = P[S0 ≤ t ∧ S1 > t] = P[S1 > t] = P[T1 > t] = 1 – P[T1 ≤ t] = 1 – (1 – exp(–λt)) = exp(–λt). Yes, that fits. This isn't a proof that A is a Poisson process; for that you have to consider the more general expression P[Nt+τ – Nt = k]. But it's a start. --LambiamTalk 15:09, 16 May 2006 (UTC)
I knew nothing about this subject, but after a quick glance at poisson process I would guess it's A(Not sure if B is correct), as it resemble the "classic" telephone call example. --Lemontea 13:50, 16 May 2006 (UTC)
Thank you for your answers :-) Hessam 21:31, 16 May 2006 (UTC)
Can a dot product return a complex number or just reals?
In the Spanish Wikipedia it says it returns "scalars". In the English "reals". Thanks.
- What do you mead by "dot product"? If you mean the scalar product in real vector spaces, of course it never returns complex numbers just because the vector space is, indeed, real. In general, if you have a vector space over some field , any scalar product will return an element of , as a definition. Have a look at Scalar product for a general definition. Cthulhu.mythos 11:44, 15 May 2006 (UTC)
- In short - Yes, if the vectors are over the field of complex numbers. -- Meni Rosenfeld (talk) 12:22, 15 May 2006 (UTC)
- Indeed, as the questioner noticed, the article Dot product states: "the dot product [...] returns a real-valued scalar quantity." If this is wrong (or too simplistic) as stated, it should be corrected. The Dot product article starts with "For the abstract scalar product or inner product see inner product space", but it may not be clear to the reader looking up "dot product" whether what they are looking for fits the notion of "abstract scalar product or inner product". --LambiamTalk 13:34, 15 May 2006 (UTC)
- A dot product is assumed to be the standard Euclidean inner product of a real vector space. We would not usually call an inner product of complex numbers a dot product. (Next time, it would be better to ask on the article talk page so the discussion stays associated with the article.) --KSmrqT 14:22, 15 May 2006 (UTC)
Gaussian curvature --> radius
Curvature and radius are reciprocals of each other. So, given , where M and N are the principal radii of curvature, the Gaussian curvature equals , not , so that means the radius of Gaussian curvature must, therefore, equal , not —? But how can that be? Is it actually Gaussian curvature2? ~Kaimbridge~ 13:47, 15 May 2006 (UTC)
- A different choice is the mean curvature, which for a sphere will be the reciprocal of its radius. --KSmrqT 15:04, 15 May 2006 (UTC)
- (edit conflict) "Radius of Gaussian curvature" is not a defined and meaningful notion. "Radius of curvature" is meaningful for curves in 2-space, and "Gaussian curvature" is the curvature of surfaces in 3-space. See Curvature. --LambiamTalk 15:06, 15 May 2006 (UTC)
- However the radius of the two principal curvatures is defined, and are used to define the focal surface which have been studied in singularity theory and also have aplications in optics. At a point p on a surface with normal N then the two points , , define the focal surface. --Salix alba (talk) 16:26, 15 May 2006 (UTC)
- I have been going back and forth between curvature, Gaussian curvature, principal curvature (and others), but the discussion is mostly abstract theory. Is the more complete, clarified relationship, "2-space (I presume, meaning 2-D space?) curvature" is the reciprocal of its radius, and "3-space curvature" (such as Gaussian) is the reciprocal of radius2? As for semantics, the radius is the inverse of "whatever curvature", so it would seem the proper order is "radius of Gaussian curvature", not "Gaussian radius of curvature". Consider the two possibilities for "mean" (a, b are the equatorial, polar radii):
- Mean radius of curvature:
- Radius of mean curvature:
~Kaimbridge~ 18:12, 15 May 2006 (UTC)
- It is correct that the curvature of a curve at a given point is elementary: fit a circle to osculate there, and take the reciprocal of its radius. But as soon as we increase the dimension of our object, whether to a surface embedded in 3D or beyond to a general n-manifold (Riemannian) with no explicit embedding, curvature becomes a much richer phenomenon. No single number, however computed, can capture everything. For example, at a given point on an ellipsoid we can take slices in different directions and get curves with different osculating circle radii. We can prove that these values have a minimum and a maximum (the principal curvatures), and we can combine them into a single number; but how shall we combine them? No matter what choice we make, we lose information.
- If we are interested in minimal surfaces, like soap bubbles, we must average the min and max curvatures (obtaining mean curvature). But if we are working with a surface which is not given as an embedding, then we must work intrinsically and use Gaussian curvature. And as we move up in dimension to curved spaces, we encounter options such as sectional curvature, the Riemann curvature tensor, Ricci curvature, and so on.
- The broad idea is to have some way to summarize the "shape" of a (well-behaved) geometric object near a given point. (Of course, now that fractal objects have entered the common awareness, we know that curvature may not always be a meaningful measure.) Yes, the choices make learning more of a challenge, but they also make nice pictures. [1][2][3] [4] --KSmrqT 09:03, 16 May 2006 (UTC)
- Right, I realize these things can and do get complicated! P=) For instance, Gaussian may or may not be apparent, depending on an equation's form. E.g., (where is geodetic latitude and its azimuth):
- But, my question, here, isn't so much about its application, but its basic radius-curvature relationship. Maybe it would be better asked another way. How would you define/describe "MN"?: "Radius of Gaussian curvature", "radius of Gaussian curvature2" or "radius2 of Gaussian Curvature"? ~Kaimbridge~ 17:01, 16 May 2006 (UTC)
- As follows:
- MN: inverse of Gaussian curvature
- radius of Gaussian curvature: meaningless and undefined notion
- radius of Gaussian curvature2: meaningless and undefined notion
- radius2 of Gaussian curvature: meaningless and undefined notion
- Not all combinations of mathematical terms have a meaning. This thing just happens to be called "Gaussian curvature". That is an accident of history. It might as well have been called "Intrinsic contortion", in which case you probably wouldn't have thought of asking for its radius. --LambiamTalk 18:28, 16 May 2006 (UTC)
- As follows:
Matrix exponentiation
I have a matrix:
0 a b 0 c d 0 e f
that I would like to exponentiate. Can this be done analytically, and if so, what is a good approach? --HappyCamper 19:27, 15 May 2006 (UTC)
- Find The Jordan form of A: A = Q-1UQ. Then exp(A) = Q-1exp(U)Q. So the problem is reduced to exponentiating a Jordan matrix. Since exponentiation of a block diagonal matrix is done block-wise, the problem is reduced to exponentiating a Jordan block. If the eigenvalue of a block D is λ, then exp(D) = exp(λI) exp(D - λI), so we are left with exponentiating a nilpotent Jordan block. This is easy from the power series. Note, however, that if this is a parametric matrix (a, b etc. are unknown), the result will be a monster. -- Meni Rosenfeld (talk) 19:53, 15 May 2006 (UTC)
- Unfortunately, yes, the parameters are unknown. Is there a witty method which I can use to exploit the zero eigenvalue of the matrix, or perhaps use the Cayley-Hamilton theorem? --HappyCamper 19:59, 15 May 2006 (UTC)
- I doubt it. I've let Mathematica do this matrix, and the result certainly isn't pretty. So my guess is that any approach would force you to do some dirty work. The approach I described should work here as well - you would obviously have to also divide the problem to distinct cases (unless you are only interested in the probable case that all 3 eigenvalues are distinct). Do the calculations symbolically with the parameters, and denote as auxillary variables expressions that occur frequently (such as ). Perhaps there is some slightly easier way, but I am skeptical about any miraculous instant solutions. -- Meni Rosenfeld (talk) 20:10, 15 May 2006 (UTC)
- Oh, Mathematica can handle this? Hmm...too bad I don't have access to it. --HappyCamper 01:38, 16 May 2006 (UTC)
- A free alternative for symbolic mathematics is the venerable Maxima, a decendent of the original MIT Macsyma. The list of computer algebra systems is a valuable resource, since each system has its strengths and weaknesses, including price, specialty, capability, and reliability.
- It does appear that the first column of the result is (1,0,0)T. However, the middle entry of the last row (one of the simpler entries!) causes Mathematica's FullSimplify to produce this mess:
- Recall that the matrix exponential is defined by the same power series as exp, so will involve not only products of the matrix with itself, but also sums. If we can diagonalize the matrix, as A = Q−1DQ, with Q orthogonal and D diagonal, then we get tremendous simplification. First, notice that
- A2 = (Q−1DQ)(Q−1DQ) = Q−1D2Q.
- This generalizes to all powers. Next, notice that linearity of matrix multiplication (on both sides) allows the Q "sandwich" to group all the diagonal matrices inside.
- I + Q−1DQ + 1⁄2 Q−1D2Q + ⋯ = Q−1(I + D + 1⁄2D2 + ⋯) Q.
- Unfortunately, an algebraic expression for the diagonal form may be messy or impossible (for an n×n matrix the characteristic polynomial has degree n), and not every matrix can be diagonalized (hence the Jordan form). So unless the matrix A has special properties, its exponential won't be pretty. --KSmrqT 07:56, 16 May 2006 (UTC)
- Oh, Mathematica can handle this? Hmm...too bad I don't have access to it. --HappyCamper 01:38, 16 May 2006 (UTC)
- You can use the zero eigenvalue to reduce it to the exponential of a two-by-two matrix, as follows:
-
- This shows that the first column is indeed [1,0,0]T. If you insist, you can continue and get an analytic expression out of it. But it won't be pretty. -- Jitse Niesen (talk) 13:10, 16 May 2006 (UTC)
- You can use the zero eigenvalue to reduce it to the exponential of a two-by-two matrix, as follows:
- Shouldn't the exponents in the fourth and fifth forms be k-1? --LambiamTalk 13:46, 16 May 2006 (UTC)
- Yes, thanks. -- Jitse Niesen (talk) 02:34, 17 May 2006 (UTC)
- And hey, we have some analytic expression for the 2 by 2 matrix here: [5]. Thanks everyone! --HappyCamper 03:12, 17 May 2006 (UTC)
Pi
My question is, has anyone ever thought of using percentage, instead of Pi, in finding the circumference of a perfect Circle?
Thanks.
- Pi is the ratio of a circle's circumference to its diameter. Presumably, a "percentage" would be a ratio of approximately 314.159%; that is, pi. Or have I misunderstood your question? — Lomn Talk 21:05, 15 May 2006 (UTC)
Hi! Lomn,
Below is an example in using percentage instead of Pi.
Example: 3 x diameter plus the percentage equals the circumference of a perfect Cirle.
I think this is right. I hope this example gives a more clear understanding of my question.
Thanks.
- You could say: to get the circumference, take 3 × the diameter, and then add approximately 4.71975511966 percent. But what would the point of doing that? --LambiamTalk 00:09, 16 May 2006 (UTC)
- Well, something similar was attempted - see Grad (angle). While it is a bit easier for doing arithmetic with angles, when you start getting into stuff like calculus the factors get very annoying. Confusing Manifestation 01:14, 16 May 2006 (UTC)
- As noted above, there's no real purpose to this. Your percentage is still a ratio, and thus still bound to pi. Your equation has become, in effect, c = 3d + (π-3)d. — Lomn Talk 14:57, 16 May 2006 (UTC)
Hi! Lomn,
Well, instead of c = 3d + (π-3)d, how about something more like this; 33.333333333333333333333333333333% of d + 3d = C
Thanks.
- You can write it that way. The percentage would be 100 x π - 300. Approximately 14.15926...% of the original value, continuing with the digits of pi. You can't escape from pi. If you want the percentage to add to three times the diameter, divide that percentage by 3. Notinasnaid 18:19, 16 May 2006 (UTC)
- It isn't clear whether you thought this formula is correct (which it is not), or whether you are looking for a correct formula of the same form. If the latter, than as stated previously, you'll get that C is approximately 14.15926535897932384626433832795% of d + 3d. Again, no escaping π. -- Meni Rosenfeld (talk) 19:18, 16 May 2006 (UTC)
- Ultimately, any means of finding the circumference of a circle based upon its diameter (or radius, or any other term that is a ratio of the diameter) is going to be require a ratio, and that ratio is always pi. The only way to leave pi out of this is to forego the diameter entirely and physically measure a circle's circumference (I'll dodge the question of whether that constitutes mathematics, thanks). — Lomn Talk 20:59, 16 May 2006 (UTC)
I thank you all for helping me in finding an answer to my question. Again, Thanks.
Cauchy & d'alambert convergence criteria
Can anyone give me some "general" guidelines in which when to use each convergence criteria? Thanks.
- if you have a certain series, you put it into the formulas of the criterias. if one of the formulas you get seems simpler or easier to prove to pass the criteria use it. if it doesn't work try the other one.
- also note that some convergent series pass the cauchy criteria and not the d'alambert, so if you can't prove d'alambert for a series you'll have to try using the cauchy, even though the formula may happen to be much bigger or complicated. and then if this doesn't work too maybe you'll have to use other things ... or actualy find out and prove that the series does not converge. hope this helps. --itaj 00:25, 16 May 2006 (UTC)
thanks
Derivatives of complex exponentials
Suppose I'm considering zc where z is an element of the cut complex plane (Complex plane excluding the negative real axis), and c is some complex constant. This is defined by zc = exp(c Log(z) ). Now, if I want to take the nth derivative of zc, am I allowed to just use normal polynomial term differentiation rules (i.e. d/dz(zc) = czc-1), or do I have to go by the definition and use the chain rule? I tried finding the general term by the definition but it started looking like a horrible mess of product rules and so forth. I'm uneasy about just using the normal standard derivative since c is a complex number and not a real, so is there an easy way to calculate the general nth derivative? Thanks. Maelin 23:20, 15 May 2006 (UTC)
- is true in any region where zc is analytic, because . —Keenan Pepper 02:52, 16 May 2006 (UTC)
- Wow, that's nice. So as long as you stick to a single definition of log, the identity is automatically true. – b_jonas 17:56, 16 May 2006 (UTC)
Kuratowski closure axioms - topology defined by closure
about Kuratowski closure axioms. well, i already put this question in the talk page, but got no response. i think it's good enough to be here:
after reading the definition in the article, i can't see how to prove the following using the axioms:
- i.e. the infinite intersection of closed sets is closed.
and that's one of the needed properties of the closed sets in a topology. --itaj 00:02, 16 May 2006 (UTC)
- Well, for any j:
- ∩ cl A ⊆ cl A_j (essential property of intersections)
- cl ∩ cl A ⊆ cl cl A_j (axiom 3 implies monotonic)
- cl ∩ cl A ⊆ cl A_j (axiom 2)
- cl ∩ cl A ⊆ ∩ cl A (essential property of intersections)
- cl ∩ cl A = ∩ cl A (axiom 1)
- Melchoir 03:51, 16 May 2006 (UTC)
- Maybe I should poke back in here and explain: I got that by working backwards. It's like a proof in algebra: start with the statement you want, then look for a slightly simpler statement that implies it. At every step, there's often only one reasonable thing to do. Melchoir 03:59, 16 May 2006 (UTC)
May 16
Weak confluence in abstract reduction systems
It has been stated (attributed to Hindley, by Kleene, by my reference) that the abstract reduction system defined by reduction rules { b -> a, b -> c, c -> b, c -> d} is weakly confluent but not confluent. It is clear that elements b and c are weakly confluent, but why must elements a and d be weakly confluent? In general, if n is a normal form, n cannot be weakly confluent as for n to be weakly confluent, n must have a one-step reduction to some other element, but that immediately contradicts the supposition that n is a normal form -- if this reasoning is valid, then no abstract reduction system with a normal form can be weakly confluent, as an abstract reduction system is said to be weakly confluent if all of its elements are. The conclusion is highly counterintuitive. Is there a problem here? Dysprosia 10:02, 16 May 2006 (UTC)
- On the contrary, normal forms are confluent. Local confluence of a means something like: for all b and c, IF (a → b AND a → c) THEN there is some d such that (b →* d AND c →* d). So if a is normal this becomes: for all b and c, IF true THEN whatever. This is true. --LambiamTalk 11:49, 16 May 2006 (UTC)
- But if a is normal, no such reduction a -> b exists, simply because a is normal. Dysprosia 12:04, 16 May 2006 (UTC)
- Sorry, I made a mistake. I meant to write this: "So if a is normal this becomes: for all b and c, IF false THEN whatever." Unlike my previous attempt, this is true. Precisely because no such reduction exists, the confluence condition cannot be violated. --LambiamTalk 12:44, 16 May 2006 (UTC)
- Ah, I see. I'd forgotten about the wily nature of implication with false antedecents. Dysprosia 12:50, 16 May 2006 (UTC)
Rolling dice
ok, im working on a c++ program that does stuff with dice probability....
basically, what i need to know is this: if one has 4 4-sided dice, how many possible combinations add up to 7? 1123 and 2311 ARE different.... i got 20, but i dont think thats high enough
any help is appreciated
--spuck
- I got 20 as well - 12 for 1123, 4 for 1114 and 4 for 1222. That's correct. -- Meni Rosenfeld (talk) 20:17, 16 May 2006 (UTC)
- Perhaps the example of a pair of ordinary 6-sided (cube) dice creates false expectations. In that case 7 is the most likely roll, because for each value of the first number there is a suitable value of the second number: 1+6, 2+5, …, 6+1. Even so, only 6 ways are possible.
- The real problem with a fair 4-sided die is how to roll it! I'd suggest substituting a regular octahedron (8-sided), with each digit duplicated. ;-)
- Speaking as a D&D player who rolls a lot of d4s, I recommend bouncing them off the table. This will give the effect of a "roll". Easier to do than describe! --Sir Ophiuchus 00:34, 18 May 2006 (UTC)
- Back to mathematics, the question involves how to count so we know we've seen each possibility exactly once, and a little combinatorics. There is no single "right way" to do this. One natural approach for a program uses recursion: If the first die rolls 1, how many ways can 3 dice roll 6?
- For more mathematics, try the article on partition, and this link. --KSmrqT 10:45, 17 May 2006 (UTC)
I'm doing a homework assignment about sigma notation and I've come across a problem I can't solve such that if you guys show me how to do it, I can then apply that method to other, similar problems. (I've already checked out the sigma-notation page and I didn't find it to be of much help.) How would you express 35 + 48 + 63 + 80 + 99 in sigma notation?
- I think I figured it out. I can't use TeX very well, but this is my solution:
- — Preceding unsigned comment added by 162.83.220.154 (talk)
That's not right, it doesn't add up. —Mets501talk 21:03, 16 May 2006 (UTC)
OK, got it now (with the help of a quadratic regression on my calculator):
- , or, if you're one-based, – b_jonas 21:29, 16 May 2006 (UTC)
- Alternately, using binomials instead of powers, or – b_jonas 21:47, 16 May 2006 (UTC)
- Yet more alternatively, recognize that is , so (changing indices more) it's just , which seems likely to be the "original" form. --Tardis 22:10, 16 May 2006 (UTC)
- If you want to be a smartass, you could say where a1 = 35, ... Dysprosia
- or Or, even better, w00t--Deville (Talk) 22:37, 16 May 2006 (UTC)
- Surely the easiest is just . Each of the terms in the series is just one less than a square. Richard B 22:40, 16 May 2006 (UTC)
Yes, that was the easiest. I should have thought of that :-) —Mets501talk 02:57, 17 May 2006 (UTC)
- Surely this is really a case of identifying the series - which has been done with the "n2 − 1" above. But how do you identify it? The technique I was taught was try successive differences:
35 48 63 80 99 13 15 17 19 2 2 2
- And this implies a n2 is involved. -- SGBailey 10:02, 17 May 2006 (UTC)
- For lazy people (none of us), A005563 = n^2 - 1 is the first sequence found with "35 48 63 80 99" in an OEIS search. --DLL 18:30, 17 May 2006 (UTC)
May 17
Cancelling a sent e-mail on Gmail
I know well, that to cancel a sent e-mail is impossible, unless you have some access to the recipient's mailbox. But, now I got into situation when I need it very much. And, maybe, there is a way to do it after all?
I sent a letter form my gmail address to another person's gmail address, and I don't know the other person's password. I know that gmail made a lot of cool things, such as 2.5 G space, internal search, and stuff. Maybe they did implement the ability to cancel sent e-mails too? It's all on their servers after all. (By the way, many message boards like Vbulletin let you delete your unread PMs). If you know something, your help is very appreciated. I would be ready to pay a reasonable sum of money if you will help me.
Crocodealer 03:17, 17 May 2006 (UTC)
- I don't see what this has to do with mathematics. Regardless, I don't believe you can cancel sent emails, and Gmail isn't providing the feature and won't just because you ask them, or throw money at them. Sorry. Dysprosia 04:16, 17 May 2006 (UTC)
- It has nothing to do with mathematics, but on Wikipedia:Reference desk it is said: Mathematics. To ask questions about mathematics and computer science.
- (Tongue-in-cheek) Let's not be so hasty. The NSA are a major employer of both mathematicians and computers, and are surely well aware of the existence of this gmail. Although it will never be deleted from their files, they seem to have a great deal of influence with US corporations. If you could persuade them that this was in the US national interest, for which the threshold seems quite low, then perhaps they could arrange something. ;-) --KSmrqT 11:10, 17 May 2006 (UTC)
- It has nothing to do with mathematics, but on Wikipedia:Reference desk it is said: Mathematics. To ask questions about mathematics and computer science.
- So, where should I ask this question? Crocodealer
There's no way to cancel a sent email, even though it's gmail. -lethe talk + 05:17, 17 May 2006 (UTC)
- Tell the person that it's a virus and that if they open the email, it will immediately infect their computer. That way, there is at least a possibilty they will delete it without opening it ;) --AMorris (talk)●(contribs) 07:28, 17 May 2006 (UTC)
- Oddly enough, on many decent forum software, the PM(Private Messaging) does provide ability to retract a massage before the recipient read it. Regression, huh? ;) --Lemontea 07:54, 17 May 2006 (UTC)
- In fact, I have heared about an email client that allows the sender to delete a mail received by you, but I think it's more a bug than a feature and I doubt gmail would have it. – b_jonas 11:00, 17 May 2006 (UTC)
- I don't think that's possible with the current e-mail standards. However, Microsoft (in the new Exchange server IIRC) makes use of DRM technology to probably enable a sender to revoke the rights of the user to read the email. Dysprosia 11:05, 17 May 2006 (UTC)
- Sure it isn't possible, that's why it only works if the email reader client of the recipient also supports that extension. – b_jonas 22:48, 17 May 2006 (UTC)
- It's not a matter of software and "extensions", it's a matter of the underlying protocols supporting it, otherwise one could only send emails to those using the same program. Dysprosia 09:36, 20 May 2006 (UTC)
- There's always the obvious answer of just trying asking... did you try that yet? --Welcometocarthage 18:59, 17 May 2006 (UTC) Welcometocarthage
windows xp limited identity accounts
I have installed a game on my computer. When I try to play that game on a limited account, it stated that i need to have direct x 7 to play it. I have direct x 9, and the game works on an admin identity. Can I change settings on the limited accounts somehow to resolve this problem?
- I don't see what this has to do with mathematics. Dysprosia 04:16, 17 May 2006 (UTC)
- Wikipedia:Reference desk was changed and now states that this page should be used for questions in mathematics and computer science. I guess this includes questions like these. -- Jitse Niesen (talk) 05:03, 17 May 2006 (UTC)
- It would be best to possibly rename the page so it is absolutely obvious what should be here and what should not (IIRC the science desk is getting computing related questions too). Dysprosia 10:10, 17 May 2006 (UTC)
- We clearly need a computing reference desk. Fredrik Johansson 10:14, 17 May 2006 (UTC)
- This would probably be a preferable solution. Dysprosia 10:17, 17 May 2006 (UTC)
- I would also like that solution. Right now, it seems like computer tech support and computer science are trying to be split between math and science, which isn't great. -lethe talk + 02:21, 18 May 2006 (UTC)
- It's doubtful; it really depends on what permissions are needed. Those could vary from registry read permissions, to full permissions on a system directory somewhere. If you want to try and track them all down I'd suggest looking at the tools from sysinternals.com, specifically FileMon and Registry Monitor, which may provide useful pointers to track down what's going on. If you have XP Pro you could try creating a user in the Power Users group, and see if the game runs. --Blowdart 10:29, 17 May 2006 (UTC)
- Will there be multiple accounts trying to play? If not, it may work to uninstall (as admin) and then reinstall from the limited account. Or here's a thought: contact the game manufacturer. They sold the game, they provided the installer, and they probably have a forum for questions just like this. --KSmrqT 11:19, 17 May 2006 (UTC)
- I'm not sure about that. There's been a fair bit of discussion on the Reference Desk's talk page about how we could split it up further if we decide to do so, and it doesn't sound like a separate Computers desk would be a good idea. Black Carrot 02:18, 18 May 2006 (UTC)
List of mathematical series
Do we have such a list - I can't find one. Or do we rely on links to the maths sequence website? (One entry would be SUM(1+(2*n)) = (n+1)^2) -- SGBailey 11:32, 17 May 2006 (UTC)
- There appears to be no such list. There is the article Summation, which contains a list that covers a slightly simpler case and refers to Series (mathematics), which links to Arithmetic series, which covers a more general form of this particular summation. Forgive my ignorance, but what is the maths sequence website? The OEIS? --LambiamTalk 11:48, 17 May 2006 (UTC)
- Do you mean this? Black Carrot 12:04, 17 May 2006 (UTC)
- Yes. Obviously we don't want to duplicate the contents of OEIS, but I would have though a list of a few of the common ones (that used to be in high school maths courses or in "maths table books") would be worth having. -- SGBailey 16:05, 17 May 2006 (UTC)
factorials (!)
a friend of mine on the net tried to do 100,000 factorial (100,000!) on calc.exe partly to test the ability of the computers at his school. apparantly he cant even do it, but with my 1.1Ghz AMD Duron it didnt take longer than a couple minutes.
100,000! = 2.8242294079603478742934215780245e+456573
His challenge is: What is "1,000,000!" ? what is "1,000,000,000!" ? is anyone able to calculate these?
Use logarithm.
Calc 1*2*..*9 using log base 10.
Calc 11*12*..*99 using log base 100.
Calc 111*112*...*999 using log base 1000.
And so on.
It's easy to convert from a result in log base 10 to a number in log base 100. And so on. Ohanian 12:57, 17 May 2006 (UTC)
- The number of digits for each for an exact answer would be extremely long. By means of Stirling's approximation, 1000000! has approximately 5565709 decimal digits. 1000000000! will have much much more. Dysprosia 13:06, 17 May 2006 (UTC)
- Not directly related to the question here, but you can do really cool stuff with Stirling's approximation. For example, if you flip a fair coin 2n times, what is the probability that you will get exactly n heads and n tails? The exact value is . But apply Stirling's approximation to the factorials, and for large n this works out to be approximately . Chuck 18:22, 17 May 2006 (UTC)
- I think you mean --Deville (Talk) 19:13, 17 May 2006 (UTC)
- Yep, you're right. Chuck 19:47, 17 May 2006 (UTC)
- And that's actually cool in another way - it looks to me like it's proving a result also derivable from the Central limit theorem, and any time a result can be shown in two completely different ways is a cool thing in my book. Confusing Manifestation 06:21, 18 May 2006 (UTC)
- I think you mean --Deville (Talk) 19:13, 17 May 2006 (UTC)
- Not directly related to the question here, but you can do really cool stuff with Stirling's approximation. For example, if you flip a fair coin 2n times, what is the probability that you will get exactly n heads and n tails? The exact value is . But apply Stirling's approximation to the factorials, and for large n this works out to be approximately . Chuck 18:22, 17 May 2006 (UTC)
- Calc.exe takes minutes to calculate 100,000! approximately? I've written a program that finds the exact value of 100000! in 0.5 seconds (and 1,000,000! in 20 seconds) on my computer. Here's a slightly simplified version of it. 1,000,000,000! is quite a big number, though; it'd take over 3 gigabytes of memory just to store it. As Dysprosia said, you can use Stirling's approximation to find the approximate value. Fredrik Johansson 18:02, 17 May 2006 (UTC)
--- Fredrik, i find the fact that you have such a program very interesting, however... i do not know python well enough to be able to compile it, and in fact the only reason i know about it is its on all the college computers here... and my friend wants me to learn it this summer. Is there any way you could just calculate the numbers for me? or get me the exe? I dont even need the answer with all digits, just something like i posted, like 1.902526*10^6045073 or whatever massive number it comes out to be. Hope you all understand my question now :) -Mike ---
- Stirling's formula gives
- Taking n = 109 gives log10 n! ≈ 8565705522.9958381065, so n! is about 100.9958381065 · 108565705522 ≈ 9.90463 · 108565705522. Likewise, 1000000! is about 8.26393 · 105565708. Computing these values by direct multiplication isn't time consuming if you only want a few significant figures; 109! takes only a couple of seconds on a modern computer. (Calc.exe isn't that clever, though, and uses full precision even though most digits will be discarded.) Fredrik Johansson 15:40, 18 May 2006 (UTC)
mid-point scan conversion algorithm for circle drawing
how can I derive decition variable and associated parameters i.e. rate of change of errors for mid-point scan conversion algorithm for circle drawing?
Website with information about "advanced" limit calculations
Hello. I have been searching with Google for a while but could only find information about how to solve very simple limits of both functions and sequences. I'm interested in some place where I can learn how to solve things like (sorry for not knowing wiki math formulation):
lim 1^10 + 2^10 + 3^10 + ... + (2n - 1)^10 + (2n)^10 ------------------------------------------------ n->infinity n^11
lim ( 1/x + 1/sqrt(x) ) * (sqrt(x+1) - 1) x->0+
Things a bit more difficult. By the way, where in wikipedia can I learn how to write correctly these formulas? Thanks.
- Try Wikipedia:Manual of Style (mathematics) but for me it looks like I'd have to learn a bit. --DLL 18:21, 17 May 2006 (UTC)
- A good way to learn how to write a formula for Wikipedia is to look at examples. There are two basic approaches at present, one using wiki markup and one using TeX. Your two limits would be done in TeX form, most likely.
- A Wikipedia guide to formula markup can be found at (surprise!) Help:Formula.
- As for how to solve these things, it may be worth remembering that summations are the discrete version of integration, and we are not guaranteed obvious or compact solutions. Today's symbolic mathematics programs include sophisticated algorithms for both, but that's not the same as studying a text like Concrete Mathematics to learn techniques for oneself. For fun, I threw your limits at a program and was told 2048⁄11 for the first and 1⁄2 for the second.
- An approach to the second limit might be to try to develop a power series at zero by differentiation. An approach to the first limit might be to try to express the summation in the numerator in closed form.
- And folks (everyone posting questions!), please sign your questions by using four tildes, ~~~~; thanks. --KSmrqT 19:15, 17 May 2006 (UTC)
- To find the second limit, use the Taylor series approximation for the square root, √(1+x) ≈ 1 + x/2 for x near 0. Then the expression becomes
- which simplifies to
- The second term vanishes with x, so the limit is 1/2. Taylor series are generally very useful for calculating limits. Fredrik Johansson 18:36, 17 May 2006 (UTC)
- Edit: fixed a mistake. Fredrik Johansson 19:03, 17 May 2006 (UTC)
- L'Hôpital's rule may help with the problems, and Help:Formula with the formatting. Chuck 19:07, 17 May 2006 (UTC)
...............................
- Maybe this Reference desk is the place
:-)
- As pointed out in Summation#Approximation by definite integrals, sums can be approximated by definite integrals. For this case, since the function f defined by f(x) = x10 is monotonically increasing, we have:
- Using the formula for this type of integral, we find:
- Dividing everything by n11 gives:
- We want to find the limit of the term in the middle for n → ∞. If the two outer terms have the same limit, then so will the middle term. For the leftmost term finding the limit is dead easy: it is the constant value 211/11. With a small bit of further effort we see that the rightmost term has the same limit.
- For the second problem, assuming x > 0:
- .
- It is now immediate that the one-sided limit for x → 0+ equals 1/2. --LambiamTalk 21:52, 17 May 2006 (UTC)
THANK YOU very much too all, guys. You've been extremelly useful. Thank you.
- Another way to do this is to note that the formula
- holds, then plug in and ignore all but the leading order term in the limit. To derive the above formula, one way to do it is make the Ansatz that the sum is an 11th degree polynomial, and plug in N = 1,2,...,12, and then solve a 12x12 system of equations. -- Deville (Talk) 14:35, 18 May 2006 (UTC)
Theorem Problem
I have been working on some math, and I think I might have stumbled upon a new theorem. Is the any way I can check if someone else has already figured my theorem out? And if not, is there someone I should send it too, or should I just not worry about it at all?
--Welcometocarthage 18:46, 17 May 2006 (UTC) welcometocarthage
- Those with serious mathematics training would not need to ask; those without are not likely to have discovered a significant new theorem. However, "not likely" does not mean it can't happen. Also, the kind of serious interest that would lead to such a question may be worth nurturing. Mathematics today has many specialties, both in its researchers and in its publications; an appropriate contact would depend on the subject of the proof, and perhaps on area of residence. --KSmrqT 19:27, 17 May 2006 (UTC)
........................
- If you tell us what the theorem is, we might be able to tell whether it appears new, and if so, whether it appears to be of sufficient interest to submit to a journal for publication, and if so probably even which journal. --LambiamTalk 20:18, 17 May 2006 (UTC)
- Although, in the same way it's a bad idea to post your e-mail address here, it might be a bad idea to publish a new idea you want to keep hold of. Anyone and everyone can see this message board. If I succeed in what I'm working on, I have no intention of mentioning it here until I have full and irrevocable credit for it. So, perhaps telling us the area it's in so we can point you to a specific person or group would be best. Black Carrot 02:13, 18 May 2006 (UTC)
The theorem that I think I have discovered is in the study of Geometry. It is not a very important discovery, though, even if I am right. Where should I go to look for such a theorem? --Welcometocarthage
- If this is Euclidean geometry in the plane, and it is relatively simple to state, then it is extremely unlikely you'd be the first to discover something relatively simple and new in the almost 23 centuries such problems have been studied extensively. My first guess would be Napoleon's Theorem, "one of the most-often rediscovered results in mathematics". For starters you might have a look at Euclidean geometry#Classical theorems and see if there is any relation. Another thing to look for is Pappus' Theorem. If you know how a mathematician would formulate the problem, you can do a Google search on some typical parts of the statement. For example the query [
"equilateral triangles" centres "form an equilateral triangle"
] yields Nappie's theorem among the first few entries.
- If you're afraid someone might claim the honour of your result: In my opinion the chance is much less if you publicly reveal it here than if you send it in private to an expert. Euclidean geometry is not fashionable as a research area, you might even say it's kind of dead, so in case the result is known but not well known, it may be hard to find an expert who is likely to know it. --LambiamTalk 18:23, 18 May 2006 (UTC)
- The Académie of Sciences in Paris, France, used to receive envelopes containing supposed new theorems. Then people would open and read and discuss them. The inventor was protected by that means without the use of patents &c.
- Now I would expect at least some people interested in geometry here in WP : authors of geom articles. IANAGE myself, but try searching keywords about your discovery in Mathworld or another maths site. See if there are theorems, corollaries or other formulations for the specific domain you are about. --DLL 21:17, 18 May 2006 (UTC)
Actually, my theorem is in Euclidean geometry and I'm pretty sure someone has thought of it already. If not, then I'll be pretty happy! Here it is, I might as well just show it: If two opposite angles in a trapezoid are supplementary, then the trapezoid is isosceles. See, it's so simple that someone had to think of it first. So.... Has anyone thought of it first? As you can see, it's not useful in any way, but to think that I found something in a 'dead' math.... it makes my mind reel. (This comment is by Welcometocarthage, 00:50, May 19 2006 (UTC))
- I don't think this theorem has a name, and I doubt it will get a name, although "Hannibal's Theorem" sounds good. the result is well known in the sense that any mathematician will say, without needing to think about it: "yes, of course". It is the easy consequence of two things, both mentioned in the Trapezoid article: An isosceles trapezoid is one for which the base angles are congruent (just as for triangles), and in a trapezoid a base angle and the adjacent angle are supplementary. As phrased, there is some ambiguity, but that is only in how it is expressed here and not in what is known. So the proof is then essentially: Opposite angle is supplement of base angle as well as of other base angle, so base angles are the same, therefore isosceles. Q.E.D. --LambiamTalk 14:56, 19 May 2006 (UTC)
- A mathematical statement can be true, yet not rise to the level of being called a theorem or lemma or corollary, and certainly not being given a name. This would be an example. That does not necessarily mean it is without interest, at least to someone. Usually we distinguish as named theorems those statements that are pivotal to the understanding of a topic. A theorem may be trivial to prove, and yet not "obvious", and it may have far-reaching consequences. Consider the "pigeonhole principle"; despite the simplicity of the statement and proof, it is remarkably useful in concrete mathematics, such as combinatorics.
- For those who have the itch, there can be great joy in sensing and then proving a new fact, regardless of its historical significance. We honor those who see an influential conjecture, as well as those who prove one, noting that a great deal of time and effort may separate these two events. We may even appreciate a new proof of an established theorem if it provides additional insight.
- So enjoy the discovery, and may you have many more. --KSmrqT 16:33, 19 May 2006 (UTC)
Thank you for all of your input on this. Hope to come up with another question soon!
- Comment: While this theorem is a rather "trivial" one, it does demostrate an important proof technique: by finding invariant (mathematics) - that is, things that remain constant even under a change. Take this theorem as an example, we can use interior angle of parallel line to show that the base angles are equal. Then we "slide" the left side of the line to the right to form a triangle. (We can do this because the top and bottom lines are parallel) Now the triangle has equal base angles, so the sides are isosceles. --Lemontea 02:48, 20 May 2006 (UTC)
Codec of audio
Does anyone know of a tool which could help me identify the format (and therefore download the necessary codec(s) for playing it) of an audio file, the way GSpot can do for video files? Thanks in advance! — QuantumEleven 21:55, 17 May 2006 (UTC)
- 'nix has file, that may help. Dysprosia 01:03, 18 May 2006 (UTC)
- Thanks, Dysprosia! I, erm, forgot to mention I still have Windoze... (hides in shame)... — QuantumEleven 06:18, 18 May 2006 (UTC)
- There's always something like Cygwin... Dysprosia 06:38, 18 May 2006 (UTC)
- The ffdshow audio decoder will help you in two respects. Firstly, it will most likely decode the audio format, and secondly, will give you all the important information about the file. There are a number of sites that offer precompiled binaries for Windows (I would recommend you check out the CCCP, which is a Codec pack that is actually nice and not bloaty. An alternative to ffdshow would be avdump, which is a CLI program and available here [6].
- Thanks - I'll take a look! — QuantumEleven 08:09, 21 May 2006 (UTC)
May 18
Election statistics
Please correct me if I'm wrong about any of this background: In the United Kingdom, it is possible, and as far as I know usual, for a government to be "elected" without winning a majority of the votes. This happens because we don't have a system of proportional representation and individual votes select MPs to represent constituencies. These MPs (some 600+ of them) are then assessed and usually one party has a genuine majority of these. This party forms a government. The government, while typically not elected by an actual majority of people is considered to have been given a mandate as strong as the parliamentary majority suggests. For example, I believe the 1997 Labour landslide was not the result of a popular majority, yet the new government was seen as having been given carte-blanche to do its thing. I suppose you could say that the popular vote is "distilled" even further by the party in government's leader being in charge, e.g. UK likes Labour >(elect house of commons)> UK loves Labour >(Labour support Blair as leader)> UK worship Tony Blair.
Anyway, the consensus seems to be that the current system favours the big parties, whereas PR would give an advantage to, for example, the Liberal Democrats, our third party.
So my question is this: is the current "skewing" of the vote a result of our non-PR system or a peculiarity of the UK? Is adopting PR over a UK-type system always likely to benefit "small" parties? If so, what's the theory behind this?
Also, does anyone know any particularly extreme examples of odd election statistics? For example a government being elected (in the standard way - one party, not through coalition etc) while winning fewer votes than another party?
Thanks. --87.194.20.253 13:00, 18 May 2006 (UTC)
- As far as I know, non-first past the post systems do tend to give more weight to minority parties. Malaysia would be a good example of how first past the post can be gamed to create an illusion of "worship"; although the government got only >60% of the vote in the 2004 general election, it controls 92% of all Parliamentary seats. You might be interested in our articles about Single Transferable Vote, etc. Unfortunately I'm not well-versed in the math behind how these systems work, so I'll leave it to others. Johnleemk | Talk 13:13, 18 May 2006 (UTC)
- It is true that the party which wins the numerical majority is not necessarily going to win the most seats in the UK parliament (or in any other parliamentary system which doesn't use proportional representation). However, this is a pretty unlikely occurrence overall. It would be difficult to really nail down the probability, given that it's hard to figure out the pdf of the way each constituency will vote; but it can only come from a confluence of many unlikely events, so you won't see it so often. As you might know, there is a similar system in the US, and this sort of phenomenon can even happen in the Presidential election. As you might know, in 2000 George W. Bush was elected president although he gained fewer votes than his opponent Al Gore, although Gore didn't have a majority either, just a larger plurality.
- As you point out, a possible disadvantage of such a "sectionalized" system (and an advantage of proportional representation) is that sometimes the side with fewer votes wins.
- It is also arguable that PR has several disadvantages as well. As you point out, it does allow third parties to flourish more readily, and it's direct(er) democracy. However, it should be noted that since only the absolute number of votes matter, this encourages the parties to concentrate all of their funding and political maneuvering in urban areas, where they're more likely to pick up more votes, and ignore less populated areas. In short, it can be argued that PR encourages "mass marketing" of campaigns. A sectional system requires a party to strive to gain a wide variety of constituencies as opposed to just getting the bodies in the booth.
- As for strange occurrences, the one I mentioned about the United States presidential election, 2000 is one example.
This is the only time this sort of thing has happened in the States, AFAIK(The same thing happened in 1888, see United States presidential election, 1888 and of course there have been many cases of the elected president not winning the popular vote, but it was always in a different way than this), but I'm sure there are other examples in other countries. -- Deville (Talk) 13:27, 18 May 2006 (UTC)
- I believe it's actually fairly normal for the controlling party in the UK not to have a majority of votes, since there are so many candidates in each constituency. If you did it by PR, the very smallest parties and independent candidates would have no chance. It would all be party politics, rather than the individual basis (you vote for the candidate you think will best represent you, not the party) it still is in theory. It is true that PR would give an advantage to 3rd parties, but is that necessarily a good thing? Currently, the results we get are pretty much what people vote for, minus the outliers. Under PR we would get more Lib Dem representation, and more green representation, but also BNP, National Front, UKIP, National Workers etc at the same time as losing all the independent MPs. And with PR, you really would be voting in a presedential figure. Currently, people vote for who they want to represent them and these all govern together. In practice there is a Prime Minister, but really he is just the guy in charge of the largest block of MPs. Every MP is free to vote how they want, and the Prime Minister can't do much about it. If we voted in PR, we would most likely be voting for a single person and I'm unhappy with that kind of leadership for a country. Sorry, that probably got off-topic. Skittle 13:45, 18 May 2006 (UTC)
- This is another good point that I hadn't thought to mention. There already has been a lot of criticism of Blair for acting too presidential in the first place and not acting so much like a prime minister, and PR would make things even more so like that. Of course, whether this is good or bad would be quite subject to debate. -- Deville (Talk) 14:16, 18 May 2006 (UTC)
- There are many issues raised here. The most mathematical issue is addressed by the article on voting systems. These have surprising consequences, no matter which method is used. Note that classical Athenian democracy was on a small enough scale that no intervening representatives were elected; citizens voted on issues directly. Representatives are used for at least two reasons: (1) to keep the governing body a manageable size, and (2) to insulate decisions from the ill-informed passions of the general public. At least one of these reasons could be considered controversial. ;-) --KSmrqT 14:39, 18 May 2006 (UTC)
- And, indeed, your second point is the main reason to keep the House of Lords full of life peers, completely independently chosen, with full powers to veto any bill. Of course, birth may not be the best principle for choosing them, particularly if it tends to accumulate at the top of the social scale. Maybe a random lottery? Skittle 14:47, 18 May 2006 (UTC)
- In New Zealand general election 1978 and New Zealand general election 1981, the New Zealand National Party won a majority of the seats and remained the government even though it won fewer votes than the opposition New Zealand Labour Party. This was one of the factors leading up to the Royal Commission on the Electoral System and a lengthy process which ended with a change in the voting system in the mid 1990s.-gadfium 05:39, 19 May 2006 (UTC)
- However, proportional representation is now criticised by some for giving New Zealand's minor parties too much power. The New Zealand First party has done particularly well out of it, having held the balance of power in two of the four elections conducted under this system, despite receiving only 13% and 6% of the vote respectively in each case. -- Avenue 09:25, 19 May 2006 (UTC)
Wow, thanks so much to everyone who chipped in! --87.194.20.253 11:02, 19 May 2006 (UTC)
- Also worth looking at is Arrow's impossibility theorem which demonstrates that no voting system can possibly meet a certain set of reasonable criteria when there are three or more options to choose from. There is quite a bit of theoretical work on fairness of voting systems, for instance the Gallagher Index measures dis-proportionality. --Salix alba (talk) 12:38, 19 May 2006 (UTC)
Metric
How many miligrams equals a gram? 72.174.30.223 14:30, 18 May 2006 (UTC)
- The proper spelling is "milligrams", and the article to read is SI prefix, even though this concerns the metric system. --KSmrqT 14:44, 18 May 2006 (UTC)
milli always means 'a thousand', and with units means 'a thousandth', so here it indicates 1000 milligrams in a gram. Kilo also means a thousand, but the other way. ie, there are 1000 grams in a kilogram. Looking up milligram might have told you this. Skittle 14:41, 18 May 2006 (UTC)
- Or try google calculator: 1 gram in milligrams – b_jonas 15:05, 18 May 2006 (UTC)
1 tonne is equal to 1000 kilograms
1 kilogram is equal to 1000 grams
1 gram is equal to 1000 milligrams
1 milligram is equal to 1000 micrograms
1 microgram is equal to 1000 nanograms
If you look carefully, I think you will detect a subtle trend.
Ohanian 22:24, 18 May 2006 (UTC)
C++
I'm taking Computer Programming II at my high school, but even my teacher doesn't know why my program won't work. The idea of the program is to read two *.dat files: one that has the multiple choice answers for five questions and another that has the number of players, names, and their answers. First the program reads the number of players, and that variable is used in a for loop designed to run once for each player's information. In that for loop it reads the name of the player, and then in a second loop (that runs five times) it in turn reads the answer from one file and compares it to the answer from the other file, incrementing a counter for each one that is correct. After the second for loop, it couts the name and how many questions out of five that they got right. The problem is that at the end of the first user, the variable for the correct answer is never reassigned, and for the rest of the users it for some reason compares all their answers to the answer for #5. My teacher spent like three hours on it last night, but she can't figure out why it won't work. I don't know if it's the program (Microsoft Visual C++) or what, but syntax-wise there shouldn't be a problem. I put the source code up on my subpage. —Akrabbimtalk 15:30, 18 May 2006 (UTC)
- Hiya. Instead of
getline(responseIN, name);
tryresponseIN >> name;
That will definitely work. (I don't know how the getline function works, but that doesn't look right at all.) Btw, you don't need those swallow lines, as the ifstream class is for breaking a stream up by whitespace and that means you don't need to declare the dummy string. Finally, and this is just a little thing, it would improve readability to leave zeroing correct until just before the "marking" loop. Hope this helps! RupertMillard (Talk) 16:22, 18 May 2006 (UTC)
- You are calling
ifstream::open
on the same object within a loop. If you want to reuse stream objects in that way you need to callifstream::close
andifstream::clear
before reopening. A better solution would be to only read the key file once, use a STL container class. EricR 16:46, 18 May 2006 (UTC)- Eric, he is closing the stream. RupertMillard (Talk) 17:12, 18 May 2006 (UTC)
- But not clearing the stream state. Neither
ifstream::close
norifstream::open
will clear the eof bit for the stream. To clear the eof bit one needs to callifstream::clear
or declare the stream inside the loop where it is used so the constructor and destructor get called for each iteration. EricR 17:28, 18 May 2006 (UTC)- Well you've lost me now. Being a C man, I don't know very much about C++ at all, although it does work on my computer. RupertMillard (Talk) 18:03, 18 May 2006 (UTC)
- But not clearing the stream state. Neither
- Eric, he is closing the stream. RupertMillard (Talk) 17:12, 18 May 2006 (UTC)
- From a design perspective, this code has some trouble spots. However, those do not impact its correctness. I'm wondering about the getline, which for an ifstream should, I believe, have another parameter, the maximum number of characters to read.
- But perhaps if we fix the design questions the problem will fix itself.
- File operations are typically much more expensive than memory operations, and opening a file especially so. The answers file should be opened and read exactly once, before any further processing, and the results stored in an suitable data structure, such as a Standard Template Library vector. (But this may be beyond what the class has covered so far.)
- The number of answers, 5, is hardwired into the program as a numeric value, but it should be a named constant or — better still — a variable read from the answers file (as is done with the number of names).
- When a file is opened on a stream, it would be wise to test it with good(), not just look for a non-null pointer.
- Good practice is to clear the count and reset the current answer immediately before the tally loop, not afterward.
- Good practice is to name variables more descriptively, like numUsers instead of users, or currentUserNum instead of c.
- In the Real World, a program should defend itself against bad input, such as a line of test responses with the wrong number of answers, either too few or too many. (But this may be more of a burden than this assignment should carry.)
- If use of a vector is too advanced, try opening the key file only once, and using seekg(0, ios::beg) to reset before each tally loop.
- As soon as possible, learn to use a debugger to step through your program. The discipline to cultivate is "Assume nothing, test everything." In a small program like this it is possible to look at the value of every variable at every step, to verify that things are as expected. It is all too easy for even an experienced programmer to stare at code and not see a mistake, much as we overlook spelling errors in text. The debugger is unencumbered by seeing things as they are expected to be, and will show you things as they truly are. The truth is your friend. --KSmrqT 18:03, 18 May 2006 (UTC)
- Seeking to the beginning of the file at the start of each iteration might not solve the problem. If there is no extra whitespace at the end of the file (or a variable number of values are read as you suggest) the last read operation will set the eof flag for the stream. The seekg function will only move the get pointer, not reset the stream state. EricR 20:35, 18 May 2006 (UTC)
- This is a subtle point which is hard to tease out of the reference document, but I see no indication that eofbit is cleared by either a seekg or a close, and so would use a clear for safety, as you suggest. Note that a good() test fails if eofbit is set, providing a hint of this problem. One benefit of coding defensively is that there is less need to track down obscure bugs. :-) --KSmrqT 11:32, 19 May 2006 (UTC)
- Incidentally, to obtain an "official" C++ international standard document requires the exchange of money. What I have linked above is the draft that was approved as the standard, a subtle difference with practical financial benefits. (Note a Technical Corrigendum was incorporated in 2003.) Either way, this is not a hand-holding beginner's guide, nor a vendor's compiler guide; what this is, is the only thing it is safe to rely on (if the vendors conform). --KSmrqT 14:26, 20 May 2006 (UTC)
- This is a subtle point which is hard to tease out of the reference document, but I see no indication that eofbit is cleared by either a seekg or a close, and so would use a clear for safety, as you suggest. Note that a good() test fails if eofbit is set, providing a hint of this problem. One benefit of coding defensively is that there is less need to track down obscure bugs. :-) --KSmrqT 11:32, 19 May 2006 (UTC)
- Seeking to the beginning of the file at the start of each iteration might not solve the problem. If there is no extra whitespace at the end of the file (or a variable number of values are read as you suggest) the last read operation will set the eof flag for the stream. The seekg function will only move the get pointer, not reset the stream state. EricR 20:35, 18 May 2006 (UTC)
help with optimal classification equations
I have been working on formatting a few equations in math notation but don't know if I have them right. Can I get help with them by posting them here? -- PCE 16:18, 18 May 2006 (UTC)
- I went ahead and posted them under a new article entitled Optimal Classification. Thanks. -- PCE 16:38, 18 May 2006 (UTC)
Kernels, Anyone?
A kernel is very important to the working of a computer, as I recently found out. My computer is a Windows 98. Whenever my computer runs certain programs, though, it says "Kernel32 has had an illegal operation. Click OK to terminate the program." It drives me nuts, and I have no idea why it does this! So here's my question: why does my computer do this, and what exactly is an illegal operation? --Welcometocarthage
- An illegal operation is when the computer tries to do something that's impossible, such as dividing by zero or accessing memory that doesn't exist, or a program tries to do something it isn't allowed to, such as trying to use another program's memory space. It usually happens because the person who wrote the program in question didn't think of all the situations the program might encounter, and so didn't make the program able to deal with them. --Serie 19:36, 18 May 2006 (UTC)
- Windows 98 is not a robust operating system, neither in its design nor in its implementation. Combine that with programming mistakes in applications, and the result is any number of possible sources for an error message like this. At least this appears to be terminating only a specific program, not forcing a system reboot (aka Blue Screen of Death). For help tracking down the culprit, try reading the "WHAT IS A KERNEL32 ERROR?" entry on this page. Lucky(?) you, a web search finds many comrades-in-arms for those afflicted by Windows. So whenever you see a message like this, write it down carefully and then search for its key words. The long term solution is to switch to a better operating system. --KSmrqT 20:15, 18 May 2006 (UTC)
- Like Windows 95 (!) — Arthur Rubin | (talk) 20:53, 18 May 2006 (UTC)
Perfecting VB6 code
It seems like VB used to have a wizard or a program that listed variables, created flowcharts and did a whole bunch of other stuff to help programmers keep from making errors that are responsible for crashes. Anybody know where these add ins or add-ons or wizards or whatever are? -- PCE 21:28, 18 May 2006 (UTC)
Euler's Totient Function
Can someone find phi(2695), phi(4312), and phi(5390)? They might all be the same. --71.235.83.132 21:59, 18 May 2006 (UTC)
- I get 1680 for all three. --LambiamTalk 22:12, 18 May 2006 (UTC)
- Postscriptum. 2695 = 5 × 539, 4312 = 8 × 539, 5390 = 10 × 539. Since φ is multiplicative and in all cases the factors are coprime, φ(2695) = φ(5) × φ(539), φ(4312) = φ(8) × φ(539), φ(5390) = φ(10) × φ(539). In the table in Euler's totient function we see that φ(5) = φ(8) = φ(10) = 4 (s.t. you can also find using "mental math"), so indeed all three are equal. --LambiamTalk 22:24, 18 May 2006 (UTC)
May 19
Mathcad help
Would anyone know the best way in Mathcad 12 to count the number of specific integer values in an array? -- PCE 11:09, 19 May 2006 (UTC)
- If you want the number of occurances of a specific integer use rows(match(myinteger,myarray))
- If you want the number of different integers in your array you could try this (sorry for the formatting, mathcad layout is awkward)
n(myarray) = | y <- sort(myarray) | n <- 1 | for j ɛ 1 .. rows(y)-1 | n <- n+1 if y_j <> y_(j-1) | return n
- where I've tried to apprximate the mathcad symbols as well as I can. If your array doesn't just contain integers then you need to AND an integer check on to the end of the n <- n+1 line. There may be a better way though. JMiall 17:06, 19 May 2006 (UTC)
- Thanks so much for this information. I had tried to use rows(match(myinteger,myarray)) method but it would not allow me to use an array variable for myinteger but required a scalar variable or a constant instead. I was hoping to find a way to use conventional mathematics symbols to express the idea of an accumulator and a nested array such as x=x+1 and y(x(i)) but Mathcad rejects both of these constructs. Any ideas beside writing a routine or using a Mathcad function that I might use to accomplish both of these tasks using conventional non-program type symbols and structures? -- PCE 19:57, 19 May 2006 (UTC)
Sequence of zeros in pi
Several years ago as an undergraduate I went to a lecture by a PhD student concerning pi, and the only thing I remember about the lecture is that he stated that it had been proved that there was a maximum length that any sub-sequence of all zeros could be within the digits of pi. That is, it would be impossible to find a continuous sequence of zeros greater than [some number] when looking through the digits of pi. I didn't think much of it until now, when learning that pi is thought to be a normal number, and so any sequence of digits should be found with equal probability within pi. This is obviously the opposite of what I remember from the lecture. So did I remember wrong? Does any one know of any proof that remotely sounds like this? — Asbestos | Talk (RFC) 15:32, 19 May 2006 (UTC)
- One possibility is that the lecturer knew something that is further unknown, like he found a proof, which unfortunately was accidentally eaten up by his dog, after which the shock was so large that he suffered memory loss and could not reconstruct the proof. Somewhat more likely is that he was mistaken; such things have been known to happen to PhD students. Finally, maybe you indeed remember wrong. The only thing I can think of remotely resembling the claim is that it has been proved that there is no all-zero segment of infinite length, nor any other infinitely repeating sequence of digits. --LambiamTalk 19:25, 19 May 2006 (UTC)
May 20
HTML Variable Processing
If I had passed a variable through a URL (eg: www.example.com/index.htm?name=John), is it possible, with only HTML and Javascript availible (i.e. no PHP, ASP etc.), to put that variable of "John" into my page somewhere? Or is it only possible to do so with Server-Side Coding?DanielBC 06:10, 20 May 2006 (UTC)
- Well, you could do this in JavaScript:
- document.write(location.href.toString().split('=')[1]);
- which would output John, but I don't think this is what you need. x42bn6 Talk 06:27, 20 May 2006 (UTC)
- You may be able to do it without CGI, but CGI is perfect for this sort of thing. Dysprosia 11:18, 20 May 2006 (UTC)
Thanks to all above, maybe document write is what I need! I will investigate later today - the above example isn't actually what I was intending to do with it - I was planning to create a form/input box, ask the user for a URL, and then use that URL later in the document to create an inline frame to that URL (the whole concept is being used to repeatedly refresh a page so I can watch it for changes). Because I could use docuemnt write to write the whole command of the inlineframe??? Would that work? Thanks again. DanielBC 22:24, 20 May 2006 (UTC)
- That sounds like a job for CGI. Dysprosia 01:29, 21 May 2006 (UTC)
- Or PHP. Assuming you defined your web server to parse .htm files with the PHP engine (or allowed for a URL like www.example.com/index.php?name=John ). — QuantumEleven 15:22, 22 May 2006 (UTC)
- I believe that PHP is CGI. Any language would suffice, like Perl, for example. Dysprosia 22:49, 22 May 2006 (UTC)
- The (window).location property refered to above is both read a write, so you can read the current url, extract the query string using location.search.substring(1), build whatever url you need and then do
location=http://www.example.com/page.html to go to a new page. You don't even need a iframe, you could just use a text area in a form and write to that. A good javascript reference is what you need. --Salix alba (talk) 22:47, 21 May 2006 (UTC)
calculus
Explain the importance of calculus.
- Calculus is important, because it is an indication that you probably need to brush your teeth more. Dysprosia 10:32, 20 May 2006 (UTC)
- Calculus can help you determine how often you need to brush your teeth. -- PCE 10:39, 20 May 2006 (UTC)
- Calculus can help you determine how much more often you need to brush your teeth, etc etc. Also, given how much you brush your teeth, Calculus can tell you how clean your teeth are. It's mathematic's magic box of tricks! In all seriousness, I bet your teacher would love it if you did your homework exclusively in terms of personal hygiene metaphors.... --The Gold Miner 12:18, 20 May 2006 (UTC)
- You folks deserve a plaque for your responses! --hydnjo talk 12:34, 20 May 2006 (UTC)
- Sorry, I just don't understand how dental hygiene is relevant to bezoars. Perhaps someone should look through the disambiguation page to see if another meaning might be intended. --KSmrqT 12:51, 20 May 2006 (UTC)
- Perhaps we're all stoned ;-)) --hydnjo talk 14:54, 20 May 2006 (UTC)
- Perhaps; the word derives from the Greek khálix (χάλιξ), meaning pebble. The Romans used pebbles for gaming and reckoning, from which we also get "calculate". It's not because calculus is hard. ;-) --KSmrqT 17:14, 20 May 2006 (UTC)
- Importance of calculus is important, because it allows some people to do their own homework. Cthulhu.mythos 09:03, 22 May 2006 (UTC)
- Importantance of calculus is importanant, because it allows some poeple to do their own homework on the importance of claculus's importance. --Welcometocarthage
one minus the inverse of a number
Is there a name or description for the result of subtracting the inverse of a number from one? -- PCE 10:30, 20 May 2006 (UTC)
- Should we assume that you are referring to the multiplicative inverse and not the additive inverse? --hydnjo talk 12:29, 20 May 2006 (UTC)
- Well, I don't know a name, but since you say "description"... given x, this is y=1-1/x, which is x/x-1/x, which is (x-1)/x, so it's the number just less than x, divided by x. This increases asymptotically to 1 as x increases, with a y-intercept approaching negative infinity from the positive side and a positive x intercept at 1. I suppose there might also be a name for "any fraction where the numerator is 1 less than the denominator", but I don't know it. Black Carrot 17:35, 20 May 2006 (UTC)
- Actually Superparticular sounds about as close as I'm going to get. The actual formula for duplicating the results of the relationship I am refering to is: y=1+(-1*|v^(-1*|c|)|) or y equals 1 plus (minus 1 times the absolute value of v raised to the power of (minus 1 times the absolute value of c)) or y=1+(-1*abs(v^(-1*abs(c)))) or . -- PCE 01:39, 21 May 2006 (UTC)
- Not quite, that's (x+1)/x. Although, by extension, I suppose you could call these 'subparticular' numbers. The closest I can get wandering around our articles is the unit fractions, which are what you're subtracting from 1. Black Carrot 20:53, 20 May 2006 (UTC)
- I like the term "subparticular number". If we use it in a few places elsewhere on the web first, we can add the term to Wikipedia without violating WP:NOR *evil grin* - Fredrik Johansson 01:06, 21 May 2006 (UTC)
- You will probably need at least three printed references older than fifty years to prevent immediate deletion in the Wiktionary unless you happen to know one of the bureaucrats. (Just kidding...not really.) -- PCE 01:49, 21 May 2006 (UTC)
- The inverse of the Hölder conjugate? —Ilmari Karonen (talk) 22:15, 21 May 2006 (UTC)
- Wow, I didn't understand a word of that article. Black Carrot 22:47, 21 May 2006 (UTC)
- Wow youself BC, you're smarter than me and I understood every word ...alright I'm lying. hydnjo talk 22:59, 21 May 2006 (UTC)
- I'm not surprised, it's a pretty crap article — the formatting is messy and the definition makes little sense unless you're already familiar with Lp spaces. I'm not quite sure where to start fixing it, though. :( —Ilmari Karonen (talk) 23:45, 21 May 2006 (UTC)
Radial graph
Does anyone know the technical term for what I call a "radial graph"? It typically looks pentagonal/hexagonal/whatever and it shows different attributes of something. Corporal 16:57, 20 May 2006 (UTC)
- A polar graph ? StuRat 16:59, 20 May 2006 (UTC)
- It looks somewhat like what I'm looking for, but it doesn't have anything to do with calculus - What's I'm referring to is a graph that would be, say, pentagonal with a line from the center to each vertex representing one of five attributes. A point would be placed on a line somewhere between the center and the corresponding vertex representing the relative "greatness" of that attribute, and then each of those 5 points would be connected by lines and the area inside the lines would be shaded. Corporal 17:04, 20 May 2006 (UTC)
- Oh yeah, and I have an example here if that's not clear enough: [7]
- It looks somewhat like what I'm looking for, but it doesn't have anything to do with calculus - What's I'm referring to is a graph that would be, say, pentagonal with a line from the center to each vertex representing one of five attributes. A point would be placed on a line somewhere between the center and the corresponding vertex representing the relative "greatness" of that attribute, and then each of those 5 points would be connected by lines and the area inside the lines would be shaded. Corporal 17:04, 20 May 2006 (UTC)
- I'm tempted to say it's just artistic, but I remember my dad showing me something like that awhile ago (it was to do with his work), and it apparently actually means something. I'll see if he remembers it. Just looking at it, though, it doesn't seem all that useful. Given attributes A, B, C, and D, say, the area is (AB+BC+CD+DA)/2, which doesn't look very informative. Black Carrot 17:28, 20 May 2006 (UTC)
- It probably is just artistic, but I personally think it's a better/more concise representation of attributes than just a regular bar graph. Could just be the aestetics though... Corporal 18:21, 20 May 2006 (UTC)
- I'm tempted to say it's just artistic, but I remember my dad showing me something like that awhile ago (it was to do with his work), and it apparently actually means something. I'll see if he remembers it. Just looking at it, though, it doesn't seem all that useful. Given attributes A, B, C, and D, say, the area is (AB+BC+CD+DA)/2, which doesn't look very informative. Black Carrot 17:28, 20 May 2006 (UTC)
- Isometric projection? Also see 3D graph paper. --hydnjo talk 17:31, 20 May 2006 (UTC)
- Try "star plot", see e.g. <http://www.itl.nist.gov/div898/handbook/eda/section3/starplot.htm> and <http://www.math.yorku.ca/SCS/sugi/sugi16-paper.html#H1_5:Star>. --LambiamTalk 18:38, 20 May 2006 (UTC)
- That's it. Thanks! Corporal 20:12, 20 May 2006 (UTC)
- Excel calls this a "radar chart". It is also called a "spider chart" or "spider's web chart" - see [8] Gandalf61 12:11, 21 May 2006 (UTC)
- DDR calls its graph of this kind the "Groove Radar" ... Confusing Manifestation 05:48, 22 May 2006 (UTC)
"undefined; assuming extern returning int"
In MS Visual Studio 6.0, programming in C. What does that mean for a function? I guess it is defined in another file and its header is included...
Forget this question. It was due to a typo... *laughs*.
- Forget what? --hydnjo talk 17:52, 20 May 2006 (UTC)
- The anon probably misspelled a keyword, then when s/he tried to compile the program, it did not work, giving the error message above. --HappyCamper 01:06, 21 May 2006 (UTC)
- HC, you were requested by the anon to forget that. Did you forget? ;-) --hydnjo talk 03:42, 21 May 2006 (UTC)
May 21
Conference graph
What is a conference graph? --HappyCamper 01:05, 21 May 2006 (UTC)
- That's a graph your 11 year old daughter prepares for you to take to the conference to help you make an illustrated presentation... -- PCE 01:55, 21 May 2006 (UTC)
- Googling reveals that is some sort of strongly regular graph. One may need to look deeper for more details. Dysprosia 02:07, 21 May 2006 (UTC)
- Consider some researchers who participate in conferences. Let the researchers be the vortices of the weighted graph. For each conference, add 1 to the weight of the edge connecting the two researchers iff they both participated in the conference. What you get is the conference graph. Source. Conscious 20:55, 21 May 2006 (UTC)
Domain/Range etc. for 3D graph
For 2D graphs you have domain for the x axis and range for the f(x) or y axis. How about for the 3D? Which variable, x,y, or z is traditionally the output? Tuvwxyz 13:18, 21 May 2006 (UTC)
- Go back to the definitions of how a 3D graph is formed. One can define a 3D graph in terms of a function of two variables and plotting the height: ie., f(x, y) = z. The domain of the function would be a subset of R2, and the range would be a subset of R. Dysprosia 13:23, 21 May 2006 (UTC)
i want to know about this chapter information and how to do it, i need it quiekly please.
i want to know about this chapter: Inequalities,Factorisation,Percentages,Ratios,Square root,Pythagorean Theorem,Polygons,Similar Triangles,this chapter's are from amercian system. — Preceding unsigned comment added by 195.229.242.54 (talk)
- Please either ask a specific question, or visit the Wikipedia articles for those topics.
Pythagorean rotation
What are the angles of the two acute corners on a pythagoreanesque triangle? What is the number of degrees you would need to rotate one from the shortest side(a²) being flat to the hypotenuese(c²) being flat? I need this for a diagram made in Paintshop Pro 6. thank you, good day. --HomfrogHomfrogTell me a story!ContribulationsHomfrog 16:21, 21 May 2006 (UTC)
- Okay, I think you mean right-angled triangle. The two acute angles can be anything, as long as they add up to 90 degrees. At a guess, if I've understood you correctly, the angle you want to rotate the triangle should be the same as the top angle, that is the angle of the pointy bit at the top, plus 90. This should be the same as 180 minus the bottom angle. I am assuming for this that your straight side is on the left. If not, the angle would be 360 minus the angle I suggested. Good luck. Skittle 16:43, 21 May 2006 (UTC)
- So what if the bottom side was 99 pixels long? tThe unit would be 33 pixels. So how about with that info? --HomfrogHomfrogTell me a story!ContribulationsHomfrog 17:23, 21 May 2006 (UTC)
- Knowing the length of a single side doesn't tell me anything about the angles, and I don't know what you mean by 'The unit'. Try looking up right-angled triangle, trigonometry and pythagoras's theorem. See if they help you understand better. There are many different right-angled triangles; they are not all the same shape. Skittle 17:41, 21 May 2006 (UTC)
- "Perhaps Homfrog means by "pythagoreanesque": a triangle in which a:b:c = 3:4:5. So a = 3 "units"; if the unit is 33 px, then a = 99 px. The rotation required only depends on the ratio between a and b and is independent of the unit. You'd have to rotate by the supplement of the acute angle at the "a" side, that is, 180° − arctan(4/3) = 128.87° or thereabouts, which is approximately 2.2143 radians. Whether this is clockwise or counterclockwise depends on the orientation of the triangle. The same formula works for all right-angled triangles if you plug in the right values for a and b.
Cubic equations with three real, irrational roots
The equation 8x3 − 6x + 1 = 0 has the solutions sin 10º, sin 50º and −sin 70º, and is solved readily using trigonometric methods. However, attempting to solve the equation using Cardano's method (see Cubic equation) yields some rather nasty expressions, such as
Question 1: Is it possible to reduce this to an expression involving radicals and non-complex rational numbers only?
Question 2: Can anybody give an example of a cubic equation with three different real irrational roots, where the roots can be expressed using radicals and non-complex rational numbers only? --Vibo56 16:58, 21 May 2006 (UTC)
- I don't know about the first question, but my guess is that no. About the second, the equation
- Satisfies your conditions. If you want the coefficients to be integers as well, I guess this is equivalent to the first question. -- Meni Rosenfeld (talk) 17:50, 21 May 2006 (UTC)
- Yes, I did want the coefficients to be integers. And I suspect you are right that the answer to both questions is no. If so, is anybody aware of a proof? --Vibo56 17:56, 21 May 2006 (UTC)
- I think that the answer to Question 1 in general is "no", because of the result refered to here:
- "One of the great algebraists of the 20th century, B.L. van der Waerden observes in his book Algebra I, that the Casus Irreducibilis is unavoidable. There will never be an algebraic improvement of the cubic formula, which avoids the usage of complex numbers." [9]
- However, it may still be possible that for this particular equation, such a formula exist. Perhaps that reference is enough to get you started if you are really interested. You could also try asking User:Gene Ward Smith. -- Jitse Niesen (talk) 03:05, 22 May 2006 (UTC)
- Thank you, Jitse, as far as I can see, the reference answers both questions. And I had no idea that it was this very problem that initiated the study of complex numbers! --Vibo56 16:57, 22 May 2006 (UTC)
- I think that the answer to Question 1 in general is "no", because of the result refered to here:
- Yes, I did want the coefficients to be integers. And I suspect you are right that the answer to both questions is no. If so, is anybody aware of a proof? --Vibo56 17:56, 21 May 2006 (UTC)
Triangle with three right angles
My maths teacher asked me the question if there are any triangles where all the angles are right. After a while (after class) I produced the answer that a quarter of a circle gives such a right angle, but I don't know if that was what my teacher meant. Is it...? Henning 17:01, 21 May 2006 (UTC)
- The sum of the angles of a triangle in a plane must equal 180 degrees. Therefore, if one angle is 90 degrees, both the other angles must be less than 90 degrees. You can have such triangles on the surface of a sphere, though. --Vibo56 17:36, 21 May 2006 (UTC)
- [Edit conflict]What your teacher probably meant was, instead of drawing a triangle on the plane, draw it on the surface of a sphere. You can draw three quarters of a circle which meet each other at a right angle, and these will be considered as straight line segments in spherical geometry. Your suggestion is also a nice idea, however, a quarter of a circle is not a straight line segment in Euclidean geometry. -- Meni Rosenfeld (talk) 17:37, 21 May 2006 (UTC)
- It is possible in spherical geometry, which is non-Euclidean. --LambiamTalk 17:43, 21 May 2006 (UTC)
- A quarter of a circle is a sector, not a triangle. What's fun is that Jolly's idea show two segments and only one arc, when you have three arcs on a sphere. --DLL 18:07, 21 May 2006 (UTC)
- It is possible in spherical geometry, which is non-Euclidean. --LambiamTalk 17:43, 21 May 2006 (UTC)
- Doesn't really matter if this is what your teacher meant or not - it is still a valid and interesting observation. It sounds as if you have discovered spherical geometry with remarkably little prompting. Here are some follow up questions:
- There are many paths that can be drawn between two points on a sphere - which one is the equivalent of a straight line in Euclidean geometry ?
- Take two "straight line" equivalents on a sphere that both pass through a given point. Do these lines intersect anywhere else on the sphere ?
- Once you know the equivalent of "straight lines" on a sphere, you can define a general triangle - can you show that the sum of the angles of any such triangle drawn on a sphere will always be greater than 180 degrees ?
- Can you find a relationship between the area of a triangle drawn on a sphere with radius 1 unit and the sum of its angles ? Gandalf61 09:14, 22 May 2006 (UTC)
mathematical incompleteness
In regard to the inability to express the dependency x=x+1 in conventional mathematical notation or such possibilities as y(x(i)) is conventional mathematics incomplete or just its notation? -- PCE 18:27, 21 May 2006 (UTC)
- In most contexts, x=x+1 is a contradiction, not a dependency. What do you mean by y(x(i))? Perhaps you should be looking at temporal logic? -- EdC 21:44, 21 May 2006 (UTC)
- y(x(i)) (where i is the index of x) x(i) is the index of y. Thus an array which uses the contents of another array as its index. -- PCE 22:18, 21 May 2006 (UTC)
- Do you mean ? Arrays typically take integer indices, but indexing sets can be anything you want as long as they're of appropriate cardinality. EdC 22:24, 21 May 2006 (UTC)
- "Conventional" mathematical notation can both express the (always false) proposition x=x+1 as well as y(x(i)) — using that arrays are essentially functions defined on a limited domain. Perhaps you could clarify the question; what is it that is not expressed by this? --LambiamTalk 22:30, 21 May 2006 (UTC)
- Do you mean ? Arrays typically take integer indices, but indexing sets can be anything you want as long as they're of appropriate cardinality. EdC 22:24, 21 May 2006 (UTC)
- y(x(i)) (where i is the index of x) x(i) is the index of y. Thus an array which uses the contents of another array as its index. -- PCE 22:18, 21 May 2006 (UTC)
- I'm trying to do two things... First I want to be able to describe these constructs (which are in common use by computer programmers in virtually all computer launguage) in terms of "conventional" mathematical notation. Second I want to be able to implement these constructs using Mathcad 12 without using Mathcad functions or writing a Mathcad user program. -- PCE 04:15, 22 May 2006 (UTC)
- x = x + 1
- logic dictates that x = infinity
- Note: infinity is NOT A NUMBER. Therefore x is NOT A NUMBER.
- Ohanian 01:06, 22 May 2006 (UTC)
- Is this mixing apples and oranges? In computer programming languages such as C++, the statement
- x = x + 1
- does not express equality, but assignment. There is a well-developed mathematical formal semantics of programming languages to give meaning to the notation. As it happens, programming is possible with pure functions having no side effects, and the semantics are generally simpler. But in the context of mathematics this expression describes equality, not assignment. That is, in the mathematical world x might be an unknown value, but it would be the same value on both sides of the equality. --KSmrqT 03:31, 22 May 2006 (UTC)
- Well, x = x + 1 modulo 1! Sounds silly, but this kind of thing is sometimes worth keeping in mind. Melchoir 08:39, 22 May 2006 (UTC)
GENEALOGY
What are the stistical odds of a person born in 2000 being a direct descendent of William the Conquerer, born in 1027? Thank You
- By direct descendant, do you mean patrilineal descendant? Subject to what constraints? (Where is the person born?) Lacking any historical or genealogical information, the odds are symmetrical: 1/(number of males alive in 1027). In actual fact, the odds are most likely to either be near unity or be zero. See the articles on most recent common ancestor and Y-chromosomal Adam. -- EdC 22:32, 21 May 2006 (UTC)
- If you're of Anglo-Saxon descent: pretty high, since his son Henry Beauclerc "is famed for holding the record for the largest number of acknowledged illegitimate children born to any English king, with the number being around 20 or 25". So the likelihood that he has no living descendents Every generation the number of descendents roughly doubles, except that you get duplicates, but you can think of it as drawing 2G balls from an urn with P balls, where G is the generation number and P is the size of the pool of potential descendants – for most of history largely limited by location, until you get substantial migrations like to America. The probability of not being a descendant then comes to about exp(-2G/P), which, for G = 32 and P << 360 million, is practically zero. (I'll leave it to other editors to explain why this analysis is way too simplistic.) If you are, however, from Tuva or Mali, your chances are pretty slim. --LambiamTalk
Functional equation
Is there such a function f that satisfies f(x+y) + f(x-y) = 0 ? --HappyCamper 21:42, 21 May 2006 (UTC)
- The zero function. (Actually, any function with range additive self inverses, but let's keep it simple.) -- EdC 21:50, 21 May 2006 (UTC)
- If this holds for all x and y, we have f(x+0) + f(x-0) = 0, or 2f(x) = 0, so f(x) = 0 for all x: the everywhere zero function is the only solution of this functional equation. --LambiamTalk 22:00, 21 May 2006 (UTC)
- Well, no; is a valid solution if . --EdC 22:20, 21 May 2006 (UTC)
- Excluding funny stuff like ranges with zero divisors, the equation defines a function that is odd symmetric around every point. It's pretty obvious that the only such function is indeed f(x) = 0. —Ilmari Karonen (talk) 23:59, 21 May 2006 (UTC)
- If this holds for all x and y, we have f(x+0) + f(x-0) = 0, or 2f(x) = 0, so f(x) = 0 for all x: the everywhere zero function is the only solution of this functional equation. --LambiamTalk 22:00, 21 May 2006 (UTC)
- Okay, I see what's going on now. Thanks :-) --HappyCamper 02:45, 22 May 2006 (UTC)
May 22
Probability Paradox
Here's something I've been thinking about for a while. In a probabiliby class I had this question:
- Suppose there are two dice: one red, one blue.
- Both dice are rolled, but you do not see the results.
- What are the odds that both dice show the same result if an observer tells you that the red die shows a 5?
- What if you are told that at least one of the dice shows a 5?"
The answers are 1/6 and 1/11, respectively, which I understand using Bayes' Rule or just eliminating those dice combinations that don't fit.
Now let's say that I roll the dice and don't look at the results, but instead I just feel one of the dice.
Again I'm determining the probability that both dice show the same result. If I can feel that one of the dice shows a 5, then if I hold on to the die, the situation is analagous to knowing that the red die shows a 5 in the first question.
So the probability is 1/6 that the other die shows a 5, so the odds are 1/6 that both dice are the same.
But now, if I let go of the die, I only know that at least one of the dice showed a 5. So the probability that both show a 5 goes to 1/11.
This seems strange to me. Is the probabiliy really 1/6 if I hold on to the die, and 1/11 if I let it go? --Wyckyd Sceptre 00:53, 22 May 2006 (UTC)
Again I'm determining the probability that both dice show the same result. If I can feel that one of the dice shows a 5, then if I hold on to the die, the situation is analagous to knowing that the red die shows a 5 in the first question.
Wrong! It is not the same. The situation is NOT ANALAGOUS to knowing that the red die shows a 5 in the first question. Unfotunately I don't have time to get you a detailed response. Ohanian 01:00, 22 May 2006 (UTC)
Actually it is and I was wrong myself. Ohanian 03:02, 22 May 2006 (UTC)
- Or perhaps th[e] margin is too narrow to contain the answer. Joe 01:28, 22 May 2006 (UTC)
- Waaaaay too narrow! hydnjo talk 02:00, 22 May 2006 (UTC)
If you roll two dice, the probability that both dice show the same face is
Pr(r=1,b=1) + Pr(r=2,b=2) + Pr(r=3,b=3) + Pr(r=4,b=4) + Pr(r=5,b=5) + Pr(r=6,b=6) = 6/36 = 1/6
Suppose you put your hand and felt that one of the die is a "FIVE".
It changes nothing. The probability is still 1/6 that both dice show the same face.
Pr(r=5,b=5 | x=5) = Pr(color(x)==blue) * Pr(r=5,b=5|b=5) + Pr(color(x)==red) * Pr(r=5,b=5|r=5)
Pr(r=5,b=5 | x=5) = (1/2) * (1/6) + (1/2) * (1/6) = 1/6 SURPRISE , SURPRISE , SURPRISE !!!
Ohanian 02:49, 22 May 2006 (UTC)
- Good grief! I sure hope he doesn't show up at the monty. hydnjo talk 02:59, 22 May 2006 (UTC)
- As usual the question does not give the full monty. Let us assume the giver of extra information is incapable of lying, something that was not explicitly stated. There is the "What if you are told that at least one of the dice shows a 5?" What is not stated is whether the teller gives out this extra bit of information on whether there is at least one 5 unconditionally. Consider a teller who tells you this, but only if the red die shows a 5? If only the blue one shows a 5, they keep their mouth shut. This behaviour does not contradict what was stated. But now we're back to 1/6. If the teller tells you at least one die shows a 5 only if exactly one shows a 5, the probability drops to 0. And in that case, if they don't tell you this it goes up to 1/7, since 5 possibilities are left ((1,1), (2,2), (3,3), (4,4), and (6,6)) out of 35 (all 6×6 combinations except (5,5)). --LambiamTalk 07:16, 22 May 2006 (UTC)
- I would say, the number five has nothing particular here. You could have six different problems , where is the following:
- Suppose there are two dice: one red, one blue.
- Both dice are rolled, but you do not see the results.
- What are the odds that both dice show the same result if an observer tells you that the red die shows a ?
- What if you are told that at least one of the dice shows a ?"
- Of course, all these problems are the same problem. Hence, your second question is equivalent to the following: you roll the dice, you ask your observer, and (s)he tells you, oh, look, we have fallen upon . The odds being perfectly symmetrical, the probability you are looking for must be 1/6. (I hope I did not mess up too much). Cthulhu.mythos 09:23, 22 May 2006 (UTC)
- A=(r=6), B=(b=6), C=(r=b). the paradox is that To resolve it you have to understand that different information is given in these two cases. When you put the die down you forfeit some information and reduce the odds from 1/6 to 1/11. Look at the difference between P((r=6)|(r=6)) and P((r=6) | ((r=6) or (b=6)) ) (Igny 17:36, 22 May 2006 (UTC))
- See Three cards problem for correct calculations with conditional probabilities, and Monty Hall problem for the possible effects of choices as to what (correct) statement the observer chooses to report.
- That being said
- What are the odds that both dice show the same result if an observer tells you that the red die shows a n?
- What are the odds that both dice show the same result if an observer tells you that the first die looked at shows a n?
- What if you are told that at least one of the dice shows a n?
- Answers are 1/6, 1/6, and 1/11 (if n is chosen by the observer in advance)
- — Arthur Rubin | (talk) 19:10, 22 May 2006 (UTC)
Falling Sums
This is something I've been toying with for awhile, and I'd like to know if any of you know if someone else has thought about it before me. Consider the sum . Given two such sums, and , it's easy to determine when they first intersect: , with and . The gcf (or gcd) part can be found quickly using Euclid's algorithm. Now, consider the sum , the sum of a decreasing linear progression of length a starting at n. (This can be written in closed form in many reasonably compact ways, the best I've found is .) How might you find the intersections of two such sums, ? Is there something related to the gcf that can be used for this? Black Carrot 01:24, 22 May 2006 (UTC)
- Mmmh, there is something I must be missing here: what do you mean by "intersecting sums"? Cthulhu.mythos 09:28, 22 May 2006 (UTC)
- I think Black Carrot is looking for values of a and b (specially, the smallest ones) such that
- or, equivalently, for solutions of the Diophantine equation
- -- Jitse Niesen (talk) 09:53, 22 May 2006 (UTC)
- I think Black Carrot is looking for values of a and b (specially, the smallest ones) such that
- Yes, exactly. Well, I'm more interested in the summation part, not so much the Diophantine version of it. And I'm looking at it from the point of view of its rather striking similarity to the least common multiple. Have you heard of anyone else working on this? Black Carrot 22:25, 22 May 2006 (UTC)
solving equation
i want to know how to do it. — Preceding unsigned comment added by 07:03, 2006 May 22 (talk • contribs) 195.229.242.54
- There are many types of equations, and equation solving is not a general thing you can learn, but a mixture of theory, techniques and methods that work in some cases but not in others. I don't know your background, but a start would be to buy a high school textbook on Elementary Algebra and study that. If bought used, you might find a cheap copy, although that may be more difficult in the Emirates than in the USA. --LambiamTalk 07:31, 22 May 2006 (UTC)
Beta testers wanted
Sorry but i'm not really asking a question here. I made a game similar to notpron on my home page with a code/cipher theme. It doesn't have too many levels (13 and the first 2 are tutorial levels). It is intended for non experts/non geeks so i figured that the kind of people who read this noticeboard would have no trouble with it. If you feel like it, would you take a look at it here and see if i've made any glaring errors or pages that turn out to be impossible to solve. Thanks Theresa Knott | Taste the Korn 15:35, 22 May 2006 (UTC)
- The blue on gray text at level two hurts my eyes. There is one item on level 5 that needs to be guessed - probably easy enough for a native English speaker. I'm stuck on level 7. For now. --LarryMac 16:11, 22 May 2006 (UTC)
- Now up to 9. Needing a break. --LarryMac 16:33, 22 May 2006 (UTC)
- I didn't think 5 involved any guesswork, as it was systematic. 6 I have trouble with as I'm trying to intepret a way to input the password, or something. Skittle 16:46, 22 May 2006 (UTC)
- Okay, that was odd. The join between 6 and 7 :-\ Skittle 17:15, 22 May 2006 (UTC)
- I didn't think 5 involved any guesswork, as it was systematic. 6 I have trouble with as I'm trying to intepret a way to input the password, or something. Skittle 16:46, 22 May 2006 (UTC)
- I see Level 7 twice, with different passwords. --LambiamTalk 17:27, 22 May 2006 (UTC)
- How odd, that didn't happen to me. Level 8 is annoying me, trying to find which bit matters. Skittle 18:10, 22 May 2006 (UTC)
- Current sticking point for me is 11. Layout wise, the text beginning with "hmm" is right on the hoizontal line dividing the window, I almost couldn't see it. (IE 6, for reference). --LarryMac 18:21, 22 May 2006 (UTC)
- Another layout thing -- on level 6, the phrase "Crack the code" begins at about 2/3 of the way (left to right), on the same line as the previous level's password. "Crack the" is on that line, "code" is on the next. --LarryMac 18:26, 22 May 2006 (UTC)
- At level 5 the name of the crypto method is misspelled: "ea" should be "ae" and next "e" should be "a". --LambiamTalk 18:50, 22 May 2006 (UTC)
- Level 42 is the best. --DLL 19:37, 22 May 2006 (UTC)
- Now accepting all assistance in getting past level 11. --LarryMac 19:51, 22 May 2006 (UTC)
It was boastin'. Stuck on 10 with a treasurus. There's a knot to taste. Theresa, it is a good idea and the pages are just nice. How many levels do you intend to create ? --DLL 22:08, 22 May 2006 (UTC)
There seems to be both a level 8 and a level eight. How odd. Also, are all your puzzles solvable by hand or do some of them require computers? I had to resort to computer decryption for level 8 (not eight), following the advice of LarryMac. Skittle 22:38, 22 May 2006 (UTC)
- And I agree with LarryMac about the text being over the line, and so hard to read, on 11. And it should say 'interchange'. Skittle 22:45, 22 May 2006 (UTC)
PHP
How do you find a string in another string in PHP? i.e. Is there a function to say that "Pokémon/Pikachu" or "Template:Pokémon" contains the string "Pokémon".
Also how is the + tab added to the top of the page? Thanks, Gerard Foley 15:46, 22 May 2006 (UTC)
- Maybe you want the strpos function. Returns FALSE if the string is not found, and returns the index of the start of the string if it is. -lethe talk + 16:02, 22 May 2006 (UTC)
- Regular expresions, will also do and offer more powerful searching, be careful with non ascii characters. As to the + tab, this is buried deeply in the SkinTemplate.php code. --Salix alba (talk) 16:23, 22 May 2006 (UTC)
Why is antidifferentiation harder than differentiation?
The article on the antiderivative observes:
- Finding antiderivatives is considerably harder than finding derivatives.
which is quite true!
Why is this so? Are there any deep reasons why it should be so hard to find antiderivatives? Is it a fundamental difficulty, one that we would expect even space aliens to understand? or is it an artifact of our mathematical notation, or of our ideas about which functions are "elementary"?
Or perhaps this is the wrong question, and the right question to ask is why it is so easy to find derivatives?
-- Dominus 21:23, 22 May 2006 (UTC)
- One way to think of it is that the derivative requires information about a function only in or immediately around a single point, whereas the the antiderivative requires information from all points in an interval. The antiderivative therefore embodies much more structure or information, so it should be expected to be more "difficult". Another argument is that differentiation tends to turn simple expressions into more complicated ones, and going the other way is harder; of course, this holds for all kinds of algebraic manipulation and has nothing to do with derivatives in particular (it is also tautological). Fredrik Johansson 21:41, 22 May 2006 (UTC)
- One simple point is that differentiation has the chain rule. But that's really more how than why. Perhaps it connects with Fredrik's point because everything acts linear on a small enough scale (thus allowing the chain rule). --Tardis 21:47, 22 May 2006 (UTC)
- It depends on what you mean by "find". At one level the claim is just false; a function is much more likely to have an antiderivative than a derivative. For example, all continuous functions have antiderivatives, but they don't all have derivatives.
- If we take "find" to giving a "closed-form" symbolic expression for the function, then I think the issue is that such expressions all denote compositions of some fixed class of functions, all of which have symbolically expressed derivatives (if they didn't we'd invent them), and after that you just use the chain rule. There isn't any such rule for antidifferentiation. If there's a deeper "reason" than that, I don't know it (but see differential algebra for a technology allowing proofs that symbolic antiderivatives of a specified form don't exist). --Trovatore 21:54, 22 May 2006 (UTC)
For that matter, why is multiplying harder than factoring? Why is the inverse process ever harder than the forward process? I don't know. -lethe talk + 21:57, 22 May 2006 (UTC)
- Yeah, that's what I was going to say. There only is a method for finding derivatives; all antiderivatives are defined and proven in terms of the derivatives they reflect, hence the name. And factoring is harder than multiplying, as far as I can tell, because substantial amounts of important information are lost when you turn those two numbers into one. Black Carrot 22:03, 22 May 2006 (UTC)
- An integer product contains just as much information about its factors as the factors do separately. What is lost? Fredrik Johansson 22:07, 22 May 2006 (UTC)
Logarithms
Hey!
I had two questions from my Pre-Calc class. I have the answers to the questions but I don't know how to get there. Any help would be great!! Thanks!
(e^x + e^-x)/ 2 = 3
The answers are ln(3+2 sqrt 2) and ln(3-2 sqrt 2)
- Multiply through by (OK since is nonzero); solve for as a quadratic; take logarithms.
The second problem is.
2^2x + 2^ x+2 - 12 = 0
The answer is ln 3/ln 2
- Rewrite as ; proceed as above. It's quite sneaky; another way to proceed without knowing the trick is to take a parametric form (e.g. ) and solve for that first. EdC 22:33, 22 May 2006 (UTC)
Thank you!!!