intro
π¦ μ΄ 19κ°μ ꡬλ©μ΄ μλ λΉλκΈ°μ§μμ 20λ§λ¦¬μ λΉλκΈ°κ° λ€μ΄κ°λ €κ³ ν λ, μ μ΄λ ν κ³³μ λΉλκΈ°μ§μλ μ μ΄λ 2λ§λ¦¬ μ΄μμ λΉλκΈ°κ° λ°λμ μμ μ λ°μ μλ€λ μ리.
β theorem I: κ° κ΅¬λ©μ Aλ§λ¦¬μ λΉλκΈ°κ° νκ· μ μΌλ‘ λ€μ΄κ° μλ€λ©΄, Aκ° μ μκ° μλλΌλ©΄, μ μ΄λ ν κ³³μλ ceil(A)λ§λ¦¬μ λΉλκΈ°κ° μλ€λ λ». λλ¨Έμ§ λΉλκΈ° μ§μλ μ΅λ floor(A)λ§λ¦¬μ λΉλκΈ°κ° μλ€.
β‘ theorem II: n+1κ°μ 물건μ nκ°μ μμμ λ£μΌλ €κ³ ν λ, μ μ΄λ ν κ° μ΄μμ μμμλ 2κ° μ΄μμ 물건μ λ£μ μ λ°μ μλ€.
π¦ generalization
β ) λ§μ½ Kn+1λ§λ¦¬μ λΉλκΈ°κ° nκ°μ λΉλκΈ°μ§μ λ€μ΄κ°λ €κ³ ν λ, (Kn+1)/nμ K + 1/nμ΄λ―λ‘ μ μ΄λ ν κ³³μ λΉλκΈ°μ§μλ K+1λ§λ¦¬ μ΄μμ λΉλκΈ°κ° μ‘΄μ¬νλ€.
β‘) strong form - theorem III: q1, q2, ... qnμ μμ°μλΌ νμ. q1 + q2 + ... + qn - n +1κ°μ 물체λ₯Ό nκ°μ μμμ λ£λλ€κ³ κ°μ νμ. κ·Έλ¬λ©΄ 첫λ²μ§Έ μμκ° μ΅μ q1κ°λ₯Ό κ°κ±°λ, λλ²μ§Έ μμκ° q2κ°λ₯Ό κ°κ±°λ, μΈλ²μ§Έ μμκ° q3κ°λ₯Ό κ°κ±°λ ~ nλ²μ§Έ μμκ° qnκ°λ₯Ό κ°κ² λλ€. μκ°ν΄λ³΄λ©΄ μλͺ ν μ리. q1 μμλ q1κ° μ΄μμ΄ μμ΄μΌ 쑰건μ μΆ©μ‘±νλ―λ‘, 쑰건μ μΆ©μ‘±νμ§ μμΌλ©΄μ μ΅λλ‘ λ£μ μ μλ 물체μ κ°μλ q1 - 1 / q2λ q2 -1 ~~ / qnμ qn - 1μ΄λ―λ‘, λ€ λνλ©΄ q1 + q2 + ... + qn - nμ΄ λλ€. μ΄ λ 1λ§ λ μΆκ°νλ©΄ μ΅μμ 물체 κ°μλ‘ μ μμ 쑰건 μ€ μ μ΄λ ν κ³³ μ΄μμ 쑰건μ λ§μ‘±νλ€!
application & questions
Questionsλ‘ nκ³Ό K+1μ μ΄μ©ν΄ μμΌλ‘ Kn+1μ ꡬνλ λ¬Έμ κ° λ§μ΄ λ±μ₯.
Q1. how many students must be in a class to guarantee that at least 2 student receive the same score on final exam, if the exam is graded on a scale from 0 to 100 points?
A1: nμ 100 / K+1μ 2λΌκ³ νλ€λ©΄ Kn+1μ 100*1 + 1λ‘ 101. μ¦ μ΅μ 101λͺ μ΄ μμ΄μΌ λκ°μ μ μλ₯Ό λ°λ νμμ΄ μ‘΄μ¬νλ€.
Q2. A bag contains 10 red marbles, 10 white marbles, and 10 blue marbles. What is the minimum no. of marbles you have to choose randomly from the bag to ensure that we get 4 marbles of same color?
A2: μκΉμ κ°μ n = 3 / ν κ³³μ μ΅μ 4κ° κ΅¬μ¬μ΄ λ€μ΄κ°μΌ νλ―λ‘ K + 1 = 4 → λ°λΌμ Kn+1 = 3*3 + 1 = 10. μ΅μ 10λ²μ 골λΌμΌ νλ€.
Q3. How many cards must be selected from a standard deck of 52 cards to guarantee that at least 3 cards of same suit chosen?
A3: μΉ΄λ μ’ λ₯μ κ°μ n = 4(heart, spade, diamonds, clubs - κ°κ° 13κ°μ© μ‘΄μ¬) / ν κ³³μ μ΅μ 3κ°μ μΉ΄λκ° λ€μ΄κ°μΌ νλ―λ‘ K + 1 = 3 → λ°λΌμ Kn+1=2*4+1=9λ‘ μ΅μ 9κ°μ μΉ΄λλ 골λΌμΌ νλ€.
Q4. How many cards must be selected from a standard deck of 52 cards to guarantee that at least 3 hearts are selected?
A4: νΉμ λΉλκΈ°μ§μμ μ΅μ 3κ°μ μΉ΄λλ₯Ό κ³ λ₯΄κΈ° μν λ¬Έμ . μ¦ ν κ³³λ§ μ΅μ 3κ°μ μΉ΄λκ° λ€μ΄κ°μΌ νκ³ λλ¨Έμ§λ μκ΄ x / μ΄ λ λλ¨Έμ§ λΉλκΈ°μ§μ λ€ λ€μ΄κ°λ κ²½μ°μ μ 13 + 13 + 13 μ΄ν, μΉ΄λ μ’ λ₯μ κ°μ n = 1 / ν΄λΉ λΉλκΈ°μ§μ μ΅μ 3κ°μ μΉ΄λ λ€μ΄κ°μΌ νλ―λ‘ K + 1 = 3 λ°λΌμ Kn+1=2*1+1λ‘ 3. μ¦ 39 + 3μΌλ‘ μ΅μ 42κ°μ μΉ΄λλ 골λΌμΌ νλ€. νΉμ λΉλκΈ°μ§μ΄ μλ λ€λ₯Έ μ§μ΄ λͺ¨λ λκΉμ§ 골λΌμ§κ³ λ λ€μ, νΉμ λΉλκΈ°μ§μ λν΄μλ§ λΉλκΈ°μ§μ μ리 곡μ μ μ©.
Q5. In a computer science department, a student club can be formed with either 10 members from first year or 8 members from second year or 6 from third year or 4 from final year. What is the minimum no. of students we have to choose randomly from department to ensure that a student club is formed?
A5: κ° λΉλκΈ°μ§λ³ λ€μ΄κ°λ μ΅μ λΉλκΈ°μ κ°μκ° λ€λ₯΄λ€. 10 / 8 / 6 / 4μ 쑰건μ μ΅μ ν κ³³μ λΉλκΈ°μ§λ§ λ§μΆλ©΄ λλ―λ‘, μ 곡μμ μν΄ 10 + 8 + 6 + 4 - 4(n) + 1λ‘ 25λͺ μ΄ μ λ΅.
Q6. A box contains 6 red, 8 green, 10 blue, 12 yellow and 15 white balls. What is the minimum no. of balls we have to choose randomly from the box to ensure that we get 9 balls of same color?
A6: μΌλ¨ redμ greenμ 9κ° λ―Έλ§μ΄λ―λ‘ μ μ© λΆκ°λ₯νκΈ°μ λ¨Όμ λ€ κ³ λ₯΄κ³ (6+8), μ΄ν 3κ°μ ballμμ λΉλκΈ°μ§μ μ리λ₯Ό λΆλΆμ μΌλ‘ μ μ©νλ©΄ λλ€. n = 3 / K + 1 = 9μ΄λ―λ‘ Kn+1=25. λ°λΌμ 25+14μΈ 39κ°μ 곡 κ³ λ₯΄λ©΄ λ!
Q7. (BOJ 20529 κ°μ₯ κ°κΉμ΄ μΈ μ¬λμ μ¬λ¦¬μ 거리)
Solution7: MBTI μ νμ 16κ° pigeonhole number. κ°μ MBTIκ° 3κ° μ΄μ μκ²λ νλ €λ©΄ n = 16 / K+1=3μ΄λ―λ‘ nK+1=33. μ¦ μ΅μ 33κ° μ΄μ μλ€λ©΄ μΈ κ°μ κ°μ MBTI λ±μ₯. μ¦ κ°μκ° 33κ° μ΄μμ΄λΌλ©΄ μΈ μ¬λμ μ¬λ¦¬μ μ΅μ 거리λ 무쑰건 0 νμ©μΌλ‘ μ½λ μ€νμκ° λ¨μΆ
'Computer Science > Algorithms' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
βMerge Sort (0) | 2024.04.06 |
---|---|
π‘ Two Pointers (1) | 2024.02.11 |
π Backtracking (0) | 2024.01.18 |
π§Ώ Dijkstra's (Shortest Path) Algorithm (1) | 2024.01.14 |
πLIS(Longest Increasing Subsequence) O(n^2)/O(nlogn) (0) | 2024.01.06 |
λκΈ