Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Wordleを遊んで情報科学を勉強する

meihei
February 18, 2022

 Wordleを遊んで情報科学を勉強する

PR TIMES 社内勉強会 @2022/02/18

- 頻度分析・単一置換暗号の話
- 情報エントロピーの話

meihei

February 18, 2022
Tweet

More Decks by meihei

Other Decks in Technology

Transcript

  1. ɹ135*.&4ࣾ಺ษڧձ
    8PSEMFΛ༡ΜͰ
    ৘ใՊֶΛษڧ͢Δ

    View full-size slide

  2. ΞδΣϯμ
    ࣗݾ঺հ
    8PSEMFͱ͸
    ස౓෼ੳ
    Τϯτϩϐʔ
    ·ͱΊ

    View full-size slide

  3. ࣗݾ঺հ
    ໊લɿߐؒ༸ฏ
    ৬ۀɿόοΫΤϯυΤϯδχΞ
    (JU)VCNFJIFJ
    5XJUUFSBQQF@T

    View full-size slide

  4. 8PSEMFͰ༡Μͩ͜ͱ͕͋Δਓ🙋

    View full-size slide

  5. 8PSEMFͱ͸
    ̑จࣈͷ୯ޠΛ౰ͯΔήʔϜ
    จࣈͱҐஔ͕౰͍ͨͬͯͨΒ🟩
    จࣈ͕౰͍ͨͬͯͨΒ🟨
    จࣈ͕౴͑ʹؚ·Εͳ͍৔߹͸⬜
    ௅ઓ͸̒ճ·Ͱ

    View full-size slide

  6. ྫ͑͹ɾɾɾ
    ਖ਼ղ͕803-%ͷ৔߹
    41&",ͱೖྗ͢Δͱ⬜⬜⬜⬜⬜͕ฦ͞ΕΔ
    108&3ͱೖྗ͢Δͱ⬜🟩🟨⬜🟨͕ฦ͞ΕΔ
    80345ͱೖྗ͢Δͱ🟩🟩🟩⬜⬜͕ฦ͞ΕΔ
    803-%ͱೖྗ͢Δͱ🟩🟩🟩🟩🟩͕ฦ͞ΕͯɺήʔϜʹউར

    View full-size slide

  7. ࠓ೔͸͜ͷήʔϜͰ༡ͼͳ͕Β
    ৘ใՊֶ $4
    ͷษڧΛ͠·͢

    View full-size slide

  8. ΞδΣϯμ
    ࣗݾ঺հ
    8PSEMFͱ͸
    ස౓෼ੳ
    Τϯτϩϐʔ
    ·ͱΊ
    ࠓ೔ֶͿࣄ

    View full-size slide

  9. ͬͦ͘͞༡ΜͰߦ͖·͠ΐ͏

    View full-size slide

  10. ॳखɺԿʹ͠·͔͢ʁ

    View full-size slide

  11. 🟩🟩🟩🟩🟩ˡউͪ
    ⬜🟩🟩🟩🟩ˡ̐จࣈ౰͍ͨͬͯΔɺઌ಄̍จࣈ͕ҧ͏
    ⬜🟨⬜🟨⬜ˡ̎จࣈ౰͍ͨͬͯΔ
    ⬜⬜⬜⬜⬜ˡશવΘ͔Βͳ͍ʁ

    View full-size slide

  12. 🟩ͱ🟨͕དྷΔͱخ͍͠

    View full-size slide

  13. ͳΔ΂͘ਖ਼ղͷ̑จࣈʹ
    ࢖ΘΕ͍ͯΔจࣈΛೖྗ͍ͨ͠

    View full-size slide

  14. ස౓෼ੳ

    View full-size slide

  15. ୯Ұஔ׵҉߸ͷ࿩Λ͠·͢
    ͍͖ͳΓͰ͕͢ʜ

    View full-size slide

  16. ୯Ұஔ׵҉߸
    ͭͷจࣈʹରͯ͠ɺৗʹಉ͡จࣈʹ
    ม׵͞ΕΔΑ͏ͳ҉߸
    γʔβʔ҉߸ɺ305ͳͲ͕༗໊
    γʔβʔ҉߸

    View full-size slide

  17. ྫʢ305ʣ
    ΞϧϑΝϕοτΛจࣈγϑτͤͨ͞୯Ұஔ׵҉߸
    ฏจ ҉߸จ

    View full-size slide

  18. ྫʢ305ʣ
    ΞϧϑΝϕοτΛจࣈγϑτͤͨ͞୯Ұஔ׵҉߸
    ҉߸จ
    🤔

    View full-size slide

  19. ͜Εɺ࣮͸؆୯ʹղ͚·͢

    View full-size slide

  20. ม׵લ͸zFz͕ଟ͘ɺม׵ޙ͸zSz͕ଟ͍
    ฏจ ҉߸จ

    View full-size slide

  21. ม׵લ͸zWz͕গͳ͘ɺม׵ޙ͸zJz͕গͳ͍
    ฏจ ҉߸จ

    View full-size slide

  22. จࣈͷग़ݱස౓͸ภΓ͕͋Γͦ͏

    View full-size slide

  23. จষதͷจࣈͷग़ݱස౓
    ฏจ ҉߸จ

    View full-size slide

  24. ୯Ұஔ׵҉߸͸͜͏΍ͬͯղ͘
    ฏจ Ұൠతͳจষͷจࣈͷग़ݱස౓ͱൺֱ
    ҉߸จ ҉߸จͷจࣈͷग़ݱස౓Λ෼ੳ

    View full-size slide

  25. 8PSEMF΋ಉ͡ΞϓϩʔνͰ
    ղ͚ͳ͍Ζ͏͔ʁ

    View full-size slide

  26. ස౓෼ੳGPS8PSEMF
    ొ࿥͞Ε͍ͯΔ̑จࣈͷӳ୯ޠ͸ ݸ͋Δ
    ͔͠͠ɺ࣮ࡍʹXPSEMFͰ౴͑ͱͯ͠࢖ΘΕΔ୯ޠ͸ ݸ
    ϫʔυϦετ͸(JU)VC͔ΒऔಘՄೳ
    ˠΑ͠ɺ෼ੳ͠Α͏
    ˞͜Ε͸ެࣜͷ΋ͷͰ͸ͳ͍Ͱ͢

    View full-size slide

  27. ୯ޠʹจࣈ͕̍จࣈҎ্ग़ݱ͢Δස౓
    ΍͸ΓF͕ڧ͍ʢ໿ͷ
    ୯ޠʹؚ·ΕΔʣ
    ࣍఺ͰB΍Sʢ໿ʣ
    J M O P T UͳͲ͸Α͘ग़
    ݱ͢Δʢ໿ʣ
    K R Y [͸΄ͱΜͲग़ݱ͠
    ͳ͍ʢ໿ʣ

    View full-size slide

  28. ͳΔ΂͘ਖ਼ղͷ̑จࣈʹ
    ࢖ΘΕ͍ͯΔจࣈΛೖྗ͍ͨ͠
    ໋୊

    View full-size slide

  29. ग़ݱස౓ͷߴ͍F B SΛඞͣ࢖͏
    Ճ͑ͯJ M O P T UΛ࢖ͬͯ୯ޠ
    Λ࡞Δ
    ΍Δ͜ͱ

    View full-size slide

  30. ୯ޠͷީิ
    w FBSO
    w FBSMT
    w FBSOT
    w FBSOU
    w FBSTU
    w MFBST
    w OFBST
    w TUFBS
    w UFBST

    View full-size slide

  31. ୯ޠͷީิ
    w FBSO
    w FBSMT
    w FBSOT
    w FBSOU
    w FBSTU
    w MFBST
    w OFBST
    w TUFBS
    w UFBST
    ˢࠓճ͸͜ΕΛ࠾༻

    View full-size slide

  32. ॳख5&"34ͰຒΊͯߦ͘

    View full-size slide

  33. ྑ͍ॳख͕ଧͯͨ🙌

    View full-size slide

  34. ࣍ͷखɺԿʹ͠·͔͢ʁ

    View full-size slide

  35. ·ͣ͸۪௚ʹߟ͑ͯΈΔ

    View full-size slide

  36. ࠓ෼͔͍ͬͯΔࣄ
    w "͸จࣈͱҐஔ͕߹͍ͬͯΔ
    w & 4͸Ͳ͔͜Ͱ࢖ΘΕ͍ͯΔ
    w 5 3͸࢖ΘΕͳ͍
    ɹɹˠ͜ͷ৘ใ͔Β৚݅Λ࡞Δ

    View full-size slide

  37. ਖ਼ղͰ͋Δ৚݅
    w ̏จࣈ໨͸"
    w ̎จࣈ໨Ҏ֎ʹ&ؚ͕·ΕΔ
    w ̑จࣈ໨Ҏ֎ʹ4ؚ͕·ΕΔ
    w 5 3͸จࣈʹؚ·Εͳ͍

    View full-size slide

  38. ୯ޠͷީิʢ̍̕௨Γʣ
    w BCBTF
    w DFBTF
    w DIBTF
    w MFBTF
    w MFBTI
    w QIBTF
    w TDBMF
    w TIBEF
    w TIBLF
    w TIBMF
    w TIBNF
    w TIBQF
    w TIBWF
    w TMBWF
    w TOBLF
    w TQBDF
    w TQBEF
    w TVBWF
    w VTBHF

    View full-size slide

  39. ස౓෼ੳΑΓJ M O Pؚ͕·ΕΔจࣈ
    w BCBTF
    w DFBTF
    w DIBTF
    w MFBTF
    w MFBTI
    w QIBTF
    w TDBMF
    w TIBEF
    w TIBLF
    w TIBMF
    w TIBNF
    w TIBQF
    w TIBWF
    w TMBWF
    w TOBLF
    w TQBDF
    w TQBEF
    w TVBWF
    w VTBHF

    View full-size slide

  40. ස౓෼ੳΑΓJ M O Pؚ͕·ΕΔจࣈ
    w BCBTF
    w DFBTF
    w DIBTF
    w MFBTF
    w MFBTI
    w QIBTF
    w TDBMF
    w TIBEF
    w TIBLF
    w TIBMF
    w TIBNF
    w TIBQF
    w TIBWF
    w TMBWF
    w TOBLF
    w TQBDF
    w TQBEF
    w TVBWF
    w VTBHF
    ˣࠓճ͸͜ΕΛ࠾༻

    View full-size slide

  41. ̎ख໨4$"-&ͰຒΊͯߦ͘

    View full-size slide

  42. 🟩͕૿͑ͨ🙌

    View full-size slide

  43. ߋʹ୯ޠͷީิΛߜΔʢ̕௨Γʣ
    w TIBEF
    w TIBLF
    w TIBNF
    w TIBQF
    w TIBWF
    w TOBLF
    w TQBDF
    w TQBEF
    w TVBWF

    View full-size slide

  44. ߋʹ୯ޠͷީิΛߜΔʢ̕௨Γʣ
    w TIBEF
    w TIBLF
    w TIBNF
    w TIBQF
    w TIBWF
    w TOBLF
    w TQBDF
    w TQBEF
    w TVBWF
    ˣࠓճ͸͜ΕΛ࠾༻

    View full-size slide

  45. ̏ख໨4)"%&ͰຒΊͯߦ͘

    View full-size slide

  46. 🟩͕૿͑ͨ🙌

    View full-size slide

  47. ߋʹ୯ޠͷީิΛߜΔʢ̐௨Γʣ
    w TIBLF
    w TIBNF
    w TIBQF
    w TIBWF
    ˡ࣍͸͜ΕΛ࠾༻

    View full-size slide

  48. ̐ख໨4)".&ͰຒΊͯߦ͘

    View full-size slide

  49. ͸ͣΕͨ😥

    View full-size slide

  50. ߋʹ୯ޠͷީิΛߜΔʢ̏௨Γʣ
    w TIBLF
    w TIBQF
    w TIBWF ˡ࣍͸͜ΕΛ࠾༻

    View full-size slide

  51. ̑ख໨4)"7&ͰຒΊͯߦ͘

    View full-size slide

  52. ͸ͣΕͨ😰

    View full-size slide

  53. ߋʹ୯ޠͷީิΛߜΔʢ̎௨Γʣ
    w TIBLF
    w TIBQF ˡ࠷ޙ͸͜ΕΛ࠾༻

    View full-size slide

  54. ϥετ4)"1&ͰຒΊͯߦ͘

    View full-size slide

  55. ͸ͣΕͨ😱

    View full-size slide

  56. ৼΓฦͬͯΈΔ
    ̍ख໨͸ ௨Γ
    ̎ख໨͸௨Γ
    ̏ख໨͸௨Γ
    ̐ख໨͸௨Γ
    ̑ख໨͸௨Γ
    ̒ख໨͸௨Γ

    View full-size slide

  57. ৼΓฦͬͯΈΔ
    ̍ख໨͸ ௨Γ
    ̎ख໨͸௨Γ
    ̏ख໨͸௨Γ
    ̐ख໨͸௨Γ
    ̑ख໨͸௨Γ
    ̒ख໨͸௨Γ
    ·Ͱ࡟ݮɺྑ͍ख

    View full-size slide

  58. ৼΓฦͬͯΈΔ
    ̍ख໨͸ ௨Γ
    ̎ख໨͸௨Γ
    ̏ख໨͸௨Γ
    ̐ख໨͸௨Γ
    ̑ख໨͸௨Γ
    ̒ख໨͸௨Γ
    ·Ͱ࡟ݮɺඍົ

    View full-size slide

  59. ৼΓฦͬͯΈΔ
    ̍ख໨͸ ௨Γ
    ̎ख໨͸௨Γ
    ̏ख໨͸௨Γ
    ̐ख໨͸௨Γ
    ̑ख໨͸௨Γ
    ̒ख໨͸௨Γ
    ·Ͱ࡟ݮɺඍົ

    View full-size slide

  60. ৼΓฦͬͯΈΔ
    ̍ख໨͸ ௨Γ
    ̎ख໨͸௨Γ
    ̏ख໨͸௨Γ
    ̐ख໨͸௨Γ
    ̑ख໨͸௨Γ
    ̒ख໨͸௨Γ
    ͻͲ͍
    ͻͲ͍

    View full-size slide

  61. ॳखͰ෼͔ͬͨࣄ
    w "͸จࣈͱҐஔ͕߹͍ͬͯΔ
    w & 4͸Ͳ͔͜Ͱ࢖ΘΕ͍ͯΔ
    w 5 3͸࢖ΘΕͳ͍

    View full-size slide

  62. ॳखͰ͸ଟ͘ͷ৘ใ͕ಘΒΕͨ

    View full-size slide

  63. ௨Γ͔Β௨Γ·Ͱ
    ࡟ݮͨ͠

    View full-size slide

  64. ̐ख໨Ͱ෼͔ͬͨࣄ
    w .͸࢖ΘΕͳ͍

    View full-size slide

  65. ̐ख໨͸গ͠ͷࣄ͔͠
    ෼͔Βͳ͔ͬͨ

    View full-size slide

  66. ௨Γ͔Β௨Γʹͳ͚ͬͨͩ

    View full-size slide

  67. ͭ·ΓɺಘΒΕΔ৘ใ͕
    ଟ͍΄͏͕ྑ͍ख

    View full-size slide

  68. ಘΒΕΔ৘ใͷྔΛ͸͔Δࣄ͸
    ग़དྷͳ͍ͩΖ͏͔ʁ

    View full-size slide

  69. Τϯτϩϐʔ

    View full-size slide

  70. ৘ใྔ
    ͦͷࣄ৅͕ͲΕ͚ͩ৘ใΛग़͔ͨ͠Λ͸͔Δई౓
    ࣄ৅͕ى͜Δ֬཰ ͱ͢Δͱ
    ৘ใྔ
    p
    I(p) = − log p

    View full-size slide

  71. ؆୯ʹݴ͏ͱɺ௝͍͠ࣄ͸
    ಘΒΕΔ৘ใ͕ଟ͍

    View full-size slide

  72. ৘ใྔͷྫ
    छྨͷΞϧϑΝϕοτ͔Β̍ͭΛ౰ͯΔ
    *
    −log2
    1
    26

    View full-size slide

  73. ৘ใྔͷྫ
    छྨͷΞϧϑΝϕοτ͔Β̍ͭΛ౰ͯΔ
    *
    ɹˠ෼͔Γ͖͍ͬͯΔࣄ৅
    ɹɹˠಘΒΕΔ৘ใྔ͸̌
    −log2
    1
    1

    View full-size slide

  74. ৘ใྔΛ࢖͑͹8PSEMF
    ΋ղ͚ͦ͏ͩʂ

    View full-size slide

  75. Ͳ͏΍ͬͯ8PSEMFʹԠ༻͢Δ͔ʁ

    View full-size slide

  76. ΤϯτϩϐʔΛ࠷େԽ͢Δ

    View full-size slide

  77. Τϯτϩϐʔʢฏۉ৘ใྔʣ
    ͷ͢΂ͯͷࣄ৅ʹରͯ͠৘ใྔͷฏۉΛͱͬͨ΋ͷ
    ฏۉ৘ใྔ
    ɹɹˠ͍ͭ͜Λ࠷େԽ͢Ε͹Αͦ͞͏
    X
    H(X) = − ∑
    i
    pi
    log pi

    View full-size slide

  78. ࣮ࡍʹ8PSEMFͰΤϯτϩϐʔ
    Λ࢖ͬͯΈΔ

    View full-size slide

  79. ̐ख໨ͷީิ
    w TIBLF
    w TIBNF
    w TIBQF
    w TIBWF

    View full-size slide

  80. 4)".&ΛબΜͩ৔߹
    w TIBLFɹˠɹ🟩🟩🟩⬜🟩
    w TIBNFɹˠɹ🟩🟩🟩🟩🟩
    w TIBQFɹˠɹ🟩🟩🟩⬜🟩
    w TIBWFɹˠɹ🟩🟩🟩⬜🟩

    View full-size slide

  81. 4)".&ΛબΜͩ৔߹
    w TIBLFɹˠɹ🟩🟩🟩⬜🟩
    w TIBNFɹˠɹ🟩🟩🟩🟩🟩
    w TIBQFɹˠɹ🟩🟩🟩⬜🟩
    w TIBWFɹˠɹ🟩🟩🟩⬜🟩
    🟩🟩🟩⬜🟩

    🟩🟩🟩🟩🟩

    p
    3
    4
    p
    1
    4

    View full-size slide

  82. 4)".&ΛબΜͩ৔߹
    w TIBLFɹˠɹ🟩🟩🟩⬜🟩
    w TIBNFɹˠɹ🟩🟩🟩🟩🟩
    w TIBQFɹˠɹ🟩🟩🟩⬜🟩
    w TIBWFɹˠɹ🟩🟩🟩⬜🟩
    🟩🟩🟩⬜🟩

    🟩🟩🟩🟩🟩

    p
    3
    4
    p
    1
    4
    4)".&

    H −
    3
    4
    log2
    3
    4

    1
    4
    log2
    1
    4
    ≒ 0.81

    View full-size slide

  83. Τϯτϩϐʔ͕େ͖͍୯ޠ
    Ͱ͸Ͳ͏ͳΔͷ͔

    View full-size slide

  84. 4,*.1ΛબΜͩ৔߹
    w TIBLFɹˠɹ🟩🟨⬜⬜⬜
    w TIBNFɹˠɹ🟩⬜⬜⬜⬜
    w TIBQFɹˠɹ🟩⬜⬜⬜🟨
    w TIBWFɹˠɹ🟩⬜⬜⬜⬜
    ˞༧Ίܭࢉͯ͠ɺ͜ͷ୯ޠΛબΜͰ͍·͢

    View full-size slide

  85. 4,*.1ΛબΜͩ৔߹
    w TIBLFɹˠɹ🟩🟨⬜⬜⬜
    w TIBNFɹˠɹ🟩⬜⬜⬜⬜
    w TIBQFɹˠɹ🟩⬜⬜⬜🟨
    w TIBWFɹˠɹ🟩⬜⬜⬜⬜
    🟩⬜⬜⬜⬜

    🟩🟨⬜⬜⬜

    🟩⬜⬜⬜🟨

    p
    2
    4
    p
    1
    4
    p
    1
    4

    View full-size slide

  86. 4,*.1ΛબΜͩ৔߹
    w TIBLFɹˠɹ🟩🟨⬜⬜⬜
    w TIBNFɹˠɹ🟩⬜⬜⬜⬜
    w TIBQFɹˠɹ🟩⬜⬜⬜🟨
    w TIBWFɹˠɹ🟩⬜⬜⬜⬜
    🟩⬜⬜⬜⬜

    🟩🟨⬜⬜⬜

    🟩⬜⬜⬜🟨

    p
    2
    4
    p
    1
    4
    p
    1
    4
    4,*.1

    H −
    2
    4
    log2
    2
    4

    1
    4
    log2
    1
    4

    1
    4
    log2
    1
    4
    ≒ 1.5

    View full-size slide

  87. 4)".&ΑΓ΋4,*.1ͷํ͕
    ಘΒΕΔ৘ใ͕ଟ͍

    View full-size slide

  88. 4,*.1ͰຒΊͯߦ͘

    View full-size slide

  89. ͸ͣΕͨ😥

    View full-size slide

  90. Ͱ΋৘ใྔ͸େ͖͍😄

    View full-size slide

  91. ̑ख໨ͷ୯ޠͷީิ͸ʜ
    w TIBLF
    ɹˠɹ̍௨ΓʹߜΒΕͨʂ

    View full-size slide

  92. Τϯτϩϐʔ͛͢ʔ

    View full-size slide

  93. 🟩ͱ🟨͸ݮͬͯྑ͍ͷ͔ʁ
    🤔

    View full-size slide

  94. 🟩ͱ🟨͕དྷΔͱخ͍͠

    View full-size slide

  95. 🟩ͱ🟨͕དྷΔͱخ͍͠
    ͜Ε͸ؒҧ͑

    View full-size slide

  96. ਖ਼͘͠͸
    Τϯτϩϐʔ͕࠷େԽ͞ΕΔ
    ͱخ͍͠

    View full-size slide

  97. ͪͳΈʹ
    Τϯτϩϐʔͷ࠷େԽ͸ॳखͰ΋దԠग़དྷΔ
    ɹˠɹιϧόʔ࡞ΔͳΒස౓෼ੳΑΓΤϯτϩϐʔ
    4"-&5͕࠷ڧͱ͍͏ͷ͕௨આ

    View full-size slide

  98. ࠓ೔ֶΜͩ͜ͱ
    ୯Ұஔ׵҉߸͸ස౓෼ੳͰղ͚Δ
    ࣗવݴޠͷจࣈʹ͸ग़ݱස౓ʹภΓ͕͋Δ
    ৘ใྔͱ͸ͦͷࣄ৅͕ͲΕ͚ͩ৘ใΛग़͔ͨ͠Λ͸͔Δई౓
    ৘ใྔ
    Τϯτϩϐʔͱ͸͢΂ͯͷࣄ৅ͷ৘ใྔͷฏۉ
    ฏۉ৘ใྔ
    I(p) = − log p
    H(X) = − ∑
    i
    pi
    log pi

    View full-size slide

  99. ࢀߟ
    w IUUQTYDMPDIFIBUFCMPKQFOUSZ
    w IUUQTTPOPSPVTDIPDPMBUFDPNOPUFTJOEFYQIQ
    UJUMF5IF@CFTU@TUSBUFHJFT@GPS@8PSEMF
    w IUUQTHJUIVCDPNBMFYXPSEMF
    w IUUQTRJJUBDPNNBTBLB@QSPHSBNNJOHJUFNT
    BGFBBFECG
    w IUUQTGSFTINBOEFWXPSEMFMFBEFSCPBSE

    View full-size slide