Editing Talk:2435: Geothmetic Meandian
Please sign your posts with ~~~~ |
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 40: | Line 40: | ||
I do not agree with the statement that "The title text may also be a sly reference to an actual mathematical theorem, namely that if one performs this procedure only using the arithmetic mean and the harmonic mean, the result will converge to the geometric mean." Could one produce a reference to this result? A simple computer experiment does not show this "theorem" to be true, i.e. for the procedure to return the geometric mean of the original entry. [[User:Pointfivegully|Pointfivegully]] ([[User talk:Pointfivegully|talk]]) 15:04, 12 March 2021 (UTC) | I do not agree with the statement that "The title text may also be a sly reference to an actual mathematical theorem, namely that if one performs this procedure only using the arithmetic mean and the harmonic mean, the result will converge to the geometric mean." Could one produce a reference to this result? A simple computer experiment does not show this "theorem" to be true, i.e. for the procedure to return the geometric mean of the original entry. [[User:Pointfivegully|Pointfivegully]] ([[User talk:Pointfivegully|talk]]) 15:04, 12 March 2021 (UTC) | ||
− | |||
− | |||
== Proof of convergence == | == Proof of convergence == | ||
Line 163: | Line 161: | ||
− | I'd like to add my own | + | I'd like to add my own implemetation: |
− | + | from math import * | |
− | + | def getMeans(n=list): | |
− | + | n.sort() | |
− | + | mean=sum(n)/len(n) | |
− | + | if len(n)%2==1: | |
− | + | median=n[len(n)//2] | |
− | + | else: | |
− | + | median=(n[1+floor(len(n)/2)]-n[floor(len(n)/2)])/2 | |
− | + | prod=1 | |
− | + | for i in n: | |
− | + | prod*=i | |
− | + | gmean=prod**(1/len(n)) | |
− | + | return [mean,median,gmean] | |
− | + | def gmdn(tol,n=list): | |
− | + | mList=n | |
− | + | mList=getMeans(mList) | |
− | + | while not (isclose(mList[0],mList[1],rel_tol=tol) and isclose(mList[1],mList[2],rel_tol=tol) and isclose(mList[0],mList[2],rel_tol=tol) ) : | |
− | + | mList = getMeans(mList) | |
− | + | return (mList[0]+mList[1]+mList[2])/3 | |
− | + | print(gmdn(1e-15,[1,1,2,3,5])) | |
− | |||
− | |||
which gives me 2.089057949736859 | which gives me 2.089057949736859 | ||
Line 204: | Line 200: | ||
R = GMDN(a,b,c) | R = GMDN(a,b,c) | ||
− | |||
− | |||
=== The RandallMunroe Set === | === The RandallMunroe Set === | ||
Line 284: | Line 278: | ||
My python program: | My python program: | ||
− | + | from math import * | |
− | + | def getMeans(n=list): | |
− | + | n.sort() | |
− | + | mean=sum(n)/len(n) | |
− | + | if len(n)%2==1: | |
− | + | median=n[len(n)//2] | |
− | + | else: | |
− | + | median=(n[1+floor(len(n)/2)]-n[floor(len(n)/2)])/2 | |
− | + | prod=1 | |
− | + | for i in n: | |
− | + | prod*=i | |
− | + | gmean=prod**(1/len(n)) | |
− | + | return [mean,median,gmean] | |
− | + | def gmdn(tol,n=list): | |
− | + | mList=n | |
− | + | mList=getMeans(mList) | |
− | + | while not (isclose(mList[0],mList[1],rel_tol=tol) and isclose(mList[1],mList[2],rel_tol=tol) and isclose(mList[0],mList[2],rel_tol=tol) ) : | |
− | + | mList = getMeans(mList) | |
− | + | return mList[0] | |
− | + | print(gmdn(1e-15,[1,1,2,3,5])) | |
− | |||
It gave me 2.0890579497368584 | It gave me 2.0890579497368584 | ||
Line 348: | Line 341: | ||
I believe we can produce a simpler, rigorous proof. Assuming a set of three is given, we can show that after every 2 iterations, the range is reduced by at least 1/3 of its original value, and therefore it converges exponentially to 0. We use the fact that each iteration, none of the three values will lie outside the range of the previous iteration. In addition, it can be shown that the arithmean lies at least 1/3 of the previous range away from the highest and lowest values of the previous iteration. | I believe we can produce a simpler, rigorous proof. Assuming a set of three is given, we can show that after every 2 iterations, the range is reduced by at least 1/3 of its original value, and therefore it converges exponentially to 0. We use the fact that each iteration, none of the three values will lie outside the range of the previous iteration. In addition, it can be shown that the arithmean lies at least 1/3 of the previous range away from the highest and lowest values of the previous iteration. | ||
− | If the arithmean is the highest or lowest value on the first iteration, then the range will therefore already be small enough (and won't get bigger in the second iteration.) Otherwise, the only remaining option is that it is the middle (median) value. So on the second iteration, both the median and the arithmean are within the reduced 1/3 range, and at least one of them must be the highest or lowest value. The range will always be the required size. | + | If the arithmean is the highest or lowest value on the first iteration, then the range will therefore already be small enough (and won't get bigger in the second iteration.) Otherwise, the only remaining option is that it is the middle (median) value. So on the second iteration, both the median and the arithmean are within the reduced 1/3 range, and at least one of them must be the highest or lowest value. The range will always be the required size. [[Special:Contributions/141.101.98.16|141.101.98.16]] |
− | |||
− | |||
− | [[Special:Contributions/141.101.98.16|141.101.98.16]] | ||
== Why is this funny? == | == Why is this funny? == | ||
Line 365: | Line 355: | ||
:Yes, here's a bit more on that.. I agree with [[User:Elektrizikekswerk|Elektrizikekswerk]] the joke is explained. The stat tip: "If you aren't sure whether to use the mean, median or geometric mean, just calculate all three, then repeat until it converges." is funny because there are many situations in the physical sciences where the arthmean, geometric mean and median for some data are different values. It is perhaps common that scientists not well versed in statistics are unsure which to use. The funny bit is imagining this less-statistically-versed-scientist throwing up their hands and just accepting the fixed constant given by iterating GMDN as the 'answer' irrelevant of any physical meaning. Also the name "geothmetic meandian" is funny because the word meandian is similar to both median, which it uses, and to ''meander'' which is indicated by the alternate assignment of the median on each iteration -- informally, this function meanders. [[User:Ramakarl|Ramakarl]] | :Yes, here's a bit more on that.. I agree with [[User:Elektrizikekswerk|Elektrizikekswerk]] the joke is explained. The stat tip: "If you aren't sure whether to use the mean, median or geometric mean, just calculate all three, then repeat until it converges." is funny because there are many situations in the physical sciences where the arthmean, geometric mean and median for some data are different values. It is perhaps common that scientists not well versed in statistics are unsure which to use. The funny bit is imagining this less-statistically-versed-scientist throwing up their hands and just accepting the fixed constant given by iterating GMDN as the 'answer' irrelevant of any physical meaning. Also the name "geothmetic meandian" is funny because the word meandian is similar to both median, which it uses, and to ''meander'' which is indicated by the alternate assignment of the median on each iteration -- informally, this function meanders. [[User:Ramakarl|Ramakarl]] | ||
:Thanks to all who shared the absurdity so I could also enjoy the joke, and the joke is on me for needing to have a joke "explained". Now where is the button for me to give credit to the best answer? I want to be sure you get points toward your next-level badge. ;-) [[User:Rtanenbaum|Rtanenbaum]] ([[User talk:Rtanenbaum|talk]]) 16:23, 13 March 2021 (UTC) | :Thanks to all who shared the absurdity so I could also enjoy the joke, and the joke is on me for needing to have a joke "explained". Now where is the button for me to give credit to the best answer? I want to be sure you get points toward your next-level badge. ;-) [[User:Rtanenbaum|Rtanenbaum]] ([[User talk:Rtanenbaum|talk]]) 16:23, 13 March 2021 (UTC) | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |