Wikipedia:Reference desk/Archives/Mathematics/2008 January 13

Mathematics desk
< January 12 << Dec | January | Feb >> January 14 >
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.


January 13

edit

Bayes question

edit

I'm trying to classify images appearing in HTML into photographs / non-photographs.

Two possible indicators (among many others) I can use are whether the image tag has an alt attribute and whether the image has a title attribute set.

In my data set I've found that about 90% of photographs have an alt attribute set; and about 60% of non-photographs have an alt attribute set. Also, about 20% of photographs have a title attribute set; and about 5% of non-photographs have a title attribute set.

How can I calculate the probability of an image being either photograph or non-photograph for every possible (true/false) configuration of the two input variables?

I think that this is just Bayesian conversion of Pr(H|D) to Pr(D|H), but I've not found a simple explanation of how to do that with more than one input variable. (And yes, let's assume that the title/alt attribute presences are independent).

--Clairvoyant walrus2 (talk) 00:16, 13 January 2008 (UTC)[reply]

You will need a prior to do anything Bayesian. In other words you need to know the probability of your images being photos/non-photos in the absence of alt/title evidence. And rather than assuming independence, why not just gather data on the prevalence of each of the four combined possibilities? Algebraist 00:27, 13 January 2008 (UTC)[reply]
I can get priors easily enough... why not get all 4 possibilities? There aren't really just two input variables, I just described it that way for simplicity, there are actually a couple dozen. --Clairvoyant walrus2 (talk) 02:37, 13 January 2008 (UTC)[reply]
How'd you end up with the name "Clairvoyant walrus2"? Was "Clairvoyant walrus" already taken? Anyway, the usual Bayesian rule says that  . Substitute   and use independence of   and   (which means that  ) to get  . Now you can replace   with "x is a photo" and   with "x (does / does not) have an alt attribute" and   with "x (does / does not) have a title attribute". -- BenRG (talk) 08:07, 13 January 2008 (UTC)[reply]
Wikipedia:Reference desk/Archives/Mathematics/2007 December 14#Advice for integrating disparate similarity measures? indicates that Clairvoyant walrus is the same as Clairvoyant walrus2. The latter account was created the day after the last edit by the former. Maybe due to a forgotten password? PrimeHunter (talk) 08:38, 13 January 2008 (UTC)[reply]

Ok, I see now. Thanks. The answer had been staring me in the face. I implemented it in my application and it works well. --Clairvoyant walrus2 (talk) 04:17, 14 January 2008 (UTC)[reply]

Standard deviation and confidiance interfulls

edit

When doing questions for an exam and comparing them with a friend we realise that we had different formulas for standard deviation and thus were getting different answers.

mine was

 

where as his was

 

both of us had found different books showing each, which one is correct. The question was to find the confidence interval. —Preceding unsigned comment added by 136.206.1.17 (talk) 11:10, 13 January 2008 (UTC)[reply]

The former is the correct way to calculate the standard deviation of a given population. The latter is the unbiased ("best" in some way) way to estimate the standard deviation of a population given only a sample of it. You may need one or the other depending on the circumstances - I don't think "confidence intervals" gives enough context. -- Meni Rosenfeld (talk) 13:12, 13 January 2008 (UTC)[reply]
Are you sure that the latter is unbiased, Meni? If I understand our article correctly, its square is an unbiased estimator of the variance. However, the formula given needs a slight correction to get an unbiased estimate of the standard deviation. --NorwegianBlue talk 18:34, 13 January 2008 (UTC)[reply]
You are of course correct. -- Meni Rosenfeld (talk) 18:52, 13 January 2008 (UTC)[reply]

Cyclic pentagon

edit

As part of the solution of a newspaper puzzle, I have 10 sets of 5 distinct internal angles of a cyclic pentagon. In each case, the angles could be put into 12 distinguishable sequences of occurrence round the pentagon (e.g. ABCDE, BCDEA, AEDCB are non-distinguishable in the sense of giving the same figure, turning over if necessary). My question is twofold:

1) Can any sequence of 5 positive numbers summing to 540° be drawn as a cyclic pentagon with internal angles in that order, and if so, how? 2) Can it be established without drawing whether or not the centre of the circumscribing circle is inside the pentagon?

For example, one of my sets is (171°,161°,131°,44°,33°). Having to assess 120 pentagons seems wildly excessive for the purposes of the puzzle. 86.152.78.37 (talk) 16:34, 13 January 2008 (UTC)[reply]

Denoting by O the center of the circle,   and so on, you have the following equations:
 
For which the solution is:
 
I think a sufficient and necessary condition to being a legal pentagon is that all of those internal angles are positive. Therefore, a solution does not always exist, but you can easily find when it does. Also, once you have calculated the internal angles it is trivial to construct the pentagon. I also think that the centre of the circumscribing circle is insideoutside the pentagon iff one of the internal angles is greater than 180°, which is also easy to check. -- Meni Rosenfeld (talk) 18:24, 13 January 2008 (UTC)[reply]
Assuming my geometry is correct, our silicon masters are more than willing to provide solutions to the problem. For the set you give there is no legal permutation. -- Meni Rosenfeld (talk) 18:32, 13 January 2008 (UTC)[reply]
Thanks. I understood as soon as I realised that your "internal angles" are at the centre, whereas mine are at the vertices. I think too that you mean that the centre of the circle is outside the pentagon iff one of α etc exceeds 180°.
I don't recall coming across anything like this before, but I'd have thought that the condition for a pentagon (and hexagon, ...) to be cyclic would be of interest, as an extension to all triangles being cyclic and quadrilaterals only if opposite angles sum to 180°. 86.152.78.37 (talk) 23:49, 13 January 2008 (UTC)[reply]
The difference originates from the fact that for an odd number of sides, the system of equations is regular, thus there is always a "solution". However, if the numerical solution includes negatives, it means that the polygon intersects itself. For the triangle, it is so simple it can never intersect itself, so there is always a legal solution. For a pentagon, you still can always find a cyclic one, but it might intersect itself. The condition that it doesn't intersect itself manifests as a bunch of inequalities. For an even number of sides, such as a square, the system is singular, and thus the vertex angles must satisfy some condition (in this case,  ) if you want any sort of solution. -- Meni Rosenfeld (talk) 10:09, 14 January 2008 (UTC)[reply]

Proving Limits

edit
Imagine I evaluate following expression  

and get 2 as its limit. I factored both the numerator and the denominator as much as I could and that's the result I got. What I would like to know is prove it indeed is 2. I suppose I could check with a graphic calculator, but I would like to be able to do it using Heine's method. It needn't be the above expression, that was just an example. Any limit will do it, just in case someone thinks I am here just to have my homework solved for me. That's not the case. Thank you very much in advance. -- Ishikawa Minoru (talk) 17:46, 13 January 2008 (UTC)[reply]

I have not heard of Heine's method, but L'Hôpital's rule can be useful here.
The way to prove a limit depends on what you are allowed to use. If you want to go all the way back to the δ-ε definition, it should go as follows: Let ε>0. Calculate   (valid for  ). Now you need to find some   such that if   then  . Can you do it? -- Meni Rosenfeld (talk) 17:58, 13 January 2008 (UTC)[reply]
It would be a mistake to use L'Hopital's rule in this problem in certain contexts. For one thing, you may be finding limits in order to prove facts about derivatives, and then using derivatives in L'Hopital's rule. The fact that you get 0 when you plug in x = 3 tells you that (x − 3) is a factor, so you get
 
and just use long division to find the two "somethings". You use the word "prove", which suggests either you don't want only to evaluate the limit, or you don't realize what the correct way of using that word is. Maybe I'll say more later if you clarify further. Michael Hardy (talk) 00:12, 14 January 2008 (UTC)[reply]
I find it unlikely that this particular problem is related to the evaluation of a derivative. Again, it all depends on what is allowed to be used, we certainly want to avoid any circularities. That said, I am personally more comfortable with taking derivatives for L'hopital's than with polynomial long division for factoring. -- Meni Rosenfeld (talk) 09:14, 14 January 2008 (UTC)[reply]
Assuming you're allowed basic properties of limits, factorising is useful:
 
Algebraist 18:29, 13 January 2008 (UTC)[reply]
...and that equals  
CiaPan (talk) 06:32, 16 January 2008 (UTC)[reply]

Can someone at this desk take a look at the above article. It was created by a newbie and needs cleanup but I don't know enough to do it myself. Theresa Knott | The otter sank 18:03, 13 January 2008 (UTC)[reply]

MATH QUESTION ON SPECIAL RIGHT TRIANGLES AND HOW TO CALCULATE THEIR AREA'S

edit

Math question on special right triangles and how to calculate their area's
Now then, isn't that easier on the eyes?  ;-)

Okay, for Geometry we have this problem to do and I completly forgot how to do it. It has something to do with a special right triangle and calculating it's area. I don't wanna know just the answer but how to get to it. The question is a diagram of a 45-45-90 triangle and the 'taller' side is 73. The hypotenuse and base are unlabeled. The right angle is where the 'taller' side and bottom base meet. —Preceding unsigned comment added by 80.148.25.183 (talk) 19:34, 13 January 2008 (UTC)[reply]

If it's a 45-45-90 triangle, then there's a very specific relationship between the length of one leg and another. What is it? Gscshoyru (talk) 19:37, 13 January 2008 (UTC)[reply]
Look here if you need more help. hydnjo talk 01:14, 14 January 2008 (UTC)[reply]
Have you looked at Special_right_triangles#45-45-90_triangle ? --YbborTalk 01:43, 14 January 2008 (UTC)[reply]
Yes, that's much better! hydnjo talk 01:56, 14 January 2008 (UTC)[reply]