Wikipedia:Reference desk/Archives/Mathematics/2009 June 24

Mathematics desk
< June 23 << May | June | Jul >> June 25 >
Welcome to the Wikipedia Mathematics Reference Desk Archives
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


June 24

edit

Normal distribution curves from two values.

edit

Is it possible to create a normal distribution curve if you only know, say, two of the standard deviation values are?

For example, let's say I know two values, X and Y, and I also know that between these two values 95% of the other values exist; is it possible to figure out what the rest of the standard deviations would be for the graph, and other information? I would thing it would be, but perhaps I'm wrong.

On a side note, does anyone know if there's a way of getting Excel to generate Normal distribution curves? It's been like 5 years since I've had to even think about drawing them and the wikipedia article is confusing me. (I know that's more of a computer sciences question, but I figure Mathematicians probably know the answer to that question as Excel seems very math/statistics oriented)

Thanks in advanced for your help! --HoneymaneHeghlu meH QaQ jajvam 03:27, 24 June 2009 (UTC)[reply]

Can't help you with the Excel, but the answer for your question is no. The problem is that a normal distribution is characterized by two parameters (the mean and the variance), and your information only supplies one equation characterizing the relationship between the two (specifically, that 95% of the distribution lies between X and Y). Thus, there are infinitely many possible normal distributions meeting your criteria. You need an additional piece of information. RayTalk 05:08, 24 June 2009 (UTC)[reply]
So it's not possible to derive the mean from the part of the standard deviation? --HoneymaneHeghlu meH QaQ jajvam 05:35, 24 June 2009 (UTC)[reply]
Well, in your example, the mean will be around midway between X and Y, you just won't be able to figure out exactly where it is between those values. That assumes your "95%" means "exactly 95%" and not "at least 95%". 208.70.31.186 (talk) 06:39, 24 June 2009 (UTC)[reply]
No, that's wrong. There's no reason to think the mean would be half-way between the two values. For example, one of them could be the 99th percentile of the distribution, and the other the 4th percentile. Or one could be the 99.99th percentile (a substantially larger number) and the other the 4.99th percentile---that still adds up to 95% between the two. That's why the answer is not unique. Michael Hardy (talk) 20:49, 24 June 2009 (UTC)[reply]
The anon said around midway but you can't be exact, which is perfectly accurate. The mean is going to be reasonably close to the midpoint. --Tango (talk) 21:04, 24 June 2009 (UTC)[reply]
No, it's not accurate at all. If the upper percentile is close to the 100th percentile (e.g., what if it's the 99.999999999th percentile) then the it will be a very very large number, whereas the lower one will be close to the 5th percentile, not so large at all. The mean will be far closer to the lower endpoint than to the upper one. Michael Hardy (talk) 05:57, 25 June 2009 (UTC)[reply]
There's no reason to believe that unless we know that the distribution has reasonably high variance. If all you know about a normal distribution is that exactly 95% of its mass is between a and b, then the mean could be anywhere in (a,b). Algebraist 21:07, 24 June 2009 (UTC)[reply]

To the OP: Your way of using words is so non-standard as to render your first sentence incomprehensible. Standard deviation is a precisely defined term, and what it means is not at all what you seem to mean. A normal distribution cannot have two different standard deviations; it has only one. Michael Hardy (talk) 20:51, 24 June 2009 (UTC)[reply]

Just for concreteness, for the standard normal distribution, 95% of the probability is between 2.3263 and −1.7507, but also 95% is between 3.719 and −1.6458. In the second case, you certainly don't have the mean halfway between the two, since the mean is 0. Michael Hardy (talk) 20:54, 24 June 2009 (UTC)[reply]
Perhaps I can rephrase then. Is it possible to figure out what the other 'values' in a normal distribution curve are, if you only have access to a limited amount of information? Take this diagram for example, if I know that -2σ is equal to 5, and 2σ is equal to 5, can I figure out what the mean (μ) and Standard Deviation would be?
To use the example from the SD article, if I told you that 95% of adult men are between 64 and 76 inches in height, is it possible to figure out that the mean value would be 70 inches with a mean of 3 inches? Given Ray's answer, I'm guessing the answer is no.
I realize I may not be using standard math language, it's never been my strong suit.--HoneymaneHeghlu meH QaQ jajvam 02:00, 25 June 2009 (UTC)[reply]
A normal distribution is determined by two values, the mean and the standard deviation. That means you cannot uniquely determine a normal distribution with less than two pieces of information. That 95% of the population are in a certain range is one piece of information, so it is not enough. The other example you give is different information, and is contradictory - -2σ and 2σ cannot both equal 5. That diagram is rather poor, anyway, the labels on the x-axis should be "μ+2σ", etc., not just "2σ". If you know that, say, μ+2σ=5 and μ-2σ=-5 then you can just solve the simultaneous equations to get the mean (μ) and standard deviation (σ). Note that there are two equations there, that is two pieces of information so it enough to uniquely determine the normal distribution. (The two pieces of information need to be independent of each other, if one implies the other then you only really have one piece of information.) --Tango (talk) 02:28, 25 June 2009 (UTC)[reply]
To graph a normal distribution in Excel:
  1. Put -4 in A2, -3.9 in A3 and autofill the column to 4 in A82.
  2. Put =EXP(-A2*A2/2)/SQRT(2*PI()) in B2 and autofill the column to B82
  3. Highlight region from the A2 to B82 and click on the chart wizard
--RDBury (talk) 04:46, 25 June 2009 (UTC)[reply]

Bezier curve with width

edit

I want to draw a bezier curve with an arbitrary thickness. How is this done?

The original curve has one control point (making it quadratic, I guess, although I barely know what that means). My idea is to draw two curves either side of it and fill between them. It's easy enough (if I'm doing it right) to find the offset start and end points for the two side-curves, but how can I find suitable control points for them? Offsetting the original control point by the desired width produces curves which are pinched in the middle.

Here's screenshot of this happening. (You have to ignore that the surface is tilted, but I think you can see what's going on.)  

I thought of measuring the distance between the start and end points of each of the side-curves, comparing that with the same distance on the original curve, and using the result to scale the offset of the control points. That's just a guess, though, and I think it wouldn't work. 213.122.47.84 (talk) 09:56, 24 June 2009 (UTC)[reply]

The offset curve of a (nontrivial) Bézier curve is not a Bézier curve itself, so you cannot do it in such a way at all. If by "drawing" you mean that you are trying to rasterize the curve, then a simple solution is to use whatever method you used to plot the original curve, except that you draw a (filled) circle instead of each pixel. — Emil J. 12:12, 24 June 2009 (UTC)[reply]
I was afraid so. Yes, I mean rasterize (I nearly posted this to the computing desk), and yes that's simple, but highly inefficient. Thanks for the link. I wonder what to do. Use cubic beziers, maybe. 81.131.10.72 (talk) 12:20, 24 June 2009 (UTC)[reply]
Try doing a google with 'bezier width algorithm' and you'll get a number of ways. Most systems will allow you to just specify the width and they'll do something. If you're doing this yourself you need to decide what you mean by a bezier curve with width and whether you want an ideal or real solution. For instance one definition might be what you get if you move a disc along the line - but then you get round ends. Another might be that you move a segment along the line always at right angle to the line. Dmcq (talk) 12:18, 24 June 2009 (UTC)[reply]
I need a solution similar to this: http://alienryderflex.com/polyspline/ ...which does something magical-seeming (to me) with quadratics to provide the answer for where a spline intersects a scanline. By this means I can fill between curves efficiently (not considering any pixel more than once) and perfectly (not approximating any part of the curve with a line). I would settle for looking right over being exactly correct, though. 81.131.10.72 (talk) 12:34, 24 June 2009 (UTC)[reply]
I think the usual procedure with drawing a Bezier curve is to keep subdividing it until each segment is effectively a line. In other words, if the control points are within 1 pixel of the line between the endpoints then you can assume that segment is a line and apply a line generating algorithm. A line with thickness is just a rectangle so if you want your algorithm to draw a thick Bezier curve then draw rectangles instead of lines in the last step.--RDBury (talk) 04:23, 25 June 2009 (UTC)[reply]
I'll consider* that. I had an idea of my own: if I had an algorithm for taking a set of points and producing a smooth string of splines that pass through them, I could find a handful of offset curve points by Dmcq's "segment at a right angle" method and then turn them into a series of splines that approximate the offset curves. (I have edited out what I put here about de Boor's algorithm because I think it's irrelevant.) *i.e. disregard and run back to it later. 81.131.56.235 (talk) 11:11, 25 June 2009 (UTC)[reply]

Find an array of numbers, max_i and max_j being given

edit

Hi. I need to find a nXm array (in fact n≤m≤8) of positive numbers xij, with maxjxij = ai and maxixij = bj for all i and j. The positive numbers ai and bj are given and maxiai = maxjbj=m. Apparently there are always such arrays, yes? Have you a recepit for it? Thanxx --84.221.68.243 (talk) 16:06, 24 June 2009 (UTC)[reply]

How about   --84.221.209.203 (talk) 17:54, 24 June 2009 (UTC)[reply]
Isn't   the correct answer (or at least one of correct answers)? The answer may be not unique. Let's take e.g. m=n=2 and all a=b=2. Then   will be a solution for any positive p and q not exceeding 2, as well as  . --CiaPan (talk) 20:16, 24 June 2009 (UTC)[reply]

poker odds

edit

What are the odds that in Texas Holdem poker with 10 players that 2 or more players effectivly have the same initial hand?

S=spade C=club H=heart D=Diamond.

Example,

10D 10H is effectivly the same as 10S 10C
8S 9S is effectivly 8H 9H, but not 8C 9 D 65.121.141.34 (talk) 16:49, 24 June 2009 (UTC)[reply]
A rough approximation is easy: compute the approximate odds that two hands are effectively the same, then use a birthday paradox calculation to find the likelihood of that occuring in the 45 possible pairings of 10 players. Getting everything exactly right sounds messy and if you're mostly interested in the actual number that comes out the problem, it may be easiest to run a computer simulation with a few million random deals and count how many times those ties occur. 67.122.209.126 (talk) 19:39, 24 June 2009 (UTC)[reply]
[ec] I think the probability for two particular players is  . The calculation is complicated by the fact that the events are not independent for multiple players, but the final result may be close to 20%. -- Meni Rosenfeld (talk) 19:43, 24 June 2009 (UTC)[reply]
From a computer simulation, I think the probability for at least two players having effectively the same initial hand is roughly 19.3 per cent. My interpretation is the following: from a 52 card deck I deal 2 cards each to 10 players, with no repetitions. The hand of two players count as effectively the same if their cards have exactly the same ranks (the order of the two cards in a hand does not matter) and either both player has two cards of the same suit or both player has two cards of different suits. I could have done something wrong in the computation, so someone check this please. – b_jonas 20:11, 27 June 2009 (UTC)[reply]