语法数学一点不会?可以学编程吗QAQ
明明想學編程,然兒花在單詞閱讀的時間上比扣代碼的時間還要多…內心崩潰。
這里記錄語法、發音和算法、邏輯。在線更新,too lazy to copy.
😃 點贊收藏,天天向上!
- 顎音化(英語:Palatalization)是一個語言學的名詞,指輔音在發音時變得接近硬顎音。通常發生于硬顎無擦通音/j/或者前元音如/i/、/e/的前面,這個現象會使輔音在發音時,除本身的發音動作外,舌根會頂著硬顎部分并發出一個類似短促的/j/。國際音標會在顎音化的輔音右上角加上“?”來表示。
各語言范例
顎化現像在很多語言都有出現。例如,中國的北方方言在近數百年開始出現尖團音的區別。這一種“團音”就是顎音化的形式。另外,在英語里“question”和“nature”里的“t”讀成/?/,又或是“soldier”和“procedure”里的“d”讀成/?/音。這是因為這些 t 或 d 的后面跟從了/i/和/ju/音,使前面的/t/和/d/發生了顎化現象。
顎音化在拉丁語族、斯拉夫語族、漢語、日語的發展占有很重要的地位。這種現象在世上很多語言都有出現。
In linguistics, palatalization /?p?l?t?la??ze???n/ is a sound change that either results in a palatal or palatalized consonant or a front vowel, or is triggered by one of them. Palatalization involves change in the place or manner of articulation of consonants, or the fronting or raising of vowels. In some cases, palatalization involves assimilation or lenition.
An example of palatalization in English is the colloquial pronunciation of did you? as [d?d?u?] rather than [d?dju?]
Palatalization is sometimes an example of assimilation. In some cases, it is triggered by a palatal or palatalized consonant or front vowel, but in other cases, it is not conditioned in any way.
consonant
Palatalization changes place of articulation or manner of articulation of consonants. It may add palatal secondary articulation or change primary articulation from velar to palatal or alveolar, alveolar to postalveolar.
It may also cause a consonant to change its manner of articulation from stop to affricate or fricative. The change in the manner of articulation is a form of lenition. However, the lenition is frequently accompanied by a change in place of articulation.
[k] > [k?], [c], [t?], [ts], [?], [s]
Palatalization of velar consonants commonly causes them to front, and apical and coronal consonants are usually raised. In the process, stop consonants are often spirantised except for palatalized labials.
Palatalization, as a sound change, is usually triggered only by mid, close (high) front vowels and the semivowel [j]. The sound that results from palatalization may vary from language to language. For example, palatalization of [t] may produce [t?], [t?], [t?], [ts?], [ts], etc. A change from [t] to [t?] may pass through [t?] as an intermediate state, but there is no requirement for that to happen.
In some Zoque languages, [j] does not palatalize velar consonants but it turns alveolars into palato-alveolars. In the Nupe language, /s/ and /z/ are palatalized both before front vowels and /j/, while velars are only palatalized before front vowels. In Ciluba, /j/ palatalizes only a preceding /t/, /s/, /l/ or /n/. In some variants of Ojibwe, velars are palatalized before /j/, but apicals are not. In Indo-Aryan languages, dentals and /r/ are palatalized when occurring in clusters before /j/, but velars are not.
Vowel
Palatalization sometimes refers to vowel shifts, the fronting of a back vowel or raising of a front vowel. The shifts are sometimes triggered by a nearby palatal or palatalized consonant or by a high front vowel. The Germanic umlaut is a famous example.
A similar change is reconstructed in the history of Old French in which Bartsch’s law turned open vowels into [e] or [?] after a palatalized velar consonant. If it was true for all open vowels in Old French, it would explain the palatalization of velar plosives before /a/.
In Erzya, a Uralic language, the open vowel [a] is raised to near-open [?] after a palatalized consonant, as in the name of the language, [erz??].
In Russian, the back vowels /u o/ are fronted to central [? ?], and the open vowel /a/ is raised to near-open [?], near palatalized consonants. The palatalized consonants also factor in how unstressed vowels are reduced.
uncondition
Palatalization is sometimes unconditioned or spontaneous, not triggered by a palatal or palatalized consonant or front vowel.
In southwestern Romance, clusters of a voiceless obstruent with /l/ were palatalized once or twice. This first palatalization was unconditioned. It resulted in a cluster with a palatal lateral [?], a palatal lateral on its own, or a cluster with a palatal approximant [j]. In a second palatalization, the /k/ was affricated to [t?] or spirantized to [?].
Vulgar Latin clāmāre “to call” > Aromanian cl’imari /k?imari/, Aragonese clamar /k?amar/, Spanish llamar /?amar/, Italian chiamare /kja?mare/
Istriot ciamà /t?a?ma/, Portuguese chamar /???ma?/
In the Western Romance languages, Latin [kt] was palatalized once or twice. The first palatalization was unconditioned: the /k/ was vocalized to [i?t] or spirantized to [?t]. In a second palatalization, the /t/ was affricated to [t?]:
Vulgar Latin noctem “night” > French nuit [n?i], Portuguese noite [?noj.t?], eastern Occitan nuèit, Catalan nit, Mozarabic noxte /no?te/
Spanish noche, western Occitan nuèch, Romansh notg
In many dialects of English, the back vowel /u?/ is fronted to near-back [u??], central [??], or front [y?]. This vowel shift is unconditioned, happening in all cases, and not triggered by another sound.
A similar change is reconstructed for Ancient Greek. In the Attic dialect before the Classical period, the back vowels /u u?/ were fronted to [y y?]. During the Koine or Medieval Greek period, they were unrounded to [i i?], and they finally merged as short [i], the pronunciation that they have in Modern Greek.
Anticipatory and progressive
When palatalization is assimilatory or triggered by a consonant or vowel, it is triggered by a following sound (anticipatory) or by a preceding sound (progressive).
effect
Allophony and phonemic split
Palatalization may result in a phonemic split, a historical change by which a phoneme becomes two new phonemes over time through palatalization.
Old historical splits have frequently drifted since the time they occurred and may be independent of current phonetic palatalization. The lenition tendency of palatalized consonants (by assibilation and deaffrication) is important. According to some analyses, the lenition of the palatalized consonant is still a part of the palatalization process itself.
In Japanese, allophonic palatalization affected the dental plosives /t/ and /d/, turning them into alveolo-palatal affricates [t?] and [d?] before [i], romanized as ?ch? and ?j? respectively. Japanese has only recently regained phonetic [ti] and [di] from borrowed words, and the originally allophonic palatalization has thus become lexical. A similar change has also happened in Polish and Belarusian. That would also be true about most dialects of Brazilian Portuguese if not it were nor for the strong phonotactical resistancy of its native speakers that turn dental plosives into post-alveolar affricates even in loanwords: McDonalds [m??ki?d?n?wd?(is)].
For example, Votic has undergone such a change historically, *keeli → t?eeli ‘language’, but there is currently an additional distinction between palatalized laminal and non-palatalized apical consonants. An extreme example occurs in Spanish, whose palatalized (‘soft’) g has ended up as [x] from a long process where Latin /a/ became palatalized to [ɡ?] (Late Latin) and then affricated to [d?] (Proto-Romance), deaffricated to [?] (Old Spanish), devoiced to [?] (16th century), and finally retracted to a velar, giving [x] (c. 1650). (See History of the Spanish language and Phonological history of Spanish coronal fricatives for more information).
Palatalization has played a major role in the history of English, and of other languages and language groups throughout the world, such as the Romance, Greek, Slavic, Baltic, Finnic, Mordvinic, Samoyedic, Iranian, Indo-Aryan, Goidelic, Korean, Japanese, Chinese, Twi and Micronesian languages.
English
In Anglo-Frisian, the language that gave rise to English and Frisian, the velar stops /k g/ and the consonant cluster /sk/ were palatalized in certain cases and became the sounds /t?/, /d?/ and /j/, and /?/. Many words with Anglo-Frisian palatalization survive in Modern English, and the palatalized sounds are typically spelled ?ch, (d)ge, y, sh? in Modern English.
Palatalization only occurred in certain environments, and so it did not apply to all words from the same root. This is the origin of some alternations in cognate words, such as speak and speech /?spi?k ?spi?t?/, cold and chill /?ko?ld ?t??l/, burrow and bury /?b?ro? ?b?ri/, dawn and day /?d??n ?de?/. Here ?k? originates from unpalatalized /k/ and ?w? from unpalatalized /g/.
Some English words with palatalization have unpalatalized cognates from the Northumbrian dialect and from Old Norse, such as shirt and skirt /???rt ?sk?rt/, church and kirk /?t??rt? ?k?rk/, ditch and dike /?d?t? ?da?k/. German only underwent palatalization of /sk/: cheese /t?i?z/ and K?se /k??z?/; lie and lay /?la? ?le?/, liegen and legen /?li?g?n ?le?g?n/; fish and Fisch /f??/.
The pronunciation of wicca as [?w?k?] with a hard c is a spelling pronunciation, since the actual Old English pronunciation gave rise to witch.
Later in English, another palatalization called yod-coalescence occurred. Alveolar stops and affricates were palatalized before the palatal approximant /j/, changing into [d? t? ? ?]. In standard English, yod-coalescence applies only in unstressed syllables and causes the words educate /??d??ke?t/, nature /?ne?t??r/, pressure /?pr???r/, measure /?m???r/ to have the sounds sometimes spelled ?j ch sh zh?.
In other dialects, yod-coalescence also applies in stressed syllables, and affects words like dew /?d?u?/, tune /?t?u?n/, assume /???u?m/, and resume /r???u?m/.
The Romance languages developed from Vulgar Latin, the colloquial form of Latin spoken in the Roman Empire. Various palatalizations occurred during the historical development of the Romance languages. Some groups of the Romance languages underwent more palatalizations than others. One palatalization affected all groups, some palatalizations affected most groups, and one affected only a few groups.
In Gallo-Romance, Vulgar Latin *[ka] became *[t?a] very early, with the subsequent deaffrication and some further developments of the vowel. For instance:
cattus “cat” > chat /?a/
calva “bald” (fem.) > chauve /?ov/
*blanca “white” (fem.) > blanche /blɑ??/
catēna “chain” > cha?ne /??n/
carus “dear” > cher /???/
Early English borrowings from French show the original affricate, as chamber /?t?e?mb??/ “(private) room” < Old French chambre /t?ɑ?mbr?/ < Vulgar Latin camera; compare French chambre /?ɑ?b?/ “room”.
Mouillé
Mouillé (French pronunciation: ?[muje], moistened) is a term for palatal consonants in the Romance languages. Palatal consonants in the Romance languages developed from /l/ or /n/ by palatalization.
Spelling of palatal consonants
l mouillé n mouillé
Italian gl(i) gn
French (i)ll (i)gn
Occitan lh nh
Catalan ll ny
Spanish ll ?
Portuguese lh nh
L and n mouillé have a variety of origins in the Romance languages. In these tables, letters that represent or used to represent /?/ or /?/ are bolded. In French, /?/ merged with /j/ in pronunciation in the 18th century; in many dialects of Spanish, /?/ has merged with /?/. Romanian formerly had both /?/ and /r/, but both have merged with /j/: vīnea > *vi?e > Romanian vie /?vi.je/ “vineyard”; mulierem > *mu?ere > Romanian muiere /mu?je.re/ “woman”.
Examples of palatal /?/
Latin meliōrem
“better” auric(u)la
“ear” caballum
“horse” lunam
“moon” clavem
“key”
Italian migliore orecchio cavallo luna chiave
French meilleur oreille cheval lune clef
Occitan melhor aurelha caval luna clau
Catalan millor orella cavall lluna clau
Spanish mejor oreja caballo luna llave
Portuguese melhor orelha cavalo lua chave
Romanian — ureche cal lun? cheie
Examples of palatal /r/
Latin seniōrem
“older” cognātum
“related” annum
“year” somnum
“sleep” somnium
“dream” ung(u)lam
“claw” vīnum
“wine”
Italian signore cognato anno sonno sogno unghia vino
French seigneur — an somme songe ongle vin
Occitan senhor cunhat an sòm sòmi ongla vin
Catalan senyor cunyat any son somni ungla vi
Spanish se?or cu?ado a?o sue?o sue?o u?a vino
Portuguese senhor cunhado ano sono sonho unha vinho
Romanian — cumnat an somn — unghie vin
Satem languages
In certain Indo-European language groups, the reconstructed “palato-velars” of Proto-Indo-European (*?, *?, *??) were palatalized into sibilants. The language groups with and without palatalization are called satem and centum languages, after the characteristic developments of the PIE word for “hundred”:
PIE *(d)?m?tóm > Avestan sat?m (palatalization)
Latin centum /kentum/ (no palatalization)
In the Slavic languages, two palatalizations took place. Both affected the Proto-Slavic velars *k *g *x. In the first palatalization, the velars before the front vowels *e *ē *i *ī and the palatal approximant *j changed to *? *? *?. In the second palatalization, the velars changed to c, dz or z, and s or ? before the Proto-Slavic diphthongs *aj *āj, which must have been monophthongized to *ē by this time.
In many dialects of Mandarin Chinese, the alveolar sibilants /ts ts? s/ and the velars /k k? x/ were palatalized before the medials /j ?/ and merged in pronunciation, yielding the alveolo-palatal sibilants /t? t?? ?/. Alveolo-palatal consonants occur in modern Standard Chinese and are written as ?j q x? in Pinyin. Postal romanization does not show palatalized consonants, reflecting the dialect of the imperial court during the Qing dynasty. For instance, the name of the capital of China was formerly spelled Peking, but is now spelled Beǐjīng [pe??.t?í?], and Tientsin and Sian were the former spellings of Tiānjīn [t?j??n.t?ín] and Xī’ān [?í.án].
- 輔音弱化或弱音化(Lenition)是語言學的一種輔音變化現象,存在于多種語言,但以印歐語為主。輔音弱化及語音同化都是歷史語言學的一門主要課題,亦是現時語言在歷史中變化的主要原因。
這個名詞源自拉丁語的lenis,意思就是變弱或變軟。弱音化指語音由一對較強的語音轉化為較弱的一對。若已轉化的輔音與另外的輔音還有配對關系,這個弱化過程還可能會一直繼續下去。
輔音的弱化有以下各種:
擦音化或咝音化(spirantization或affrication)
例如:[t] → [s]
濁音化(voicing或sonorization)
例如:[f] → [v]
去口音化(debuccalization)
例如:[s] → [h]
消除輔音重復(degemination)
例如:[kk] → [k]
松音化(deglottalization)
例如:[k’] → [k]
去到最后,輔音可能會弱化至完全脫落(elision ,亦作音節省略)。
弱音化的過程有兩大類:
其一是發音部位會向「開口音」的方向演變,
其二是擦音化。
-
「開口音化」是指發音部位每步向著增加張口度的方向弱化,例如:
雙輔塞音 → 塞音 → 擦音 → 咝音 → placeless approximant → 無聲
原來發音 → 去雙輔音 → 擦音化 → 咝音化
(去擦音化) → 非口腔音化 → 省略化
[pp] or [pp?] → [p] or [p?] → [p?] → [?] → [h] → (zero)
→ [pf] → [f] →
[tt] or [tt?] → [t] or [t?] → [tθ] → [θ] →
→ [ts] → [s] →
[kk] or [kk?] → [k] or [k?] → [kx] → [?] →
而「擦音化」的過程,還會令輔音從清音轉為濁音:
塞音 → 濁音化 → continuant
(咝音化, tap, etc.) → 邊音化 → 無聲(省略化) (附注)
原來發音 → voicing
(sonorization) → spirantization, flapping → approximation → elision
[p] → [b] → [β] → [β?] → (zero)
→ [v] → [?] →
→ [w] →
[t] → [d] → [e] → [e?] →
→ [z] → [?] →
→ [?] →
[k] → [ɡ] → [?] → [p] →
→ [j], [w] → -
凱爾特語的語音及文本
過去凱爾特語的文本記錄中,弱化了的輔音都會在其上加上一圓點。不過,后來的排版機由于不能輕易加上變音符號,所以這種弱化標示的習慣改為在輔音之后加上「h」字表示。例如:「母親」現在的拼法是"a mháthair",但過去的拼法,卻應該寫作"a ?á?air"。 -
漢語福州話的聲母類化
主條目:聲母類化 在福州話以及寧德地區的閩東方言中的大部分方言點,一些塞音和擦音變為同部位或相近部位的阻礙程度相對較小的音。例如,p,p?在大多較常詞組中的后字中可發生弱化,變為雙唇近音β? ,甚至消失,發生的條件是前字為陰聲韻或入聲韻,如 肉餅 [ny? pia?]→[ny(?) β?ia?] 。同樣的,還有t,t?,s,ts,ts?和k,k? 。其中t,t?,s變成?直至l,ts,ts?變成z直至通音化,k,k?變為零輔音。當前字為陽聲韻(鼻音?韻尾),后字上,p,p?變為m,t,t?,s變為n,ts,ts?變為接近齦腭鼻音n?? (??),k,k?變為?。
演化語言學
演化語言學,是對人類原始語言的發展,及其社會行為演化的科學。由于語言的聲音轉眼即逝,令到這學科研究欠缺原始數據。因此過去百多年,這學科都難以發展。由19世界80年代后期起,這學科與心理語言學、神經語言學、演化心理學、普遍文法、認知科學等學科興起跨學科研究,使演化語言學再為興盛。
Evolutionary linguistics is a subfield of psycholinguistics that studies the psychosocial and cultural factors involved in the origin of language and the development of linguistic universals. The main challenge in this research is the lack of empirical data: spoken language leaves practically no traces. This led to the abandonment of the field for more than a century, despite the common origins of language hinted at by the evolutionary relationships among individual languages established by the field of historical linguistics. Since the late 1980s, the field has been revived in the wake of progress made in the related fields of psycholinguistics, neurolinguistics, evolutionary anthropology, evolutionary psychology, universal grammar, and cognitive science.
History
Inspired by the natural sciences, especially by biology, August Schleicher (1821–1868) became the first to compare changing languages to evolving species. He introduced the representation of language families as an evolutionary tree (Stammbaumtheorie) in articles published in 1853. Stammbaumtheorie proved very productive for comparative linguistics, but did not solve the major problem of studying the origin of language: the lack of fossil records. Some scholars abandoned the question of the origin of language as unsolvable. Famously, the Société Linguistique de Paris in 1866 refused to admit any further papers on the subject.
Joseph Jastrow published a gestural theory of the evolution of language in the seventh volume of Science, 1886.The field re-appeared in 1988 in the Linguistic Bibliography as a subfield of psycholinguistics. In 1990, Steven Pinker and Paul Bloom published their paper “Natural Language and Natural Selection” which strongly argued for an adaptationist approach to language origins. Development strengthened further with the establishment (in 1996) of a series of conferences on the Evolution of Language (subsequently known as “Evolang”), promoting a scientific, multi-disciplinary approach to the issue, and interest from major academic publishers (e.g., the Studies in the Evolution of Language series has appeared with Oxford University Press since 2001) and from scientific journals.
Recent developments
Evolutionary linguistics as a field is rapidly emerging as a result of developments in neighboring disciplines. To what extent language’s features are determined by genes, a hotly debated dichotomy in linguistics, has had new light shed upon it by the discovery of the FOXP2 gene. An English family with a severe, heritable language dysfunction was found to have a defective copy of this gene. Mutations of the corresponding gene in mice (FOXP2 is fairly well conserved; modern humans share the same allele as Neanderthals) cause reductions in size and vocalization rate. If both copies are damaged, the Purkinje layer (a part of the cerebellum that contains better-connected neurons than any other) develops abnormally, runting is more common, and pups die within weeks due to inadequate lung development. Additionally, higher presence of FOXP2 in songbirds is correlated to song changes, with downregulation causing incomplete and inaccurate song imitation in zebra finches. In general, evidence suggests that the protein is vital to neuroplasticity. There is little support, however, for the idea that FOXP2 is ‘the grammar gene’ or that it had much to do with the relatively recent emergence of syntactical speech.
Another controversial dichotomy is the question of whether human language is solely human or on a continuum with (admittedly far removed) animal communication systems. Studies in ethology have forced researchers to reassess many claims of uniquely human abilities for language and speech. For instance, Tecumseh Fitch has argued that the descended larynx is not unique to humans. Similarly, once held uniquely human traits such as formant perception, combinatorial phonology and compositional semantics are now thought to be shared with at least some nonhuman animal species. Conversely, Derek Bickerton and others argue that the advent of abstract words provided a mental basis for analyzing higher-order relations, and that any communication system that remotely resembles human language utterly relies on cognitive architecture that co-evolved alongside language.
As it leaves no fossils, language’s form and even its presence are extremely hard or impossible to deduce from physical evidence. Computational modeling is now widely accepted as an approach to assure the internal consistency of language-evolution scenarios. Approximately one-third of all papers presented at the 2010 Evolution of Language conference rely at least in part on computer simulations.
Approaches
One original researcher in the field is Luc Steels, head of the research units of Sony CSL in Paris and the AI Lab at the Vrije Universiteit Brussel. He and his team are currently investigating ways in which artificial agents self-organize languages with natural-like properties and how meaning can co-evolve with language. Their research is based on the hypothesis that language is a complex adaptive system that emerges through adaptive interactions between agents and continues to evolve in order to remain adapted to the needs and capabilities of the agents. This research has been implemented in fluid construction grammar (FCG), a formalism for construction grammars that has been specially designed for the origins and evolution of language. The approach of computational modeling and the use of robotic agents grounded in real life is claimed to be theory independent. It enables the researcher to find out exactly what cognitive capacities are needed for certain language phenomena to emerge. It also focuses the researcher in formulating hypotheses in a precise and exact manner, whereas theoretical models often stay very vague.
Some linguists, such as John McWhorter, have analyzed the evolution and construction of basic communication methods such as Pidginization and Creolization.
“Nativist” models of “Universal Grammar” are informed by linguistic universals such as the existence of pronouns and demonstratives, and the similarities in each language’s process of nominalization (the process of verbs becoming nouns) as well as the reverse, the process of turning nouns into verbs. This is a purely descriptive approach to what we mean by “natural language” without attempting to address its emergence.
Finally there are those archaeologists and evolutionary anthropologists – among them Ian Watts, Camilla Power and Chris Knight (co-founder with James Hurford of the EVOLANG series of conferences) — who argue that ‘the origin of language’ is probably an insoluble problem. In agreement with Amotz Zahavi, Knight argues that language — being a realm of patent fictions — is a theoretical impossibility in a Darwinian world, where signals must be intrinsically reliable. If we are going to explain language’s evolution, according to this view, we must tackle it as part of a wider one — the evolutionary emergence of symbolic culture as such.
EVOLANG Conference
The Evolution of Language International Conferences have been held biennially since 1996.
1996 Edinburgh:
1998 London:
2000 Paris:
2002 Boston:
2004 Leipzig
2006 Rome:
2008 Barcelona:
- 生日問題
生日問題是指,如果一個房間里有23個或23個以上的人,那幺至少有兩個人的生日相同的概率要大于50%。這就意味著在一個典型的標準小學班級(30人)中,存在兩人生日相同的可能性更高。對于60或者更多的人,這種概率要大于99%。從引起邏輯矛盾的角度來說生日悖論并不是一種悖論,從這個數學事實與一般直覺相抵觸的意義上,它才稱得上是一個悖論。大多數人會認為,23人中有2人生日相同的概率應該遠遠小于50%。計算與此相關的概率被稱為生日問題,在這個問題之后的數學理論已被用于設計著名的密碼攻擊方法:生日攻擊。
對此悖論的解釋
我們可以把生日悖論理解成一個盲射打靶的問題。對于一個23人的房間,先考慮問題的補集:23人生日兩兩不同的概率是多少?為此,我們可以讓23個人依次進入,那幺每個人生日都與其他人不同的概率依次是1, 3**/365, 363/365, 362/365, 361/365,等等。先進入房間的這些人生日兩兩不同的概率是很大的,比如說前面5個是1×3**/365×363/365×362/365×361/365=97.3%。而對于最后進入房間的幾個人情況就完全不同。最后幾個人進入房間并且找不到同生日者的概率是… 345/365, 344/365, 343/365。我們可以把這種概率看成對一張靶的盲射:靶上有365個小格,其中有17個左右是黑格,其余是白格。假設每槍必中靶并且分布符合幾何概型的話,那幺連續射12槍左右任何一發都沒有擊中黑格的概率(投射于房間里的人生日都兩兩不同)是多少呢?想必大家立即會感覺到這個概率十分微小。
因此,理解生日悖論的關鍵,在于考慮上述“依次進入房間”模型中最后幾個進入房間的人“全部都沒碰到相同生日的人”概率有多大這件事情。
概率估計
假設有n個人在同一房間內,如果要計算有兩個人在同一日出生的機率,在不考慮特殊因素的前提下,例如閏年、雙胞胎,假設一年365日出生概率是平均分布的(現實生活中,出生機率不是平均分布的)。
計算概率的方法是,首先找出p(n)表示n個人中,每個人的生日日期都不同的概率。假如n > 365,根據鴿巢原理其概率為1,假設n ≤ 365,則概率為
2\bar p (n) = 1 \cdot \right[(2(n \frac{1}{365}\right) ]\cdot \right[(2\n \frac{2}{365}\right) ]\cdots \right[( 2\n\ frac{n-1}{365}\right) ]=|\frac{365}{365} \cdot \frac{3**}{365} \cdot \frac{363}{365} \cdot \frac{362}{365} \cdots \frac{365-n+1}{366}|
^因為第二個人不能跟第一個人有相同的生日(概率是3**/365),第三個人不能跟前兩個人生日相同(概率為363/365),依此類推。用階乘可以寫成如下形式
{ 365! \over 365^n (365-n)! }
p(n)表示n個人中至少2人生日相同的概率
p (n) = 1 - \bar p (n)=1 - { 365! \over 365^n (365-n)! }
n≤365,根據鴿巢原理,n大于365時概率為1。
當n=23發生的概率大約是0.507。其他數字的概率用上面的算法可以近似的得出來:
n p(n)
10 12%
20 41%
30 70%
50 97%
100 99.99996%
200 99.9999999999999999999999999998%
300 1 ?(7×10)
350 1 ?(3×10)
≥366 100%
比較p (n) = 任意兩個人生日相同概率q (n) =和某人生日相同的概率
比較p (n) = 任意兩個人生日相同概率q (n) =和某人生日相同的概率
注意所有人都是隨機選出的:作為對比,q(n)表示房間中n個其他人中與特定人(比如你)有相同生日的概率:
q (n) = 1- \left( \frac{3**}{365} \right)^n
當n = 22時概率只有大約0.059,約高于十七分之一。如果n個人中有50%概率存在某人跟你有相同生日,n至少要達到253。注意這個數字大大高于365/2 = 182.5:究其原因是因為房間內可能有些人生日相同。
^數學論證(數字方法)
在Paul Halmos的自傳中,他認為生日悖論僅通過數值上的計算來解釋是一種悲哀。為此,Paul Halmos給出了一種概念數學方法的解釋,下面就是這種方法(盡管這個方法包含一定的誤差)。乘積
\prod_{k=1}^{n-1}\left(1k \over 365}\right)
等于1-p(n),因此我們關注第一個n,欲使乘積小于1/2。由平均數不等式可以得知:
\sqrt[n-1]{\prod_{k=1}^{n-1}\left(1k \over 365}\right)}
<{1 \over n-1}\sum_{k=1}^{n-1}\left(1k \over 365}\right)
再利用已知的1到n-1所有整數和等于n(n-1)/2,然后利用不等式1-x < e,我們可以得到:
\prod_{k=1}^{n-1}\left(1k \over 365}\right)
<\left({1 \over n-1}\sum_{k=1}^{n-1}\left(1k \over 365}\right)\right)^{n-1}
=\left(1n \over 730}\right){n-1}<\left(e{-n/730}\right){n-1}=e{-(n^2-n)/730}
如果僅當
n^2-n>730\log_e 2\cong 505.997\dots
最后一個表達式的值會小于0.5。其中"loge"表示自然對數。這個數略微小于506,如果取n-n=506,我們就得到n=23。
在推導中,Halmos寫道:
這個推導是基于一些數學系學生必須掌握的重要工具。生日問題曾經是一個絕妙的例子,用來演示純思維是如何勝過機械計算:一兩分鐘就可以寫出這些不等式,而乘法運算則需要更多時間,并更易出錯,無論使用的工具是一只鉛筆還是一臺老式電腦。計算器不能提供的是理解力,或數學才能,或產生更高級、普適化理論的堅實基礎。
然而Halmos的推導只顯示至少超過23人就能保證平等機會下的生日匹配。因為我們不知道給出的不等式有多強(嚴格、清晰),因此從這個計算過程中無法確定當n=22時是否就能讓機率超過0.5。相反的,當代任何人都可以運用個人電腦程序如Microsoft Excel,幾分鐘就可以把整個機率分布圖形畫出來,對問題答案很快就有個通盤的掌握,一目了然。
泛化和逼近
生日悖論可以推廣一下:假設有n個人,每一個人都隨機地從N個特定的數中選擇出來一個數(N可能是365或者其他的大于0的整數)。
p(n)表示有兩個人選擇了同樣的數字,這個概率有多大?
下面的逼近公式可以回答這個問題
p (n)\sim 1-1/\exp(n^2/(2N))。,
N=365的結果
泛化
下面我們泛化生日問題:給定從符合離散均勻分布的區間[1,d]隨機取出n個整數,至少2個數字相同的概率p(n;d)有多大?
類似的結果可以根據上面的推導得出。
p(n;d) = \begin{cases} 1-\prod_{k=1}^{n-1}\left(1k \over d}\right) & n\le d \ 1 & n > d \end{cases}
p(n;d) \approx 1 - e^{-(n(n-1))/2d}
n(p;d)\approx \sqrt{2d\ln\left({1 \over 1-p}\right)}+{1 \over 2}
q(n;d) = 1 - \left( \frac{d-1}ze8trgl8bvbq \right)^n
反算問題
反算問題可能是:
對于確定的概率p …
…找出最大的n(p)滿足所有的概率p(n)都小于給出的p,或者
…找出最小的n(p)滿足所有的概率p(n)都大于給定的p。
對這個問題有如下逼近公式:
n §\approx \sqrt{2\cdot 365\ln\left({1 \over 1-p}\right)}+{1 \over 2}。
舉例
逼近 估計N =365
p n推廣 n<N =365 n↓ p(n↓) n↑ p(n↑)
0.01 (0.14178 √N)+0.5 3.208** 3 0.00820 4 0.01636
0.05 (0.32029 √N)+0.5 6.61916 6 0.04046 7 0.05624
0.1 (0.45904 √N)+0.5 9.27002 9 0.09462 10 0.11694
0.2 (0.66805 √N)+0.5 13.26302 13 0.19441 14 0.22310
0.3 (0.84460 √N)+0.5 16.63607 16 0.28360 17 0.31501
0.5 (1.17741 √N)+0.5 22.99439 22 0.47570 23 0.50730
0.7
(1.55176 √N)+0.5
30.14625
30
0.70632
31 0.73045 (正確值:n↓=29, n↑=30)
0.8 (1.79412 √N)+0.5 34.77666 34 0.79532 35 0.81438
0.9
(2.14597 √N)+0.5
41.49862
41
0.90315
42 0.91403 (正確值:n↓=40, n↑=41)
0.95
(2.44775 √N)+0.5
47.2**14
47
0.95477
48 0.96060 (正確值:n↓=46, n↑=47)
0.99
(3.03485 √N)+0.5
58.48081
58
0.99166
59 0.99299 (正確值:n↓=56, n↑=57)
注意:某些值被著色,說明逼近不總是正確。
經驗性測試
生日悖論可以用計算機代碼經驗性模擬
days := 365;
numPeople := 1;
prob := 0.0;
while prob < 0.5 begin
numPeople := numPeople + 1;
prob := 1 -((1-prob)*(days-(numPeople-1)) / days);
print "Number of people: " + numPeople;
print "Prob. of same birthday: " + prob;
end;
生日悖論也可以用Microsoft Excel Spreadsheet模擬
1 = 1-PERMUT(365,A1)/POWER(365,A1)
=A1+1 = 1-PERMUT(365,A2)/POWER(365,A2)
=A2+1 = 1-PERMUT(365,A3)/POWER(365,A3)
… …
應用
生日悖論普遍的應用于檢測哈希函數:N-位長度的哈希表可能發生碰撞測試次數不是2次而是只有2次。這一結論被應用到破解密碼學散列函數的生日攻擊中。
生日問題所隱含的理論已經在[Schnabel 1938]名字叫做capture-recapture的統計試驗得到應用,來估計湖里魚的數量。
不平衡概率
就像上面提到的,真實世界的人口出生日期并不是平均分布的。這種非均衡生日概率問題也已經被解決。[Klamkin 1967]
近似匹配
此問題另外一個泛化就是求得要在隨機選取多少人中才能找到2個人生日相同,相差1天,2天等的概率大于50% 。這是個更難的問題需要用到容斥原理。結果(假設生日依然按照平均分布)正像在標準生日問題中那樣令人吃驚:
2人生日相差k天 #需要的人數
0 23
1 14
2 11
3 9
4 8
5 7
7 6
只需要隨機抽取6個人,找到兩個人生日相差一周以內的概率就會超過50%。
總結
以上是生活随笔為你收集整理的语法数学一点不会?可以学编程吗QAQ的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Python——简陋的n阶魔方模拟
- 下一篇: 随机森林的特征重要性排序