Iteration

Iteration is the repetition of a process in order to generate a (possibly unbounded) sequence of outcomes. Each repetition of the process is a single iteration, and the outcome of each iteration is then the starting point of the next iteration.

In mathematics and computer science, iteration (along with the related technique of recursion) is a standard element of algorithms.

Mathematics

In mathematics, iteration may refer to the process of iterating a function, i.e. applying a function repeatedly, using the output from one iteration as the input to the next. Iteration of apparently simple functions can produce complex behaviors and difficult problems – for examples, see the Collatz conjecture and juggler sequences.

Another use of iteration in mathematics is in iterative methods which are used to produce approximate numerical solutions to certain mathematical problems. Newton's method is an example of an iterative method. Manual calculation of a number's square root is a common use and a well-known example.

Computing

In computing, iteration is the technique marking out of a block of statements within a computer program for a defined number of repetitions. That block of statements is said to be iterated; a computer scientist might also refer to that block of statements as an "iteration".

Implementations

Loops constitute the most common language constructs for performing iterations. The following pseudocode "iterates" three times the line of code between begin & end through a for loop, and uses the values of i as increments.

a := 0
for i := 1 to 3 do       { loop three times }
begin
    a := a + i;          { add the current value of i to a }
end;
print(a);                { the number 6 is printed (0 + 1; 1 + 2; 3 + 3) }

It is permissible, and often necessary, to use values from other parts of the program outside the bracketed block of statements, to perform the desired function.

Iterators constitute alternative language constructs to loops, which ensure consistent iterations over specific data structures. They can eventually save time and effort in later coding attempts. In particular, an iterator allows one to repeat the same kind of operation at each node of such a data structure, often in some pre-defined order.

Iteratees are purely functional language constructs, which accept or reject data during the iterations.

Relation with recursion

Recursions and iterations have different algorithmic definitions, even though they can generate identical effects/results. The primary difference is that recursion can be employed as a solution without prior knowledge as to how many times the action will have to repeat, while a successful iteration requires that foreknowledge.

Some types of programming languages, known as functional programming languages, are designed such that they do not set up a block of statements for explicit repetition, as with the for loop. Instead, those programming languages exclusively use recursion. Rather than call out a block of code to be repeated a pre-defined number of times, the executing code block instead "divides" the work to be done into a number of separate pieces, after which the code block executes itself on each individual piece. Each piece of work will be divided repeatedly until the "amount" of work is as small as it can possibly be, at which point the algorithm will do that work very quickly. The algorithm then "reverses" and reassembles the pieces into a complete whole.

The classic example of recursion is in list-sorting algorithms, such as merge sort. The merge sort recursive algorithm will first repeatedly divide the list into consecutive pairs; each pair is then ordered, then each consecutive pair of pairs, and so forth until the elements of the list are in the desired order.

The code below is an example of a recursive algorithm in the Scheme programming language that will output the same result as the pseudocode under the previous heading.

(let iterate ((i 1) (a 0))
  (if (<= i 3)
    (iterate (+ i 1) (+ a i))
    (display a)))

Education

In some schools of pedagogy, iterations are used to describe the process of teaching or guiding students to repeat experiments, assessments, or projects, until more accurate results are found, or the student has mastered the technical skill. This idea is found in the old adage, "Practice makes perfect." In particular, "iterative" is defined as the "process of learning and development that involves cyclical inquiry, enabling multiple opportunities for people to revisit ideas and critically reflect on their implication."[1]

Unlike computing and math, educational iterations are not predetermined; instead, the task is repeated until success according to some external criteria (often a test) is achieved.

See also

References

  1. ^ Helen Timperley; Aaron Wilson; Heather Barrar; Irene Fung. "Teacher Professional Learning and Development: Best Evidence Synthesis Iteration [BES]" (PDF). OECD. p. 238. Archived from the original (PDF) on 26 June 2013. Retrieved 4 April 2013.

Read other articles:

Artikel ini sebatang kara, artinya tidak ada artikel lain yang memiliki pranala balik ke halaman ini.Bantulah menambah pranala ke artikel ini dari artikel yang berhubungan atau coba peralatan pencari pranala.Tag ini diberikan pada November 2022. Jaap van Duijn Informasi pribadiTanggal lahir 23 Desember 1990 (umur 33)Tempat lahir Katwijk, BelandaTinggi 1,86 m (6 ft 1 in)Posisi bermain PenyerangInformasi klubKlub saat ini ADO Den HaagNomor 25Karier senior*Tahun Tim Tampil (G...

 

 

Skyline of Atlanta at night (use cursor to identify buildings) Atlanta, the capital and largest city of the U.S. state of Georgia, is home to at least 39 skyscrapers over 400 feet (122 m) tall. Most of these are clustered around Peachtree Street in the Downtown, Midtown, and Buckhead neighborhoods, with the suburban city of Sandy Springs also being the site of several skyscrapers. The tallest building in Atlanta is the 55-story Bank of America Plaza, which rises 1,023 feet (312 m) ...

 

 

British filmmaker Not to be confused with Gareth Evans (director). Gareth EdwardsEdwards at the 2023 San Diego Comic-ConBorn (1975-07-13) 13 July 1975 (age 48)Nuneaton, Warwickshire, EnglandOccupationFilmmakerYears active2002–present Gareth James Edwards (born 13 July 1975) is an Welsh filmmaker. He gained recognition for Monsters (2010), an independent film in which he served as writer, director, cinematographer, and visual effects artist.[1][2] He subsequently di...

Alternatif format templat horizontalKomentar terbaru: 12 tahun yang lalu1 komentar1 orang dalam diskusi Saya coba mengganti templat ini menjadi format horizontal, karena format vertikal terlalu memakan tempat untuk artikel yang pendek. Sementara format lama saya selamatkan dan simpan disini.Gunkarta (bicara) 2 Februari 2012 17.09 (UTC)Balas Bagian seriartikel pada Agama Mesir kuno   Kepercayaan Utama Paganisme · Panteisme · Politeisme · Emanationisme · Roh · DuatMitologi · Numero...

 

 

土库曼斯坦总统土库曼斯坦国徽土库曼斯坦总统旗現任谢尔达尔·别尔德穆哈梅多夫自2022年3月19日官邸阿什哈巴德总统府(Oguzkhan Presidential Palace)機關所在地阿什哈巴德任命者直接选举任期7年,可连选连任首任萨帕尔穆拉特·尼亚佐夫设立1991年10月27日 土库曼斯坦土库曼斯坦政府与政治 国家政府 土库曼斯坦宪法 国旗 国徽 国歌 立法機關(英语:National Council of Turkmenistan) ...

 

 

يفتقر محتوى هذه المقالة إلى الاستشهاد بمصادر. فضلاً، ساهم في تطوير هذه المقالة من خلال إضافة مصادر موثوق بها. أي معلومات غير موثقة يمكن التشكيك بها وإزالتها. (نوفمبر 2019)Learn how and when to remove this message كأس الإمبراطور 2013   تفاصيل الموسم كأس الإمبراطور  النسخة 93  البلد اليابان...

هذه المقالة بحاجة لصندوق معلومات. فضلًا ساعد في تحسين هذه المقالة بإضافة صندوق معلومات مخصص إليها. نقاء الدم (بالإنجليزية: Blood Purity)‏ مصطلح ابتكرته المؤلفة البريطانية جيه كيه رولينغ في سلسلتها عن مغامرات الصبي الساحر هاري بوتر ليرمز إلى المُعتقد شبه العنصري المرتبط به، يُس�...

 

 

Hungarian water polo player The native form of this personal name is Kis Gábor. This article uses Western name order when mentioning individuals. Gábor KisPersonal informationBorn (1982-09-27) 27 September 1982 (age 41)Budapest, Hungary[1]Nickname KicsiNationality HungarianHeight 1.94 m (6 ft 4+1⁄2 in)Position Centre forwardHandedness RightClub informationCurrent team Invictus (tech. director)Youth career1990–1996 Bp. Spartacus1996– BVSCSenior clubs...

 

 

العلاقات النمساوية السريلانكية النمسا سريلانكا   النمسا   سريلانكا تعديل مصدري - تعديل   العلاقات النمساوية السريلانكية هي العلاقات الثنائية التي تجمع بين النمسا وسريلانكا.[1][2][3][4][5] مقارنة بين البلدين هذه مقارنة عامة ومرجعية للدولتين: و�...

Australian cabinet position Leader of the Government in the SenateCommonwealth Coat of ArmsFlag of AustraliaIncumbentPenny Wongsince 23 May 2022 (2022-05-23)Australian GovernmentAustralian SenateStyleThe HonourableInaugural holderRichard O'Connor The Leader of the Government in the Senate (historically also known as the Leader of the Senate) is the government's most senior cabinet minister in the Australian Senate and the main government spokesperson in the Senate.[1&#...

 

 

القطب الشماليمعلومات عامةسميت باسم شمال الموقع الجغرافي / الإداريالإحداثيات 90°N 0°E / 90°N 0°E / 90; 0 جزء من Earth's poles (en) هيئة المياهالنوع قطب جغرافي تعديل - تعديل مصدري - تعديل ويكي بيانات موضع القطب الشمالي الذي يقع عند نقطة التقاء خطوط الطول في عام 2005 وعام 2007 انحسر ال...

 

 

Uruguayan writer (born 1923) Ida VitaleIda Vitale in 2015.Born (1923-11-02) 2 November 1923 (age 100)Montevideo, UruguayOccupationliterary critic, author, translatorLanguageSpanishNationalityUruguayanNotable awardsMiguel de Cervantes PrizeAlfonso Reyes PrizeDelmira Agustini MedalSpouseEnrique FierroÁngel RamaChildrenAmparo, Claudio Ida Vitale (born 2 November 1923) is a Uruguayan poet, translator, essayist, lecturer and literary critic. Life Vitale at the annual reading of Don Quixote i...

Lingue gallo-italicheParlato inEuropa: Italia Svizzera FranciaSan Marino Monaco Sudamerica: Argentina Brasile TassonomiaFilogenesiLingue indoeuropee Lingue italiche  Lingua latina   Lingue romanze    Lingue italo-occidentali     Lingue gallo-/italo-romanze      Lingue gallo-italiche Codici di classificazioneISO 639-2roa Linguist Listgait (EN) Glottologgall1279...

 

 

Palazzo AnnoniPalazzo AnnoniLocalizzazioneStato Italia LocalitàMilano Indirizzocorso di Porta Romana 6 Coordinate45°27′35.08″N 9°11′21.7″E45°27′35.08″N, 9°11′21.7″E Informazioni generaliCondizioniIn uso Costruzione1631 StileBarocco RealizzazioneArchitettoFrancesco Maria Richini AppaltatorePaolo Annoni CommittentePaolo Annoni Modifica dati su Wikidata · Manuale Il Palazzo Annoni (o palazzo Annoni Cicogna Mozzoni) è uno storico palazzo barocco di Milano, situato...

 

 

Coppa del Presidente degli Emirati Arabi Uniti 2017-2018 Competizione Coppa del Presidente degli Emirati Arabi Uniti Sport Calcio Edizione 39ª Organizzatore UAEFA Date 22 settembre 2017 - 3 maggio 2018 Luogo  Emirati Arabi Uniti Partecipanti 28 Risultati Vincitore  Al-Ain(7º titolo) Secondo  Al-Wasl Cronologia della competizione 2016-17 2018-19 Manuale La Coppa del Presidente degli Emirati Arabi Uniti 2017-2018 è stata la trentanovesima edizione della competizione a cui par...

Proto-germanico †Parlato inPenisola scandinava, Jutland, Germania centrale e settentrionale, Fiandra PeriodoEtà del bronzo - II secolo a.C./I secolo a.C. LocutoriClassificaestinta TassonomiaFilogenesiLingue indoeuropee Lingua proto-germanica Mappa delle culture dell'età del ferro associate al proto-germanico, ca 500 a.C.-50 a.C. L'area a sud della Scandinavia è la cultura di Jastorf Manuale La lingua proto-germanica, nota anche come la lingua germanica, è la lingua considerata come...

 

 

聖文森及格瑞那丁君主Monarchy of Saint Vincent and the Grenadines聖文森特和格林納丁斯國徽現任查爾斯三世2022年9月8日就任 详情开国君主伊丽莎白二世建立1979年 聖文森及格瑞那丁君主,圣文森特和格林纳丁斯的君主称号。聖文森及格瑞那丁的国家元首,由英國君主兼任。1979年圣文森特和格林纳丁斯独立后,王位設立,作為英聯邦內的獨立君主國。 聖文森及格瑞那丁君主为象征的...

 

 

卡兰戈拉Carangola市镇卡兰戈拉在巴西的位置坐标:20°43′58″S 42°01′44″W / 20.7328°S 42.0289°W / -20.7328; -42.0289国家巴西州米纳斯吉拉斯州面积 • 总计352.51 平方公里(136.10 平方英里)海拔399 公尺(1,309 英尺)人口 • 總計33,091人 • 密度93.9人/平方公里(243人/平方英里) 卡兰戈拉(葡萄牙语:Carangola)是巴西米纳斯吉拉�...

Kernkraftwerk Barakah Lage Kernkraftwerk Barakah (Vereinigte Arabische Emirate) Koordinaten 23° 58′ 4″ N, 52° 13′ 53″ O23.967752.2315Koordinaten: 23° 58′ 4″ N, 52° 13′ 53″ O Land Vereinigte Arabische Emirate Vereinigte Arabische Emirate Daten Betreiber Nawah Energy Company Projektbeginn 2011 Aktive Reaktoren (Brutto) 4  (5600 (5380 netto) MW) Stand März 2024 Die Datenquelle der jeweiligen Einträg...

 

 

Mahdi Dewan Perwakilan Rakyat Daerah Provinsi Jawa TimurPresidenSusilo Bambang YudhoyonoJoko WidodoGubernurSoekarwoKhofifah Indar ParawansaDaerah pemilihanJawa Timur III Informasi pribadiLahir27 April 1973 (umur 51)Kabupaten Situbondo, Jawa TimurPartai politikPPPSuami/istriRaguanHubunganSalim Qurays(Adik)Anak5PekerjaanPolitisiSunting kotak info • L • B Mahdi, S.E., S.H. ( lahir 27 April 1973) dikenal dengan sapaan Kang Mahdi adalah seorang Politisi Indonesia yang menjabat s...