Euclidean algorithm and Miguel Tejada: Difference between pages

(Difference between pages)
Content deleted Content added
 
Nhstebe (talk | contribs)
 
Line 1:
{{Infobox MLB player|
:''This article is not about [[Euclidean geometry]].''
bgcolor1=#000000|
bgcolor2=#F87217|
textcolor1=white|
textcolor2=white|
name=Miguel Tejada|
image=800px-Miguel_Tejada2.JPG|
width=200|
position=Shortstop|
team=Baltimore Orioles|
number=10|
bats=Right|
throws=Right|
birthdate={{birth date and age|1976|5|25}}|
debutdate=August 27|
debutyear=1997|
debutteam=Oakland Athletics|
statyear=April 21, 2007|
stat1label=[[Batting average]]|
stat1value=.286|
stat2label=[[Home runs]]|
stat2value=241|
stat3label=[[RBI's]]|
stat3value=957|
formerteams=<nowiki></nowiki>
*[[Oakland Athletics]] ([[1997 in baseball|1997]]-[[2003 in baseball|2003]])
}}
'''Miguel Odalis Tejada''' (born [[May 25]], [[1976]]), nicknamed "''Miggy''", is currently the [[shortstop]] of the [[Baltimore Orioles]] [[Major League Baseball]] team.
 
==Early life==
In [[number theory]], the '''Euclidean algorithm''' (also called '''Euclid's algorithm''') is an [[algorithm]] to determine the [[greatest common divisor]] (GCD) of two [[integer]]s or elements of any [[Euclidean ___domain]] (for example, [[polynomials]] over a [[field (mathematics)|field]]) by repeatedly dividing the two numbers and the remainder in turns. Its major significance is that it does not require [[factorization|factoring]] the two integers, and it is also significant in that it is one of the oldest algorithms known, dating back to the ancient Greeks.
Tejada grew up in extreme poverty in [[Baní]], a city approximately 40 miles southwest of [[Santo Domingo]], capital of the [[Dominican Republic]]. Miguel Tejada grew up idolizing the Baltimore Orioles SS Cal Ripken Jr.
At age 17 his childhood dream of playing professional baseball was realized when he signed with the [[Oakland Athletics]] for $2000.
 
==Oakland A's==
==History of the Euclidean algorithm==
Tejada developed quickly into a top-notch prospect, showing early signs of power. He reached the majors towards the end of the 1997 season, joining a struggling Oakland Athletics club. Though he only hit .202 in 26 games that year, the A's saw potential in the 21-year-old Tejada and gave him the starting shortstop job beginning in 1998.
The Euclidean algorithm is one of the oldest algorithms known, since it appeared in [[Euclid's Elements|Euclid's ''Elements'']] around [[300 BC]]. Euclid originally formulated the problem geometrically, as the problem of finding a common "measure" for two line lengths, and his algorithm proceeded by repeated subtraction of the shorter from the longer segment. However, the algorithm was probably not discovered by [[Euclid]] and it may have been known up to 200 years earlier. It was almost certainly known by [[Eudoxus of Cnidus]] (about 375 BC); and [[Aristotle]] (about 330 BC) hinted at it in his ''Topics'', 158b, 29-35.
 
The A's, and Tejada, steadily improved over the next two years. His hitting improved as he gained more discipline at the plate. In 1998, he hit .233 with 11 [[home run]]s and in 1999 his average jumped to .251 with 21 home runs.
this boring and i dont like to do this on my course
 
After a solid 87-win campaign in 1999, Tejada and a core of young players led their A's to their first [[American League]] [[Western Division]] title in eight years in 2000. Bolstered by an [[MLB Most Valuable Player Award|American League MVP]]-winning performance by [[first baseman]] [[Jason Giambi]], and aided by Tejada's .275 average and 30 home runs, the A's won 91 games. The A's faced the [[New York Yankees]] in the first round of the postseason, which was won by the Yankees 3-2 in Oakland. The Yankees would go on to win the [[World Series]] that year, their fourth championship in five years.
 
In 2001, Tejada had a comparable offensive year, hitting .267 with 31 homers. The A's captured the American League [[wild card (sports)|wild card]] with a 102-60 record. In the postseason, however, the A's fell to the Yankees in five games, blowing an initial 2-0 series lead.
 
Tejada's breakout year came in 2002. With the departure of Jason Giambi to the New York Yankees during the offseason, and a leg injury to slugger [[Jermaine Dye]], the A's lost two of their key offensive players. Tejada hit .308 with 34 homers and led the A's to their second Western Division title in three years. Their campaign included an American League record 20 game win-streak. Tejada contributed one-out, game-winning hits in the 18th and 19th games of that run: a three-run homer off [[Minnesota Twins]] closer Eddie Guardado for a 7-5 victory and a bases-loaded single against [[Kansas City Royals]] reliever Jason Grimsley to break a 6-6 tie. Tejada also showed modest speed on the basepaths with 18 steals over a two-year stretch. His performance was rewarded with the 2002 American League MVP award. For the third straight year, though, the A's fell in the fifth game of the ALDS, this time to the [[Minnesota Twins]].
 
The next year, both the A's and Tejada got off to a slow start, with the shortstop hitting under [[Mendoza line|.200]] for the first month of the season. Improved play in the second half of the season led the A's to their second straight Western Division title and their third in four years. Tejada hit .278 with 27 homers for the year, a decrease from his numbers in 2002, but still leading many offensive categories for shortstops.
This is boring i hate this stuff lol
 
In a tension-filled series, the powerful offense of the [[Boston Red Sox]] narrowly edged out the A's in the first round, once again in five games. Tejada was known for his public display of anger toward Boston starting pitcher [[Derek Lowe]] at the series' conclusion for what he perceived as obscene gestures. Lowe denied the accusation, claiming his fist pump was in celebration only.
== Running time ==
 
By the end of the 2003 season, Tejada had established himself as one of baseball's premier shortstops. The A's elected not to resign the free agent, citing budget concerns and a young [[Bobby Crosby]] coming through the system, so Tejada signed a six-year, $72 million deal with the Baltimore Orioles during the offseason.
[[Image:Euclidean algorithm running time X Y.png|thumb|256px|Plot of the running time for gcd(x,y). Red indicates a fast computation, while successively bluer points indicate slower computations]]
 
As an Oriole, Tejada follows in the footsteps of legendary Baltimore shortstop [[Cal Ripken Jr.]]. Like Ripken, Tejada is a strong and durable shortstop with unusual power numbers for a middle infielder. Ripken currently holds baseball's record for consecutive games played at 2,632. Tejada played in his 1,000th [[MLB consecutive games played streaks|consecutive game]] on July 1, 2006--currently the seventh-longest streak of all-time. As of the end of the 2006 season, Tejada's streak stood at 1,080 games. Were he not to miss a game, he would approach Ripken's record in [[2016]]. Tejada has repeatedly asserted that he is not interested in breaking Ripken's record.
When analyzing the running time of Euclid's algorithm, it turns out that the inputs requiring the most divisions are two successive [[Fibonacci number]]s (because their ratios are the [[convergent (continued fraction)|convergents]] in the slowest [[continued fraction]] expansion to converge, that of the [[golden ratio]]), and the worst case requires [[Big O notation|''O''(''n'')]] divisions, where ''n'' is the number of digits in the input. However, the divisions themselves are not constant time operations; the actual time complexity of the algorithm is <math>O(n^2)</math>.
The reason is that division of two ''n''-bit numbers takes time <math>O(n(m+1))</math>, where ''m'' is the length of the quotient. Consider the computation of gcd(''a'',''b'') where ''a'' and ''b'' have at most ''n'' bits, let <math>a_0,\dots,a_k</math> be the sequence of numbers produced by the algorithm, and let <math>n_0,\dots,n_k</math> be their lengths. Then <math>k=O(n)</math>, and the running time is bounded by
:<math>O\Big(\sum_{i<k}n_i(n_i-n_{i+1}+2)\Big)\le O\Big(n\sum_{i<k}(n_i-n_{i+1}+2)\Big)\le O(n(n_0+2k))\le O(n^2).</math>
 
Some say Miguel Tejada is the best offensive shortstop in Major League Baseball, a claim well supported by his statistics. Teammate [[Brian Roberts]] told [[Peter Gammons]] that Tejada is the best player in the game because, "He has an uncanny ability to knock in runs ... his energy. He is always up, pushing everyone and making the entire team better." Orioles' hitting instructor Terry Crowley said, "This franchise changed the day he arrived."
This is considerably better than Euclid's original algorithm, in which the modulus operation is effectively performed using repeated subtraction in <math>O(2^n)</math> steps. Consequently, that version of the algorithm requires <math>O(2^n n)</math> time for ''n''-digit numbers, or <math>O(m \log{m})</math> time for the number ''m''.
 
During the offseason, Tejada resides in the Dominican Republic with his wife, Alessandra, his daughter, Alexa, and his son, Miguel Jr.
Euclid's algorithm is widely used in practice, especially for small numbers, due to its simplicity. An alternative algorithm, the [[binary GCD algorithm]], exploits the [[binary numeral system|binary]] representation used by computers to avoid divisions and thereby increase efficiency, although it too is ''O''(''n''²); it merely shrinks the constant hidden by the [[big-O notation]] on many real machines.
 
[[Image:Tejada_press.jpg|thumb|250px|left|Miguel Tejada talks to reporter Kelli Johnson 2005.]][[Image:Tejada.jpg|thumb|right|Tejada at the 2004 Home Run Derby]]
== Relation with continued fractions ==
 
On [[July 12]], [[2004]], Tejada won the [[Century 21]] [[Home Run Derby]] in [[Houston]]. Tejada hit a record 27 [[home runs]] in the contest, with a record 15 homers in the second round. He defeated [[Houston Astros]] outfielder [[Lance Berkman]] 5-4 in the final round of the contest. Both records were broken the following year in [[Detroit]] by [[Bobby Abreu]].
The quotients that appear when the Euclidean algorithm is applied to the inputs ''a'' and ''b'' are precisely the numbers occurring in the [[continued fraction]] representation of ''a''/''b''.
Take for instance the example of ''a''&nbsp;=&nbsp;1071 and ''b''&nbsp;=&nbsp;1029 used above.
Here is the calculation with highlighted quotients:
:1071 = 1029 &times; '''1''' + 42
:1029 = 42 &times; '''24''' + 21
:42 = 21 &times; '''2''' + 0
From this, one can read off that
:<math>\frac{1071}{1029} = \mathbf{1} + \frac{1}{\mathbf{24} + \frac{1}{\mathbf{2}}}</math>.
This method can even be used for [[real number|real]] inputs ''a'' and ''b''; if ''a''/''b'' is [[irrational number|irrational]], then the Euclidean algorithm will not terminate, but the computed sequence of quotients still represents the (now infinite) continued fraction representation of ''a''/''b''.
 
Tejada led the league with 150 RBI's in 2004.
boring boring broing lol
 
While Tejada did not participate in the Home Run Derby in [[2005]], he was an [[2005 Major League Baseball All-Star Game|All-Star]] and starter for the [[American League|AL]]. In his first All-Star start, Tejada hit a solo [[home run]] against [[John Smoltz]] of the [[Atlanta Braves]], had a sacrifice RBI and was part of an all-Oriole double play with teammate [[Brian Roberts]]. His efforts earned him the [[Major League Baseball All-Star Game|All-Star MVP]], winning a [[Chevrolet Corvette]].
boring lol
 
On [[December 8]], [[2005]], it was widely reported by the [[Associated Press]] that Tejada asked the Orioles for a trade, citing unhappiness with the team's direction. Tejada challenged those statements in an interview with [[Comcast]] Sportsnet's Kelli Johnson, saying he only asked for a better team, referring to his hope that the Baltimore Orioles would improve after their eighth straight losing season.
boring
 
Several weeks later, Tejada reiterated his complaints with the Orioles' lack of action and demanded to be traded, sparking immediate rumors of a trade to the [[Boston Red Sox]] for pitcher [[Matt Clement]] and outfielder [[Manny Ramirez]]. Tejada stated that he wants a "good group that helps me to win" and commented briefly on his alleged non-involvement in Palmeiro's steroid scandal.
ummmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
boring
 
Rumors went around in early 2006 that Tejada might be traded to the Red Sox or Cubs. But on [[January 7]], [[2006 in baseball|2006]], Tejada stated his intent to remain with Baltimore for "the rest of [his] career." This statement was made to Orioles Vice President [[Jim Duquette]] in a meeting arranged by mutual friend and teammate [[Melvin Mora]].
==[[PHP]]/[[JavaScript]] implementation==
===PHP===
<pre><nowiki>
function gcd($a, $b) {
if ($b == 0) return $a;
else return gcd($b, $a % $b);
}
</nowiki></pre>
===JavaScript===
<pre><nowiki>
function gcd(var a, var b) {
if (b == 0) return a;
else return gcd(b, a % b);
}
</nowiki></pre>
 
==[[Rafael Palmeiro]]==
<!--
On [[September 22]], [[2005]], [[ESPN]] reported that [[Rafael Palmeiro]], who had tested positive for steroids and was suspended for 10 games under Major League Baseball's steroid policy, implicated Tejada to baseball's arbitration panel, suggesting that a supplement given to him by Tejada was responsible for the steroid entering his system. Tejada has denied the allegations<ref>{{cite news | url = http://sports.espn.go.com/mlb/news/story?id=2169007 | title = Palmeiro named Tejada before panel | publisher = [[ESPN]] | date = [[2005-09-23]] | accessdate = 2006-10-04 }}</ref>, saying that the only thing he gave Palmeiro was vitamin B-12, a completely legal substance under current MLB policy.
I commented this out as I translated this implementation into C above to fit with the section name
I believe the C is correct and equivalent to this (which doesn't look all that Pascally to me, or did Pascal get blocks by whitespace like Python and Haskell?) but I'll leave this here just in case.
'''function''' gcd(a, b)
'''while''' b ≠ 0
'''var''' t := b Note: This is in [[Pascal_programming_language|Pascal]].
b := a modulo b
a := t
'''return''' a
-->
 
On [[September 24]], [[2005]], The [[Baltimore Sun]] reported that "''The Health Policy Advisory Committee, which oversees baseball's testing policy, issued a statement that exonerated Tejada and chastised the media for reporting that he might have distributed steroids to another player.''"[http://www.baltimoresun.com/sports/baseball/bal-sp.palmeiro24sep24,1,3325405.story?coll=bal-home-headlines:Cite_Sources]
==See also==
 
In [[José Canseco]]'s book, ''[[Juiced: Wild Times, Rampant 'Roids, Smash Hits & How Baseball Got Big]]'', he mentions that he believes Tejada might have taken steroids. He claims to have spoken to him about them and the next season seeing him at spring training looking more defined. He never claims to have injected him with them, like he did with Palmeiro, McGwire and other ballplayers.
* [[Least common multiple]]
* [[Extended Euclidean algorithm]]
* [[Binary GCD algorithm]]
 
On [[September 30]], [[2006]] the ''[[Los Angeles Times]]'' reported that former relief pitcher [[Jason Grimsley]], during a [[June 6]], 2006 federal raid, told federal agents investigating steroids in baseball named Tejada as a user of "[[anabolic steroids]]." The ''Times'' reported that Tejada was one of five names blacked out in an affidavit filed in federal court.<ref>{{cite news
==References==
|url=http://www.latimes.com/sports/la-sp-clemens1oct01,0,6499528.story?coll=la-home-headlines
|title=Clemens Is Named in Drug Affidavit
|last=Pugmire
|first=Lance
|accessdate=2006-10-01
|date=[[2006-10-01]]
|publisher=[[Los Angeles Times]]
}}</ref> However, on [[October 3]], 2006, the ''[[Washington Post]]'' reported that [[San Francisco]] United States attorney Kevin Ryan said that the ''Los Angeles Times'' report contained "significant inaccuracies."<ref name = WashingtonPost>
{{cite news
| url = http://www.washingtonpost.com/wp-dyn/content/article/2006/10/02/AR2006100201054.html
| title = U.S. Attorney Says Report Alleging Drug Use Contains 'Inaccuracies'
| publisher = [[Washington Post]]
| page = E02
| date = [[2006-10-03]]
| accessdate = 2006-10-04
}}</ref> Tejada, along with the other four players named, has denounced the story.<ref name = WashingtonPost/>
How dare Raffy ever say that of a teammate of Tejada's greatness!!
 
== References ==
* [[Donald Knuth]]. ''[[The Art of Computer Programming]]'', Volume 2: ''Seminumerical Algorithms'', Third Edition. Addison-Wesley, 1997. ISBN 0-201-89684-2. Sections 4.5.2&ndash;4.5.3, pp.333&ndash;379.
<!--See http://en.wikipedia.org/wiki/Wikipedia:Footnotes for an explanation of how to generate footnotes using the <ref(erences/)> tags-->
* [[Thomas H. Cormen]], [[Charles E. Leiserson]], [[Ronald L. Rivest]], and [[Clifford Stein]]. ''[[Introduction to Algorithms]]'', Second Edition. MIT Press and McGraw-Hill, 2001. ISBN 0-262-03293-7. Section 31.2: Greatest common divisor, pp.856&ndash;862.
<references />
 
{{start box}}
{{succession box | before = [[Ichiro Suzuki]] | title = [[MLB Most Valuable Player award|American League Most Valuable Player]]| years = [[2002 in baseball|2002]] | after = [[Alex Rodriguez]]}}
{{succession box | before = [[Garret Anderson]] | title = [[Home Run Derby|Home Run Derby Champion]]| years = [[2004]] | after = [[Bobby Abreu]]}}
{{succession box | title=[[List of Major League Baseball RBI champions|American League RBI Champion]] | before=[[Carlos Delgado]] | years=[[2004]]| after= [[David Ortiz]]}}
{{succession box | title=[[Major League Baseball All-Star Game]]<br> Most Valuable Player| before= [[Alfonso Soriano]] | years=2005| after= [[Michael Young (baseball player)|Michael Young]]}}
{{end box}}
 
==See also==
*[[MLB consecutive games played streaks]]
*[[List of players from Dominican Republic in Major League Baseball]]
 
==External links==
* [http://www.cut-the-knotjockbio.orgcom/blueBios/EuclidTejada/Tejada_bio.shtmlhtml Euclid'sIn-depth Algorithm] at [[cut-the-knot]biography]
*{{baseball-reference|id=t/tejadmi01}}
* [http://www.cut-the-knot.org/blue/binary.shtml Binary Euclid's Algorithm (Java)] at [[cut-the-knot]]
*{{espn mlb|id=5888|name=Miquel Tejada}}
* [http://www.cut-the-knot.org/blue/EuclidAlg.shtml Euclid's Game (Java)] at [[cut-the-knot]]
*[http://mlb.mlb.com/NASApp/mlb/team/player.jsp?player_id=123173 MLB.com profile]
* {{MathWorld | urlname=EuclideanAlgorithm | title=Euclidean Algorithm}}
* {{PlanetMath | urlname=EuclidsAlgorithm | title=Euclid's algorithm}}
 
[[Category:NumberAmerican theoreticLeague algorithmsAll-Stars|Tejada, Miguel]]
[[Category:American League RBI champions|Tejada, Miguel]]
[[Category:Baltimore Orioles players|Tejada, Miguel]]
[[Category:Oakland Athletics players|Tejada, Miguel]]
[[Category:Major league shortstops|Tejada, Miguel]]
[[Category:Dominican Republic baseball players|Tejada, Miguel]]
[[Category:1976 births|Tejada, Miguel]]
[[Category:Living people|Tejada, Miguel]]
[[Category:Major League Baseball All-Star Game MVPs|Tejada, Miguel]]
 
[[es:Miguel Tejada]]
[[ar:خوارزمية إقليدس]]
[[ja:ミゲル・テハダ]]
[[bg:Алгоритъм на Евклид]]
[[ca:Algorisme d'Euclides]]
[[cs:Euklidův algoritmus]]
[[de:Euklidischer Algorithmus]]
[[es:Algoritmo de Euclides]]
[[fr:Algorithme d'Euclide]]
[[ko:유클리드 호제법]]
[[id:Algoritma Euklidean]]
[[it:Algoritmo di Euclide]]
[[lv:Eiklīda algoritms]]
[[lt:Euklido algoritmas]]
[[hu:Euklidészi algoritmus]]
[[nl:Algoritme van Euclides]]
[[ja:ユークリッドの互除法]]
[[pl:Algorytm Euklidesa]]
[[pt:Algoritmo de Euclides]]
[[ru:Алгоритм Евклида]]
[[sl:Evklidov algoritem]]
[[fi:Eukleideen algoritmi]]
[[sv:Euklides algoritm]]
[[vi:Giải thuật Euclid]]
[[zh:輾轉相除法]]