Jump to content

Algorithm

Ɛfi Wikipedia
Wɔatwerɛ nsɛm wei ɛwɔ Asante kasa mu
(Flow-chart a ɛkyerɛ sɛnea algorithm bi yɛ Euclides algorithm's ) a wɔde bu akontaa wɔ akontahyɛde abien a ne b mu mpaapaemu kɛse (gcd) a ɛwɔ mmeae a wɔato din A ne B. Algorithm no kɔ so denam twe a wɔtwe fi mu nnidiso nnidiso wɔ loop abien mu: SƐ sɔhwɛ B ≥ A no ma "yiw " anaa "nokware" (sɛ yɛbɛka no pɛpɛɛpɛ a, nɔma b a ɛwɔ beae B no sõ anaasɛ ɛne nɔma a a ɛwɔ beae A no yɛ pɛ) AFEI, algorithm no kyerɛ B ← B − A (a ɛkyerɛ sɛ nɔma ba besi b dedaw no ananmu) . . Saa ara nso na SƐ A > B, AFEI A ← A − B. Adeyɛ no ba awiei bere a (nneɛma a ɛwɔ) B mu no yɛ 0, na ɛma gcd a ɛwɔ A. (Algorithm a wonya fii Scott 2009:13; nsɛnkyerɛnne ne mfoniniyɛ kwan a efi Tausworthe 1977) .
Ada Lovelace 's mfonini a efi "note G", kɔmputa so nhyehyɛe a edi kan a wotintimii

Wɔ nkontabuo ne kɔmputa ho nyansahu mu no, algorithm (/ˈælɡərɪðəm/ (tie)) yɛ akwankyerɛ a ɛyɛ ketewa a ɛtoatoa so a anohyeto wom, a wɔtaa de di ɔhaw pɔtee bi ho dwuma anaasɛ wɔde yɛ nkontaabuo.[1] Wɔde algorithms di dwuma sɛ nkyerɛkyerɛmu a wɔde yɛ akontaabuo ne data ho dwumadie. Algorithm a akɔ anim kɛseɛ betumi de tebea mu nneɛma adi dwuma de adan mmara a wɔde di dwuma no afa akwan ahodoɔ so (a wɔfrɛ no gyinaesi a wɔde wɔn ankasa yɛ) na wɔasusu nsusuiiɛ a ɛfata (a wɔfrɛ no nsusuiiɛ a wɔde wɔn ankasa yɛ ho), na awieɛ koraa no wɔanya afiri a wɔde di dwuma. Nnipa su a wɔde bedi dwuma sɛ mfiri ho nkyerɛkyerɛmufoɔ wɔ kasakoa akwan so no, Alan Turing de nsɛmfua te sɛ "nkaeɛ", "nhwehwɛeɛ" ne "nkanyan" de di dwuma deda.[2]

Deɛ ɛnnɛ yi ɛbɔ abira no, 'heuristic' yɛ ɔkwan a wɔfa so siesie ɔhaw ahodoɔ a ebia wɔankyerɛkyerɛ mu yie anaasɛ ebia ɛnyɛ deɛ ɛbɛma wɔanya deɛ ɛteɛ anaa deɛ ɛyɛ sen bibibiara, titiri wɔ ɔhaw ahodoɔ mu a nea efi mu ba a ɛteɛ anaa nea ɛyɛ sen biara nni hɔ a wɔakyerɛkyerɛ mu yiye.[3]

Sɛ ɔkwan a etu mpɔn no, wobetumi ada algorithm adi wɔ ahunmu ne berɛ a anohyeto wom mu,[4] ne kasa a wɔakyerɛkyerɛ mu yiye a wɔde di dwuma wɔ ɔkwan a ɛfata so[4] a wɔde bu dwumadie bi ho nkontaa.[5] Sɛ yɛfiri aseɛ firi mfitiaseɛ tebea ne mfitiaseɛ nsɛm a wɔde hyɛ mu (ebia ɛda mpan),[6] akwankyerɛ no kyerɛkyerɛ akontabuo bi a, sɛ wɔyɛ a, ɛkɔ so fa tebea a ɛtoatoa soɔ a wɔakyerɛkyerɛ mu yie dodoɔ a ɛwɔ anohyetoɔ mu[7], na awieeɛ koraa no ɛde "afiri mu"[9] ne a ɛba awiei wɔ tebea a etwa to a ɛba awiei mu. Nsakrae a efi tebea biako mu kɔ foforo mu no nyɛ nea wɔahyɛ da ahyɛ da; algorithms bi a wɔfrɛ no randomized algorithms de random input ka ho.[10]

Abakwasɛm

[sesa]

Tete nhyehyɛe ahodoɔ

Efi tete no, wɔadi akwan horow a wɔfa so di akontaabu mu haw ahorow ho dwuma anammɔn biara ho adanse. Eyi ka Babilon akontaabu (bɛyɛ afe 2500 A.Y.B.),[8] Misrifo akontaabu (bɛyɛ afe 1550 A.Y.B.), Indiafo akontaabu (bɛyɛ afe 800 A.Y.B. ne akyiri yi; s.e. Shulba Sutras, Kerala Sukuu, ne Brāhmasphuṭasiddhānta), Ifa Oracle (bɛyɛ afe 500 A.Y.B.), Helafo akontabuo (bɛyɛ afe 240 A.Y.B., s.e. sieve of Eratosthenes and Euclidean algorithm),[9] ne Arabic akontabuo (afeha a ɛtɔ so nkron, s.e. cryptographic algorithms ama mmara a wobu so a egyina mpɛn dodow nhwehwɛmu so).[10]

Al-khwarizmi ne asɛmfua algorithm

Bɛyɛ afe 825 no, Muhammad ibn Musa al-Khwarizmi kyerɛw kitāb al-ḥisāb al-hindī ("Indiafo akontabuo Nhoma") ne kitab al-jam' wa'l-tafriq al-ḥisāb al-hindī ("Nka a wɔde ka ho na wɔyi fi mu wɔ India akontabuo mu."). Saa nkyerɛwee abien yi nyinaa ayera wɔ mfitiase Arabic kasa mu wɔ saa bere yi mu. (Nanso, ne nhoma foforo a ɛfa algebra ho no da so ara wɔ hɔ.)[11]

Wɔ afe ɔha a ɛto so 12 mfiase no, Latin nkyerɛase ahorow a ɛfa al-Khwarizmi nkyerɛwee ahorow a wɔaka ho asɛm a ɛfa Hindufo–Arabic akontaabu nhyehyɛe ne akontaabu ho no puei:Liber Alghoarsmi de practica arismetrice (wɔkyerɛ sɛ John a ofi Seville na ɔkyerɛwee) ne Liber Algorismi de numero Indorum (wɔkyerɛ sɛ Adelard a ofi Bath na ɔkyerɛwee). Ɛnam wei so no, alghoarismi anaa algorismi yɛ Al-Khwarizmi din a wɔde Latin kasa; nkyerɛwee no de kasasin Dixit Algorismi ("Saa na Al-Khwarizmi kasae") na efi ase.[12]

Borɔfo kasa mu adannandi a ɛfa asɛmfua no ho

Bɛyɛ afe 1230 no, Borɔfo asɛmfua algorism dii ho adanse na afei Chaucer dii ho adanse wɔ afe 1391. Engiresifo gyee Franse asɛmfua no toom.

Wɔ afeha a ɛto so 15 mu no, wɔ Hela asɛmfua ἀριθμός (arithmos, "dodoɔ"; fa toto "akontaabu") nkɛntɛnso ase no, wɔsesaa Latin asɛmfua no yɛɛ no algorithmus. Wɔ 1656 mu no, wɔ Engiresi kasa asekyerɛ nhoma Glossographia mu no, ɛka sɛ:[13]

Algorism ([Latin] algorismus) Adwini anaa Cyphers a wɔde di dwuma, anaasɛ Cyphers a wɔde nɔma ma; ahokokwaw wɔ akontaabu mu.

Mfiri a wɔde yɛ dwuma

Wɔ 1928 mu no, wɔde nnɛyi adwene a ɛfa algorithm ho no fa bi hyɛɛ mmara kwan so denam mmɔden a wɔbɔe sɛ wobedi Entscheidungsproblem (gyinaesi ho haw) a David Hilbert de bae no ho dwuma so. Wɔhyehyɛɛ akyiri yi formalizations sɛ mmɔden a wɔbɔ sɛ wɔbɛkyerɛkyerɛ "effective calculability"[29] anaa "effective method".[30] Saa nhyehyɛe ahorow no bi ne Gödel–Herbrand–Kleene recursive functions a ɛbaa 1930, 1934 ne 1935, Alonzo Church lambda calculus a ɔyɛe wɔ 1936 mu, Emil Post Formulation 1 a ɔyɛe wɔ 1936 mu, ne Alan Turing Turing mfiri ahorow a ɔyɛe wɔ 1936–37 ne 1939 mu.

Nkyerɛaseɛ a wɔmfa nhyehyɛeɛ mu

[sesa]

Nkyerɛaseɛ a ɛnyɛ ɔkwan pa so betumi ayɛ "mmara ahodoɔ a ɛkyerɛkyerɛ dwumadie ahodoɔ a ɛtoatoa soɔ mu pɛpɛɛpɛ",[31][hia sɛ wɔfa nsɛm ka de hwɛ sɛ ɛyɛ nokware] a ɛbɛka kɔmputa so dwumadie nyinaa ho (a dwumadie a ɛnyɛ akontabuo akontabuo ka ho), ne (sɛ nhwɛsoɔ no) adwumayɛfo kwan biara a wɔahyɛ ato hɔ[14] anaasɛ aduannoa ho nyansahyɛ.[15]

Mpɛn pii no, sɛ dwumadi bi yɛ algorithm nkutoo sɛ awiei koraa no egyae[34]—ɛwom mpo sɛ ɛtɔ mmere bi a ebia loop a ɛnni ano betumi ayɛ nea wɔpɛ de.

Nhwɛsoɔ a ɛyɛ nhwɛsoɔ a ɛfa algorithm ho ne Euclidean algorithm, a wɔde kyerɛ dodoɔ a ɛkyɛn so a ɛyɛ integer mmienu; nhwɛsoɔ bi (afoforo wɔ hɔ) no, wɔde flowchart a ɛwɔ atifi hɔ no akyerɛkyerɛ mu na sɛ nhwɛsoɔ wɔ ɔfa bi a ɛbɛba akyiri yi mu.

Boolos, Jeffrey & 1974, 1999 de asɛmfua "algorithm" no nteaseɛ a ɛnyɛ ɔkwan pa so ma wɔ asɛm a wɔafa aka a ɛdidi soɔ yi mu:

Onipa biara nni hɔ a obetumi akyerɛw ntɛmntɛm, anaasɛ tenten, anaasɛ ketewaa† ("ketewa ne nketewa a anohyeto nni mu ... anka wobɛbɔ mmɔden sɛ wobɛkyerɛw wɔ molecule ahorow so, atɔm so, ɛlɛtrɔnik so") de akyerɛw an mufo nyinaa din a wɔkan wɔn a enni ano a wɔahyehyɛ denam wɔn din a wɔkyerɛw, mmiako mmiako, wɔ nkyerɛwdeɛ bi mu so. Nanso nnipa betumi ayɛ biribi a mfaso wɔ so saa ara, wɔ akuw bi a wontumi nkan a enni ano fam no: hey betumi ama akwankyerɛ a ɛda adi pefee de akyerɛ nth member a ɛwɔ set no mu, ama arbitrary finite n. Ɛsɛ sɛ wɔde akwankyerɛ a ɛte saa ma pefee, wɔ ɔkwan bi so a wobetumi de kɔmputa afiri adi akyi, anaasɛ onipa a otumi yɛ mfitiase adwuma nkutoo wɔ sɛnkyerɛnnede ahorow so.

Wɔde algorithm ho adwene nso di dwuma de kyerɛkyerɛ adwene a ɛne sɛ wotumi si gyinae no mu —adwene a ɛyɛ ade titiriw a wɔde kyerɛkyerɛ sɛnea nhyehyɛe ahorow a wɔde di dwuma wɔ ɔkwan a ɛfata so ba a wofi ase fi axioms ne mmara kakraa bi so. Wɔ ntease mu no, wontumi nsusuw bere a algorithm bi hwehwɛ sɛ wɔde wie, efisɛ ɛda adi sɛ ɛne amanne kwan so honam fam afa no nni abusuabɔ. Efi adwenem naayɛ a ɛte saa, a ɛkyerɛ adwuma a ɛkɔ so no, fi nkyerɛase a enni hɔ a ɛfa algorithm ho a ɛfata asɛmfua no a wɔde di dwuma wɔ ɔkwan a ɛyɛ nokware (wɔ ntease bi mu) ne nea enni adwene mu.

Wɔayɛ nhyehyɛe sɛ wɔde algorithms dodow no ara bedi dwuma sɛ kɔmputa so dwumadi ahorow. Nanso, wɔfa akwan foforo so nso de algorithms di dwuma, te sɛ wɔ abɔde a nkwa wom ntini mu (sɛ nhwɛso no, onipa amemene a ɛde akontaabu di dwuma anaa nkoekoemmoa bi a ɔrehwehwɛ aduan), anyinam ahoɔden kwan so, anaa mfiri bi mu.

Algorithm ahodoɔ a wɔda no adi

[sesa]

Wobɛtumi ada algorithms adi wɔ akwa ahodoɔ pii so, abi ne abɔdeɛ mu kasa, pseudocode, 'flowcharts', 'drakon-charts', 'programming' kasa anaa 'control tables' (a nkyerɛasefoɔ a wɔyɛ ho adwuma) nso ka ho. Abɔdeɛ mu kasa mu nkyerɛkyerɛmu a ɛfa algorithms ho no taa yɛ deɛ ɛyɛ nsɛm a emu nna hɔ, na wɔntaa mfa nni dwuma mma algorithms a ɛyɛ den anaa mfiridwuma mu. 'Pseudocode, flowcharts, drakon-charts ne control tables' yɛ akwan a wɔahyehyɛ a wɔfa so da algorithms adi a ɛbɔ nsɛm a emu nna hɔ pii a ɛtaa ba wɔ nsɛm a egyina abɔdeɛ kasa so no mu. Wɔayɛ nhyehyɛeɛ kasa titiriw sɛ wɔde bɛda algorithms adi wɔ ɔkwan a kɔmputa betumi adi so, nanso wɔtaa de di dwuma nso sɛ ɔkwan a wɔfa so kyerɛkyerɛ anaasɛ wɔkyerɛw algorithms.

Wobetumi akyekyɛ algorithms no akuo ahodox mmiɛnsa a Turing mfiri nkyerɛkyerɛmu no agye atom, sɛdeɛ edidi so ni:

  1. Nkyerɛkyerɛmu a ɛkorɔn

"...prose de kyerɛkyerɛ algorithm bi mu, bu ani gu dwumadie ho nsɛm a ɛkɔ anim so. Wɔ saa ɔfa yi so no, enhia sɛ yɛka sɛdeɛ afiri no di ne tape anaa ne ti di dwuma."

2. Nkyerɛkyerɛmu a ɛfa dwumadie ho

"...prose a wɔde kyerɛkyerɛ ɔkwan a Turing afiri no fa so de ne ti di dwuma ne ɔkwan a ɛfa so sie data wɔ ne teapɔn so. Wɔ saa gyinabea yi mu no, yɛmfa tebea anaa nsakraeɛ dwumadie ho nsɛm mma."

3. Nkyerɛkyerɛmu a wɔde ma wɔ ɔkwan a ɛfata so

Deɛ ɛmu da hɔ, "gyinabea a ɛwɔ fam", ma Turing afiri no "state table".

Sɛ wopɛ nhwɛsoɔ a ɛfa algorithm a ɛnyɛ den "Fa m, n" a wɔakyerɛkyerɛ mu wɔ ɔfa mmiɛnsa no nyinaa mu.

Beaeɛ a menyaa mmoa firiiɛ

[sesa]
  1. "Definition of ALGORITHM". Merriam-Webster Online Dictionary. Archived from the original on February 14, 2020. Retrieved November 14, 2019.
  2. Blair, Ann, Duguid, Paul, Goeing, Anja-Silvia and Grafton, Anthony. Information: A Historical Companion, Princeton: Princeton University Press, 2021. p. 247
  3. David A. Grossman, Ophir Frieder, Information Retrieval: Algorithms and Heuristics, 2nd edition, 2004, ISBN 1402030045
  4. 4.0 4.1 "Any classical mathematical algorithm, for example, can be described in a finite number of English words" (Rogers 1987:2).
  5. "an algorithm is a procedure for computing a function (with respect to some chosen notation for integers) ... this limitation (to numerical functions) results in no loss of generality", (Rogers 1987:1).
  6. "An algorithm has zero or more inputs, i.e., quantities which are given to it initially before the algorithm begins" (Knuth 1973:5).
  7. "A procedure which has all the characteristics of an algorithm except that it possibly lacks finiteness may be called a 'computational method'" (Knuth 1973:5).
  8. Chabert, Jean-Luc (2012). A History of Algorithms: From the Pebble to the Microchip. Springer Science & Business Media. pp. 7–8. ISBN 9783642181924.
  9. Cooke, Roger L. (2005). The History of Mathematics: A Brief Course. John Wiley & Sons. ISBN 978-1-118-46029-0.
  10. Dooley, John F. (2013). A Brief History of Cryptology and Cryptographic Algorithms. Springer Science & Business Media. pp. 12–3. ISBN 9783319016283.
  11. Burnett, Charles (2017). "Arabic Numerals". In Thomas F. Glick (ed.). Routledge Revivals: Medieval Science, Technology and Medicine (2006): An Encyclopedia. Taylor & Francis. p. 39. ISBN 978-1-351-67617-5. Archived from the original on March 28, 2023. Retrieved May 5, 2019.
  12. Brezina, Corona (2006). Al-Khwarizmi: The Inventor Of Algebra. The Rosen Publishing Group. ISBN 978-1-4042-0513-0.
  13. Blount, Thomas (1656). Glossographia or a Dictionary... London: Humphrey Moseley and George Sawbridge.
  14. Simanowski, Roberto (2018). The Death Algorithm and Other Digital Dilemmas. Untimely Meditations. Vol. 14. Translated by Chase, Jefferson. Cambridge, Massachusetts: MIT Press. p. 147. ISBN 9780262536370. Archived from the original on December 22, 2019. Retrieved May 27, 2019. [...] the next level of abstraction of central bureaucracy: globally operating algorithms.
  15. Dietrich, Eric (1999). "Algorithm". In Wilson, Robert Andrew; Keil, Frank C. (eds.). The MIT Encyclopedia of the Cognitive Sciences. MIT Cognet library. Cambridge, Massachusetts: MIT Press (published 2001). p. 11. ISBN 9780262731447. Retrieved July 22, 2020. An algorithm is a recipe, method, or technique for doing something.