Simpson's paradox

2023-10-25 06:30
文章标签 paradox simpson

本文主要是介绍Simpson's paradox,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

http://en.wikipedia.org/wiki/Simpson's_paradox

http://zh.wikipedia.org/wiki/辛普森悖论

http://baike.baidu.com/view/965928.htm


===========


Simpson's paradox

From Wikipedia, the free encyclopedia
Simpson's paradox for continuous data: a positive trend appears for two separate groups (blue and red), a negative trend (black, dashed) appears when the data are combined.
This clickable gif image shows an explicative example of Simpson's Paradox. Though the percentage of male students who obtained the scholarship for maths is higher than the percentage of female students who obtained that scholarship, and the percentage of male students who obtained the scholarship for physics is higher than the percentage of female students who obtained that scholarship, the percentage of male students who obtained a scholarship (for maths or for physics) is lower than the percentage of female students who obtained a scholarship.

In probability and statistics, Simpson's paradox (or the Yule–Simpson effect) is a paradox in which a trend that appears in different groups of data disappears when these groups are combined, and the reverse trend appears for the aggregate data. This result is often encountered in social-science and medical-science statistics,[1] and is particularly confounding when frequency data are unduly given causal interpretations.[2] Simpson's Paradox disappears when causal relations are brought into consideration.

Though it is mostly unknown to laypeople, Simpson's Paradox is well known to statisticians, and it is described in a few introductory statistics books.[3][4] Many statisticians believe that the mainstream public should be informed of the counter-intuitive results in statistics such as Simpson's paradox.[5][6]

Edward H. Simpson first described this phenomenon in a technical paper in 1951,[7] but the statisticiansKarl Pearson, et al., in 1899,[8] and Udny Yule, in 1903, had mentioned similar effects earlier.[9] The nameSimpson's paradox was introduced by Colin R. Blyth in 1972.[10] Since Edward Simpson did not actually discover this statistical paradox (an instance of Stigler's law of eponymy), some writers, instead, have used the impersonal names reversal paradox and amalgamation paradox in referring to what is now called Simpson's Paradox and the Yule-Simpson effect.[11]

Contents

   [hide] 
  • 1 Examples
    • 1.1 Kidney stone treatment
    • 1.2 Berkeley gender bias case
    • 1.3 Low birth weight paradox
    • 1.4 Batting averages
  • 2 Description
    • 2.1 Vector interpretation
  • 3 Implications for decision making
  • 4 Psychology
  • 5 Probability
  • 6 Related concepts
  • 7 References
  • 8 External links

[edit]Examples

[edit]Kidney stone treatment

This is a real-life example from a medical study[12] comparing the success rates of two treatments forkidney stones.[13]

The table shows the success rates and numbers of treatments for treatments involving both small and large kidney stones, where Treatment A includes all open procedures and Treatment B is percutaneous nephrolithotomy:

  Treatment A Treatment B
Small StonesGroup 1
93% (81/87)
Group 2
87% (234/270)
Large StonesGroup 3
73% (192/263)
Group 4
69% (55/80)
Both78% (273/350)83% (289/350)

The paradoxical conclusion is that treatment A is more effective when used on small stones, and also when used on large stones, yet treatment B is more effective when considering both sizes at the same time. In this example the "lurking" variable (or confounding variable) of the stone size was not previously known to be important until its effects were included.

Which treatment is considered better is determined by an inequality between two ratios (successes/total). The reversal of the inequality between the ratios, which creates Simpson's paradox, happens because two effects occur together:

  1. The sizes of the groups, which are combined when the lurking variable is ignored, are very different. Doctors tend to give the severe cases (large stones) the better treatment (A), and the milder cases (small stones) the inferior treatment (B). Therefore, the totals are dominated by groups 3 and 2, and not by the two much smaller groups 1 and 4.
  2. The lurking variable has a large effect on the ratios, i.e. the success rate is more strongly influenced by the severity of the case than by the choice of treatment. Therefore, the group of patients with large stones using treatment A (group 3) does worse than the group with small stones, even if the latter used the inferior treatment B (group 2).

[edit]Berkeley gender bias case

One of the best known real life examples of Simpson's paradox occurred when the University of California, Berkeley was sued for bias against women who had applied for admission to graduate schools there. The admission figures for the fall of 1973 showed that men applying were more likely than women to be admitted, and the difference was so large that it was unlikely to be due to chance.[3][14]

  Applicants Admitted
Men844244%
Women432135%

But when examining the individual departments, it appeared that no department was significantly biased against women. In fact, most departments had a "small but statistically significant bias in favor of women."[14] The data from the six largest departments are listed below.

Department Men Women
Applicants Admitted Applicants Admitted
A82562%10882%
B56063%2568%
C32537%59334%
D41733%37535%
E19128%39324%
F2726%3417%

The research paper by Bickel, et al.[14] concluded that women tended to apply to competitive departments with low rates of admission even among qualified applicants (such as in the English Department), whereas men tended to apply to less-competitive departments with high rates of admission among the qualified applicants (such as in engineering and chemistry). The conditions under which the admissions' frequency data from specific departments constitute a proper defense against charges of discrimination are formulated in the book Causality by Pearl.[2]

[edit]Low birth weight paradox

The low birth weight paradox is an apparently paradoxical observation relating to the birth weights and mortality of children born to tobacco smoking mothers. As a usual practice, babies weighing less than a certain amount (which varies between different countries) have been classified as having low birth weight. In a given population, babies with low birth weights have had a significantly higher infant mortality rate than others. However, it has been observed that babies of low birth weights born to smoking mothers have a lower mortality rate than the babies of low birth weights of non-smokers.[15]

[edit]Batting averages

A common example of Simpson's Paradox involves the batting averages of players in professional baseball. It is possible for one player to hit for a higher batting average than another player during a given year, and to do so again during the next year, but to have a lower batting average when the two years are combined. This phenomenon can occur when there are large differences in the number of at-bats between the years. (The same situation applies to calculating batting averages for the first half of the baseball season, and during the second half, and then combining all of the data for the season's batting average.)

A real-life example is provided by Ken Ross[16] and involves the batting average of two baseball players, Derek Jeter and David Justice, during the baseball years 1995 and 1996:[17]

  1995 1996 Combined
Derek Jeter12/48.250183/582.314195/630.310
David Justice104/411.25345/140.321149/551.270

In both 1995 and 1996, Justice had a higher batting average (in bold type) than Jeter did. However, when the two baseball seasons are combined, Jeter shows a higher batting average than Justice. According to Ross, this phenomenon would be observed about once per year among the possible pairs of interesting baseball players. In this particular case, the Simpson's Paradox can still be observed if the year 1997 is also taken into account:

  1995 1996 1997 Combined
Derek Jeter12/48.250183/582.314190/654.291385/1284.300
David Justice104/411.25345/140.321163/495.329312/1046.298

The Jeter and Justice example of Simpson's paradox was referred to in the "Conspiracy Theory" episode of the television series Numb3rs, though a chart shown omitted some of the data, and listed the 1996 averages as 1995.[citation needed]

[edit]Description

Illustration of Simpson's Paradox; The first graph (on the top) represents Lisa's contribution, the second one Bart's. The blue bars represent the first week, the red bars the second week; the triangles indicate the combined percentage of good contributions (weighted average). While Bart's bars both show a higher rate of success than Lisa's, Lisa's combined rate is higher because basically she improved a greater ratio relative to the quantity edited.

Suppose two people, Lisa and Bart, each edit document articles for two weeks. In the first week, Lisa improves 0 of the 3 articles she edited, and Bart improves 1 of the 7 articles he edited. In the second week, Lisa improves 5 of 7 articles she edited, while Bart improves all 3 of the articles he edited.

  Week 1 Week 2 Total
Lisa0/35/75/10
Bart1/73/34/10

Both times Bart improved a higher percentage of articles than Lisa, but the actual number of articles each edited (the bottom number of their ratios, also known as the sample size) were not the same for both of them either week. When the totals for the two weeks are added together, Bart and Lisa's work can be judged from an equal sample size, i.e. the same number of articles edited by each. Looked at in this more accurate manner, Lisa's ratio is higher and, therefore, so is her percentage. Also when the two tests are combined using a weighted average, overall, Lisa has improved a much higher percentage than Bart because the quality modifier had a significantly higher percentage. Therefore, like other paradoxes, it only appears to be a paradox because of incorrect assumptions, incomplete or misguided information, or a lack of understanding a particular concept.

  Week 1 quantity Week 2 quantity Total quantity and weighted quality
Lisa0%71.4%50%
Bart14.2%100%40%

This imagined paradox is caused when the percentage is provided but not the ratio. In this example, if only the 14.2% in the first week for Bart was provided but not the ratio (1:7), it would distort the information causing the imagined paradox. Even though Bart's percentage is higher for the first and second week, when two weeks of articles is combined, overall Lisa had improved a greater proportion, 50% of the 10 total articles. Lisa's proportional total of articles improved exceeds Bart's total.

Here are some notations:

  • In the first week
  • S_L(1) = 0\% — Lisa improved 0% of the articles she edited.
  • S_B(1) = 14.2\% — Bart had a 14.2% success rate during that time.
Success is associated with Bart.
  • In the second week
  • S_L(2) = 71.4\% — Lisa managed 71.4% in her busy life.
  • S_B(2) = 100\% — Bart achieved a 100% success rate.
Success is associated with Bart.

On both occasions Bart's edits were more successful than Lisa's. But if we combine the two sets, we see that Lisa and Bart both edited 10 articles, and:

  • S_L = \begin{matrix}\frac{5}{10}\end{matrix} — Lisa improved 5 articles.
  • S_B = \begin{matrix}\frac{4}{10}\end{matrix} — Bart improved only 4.
  • S_L > S_B \, — Success is now associated with Lisa.

Bart is better for each set but worse overall.

The paradox stems from the intuition that Bart could not possibly be a better editor on each set but worse overall. Pearl proved how this is possible, when "better editor" is taken in the counterfactual sense: "Were Bart to edit all items in a set he would do better than Lisa would, on those same items".[2] Clearly, frequency data cannot support this sense of "better editor," because it does not tell us how Bart would perform on items edited by Lisa, and vice versa. In the back of our mind, though, we assume that the articles were assigned at random to Bart and Lisa, an assumption which (for a large sample) would support the counterfactual interpretation of "better editor." However, under random assignment conditions, the data given in this example are unlikely, which accounts for our surprise when confronting the rate reversal.

The arithmetical basis of the paradox is uncontroversial. If S_B(1) > S_L(1) and S_B(2) > S_L(2) we feel that S_B must be greater than S_L. However if different weights are used to form the overall score for each person then this feeling may be disappointed. Here the first test is weighted \begin{matrix}\frac{3}{10}\end{matrix} for Lisa and \begin{matrix}\frac{7}{10}\end{matrix} for Bart while the weights are reversed on the second test.

  • S_L = \begin{matrix}\frac{7}{10}\end{matrix}S_L(1) + \begin{matrix}\frac{3}{10}\end{matrix}S_L(2)
  • S_B = \begin{matrix}\frac{3}{10}\end{matrix}S_B(1) + \begin{matrix}\frac{7}{10}\end{matrix}S_B(2)

Lisa is a better editor on average, as her overall success rate is higher. But it is possible to have told the story in a way which would make it appear obvious that Bart is more diligent.

Simpson's paradox shows us an extreme example of the importance of including data about possible confounding variables when attempting to calculate causal relations. Precise criteria for selecting a set of "confounding variables," (i.e., variables that yield correct causal relationships if included in the analysis), is given in Pearl[2] using causal graphs.

While Simpson's paradox often refers to the analysis of count tables, as shown in this example, it also occurs with continuous data:[18] for example, if one fits separated regression lines through two sets of data, the two regression lines may show a positive trend, while a regression line fitted through all data together will show a negative trend, as shown on the first picture.

[edit]Vector interpretation

Vector interpretation of Simpson's paradox

Simpson's paradox can also be illustrated using the 2-dimensional vector space.[19] A success rate of p/q can be represented by a vector \overrightarrow{A}=(q,p), with a slope of p/q. If two rates p_1/q_1 and p_2/q_2 are combined, as in the examples given above, the result can be represented by the sum of the vectors (q_1, p_1) and (q_2, p_2), which according to the parallelogram rule is the vector (q_1+q_2, p_1+p_2), with slope \frac{p_1+p_2}{q_1+q_2}.

Simpson's paradox says that even if a vector \overrightarrow{b_1} (in blue in the figure) has a smaller slope than another vector \overrightarrow{r_1} (in red), and \overrightarrow{b_2} has a smaller slope than \overrightarrow{r_2}, the sum of the two vectors \overrightarrow{b_1} + \overrightarrow{b_2} (indicated by "+" in the figure) can still have a larger slope than the sum of the two vectors \overrightarrow{r_1} + \overrightarrow{r_2}, as shown in the example.

[edit]Implications for decision making

The practical significance of Simpson's paradox surfaces in decision making situations where it poses the following dilemma: Which data should we consult in choosing an action, the aggregated or the partitioned? In the Kidney Stone example above, it is clear that if one is diagnosed with "Small Stones" or "Large Stones" the data for the respective subpopulation should be consulted and Treatment A would be preferred to Treatment B. But what if a patient is not diagnosed, and the size of the stone is not known; would it be appropriate to consult the aggregated data and administer Treatment B? This would stand contrary to common sense; a treatment that is preferred both under one condition and under its negation should also be preferred when the condition is unknown.

On the other hand, if the partitioned data is to be preferred a priori, what prevents one from partitioning the data into arbitrary sub-categories (say based on eye color or post-treatment pain) artificially constructed to yield wrong choices of treatments? Pearl[2] shows that, indeed, in many cases it is the aggregated, not the partitioned data that gives the correct choice of action. Worse yet, given the same table, one should sometimes follow the partitioned and sometimes the aggregated data, depending on the story behind the data; with each story dictating its own choice. Pearl[2] considers this to be the real paradox behind Simpson's reversal.

As to why and how a story, not data, should dictate choices, the answer is that it is the story which encodes the causal relationships among the variables. Once we extract these relationships and represent them in a graph called a causal Bayesian network we can test algorithmically whether a given partition, representing confounding variables, gives the correct answer. The test, called "back-door," requires that we check whether the nodes corresponding to the confounding variables intercept certain paths in the graph. This reduces Simpson's Paradox to an exercise in graph theory.

[edit]Psychology

Psychological interest in Simpson's paradox seeks to explain why people deem sign reversal to be impossible at first, offended by the idea that a treatment could benefit both males and females and harm the population as a whole. The question is where people get this strong intuition from, and how it is encoded in the mind. Simpson's paradox demonstrates that this intuition cannot be supported by probability calculus alone, and thus led philosophers to speculate that it is supported by an innate causal logic that guides people in reasoning about actions and their consequences. Savage's "sure thing principle"[10] is an example of what such logic may entail. A qualified version of Savage's sure thing principle can indeed be derived from Pearl's do-calculus[2] and reads: "An action A that increases the probability of an event B in each subpopulation Ci of C must also increase the probability of B in the population as a whole, provided that the action does not change the distribution of the subpopulations." This suggests that knowledge about actions and consequences is stored in a form resembling Causal Bayesian Networks.

[edit]Probability

If a 2 × 2 × 2 table is selected at random, the probability is approximately 1/60 that Simpson's paradox will occur purely by chance.[20]

[edit]Related concepts

  • Ecological fallacy (and ecological correlation)
  • Modifiable areal unit problem
  • Prosecutor's fallacy

[edit]References

  1. ^ Clifford H. Wagner (February 1982). "Simpson's Paradox in Real Life". The American Statistician 36 (1): 46–48.doi:10.2307/2684093. JSTOR 2684093.
  2. a b c d e f g Judea Pearl. Causality: Models, Reasoning, and Inference, Cambridge University Press (2000, 2nd edition 2009).ISBN 0-521-77362-8.
  3. a b David Freedman, Robert Pisani and Roger Purves. Statistics (4th edition). W.W. Norton, 2007, p. 19. ISBN 978-0393929720.
  4. ^ David S. Moore and D.S. George P. McCabe (February 2005). "Introduction to the Practice of Statistics" (5th edition). W.H. Freeman & Company. ISBN 0-7167-6282-X.
  5. ^ Robert L. Wardrop (February 1995). "Simpson's Paradox and the Hot Hand in Basketball". The American Statistician49 (1): pp. 24–28.
  6. ^ Alan Agresti (2002). "Categorical Data Analysis" (Second edition).John Wiley and Sons ISBN 0-471-36093-7
  7. ^ Simpson, Edward H. (1951). "The Interpretation of Interaction in Contingency Tables". Journal of the Royal Statistical Society, Ser. B13: 238–241.
  8. ^ Pearson, Karl; Lee, A.; Bramley-Moore, L. (1899). "Genetic (reproductive) selection: Inheritance of fertility in man". Philosophical Translations of the Royal Statistical Society, Ser. A 173: 534–539.
  9. ^ G. U. Yule (1903). "Notes on the Theory of Association of Attributes in Statistics". Biometrika 2 (2): 121–134.doi:10.1093/biomet/2.2.121.
  10. a b Colin R. Blyth (June 1972). "On Simpson's Paradox and the Sure-Thing Principle". Journal of the American Statistical Association67 (338): 364–366. doi:10.2307/2284382. JSTOR 2284382.
  11. ^ I. J. Good, Y. Mittal (June 1987). "The Amalgamation and Geometry of Two-by-Two Contingency Tables". The Annals of Statistics 15 (2): 694–711. doi:10.1214/aos/1176350369. ISSN 0090-5364.JSTOR 2241334.
  12. ^ C. R. Charig, D. R. Webb, S. R. Payne, J. E. Wickham (29 March 1986). "Comparison of treatment of renal calculi by open surgery, percutaneous nephrolithotomy, and extracorporeal shockwave lithotripsy". Br Med J (Clin Res Ed) 292 (6524): 879–882.doi:10.1136/bmj.292.6524.879. PMC 1339981. PMID 3083922.
  13. ^ Steven A. Julious and Mark A. Mullee (12/03/1994). "Confounding and Simpson's paradox". BMJ 309 (6967): 1480–1481.PMC 2541623. PMID 7804052.
  14. a b c P.J. Bickel, E.A. Hammel and J.W. O'Connell (1975). "Sex Bias in Graduate Admissions: Data From Berkeley". Science 187(4175): 398–404. doi:10.1126/science.187.4175.398.PMID 17835295..
  15. ^ Wilcox Allen (2006). "The Perils of Birth Weight — A Lesson from Directed Acyclic Graphs". American Journal of Epidemiology 164(11): 1121–1123. doi:10.1093/aje/kwj276. PMID 16931545.
  16. ^ Ken Ross. "A Mathematician at the Ballpark: Odds and Probabilities for Baseball Fans (Paperback)" Pi Press, 2004. ISBN 0-13-147990-3. 12–13
  17. ^ Statistics available from http://www.baseball-reference.com/ :Data for Derek Jeter, Data for David Justice.
  18. ^ John Fox (1997). "Applied Regression Analysis, Linear Models, and Related Methods". Sage Publications. ISBN 0-8039-4540-X. 136–137
  19. ^ Kocik Jerzy (2001). "Proofs without Words: Simpson's Paradox"(PDF). Mathematics Magazine 74 (5): 399.
  20. ^ Marios G. Pavlides and Michael D. Perlman (August 2009). "How Likely is Simpson's Paradox?". The American Statistician 63 (3): 226–233. doi:10.1198/tast.2009.09007.

[edit]External links

  • Stanford Encyclopedia of Philosophy: "Simpson's Paradox" – by Gary Malinas.
  • Earliest known uses of some of the words of mathematics: S
    • For a brief history of the origins of the paradox see the entries "Simpson's Paradox" and "Spurious Correlation"
  • Pearl, Judea, ""The Art and Science of Cause and Effect." A slide show and tutorial lecture.
  • Pearl, Judea, "Simpson's Paradox: An Anatomy" (PDF)
  • Short articles by Alexander Bogomolny at cut-the-knot:
    • "Mediant Fractions."
    • "Simpson's Paradox."
  • The Wall Street Journal column "The Numbers Guy" for December 2, 2009 dealt with recent instances of Simpson's paradox in the news. Notably a Simpson's paradox in the comparison of unemployment rates of the 2009 recession with the 1983 recession. by Cari Tuna (substituting for regular columnist Carl Bialik)

这篇关于Simpson's paradox的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/280651

相关文章

python 实现simpson rule辛普森法则算法

simpson rule辛普森法则算法介绍 辛普森法则(Simpson’s rule)是一种数值积分方法,用于估计函数在给定区间上的定积分。该方法利用二次函数来逼近被积函数,从而得到更准确的积分估计。 辛普森法则的算法通常将积分区间[a,b]划分成n个小区间(n为偶数),每个小区间的长度为h=(b−a)/n。然后,它使用三个点(区间开始、中间和结束)的函数值来近似每个小区间上的积分,并累加这些

数值积分之Simpson 3/8法则

//实现Simpson 3/8法则 #include <iostream> #include <math.h> using namespace std; class simpson2 { private:  int n, k;  double a, b, f, integral, interval, one_third_interval;  double sum_term1, sum_term

数值积分之Simpson 1/3法则

//实现Simpson 1/3法则 #include <iostream> #include <math.h> using namespace std; class simpson { private:  int n, k;  double a, b, f, half_interval, integral, interval, sum_even_terms;  double sum_odd_t

[NOI2005]月下柠檬树[计算几何(simpson)]

1502: [NOI2005]月下柠檬树 Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 1169  Solved: 626[Submit][Status][Discuss] Description Input 文件的第1行包含一个整数n和一个实数alpha,表示柠檬树的层数和月亮的光线与地面夹角(单位为弧度)。第2行包含n+1个实数h0,

如何量化多样性?答:辛普森多样性指数(Simpson’s Diversity Index)

如何量化多样性?答:辛普森多样性指数(Simpson’s Diversity Index) 生物多样性指地球上各种生命的多样性,涵盖所有生命形式,从基因、细菌到所有生态系统,例如森林或珊瑚礁生态系统。 那么如何量化多样性呢? 首先,让我们来理解一下什么是物种多样性。在一个生态系统中,如果有许多不同类型的物种共存,我们就说这个生态系统具有高的物种多样性。相反,如果只有几种物种,那么它的物种

acdream1234(Simpson积分)

链接:点击打开链接 题意:给出两个圆柱体的底面半径,一个垂直放置一个水平放置,求相交部分的体积 代码: #include <math.h>#include <stdio.h>#include <iostream>#include <stdlib.h>#include <algorithm>using namespace std;const double eps=1e-10;do

Alpah多样性指数-Simpson指数、Shannon指数、chao1指数

原文来自公众号:YY科研学社 为什么要进行微生物多样性的研究? 微生物多样性的研究对于我们理解地球生态系统的功能和稳定性至关重要。微生物在地球上的每一个角落都扮演着重要的角色,包括维持土壤健康、分解有机物质、影响人类健康等。 通过研究微生物多样性指数,比如丰富度指数和均匀度指数,我们可以更好地了解微生物在生态系统中的丰富程度和分布均匀度,从而评估生态系统的稳定性和健康状况。此外,对微生

Fetch.AI 首席技术官Toby Simpson参与AMA活动

感谢7月11日在YouTube上参与 Fetch.AI AMA的所有人。我们收到了大量的问题,遗憾的是我们没有时间回答其中的多数问题。如果你错过了现场AMA,你可以在下面观看全部内容: 在本文中,我们为AMA期间与首席技术官Toby Simpson讨论的10个最佳问题提供了答案。在页面底部,我们还添加了另外三个问题。虽然我们没有时间在AMA期间解决这些问题,但我们相信Fetch.AI社区会对这些

预测-修正法(Milne-Simpson和Adams-Bashforth-Moulton)解常微分方程(python)

第四十八篇 预测-修正法 预测-校正方法是使用先前几个已知点的信息来计算下一个点,如下图所示。 这种方法的一个缺点是,他们需要一些已知信息,可能需要一步法来生成一些点才能开始,详情可见常微分方程的一步法求解。而这些方法的优点在于,为了预测下一个点,能够有效地利用现有的信息。这与四阶龙格-库塔法相反,例如,在每一步中,需要计算四个函数,预测-修正法将不会这么麻烦。 预测-校正方法利用两个公式;根据

HDU - 4498 Function Curve 自适应simpson

题目链接:点击打开链接 题意:求题目中F(x)的弧长 思路:求出各个二次函数的交点并保存起来,然进行排序,然后按各个交点求出以这个点为端点的一段最小的函数,并求出这个函数在这个区间的弧长。弧长当然可以用自适应simpson模版 代码: #include <iostream>#include <cstdio>#include <cmath>#include <algorithm>