元组

元組(英語:Tuple)或译为多元组,也称为顺序组,泛指有限個元素所組成的序列。在數學及計算機科學分別有其特殊的意義。

数学上,n元组多元组是对象个数有限序列。元组由三部分组成:边界符、分隔符和元素。通常采用的边界符是小括号“”,分隔符是逗号。

元组被数学家用来描述包含特定部件的数学对象。例如,有向图被定义成一个二元组(V, E),这里V是节点的集合,EV × V的子集,表示边。

類型論中,多元組與重類別相關。

不同长度元组的名称

长度为n的多元组通常称为n元组。二元组就是一个有序对n可以是任意正整数,例如,四元数就可以被表示成一个四元组。

形式定义

多元组区别於集合的主要性质在于:(1)它可以多次含有某个对象;(2)对象按照一定顺序出现。可以看到(1)使它区别于全序集,(2)使它区别于多重集。两个n元组的相等性通常以下列规则来表明:

(a1, a2, ...,an) = (b1, b2, ..., bn) 当且仅当 a1 = b1, a2 = b2, ..., an = bn

另一种形式化多元组的方式是将它们作為在集合论中更基本的構造,一個方法是利用有序对。例如,一个n元组(n > 1)能够定义成其第一项和由其他项组成的 (n−1)元组组成的有序对:

(a1, a2, ..., an) = (a1, (a2, ..., an))

采用有序对的一般集合论定义,并用空集来表示0元组,就可以得到下列归纳定义:

  1. 0元组用∅表示;
  2. xn元组(a1, a2, ..., an),则 (n + 1)元组(a, a1, a2, ..., an)等同於{{a}, {a, x}}。(n≥0)

采用这个定义,(1,2,2)为

(1,(2, (2))) = (1,(2, {{2}, {2, ∅}} )) = (1, {{2}, {2, {{2}, {2, ∅}}}} ) = {{1}, {1, {{2}, {2, {{2}, {2, ∅}}}}}}

这里与LISP最初使用有序对归纳地产生其所有的n元组和表结构的方法有非常重要的类似:

  1. 特殊符号NIL表示空表;
  2. X是一个表,A是任意值,则对 (A, X)表示一个表,其(第一个元素)为A,其(表中除了第一个元素的其他元素)为X

在计算机科学中的应用

计算机科学(特别是在程序设计语言数据库关系模型),元组通常被定义为从字段名到特定值的有限函数(在此情況又可譯為值組)。其目的和在数学中一样,就是指出特定的实体,或那些包含特定部件且(或)具有特定性质的对象。但是,这里的部件透过唯一的字段名来识别,而不是透过位置,這樣通常會是更用户友好的記法。

元组的例子:

(选手:"Harry", 分數:25)

就是一个映射字段名“选手”到字符串"Harry",映射字段名“分數”到数25的函数。注意,这里各个部件的顺序是不相关的,所以這個元组也可以写成:

(分數:25, 选手:"Harry")

关系模型,一般以这样的元组來表示一个简单命题,比如这个元組的意思就是有一个选手的名字叫"Harry",他的分數是25。

在程序设计语言中,元组被用来构建数据结构。例如,下列元组可以表示双向链表中的一个节点:

(值:16, 前驱节点:1174782, 后继节点:1174791)

Read other articles:

يفتقر محتوى هذه المقالة إلى الاستشهاد بمصادر. فضلاً، ساهم في تطوير هذه المقالة من خلال إضافة مصادر موثوق بها. أي معلومات غير موثقة يمكن التشكيك بها وإزالتها. (فبراير 2019) هذه المقالة تحتاج للمزيد من الوصلات للمقالات الأخرى للمساعدة في ترابط مقالات الموسوعة. فضلًا ساعد في تحسي

 

Про геологічну пам'ятку природи див. Міст Інків. Міст інків Мости інків — інженерні споруди, що створювалися за часи існування імперії Тауантінсую. Відповідали соціально-економічним та військово-політичним потребав держави інків. Стали одним з досягнень інкської техн

 

Tamara Tenenbaum Información personalNacimiento 1989 Buenos Aires (Argentina) Nacionalidad ArgentinaEducaciónEducada en Facultad de Filosofía y Letras. Universidad de Buenos Aires Información profesionalOcupación Escritora, filósofa, periodista y profesora de universidad Empleador Universidad de Buenos AiresUniversidad Nacional de las Artes [editar datos en Wikidata] Tamara Tenenbaum (Buenos Aires, 1989) es una filósofa, escritora y periodista argentina.[1]​ Biografía ...

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

 

Thai TV series or program Gossip Girl: ThailandPromotional posterGenreTeen dramaCreated byCecily von Ziegesar (books), Josh Schwartz and Stephanie Savage (original TV series)Developed byChookiat SakveerakulStarring Sabina Meisinger Carissa Springett Patrick Chanon Makaramani Chanon Ukkharachata Victor Jarusak Weerakul Nutcha Jeka Penny Lane Narrated byOpal Panisara (as Gossip Girl)Country of originThailandOriginal languageThaiNo. of seasons1No. of episodes18ProductionProduction locations...

 

Current United States federal appellate court United States Court of Appeals for the Seventh Circuit(7th Cir.)LocationEverett McKinley Dirksen U.S. Courthouse(Chicago)Appeals fromCentral District of IllinoisNorthern District of IllinoisSouthern District of IllinoisNorthern District of IndianaSouthern District of IndianaEastern District of WisconsinWestern District of WisconsinEstablishedJune 16, 1891Judges11Circuit JusticeAmy Coney BarrettChief JudgeDiane S. Sykeswww.ca7.uscour...

Austin Albert MardonBorn (1962-06-25) 25 June 1962 (age 61)Edmonton, Alberta, CanadaNationalityCanadianAlma materUniversity of LethbridgeSouth Dakota State UniversityTexas A&M UniversityScientific careerFieldsHistorical astronomy Websitewww.austinmardon.org Austin Albert Mardon, CM (born 25 June 1962) is a Canadian author, community leader, and advocate for mental health.[1] He is an assistant adjunct professor at the John Dossetor Health Ethics Centre at the University ...

 

  لمعانٍ أخرى، طالع عمرو بن العاص (توضيح). يفتقر محتوى هذه المقالة إلى الاستشهاد بمصادر. فضلاً، ساهم في تطوير هذه المقالة من خلال إضافة مصادر موثوق بها. أي معلومات غير موثقة يمكن التشكيك بها وإزالتها. (ديسمبر 2018)   هذه المقالة عن مسلسل عمرو بن العاص عام 1983. لمسلسل رجل...

 

Region of New Zealand This article is about the local government region. For the metropolitan city, see Auckland. For other uses, see Auckland (disambiguation). Place in New ZealandAucklandAuckland Region in New ZealandCoordinates: 36°54′S 174°47′E / 36.900°S 174.783°E / -36.900; 174.783CountryNew ZealandGovernment • TypeRegional council • BodyAuckland Council • MayorWayne BrownArea[1] • Land4,941.13 ...

Federasi Mahasiswa Hong KongTanggal pendirianMei 1958Lokasi9/F., Waitex House, 7-9 Mongkok Road, Kowloon, Hong KongKoordinat22°19′12.1″N 114°09′58.5″E / 22.320028°N 114.166250°E / 22.320028; 114.166250Koordinat: 22°19′12.1″N 114°09′58.5″E / 22.320028°N 114.166250°E / 22.320028; 114.166250Sekretaris-JenderalTimothy H.L. LeeAfiliasiKamp pan-demokrasiSitus webhkfs.org.hk Federasi Mahasiswa Hong Kong Hanzi tradisional: 香港...

 

Este artigo carece de reciclagem de acordo com o livro de estilo. Sinta-se livre para editá-lo(a) para que este(a) possa atingir um nível de qualidade superior. (Julho de 2021) Esta página cita fontes, mas que não cobrem todo o conteúdo. Ajude a inserir referências. Conteúdo não verificável pode ser removido.—Encontre fontes: ABW  • CAPES  • Google (N • L • A) (Junho de 2019) Sexualidade Fisiologia Excitação Ereção O...

 

Railway station in Surrey, England WeybridgeGeneral informationLocationWeybridge, ElmbridgeEnglandCoordinates51°21′42″N 0°27′27″W / 51.3616°N 0.4575°W / 51.3616; -0.4575Grid referenceTQ074636Managed bySouth Western RailwayPlatforms3Other informationStation codeWYBClassificationDfT category C2HistoryOpened21 May 1838Passengers2017/18 2.318 million2018/19 2.384 million Interchange  0.671 million2019/20 2.227 million Interchange  0.597 mill...

Season of television series ShamelessSeason 8DVD CoverStarring William H. Macy Emmy Rossum Jeremy Allen White Ethan Cutkosky Shanola Hampton Steve Howey Emma Kenney Cameron Monaghan Isidora Goreshter Country of originUnited StatesNo. of episodes12ReleaseOriginal networkShowtimeOriginal releaseNovember 5, 2017 (2017-11-05) –January 28, 2018 (2018-01-28)Season chronology← PreviousSeason 7Next →Season 9List of episodes The eighth season of Shameless, an American co...

 

Hormones produced by the thyroid gland The thyroid system of the thyroid hormones T3 and T4[1] Thyroid hormones are any hormones produced and released by the thyroid gland, namely triiodothyronine (T3) and thyroxine (T4). They are tyrosine-based hormones that are primarily responsible for regulation of metabolism. T3 and T4 are partially composed of iodine, derived from food.[2] A deficiency of iodine leads to decreased production of T3 and T4, enlarges the thyroid tissue and will cau...

 

For other villages named Kumbhariya in Gujarat, see Kumbhariya. Lake in Kumbharia Village Kumbharia or Kumbhariya is a village in Anjar Taluka of Kutch District of Gujarat State of India. It is situated at a distance of 14  km from Anjar town, the taluka headquarters. History Kumbharia is one of the 18 villages founded by Kutch Gurjar Kshatriyas or Mistris. These Mistri community first moved into Saurashtra from Rajasthan in the early 7th century and later a major group entered Kutch in ...

Mansion in London, EnglandSarum ChaseGeneral informationStatusGrade II listedTypeMansionArchitectural styleNeo-TudorAddress23 West Heath Road, HampsteadTown or cityLondonCountryEnglandCoordinates51°33′44″N 0°11′23″W / 51.5623°N 0.1896°W / 51.5623; -0.1896Groundbreaking4 September 1932Completed1932 (1932)ClientFrank O. SalisburyDesign and constructionArchitect(s)Vyvyan Salisbury Sarum Chase is a large detached neo-Tudor mansion,[1][2] at...

 

New Zealand painter (b.1953) John Z. Robinson, photographed in 2008. John Z. Robinson (born 25 May 1953 in Foxton, New Zealand) is a New Zealand painter, printmaker, and jeweller. He has lived in Dunedin, New Zealand since 1978. Education Robinson completed a four-and-a-half-year manufacturing jewellery apprenticeship with Max Wilson in Palmerston North in 1973 and then worked with Roy Evans at Arcade Jewellers in Timaru.[1] From 1978 to 1980, he attended Otago Polytechnic School of A...

 

Moldovan footballer Virgiliu Postolachi Postolachi with Paris Saint-Germain in 2019Personal informationDate of birth (2000-03-17) 17 March 2000 (age 23)Place of birth Edineț, MoldovaHeight 1.89 m (6 ft 2+1⁄2 in)Position(s) ForwardTeam informationCurrent team GrenobleNumber 17Youth career2013–2018 Paris Saint-GermainSenior career*Years Team Apps (Gls)2018–2019 Paris Saint-Germain B 36 (5)2019–2020 Lille B 17 (0)2020–2022 Mouscron 13 (0)2021 → Vendsyssel (lo...

Marc-Vivien Foé Nazionalità  Camerun Altezza 188 cm Peso 85 kg Calcio Ruolo Centrocampista Carriera Giovanili 1991-1994 Canon Yaoundé Squadre di club1 1994-1999 Lens85 (11)1999-2000 West Ham Utd38 (1)2000-2002 Olympique Lione43 (3)2002-2003 Manchester City35 (9) Nazionale 1993 Camerun U-203 (1)1993-2003 Camerun64 (8) Palmarès  Coppa d'Africa Oro Ghana-Nigeria 2000 Oro Mali 2002  Confederations Cup Argento Francia 2003 1 I due numeri indicano le pres...

 

Pornography depicting bondage and related acts This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages) This article possibly contains original research. Please improve it by verifying the claims made and adding inline citations. Statements consisting only of original research should be removed. (November 2010) (Learn how and when to remove this template message) This article needs additional cita...

 

Strategi Solo vs Squad di Free Fire: Cara Menang Mudah!