From e310a342eff7f34c9e893a742484123dd7ccd5a2 Mon Sep 17 00:00:00 2001 From: Lily Date: Tue, 16 Jan 2024 15:59:39 +0800 Subject: [PATCH] Deployed 330b7bc with MkDocs version: 1.5.3 --- 404.html | 22 -- AI/net/index.html | 22 -- AI/pca/index.html | 22 -- CV/ML-4360/BS/lec2/index.html | 22 -- CV/ML-4360/PGM/lec5/index.html | 22 -- CV/ML-4360/SFM/lec3/index.html | 22 -- CV/ML-4360/SR/lec4/index.html | 22 -- DIP/Basic/DIP/index.html | 22 -- DIP/DL/DL/index.html | 22 -- DIP/Fourier/Fourier/index.html | 22 -- DIP/chap2/chap2/index.html | 22 -- DIP/chap3/chap3/index.html | 22 -- DIP/feature/feature/index.html | 22 -- DIP/filter/filter/index.html | 22 -- DIP/morph/morph/index.html | 22 -- GP/AMAS/AMAS/index.html | 22 -- GP/HA/HA/index.html | 22 -- GP/Polar/Polarization/index.html | 22 -- GP/QW/QW/index.html | 22 -- GP/com/com/index.html | 22 -- GP/current/current/index.html | 22 -- GP/lec1-3/lec1/index.html | 24 +- GP/light/df/diffraction/index.html | 22 -- GP/light/inteference/index.html | 22 -- GP/light/light/index.html | 22 -- GP/light/quantum light/quantum/index.html | 22 -- GP/mag/mag/index.html | 22 -- GP/matter wave/matter/index.html | 22 -- GP/sch/sch/index.html | 22 -- NA/Chap1/Chap1/index.html | 22 -- NA/Chap2/Chap2/index.html | 22 -- NA/Chap3/Chap3/index.html | 22 -- NA/Chap4/Chap4/index.html | 22 -- NA/Chap5/Chap5/index.html | 22 -- NA/Chap6/1/index.html | 26 +- NA/Chap6/Chap6/index.html | 22 -- NA/Chap7/Chap7/index.html | 24 +- NA/Chap8/Chap8/index.html | 62 +---- PT/PT/index.html | 22 -- .../index.html" | 22 -- .../index.html" | 22 -- .../\344\270\255\346\226\255/index.html" | 22 -- .../\345\207\275\346\225\260/index.html" | 22 -- .../index.html" | 22 -- .../\345\240\206\346\240\210/index.html" | 22 -- .../index.html" | 22 -- .../index.html" | 22 -- .../\347\253\257\345\217\243/index.html" | 22 -- index.html | 22 -- invisible/index.html | 22 -- note/basicII/index.html | 22 -- note/hash/index.html | 22 -- note/list/index.html | 22 -- note/sort/index.html | 259 +++++++++--------- .../index.html" | 22 -- .../index.html" | 22 -- search/search_index.json | 2 +- sitemap.xml.gz | Bin 882 -> 882 bytes "\345\244\247\344\276\240/index.html" | 22 -- .../Chap1/chap1/index.html" | 22 -- .../Chap2/chap2/index.html" | 22 -- .../Chap3/chap3/index.html" | 22 -- .../Chap4/chap4/index.html" | 22 -- .../index.html" | 22 -- .../MB/MB/index.html" | 22 -- .../Register/register/index.html" | 22 -- .../index.html" | 22 -- 67 files changed, 143 insertions(+), 1574 deletions(-) diff --git a/404.html b/404.html index 83bc71e7..5eba012a 100644 --- a/404.html +++ b/404.html @@ -1378,8 +1378,6 @@ - - @@ -1553,26 +1551,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/AI/net/index.html b/AI/net/index.html index 4a4da38f..bc4a8838 100644 --- a/AI/net/index.html +++ b/AI/net/index.html @@ -1512,8 +1512,6 @@ - - @@ -1687,26 +1685,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/AI/pca/index.html b/AI/pca/index.html index ef4d838f..34a8957a 100644 --- a/AI/pca/index.html +++ b/AI/pca/index.html @@ -1512,8 +1512,6 @@ - - @@ -1687,26 +1685,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/CV/ML-4360/BS/lec2/index.html b/CV/ML-4360/BS/lec2/index.html index ef991fc3..53c205e1 100644 --- a/CV/ML-4360/BS/lec2/index.html +++ b/CV/ML-4360/BS/lec2/index.html @@ -1393,8 +1393,6 @@ - - @@ -1568,26 +1566,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/CV/ML-4360/PGM/lec5/index.html b/CV/ML-4360/PGM/lec5/index.html index fcf6d180..a08806e3 100644 --- a/CV/ML-4360/PGM/lec5/index.html +++ b/CV/ML-4360/PGM/lec5/index.html @@ -1393,8 +1393,6 @@ - - @@ -1568,26 +1566,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/CV/ML-4360/SFM/lec3/index.html b/CV/ML-4360/SFM/lec3/index.html index 7aa9c9da..3558c2f1 100644 --- a/CV/ML-4360/SFM/lec3/index.html +++ b/CV/ML-4360/SFM/lec3/index.html @@ -1393,8 +1393,6 @@ - - @@ -1568,26 +1566,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/CV/ML-4360/SR/lec4/index.html b/CV/ML-4360/SR/lec4/index.html index 25725e40..783581b2 100644 --- a/CV/ML-4360/SR/lec4/index.html +++ b/CV/ML-4360/SR/lec4/index.html @@ -1393,8 +1393,6 @@ - - @@ -1568,26 +1566,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/DIP/Basic/DIP/index.html b/DIP/Basic/DIP/index.html index 7a51d879..c6580c08 100644 --- a/DIP/Basic/DIP/index.html +++ b/DIP/Basic/DIP/index.html @@ -1691,8 +1691,6 @@ - - @@ -1866,26 +1864,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/DIP/DL/DL/index.html b/DIP/DL/DL/index.html index 57037dca..05397517 100644 --- a/DIP/DL/DL/index.html +++ b/DIP/DL/DL/index.html @@ -1488,8 +1488,6 @@ - - @@ -1663,26 +1661,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/DIP/Fourier/Fourier/index.html b/DIP/Fourier/Fourier/index.html index d01a3e92..78b958bb 100644 --- a/DIP/Fourier/Fourier/index.html +++ b/DIP/Fourier/Fourier/index.html @@ -1514,8 +1514,6 @@ - - @@ -1689,26 +1687,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/DIP/chap2/chap2/index.html b/DIP/chap2/chap2/index.html index 8beef6ec..f524297f 100644 --- a/DIP/chap2/chap2/index.html +++ b/DIP/chap2/chap2/index.html @@ -1538,8 +1538,6 @@ - - @@ -1713,26 +1711,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/DIP/chap3/chap3/index.html b/DIP/chap3/chap3/index.html index 0316bacc..d069a1e8 100644 --- a/DIP/chap3/chap3/index.html +++ b/DIP/chap3/chap3/index.html @@ -1622,8 +1622,6 @@ - - @@ -1797,26 +1795,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/DIP/feature/feature/index.html b/DIP/feature/feature/index.html index cb811239..2bd189c7 100644 --- a/DIP/feature/feature/index.html +++ b/DIP/feature/feature/index.html @@ -1660,8 +1660,6 @@ - - @@ -1835,26 +1833,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/DIP/filter/filter/index.html b/DIP/filter/filter/index.html index ea0338cd..5e07c09e 100644 --- a/DIP/filter/filter/index.html +++ b/DIP/filter/filter/index.html @@ -1688,8 +1688,6 @@ - - @@ -1863,26 +1861,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/DIP/morph/morph/index.html b/DIP/morph/morph/index.html index 58a6cd6c..22449ce9 100644 --- a/DIP/morph/morph/index.html +++ b/DIP/morph/morph/index.html @@ -1499,8 +1499,6 @@ - - @@ -1674,26 +1672,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/GP/AMAS/AMAS/index.html b/GP/AMAS/AMAS/index.html index 16a22b2f..6e28f8f9 100644 --- a/GP/AMAS/AMAS/index.html +++ b/GP/AMAS/AMAS/index.html @@ -1395,8 +1395,6 @@ - - @@ -1570,26 +1568,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/GP/HA/HA/index.html b/GP/HA/HA/index.html index 844652e3..ba033a43 100644 --- a/GP/HA/HA/index.html +++ b/GP/HA/HA/index.html @@ -1395,8 +1395,6 @@ - - @@ -1570,26 +1568,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/GP/Polar/Polarization/index.html b/GP/Polar/Polarization/index.html index a940ea3b..ca29506d 100644 --- a/GP/Polar/Polarization/index.html +++ b/GP/Polar/Polarization/index.html @@ -1395,8 +1395,6 @@ - - @@ -1570,26 +1568,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/GP/QW/QW/index.html b/GP/QW/QW/index.html index 4273e2ef..5a62c5ec 100644 --- a/GP/QW/QW/index.html +++ b/GP/QW/QW/index.html @@ -1395,8 +1395,6 @@ - - @@ -1570,26 +1568,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/GP/com/com/index.html b/GP/com/com/index.html index 1df69440..0678a71d 100644 --- a/GP/com/com/index.html +++ b/GP/com/com/index.html @@ -1395,8 +1395,6 @@ - - @@ -1570,26 +1568,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/GP/current/current/index.html b/GP/current/current/index.html index fd576cb5..d7efb055 100644 --- a/GP/current/current/index.html +++ b/GP/current/current/index.html @@ -1395,8 +1395,6 @@ - - @@ -1570,26 +1568,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/GP/lec1-3/lec1/index.html b/GP/lec1-3/lec1/index.html index 41947007..9e2d7d25 100644 --- a/GP/lec1-3/lec1/index.html +++ b/GP/lec1-3/lec1/index.html @@ -13,7 +13,7 @@ - + @@ -1395,8 +1395,6 @@ - - @@ -1570,26 +1568,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/GP/light/df/diffraction/index.html b/GP/light/df/diffraction/index.html index 145047cb..4ba21764 100644 --- a/GP/light/df/diffraction/index.html +++ b/GP/light/df/diffraction/index.html @@ -1395,8 +1395,6 @@ - - @@ -1570,26 +1568,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/GP/light/inteference/index.html b/GP/light/inteference/index.html index 4d5cbe68..c93f2b15 100644 --- a/GP/light/inteference/index.html +++ b/GP/light/inteference/index.html @@ -1395,8 +1395,6 @@ - - @@ -1570,26 +1568,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/GP/light/light/index.html b/GP/light/light/index.html index 803a38e3..aab09c6b 100644 --- a/GP/light/light/index.html +++ b/GP/light/light/index.html @@ -1395,8 +1395,6 @@ - - @@ -1570,26 +1568,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/GP/light/quantum light/quantum/index.html b/GP/light/quantum light/quantum/index.html index 223cc567..2aa841b3 100644 --- a/GP/light/quantum light/quantum/index.html +++ b/GP/light/quantum light/quantum/index.html @@ -1395,8 +1395,6 @@ - - @@ -1570,26 +1568,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/GP/mag/mag/index.html b/GP/mag/mag/index.html index 82d01e7f..a3407bc8 100644 --- a/GP/mag/mag/index.html +++ b/GP/mag/mag/index.html @@ -1395,8 +1395,6 @@ - - @@ -1570,26 +1568,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/GP/matter wave/matter/index.html b/GP/matter wave/matter/index.html index 32b7e081..766bf370 100644 --- a/GP/matter wave/matter/index.html +++ b/GP/matter wave/matter/index.html @@ -1395,8 +1395,6 @@ - - @@ -1570,26 +1568,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/GP/sch/sch/index.html b/GP/sch/sch/index.html index b9d364f1..cd7ef820 100644 --- a/GP/sch/sch/index.html +++ b/GP/sch/sch/index.html @@ -1395,8 +1395,6 @@ - - @@ -1570,26 +1568,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/NA/Chap1/Chap1/index.html b/NA/Chap1/Chap1/index.html index ecfa2311..51cf8877 100644 --- a/NA/Chap1/Chap1/index.html +++ b/NA/Chap1/Chap1/index.html @@ -1397,8 +1397,6 @@ - - @@ -1626,26 +1624,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/NA/Chap2/Chap2/index.html b/NA/Chap2/Chap2/index.html index 577903bf..11ca9e2d 100644 --- a/NA/Chap2/Chap2/index.html +++ b/NA/Chap2/Chap2/index.html @@ -1397,8 +1397,6 @@ - - @@ -1733,26 +1731,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/NA/Chap3/Chap3/index.html b/NA/Chap3/Chap3/index.html index 437ead5d..aeda0505 100644 --- a/NA/Chap3/Chap3/index.html +++ b/NA/Chap3/Chap3/index.html @@ -1397,8 +1397,6 @@ - - @@ -1740,26 +1738,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/NA/Chap4/Chap4/index.html b/NA/Chap4/Chap4/index.html index a07eb8d8..77ff4444 100644 --- a/NA/Chap4/Chap4/index.html +++ b/NA/Chap4/Chap4/index.html @@ -1397,8 +1397,6 @@ - - @@ -1681,26 +1679,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/NA/Chap5/Chap5/index.html b/NA/Chap5/Chap5/index.html index 68302c92..02d817d8 100644 --- a/NA/Chap5/Chap5/index.html +++ b/NA/Chap5/Chap5/index.html @@ -1397,8 +1397,6 @@ - - @@ -1792,26 +1790,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/NA/Chap6/1/index.html b/NA/Chap6/1/index.html index 7424446c..51f0dcd0 100644 --- a/NA/Chap6/1/index.html +++ b/NA/Chap6/1/index.html @@ -1385,8 +1385,6 @@ - - @@ -1560,26 +1558,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - @@ -2698,11 +2676,11 @@
    对被害人的支持和保护机制 最后更新: - 2024年1月16日 10:20:29 + 2024年1月16日 15:59:37
    创建日期: - 2024年1月16日 10:20:29 + 2024年1月16日 15:59:37 diff --git a/NA/Chap6/Chap6/index.html b/NA/Chap6/Chap6/index.html index 50b348a6..ee91aa8e 100644 --- a/NA/Chap6/Chap6/index.html +++ b/NA/Chap6/Chap6/index.html @@ -1397,8 +1397,6 @@ - - @@ -1653,26 +1651,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/NA/Chap7/Chap7/index.html b/NA/Chap7/Chap7/index.html index 8fb43a31..0a173fdd 100644 --- a/NA/Chap7/Chap7/index.html +++ b/NA/Chap7/Chap7/index.html @@ -16,7 +16,7 @@ - + @@ -1397,8 +1397,6 @@ - - @@ -1635,26 +1633,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/NA/Chap8/Chap8/index.html b/NA/Chap8/Chap8/index.html index 43a73914..14fd466b 100644 --- a/NA/Chap8/Chap8/index.html +++ b/NA/Chap8/Chap8/index.html @@ -13,10 +13,6 @@ - - - - @@ -24,7 +20,7 @@ - Chapter 8 - Lily's Notebook + Chap8 - Lily's Notebook @@ -123,7 +119,7 @@
    - Chapter 8 + Chap8
    @@ -233,20 +229,16 @@ - - - - -
  • +
  • @@ -452,8 +444,6 @@ - - @@ -477,12 +467,12 @@ -
  • +
  • - + - diff --git "a/assembly/\344\270\255\346\226\255/index.html" "b/assembly/\344\270\255\346\226\255/index.html" index 1ee2a1d8..c0192926 100644 --- "a/assembly/\344\270\255\346\226\255/index.html" +++ "b/assembly/\344\270\255\346\226\255/index.html" @@ -1447,8 +1447,6 @@ - - @@ -1622,26 +1620,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git "a/assembly/\345\207\275\346\225\260/index.html" "b/assembly/\345\207\275\346\225\260/index.html" index fff5c12e..d1e6abe2 100644 --- "a/assembly/\345\207\275\346\225\260/index.html" +++ "b/assembly/\345\207\275\346\225\260/index.html" @@ -1528,8 +1528,6 @@ - - @@ -1703,26 +1701,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git "a/assembly/\345\237\272\347\241\200\346\214\207\344\273\244/index.html" "b/assembly/\345\237\272\347\241\200\346\214\207\344\273\244/index.html" index 80f84b55..e1118334 100644 --- "a/assembly/\345\237\272\347\241\200\346\214\207\344\273\244/index.html" +++ "b/assembly/\345\237\272\347\241\200\346\214\207\344\273\244/index.html" @@ -1529,8 +1529,6 @@ - - @@ -1704,26 +1702,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git "a/assembly/\345\240\206\346\240\210/index.html" "b/assembly/\345\240\206\346\240\210/index.html" index 9c2c6344..6d74ecb8 100644 --- "a/assembly/\345\240\206\346\240\210/index.html" +++ "b/assembly/\345\240\206\346\240\210/index.html" @@ -1460,8 +1460,6 @@ - - @@ -1635,26 +1633,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git "a/assembly/\345\257\204\345\255\230\345\231\250/index.html" "b/assembly/\345\257\204\345\255\230\345\231\250/index.html" index 0abeccc3..e92c7b47 100644 --- "a/assembly/\345\257\204\345\255\230\345\231\250/index.html" +++ "b/assembly/\345\257\204\345\255\230\345\231\250/index.html" @@ -1473,8 +1473,6 @@ - - @@ -1648,26 +1646,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git "a/assembly/\346\230\276\345\215\241\350\276\223\345\207\272/index.html" "b/assembly/\346\230\276\345\215\241\350\276\223\345\207\272/index.html" index 487f722e..4a972771 100644 --- "a/assembly/\346\230\276\345\215\241\350\276\223\345\207\272/index.html" +++ "b/assembly/\346\230\276\345\215\241\350\276\223\345\207\272/index.html" @@ -1453,8 +1453,6 @@ - - @@ -1628,26 +1626,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git "a/assembly/\347\253\257\345\217\243/index.html" "b/assembly/\347\253\257\345\217\243/index.html" index 7e57cf63..ccf5c552 100644 --- "a/assembly/\347\253\257\345\217\243/index.html" +++ "b/assembly/\347\253\257\345\217\243/index.html" @@ -1460,8 +1460,6 @@ - - @@ -1635,26 +1633,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/index.html b/index.html index 3641f18f..35fb9b06 100644 --- a/index.html +++ b/index.html @@ -1391,8 +1391,6 @@ - - @@ -1566,26 +1564,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/invisible/index.html b/invisible/index.html index e90400c3..bdc161a3 100644 --- a/invisible/index.html +++ b/invisible/index.html @@ -1388,8 +1388,6 @@ - - @@ -1563,26 +1561,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/note/basicII/index.html b/note/basicII/index.html index 26acfd67..d104ad18 100644 --- a/note/basicII/index.html +++ b/note/basicII/index.html @@ -1699,8 +1699,6 @@ - - @@ -1874,26 +1872,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/note/hash/index.html b/note/hash/index.html index 54efd177..e1f67f01 100644 --- a/note/hash/index.html +++ b/note/hash/index.html @@ -1533,8 +1533,6 @@ - - @@ -1708,26 +1706,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/note/list/index.html b/note/list/index.html index 88515941..7a2c8fa1 100644 --- a/note/list/index.html +++ b/note/list/index.html @@ -1385,8 +1385,6 @@ - - @@ -1560,26 +1558,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/note/sort/index.html b/note/sort/index.html index 410d68a3..0077286b 100644 --- a/note/sort/index.html +++ b/note/sort/index.html @@ -845,8 +845,8 @@ + + +
  • + + Stableness + +
  • @@ -1636,8 +1643,6 @@ - - @@ -1811,26 +1816,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - @@ -3036,8 +3021,8 @@ + + +
  • + + Stableness + +
  • @@ -3235,27 +3227,24 @@

    Algorithm 2: int parent,son; for(parent=p;parent*2<=H->Size;parent=son){ son=parent*2; - if(son<H->Size&&H->Elements[son]>H->Elements[son+1]){ + if(son<H->Size&&H->Elements[son]<H->Elements[son+1]){ son++; } - if(temp<=H->Elements[son]) - break; - else - H->Elements[parent]=H->Elements[son]; - } - H->Elements[parent]=temp; -} + if(temp>=H->Elements[son]){break;} + else{H->Elements[parent]=H->Elements[son];} + } + H->Elements[parent]=temp; +}

    void Heapsort( ElementType A[ ], int N ) 
     {   int i; 
    -    for ( i = N / 2; i >= 0; i - - ) /* BuildHeap */ 
    -        PercDown( A, i, N ); 
    -    for ( i = N - 1; i > 0; i - - ) { 
    -        Swap( &A[ 0 ], &A[ i ] ); /* DeleteMax */ 
    -        PercDown( A, 0, i ); 
    -    } 
    -}
    +    for ( i = N / 2; i >= 0; i - - ) /* BuildHeap */ {PercDown( A, i, N ); }
    +    for ( i = N - 1; i > 0; i - - ) { 
    +        Swap( &A[ 0 ], &A[ i ] ); /* DeleteMax */ 
    +        PercDown( A, 0, i ); 
    +    } 
    +}
     
    The average number of comparisons used to heapsort a random permutation of N distinct items is \(2N log N - O( N log log N )\).

    Although Heapsort gives the best average time, in practice it is slower than a version of Shellsort that uses Sedgewick's increment sequence.

    @@ -3263,76 +3252,75 @@

    Mergesort
    void Mergesort( ElementType A[ ], int N );
     void MSort( ElementType A[ ], ElementType TmpArray[ ],int Left,int Right);
     void Merge( ElementType A[ ], ElementType TmpArray[ ],int Lpos,int Rpos, int RightEnd);
    -void Mergesort( ElementType A[ ], int N ) {
    -    ElementType  *TmpArray;  /* need O(N) extra space */
    -    TmpArray = malloc( N * sizeof( ElementType ) ); 
    -    if ( TmpArray != NULL ) { 
    -            MSort( A, TmpArray, 0, N - 1 ); 
    -            free( TmpArray ); 
    -    } 
    -    else  FatalError( "No space for tmp array!!!" ); 
    -}
    -void MSort( ElementType A[ ], ElementType TmpArray[ ],int Left, int Right){
    -    int  Center; 
    -    if ( Left < Right ) {  /* if there are elements to be sorted */
    -        Center = ( Left + Right ) / 2; 
    -        MSort( A, TmpArray, Left, Center );     /* T( N / 2 ) */
    -        MSort( A, TmpArray, Center + 1, Right );    /* T( N / 2 ) */
    -        Merge( A, TmpArray, Left, Center + 1, Right );  /* O( N ) */
    -    } 
    -} 
    -/* Lpos = start of left half, Rpos = start of right half */ 
    -void Merge( ElementType A[ ], ElementType TmpArray[ ], int Lpos, int Rpos, int RightEnd ) {
    -    int  i, LeftEnd, NumElements, TmpPos; 
    -    LeftEnd = Rpos - 1; 
    -    TmpPos = Lpos; 
    -    NumElements = RightEnd - Lpos + 1; 
    -    while(Lpos<=LeftEnd && Rpos<=RightEnd){
    -        if(A[Lpos]<=A[Rpos]){TmpArray[TmpPos++]=A[Lpos++];}
    -        else{TmpArray[TmpPos++]=A[Rpos++];}
    -        while(Lpos<=LeftEnd){TmpArray[ TmpPos++ ] = A[ Lpos++ ];}
    -        while(Rpos<=RightEnd){TmpArray[ TmpPos++ ] = A[ Rpos++ ];}
    -    }
    -    for( i = 0; i < NumElements; i++, RightEnd - - ) 
    -         /* Copy TmpArray back */ 
    -        A[ RightEnd ] = TmpArray[ RightEnd ]; 
    -}
    -/** version2 **/
    -void Merge2( ElementType A[ ], ElementType TmpArray[ ], int Lpos, int Rpos, int RightEnd ) {
    -    int  i, LeftEnd, NumElements, TmpPos; 
    -    LeftEnd = Rpos - 1; 
    -    TmpPos = Lpos; 
    -    NumElements = RightEnd - Lpos + 1; 
    -    for(int i=0;i<NumElements;i++){
    -        if((Lpos<=LeftEnd)&&(Rpos>RightEnd||A[Lpos]<=A[Rpos])){TmpArray[i]=A[Lpos++];}
    -        else{TmpArray[TmpPos++]=A[Rpos++];}
    -    }
    -
    -}
    -/** version3 **/
    -void CopyArray(int B[],int iBegin,int iEnd,int A[]);
    -void Merge (int A[],int ileft,int iright,int iend,int B[]);
    -void BottomupMergeSort(int A[],int B[],int n){
    -   for(int width=1;width<n;width=width*2){
    -           for(int i=0;i<n;i=i+2*width){
    -            Merge(A,i,min(i+width,n),min(i+2*width,n),B);
    -           }
    -           CopyArray(B,0,n,A);
    -   }
    -
    -}
    -// (iBegin,iEnd]
    -void Merge (int A[],int ileft,int iright,int iend,int B[]){
    -     int i=ileft,j=iright;
    -
    -    for(int k=ileft;k<iend;k++){
    -
    -         if(i<iright&&(j>=iend||A[i]<=A[j])){
    -            B[k]=A[i++];
    -         }
    -         else{B[k]=A[j++];}
    -    }
    -}
    +
    +void Mergesort( ElementType A[ ], int N ) {
    +    ElementType  *TmpArray;  /* need O(N) extra space */
    +    TmpArray = malloc( N * sizeof( ElementType ) ); 
    +    if ( TmpArray != NULL ) { 
    +            MSort( A, TmpArray, 0, N - 1 ); 
    +            free( TmpArray ); 
    +    } 
    +    else  FatalError( "No space for tmp array!!!" ); 
    +}
    +
    +void MSort( ElementType A[ ], ElementType TmpArray[ ],int Left, int Right){
    +    int  Center; 
    +    if ( Left < Right ) {  /* if there are elements to be sorted */
    +        Center = ( Left + Right ) / 2; 
    +        MSort( A, TmpArray, Left, Center );     /* T( N / 2 ) */
    +        MSort( A, TmpArray, Center + 1, Right );    /* T( N / 2 ) */
    +        Merge( A, TmpArray, Left, Center + 1, Right );  /* O( N ) */
    +    } 
    +} 
    +
    +/* Lpos = start of left half, Rpos = start of right half */ 
    +void Merge( ElementType A[ ], ElementType TmpArray[ ], int Lpos, int Rpos, int RightEnd ) {
    +    int  i, LeftEnd, NumElements, TmpPos; 
    +    LeftEnd = Rpos - 1; 
    +    TmpPos = Lpos; 
    +    NumElements = RightEnd - Lpos + 1; 
    +    while(Lpos<=LeftEnd && Rpos<=RightEnd){
    +        if(A[Lpos]<=A[Rpos]){TmpArray[TmpPos++]=A[Lpos++];}
    +        else{TmpArray[TmpPos++]=A[Rpos++];}
    +    }
    +    while(Lpos<=LeftEnd){TmpArray[ TmpPos++ ] = A[ Lpos++ ];}
    +    while(Rpos<=RightEnd){TmpArray[ TmpPos++ ] = A[ Rpos++ ];}
    +    for( i = 0; i < NumElements; i++, RightEnd - - ) 
    +         /* Copy TmpArray back */ 
    +        A[ RightEnd ] = TmpArray[ RightEnd ]; 
    +}
    +/** version2 **/
    +void Merge2( ElementType A[ ], ElementType TmpArray[ ], int Lpos, int Rpos, int RightEnd ) {
    +    int  i, LeftEnd, NumElements, TmpPos; 
    +    LeftEnd = Rpos - 1; 
    +    TmpPos = Lpos; 
    +    NumElements = RightEnd - Lpos + 1; 
    +    for(int i=0;i<NumElements;i++){
    +        if((Lpos<=LeftEnd)&&(Rpos>RightEnd||A[Lpos]<=A[Rpos])){TmpArray[i]=A[Lpos++];}
    +        else{TmpArray[TmpPos++]=A[Rpos++];}
    +    }
    +}
    +/** version3 **/
    +void CopyArray(int B[],int iBegin,int iEnd,int A[]);
    +void Merge (int A[],int ileft,int iright,int iend,int B[]);
    +void BottomupMergeSort(int A[],int B[],int n){
    +   for(int width=1;width<n;width=width*2){
    +           for(int i=0;i<n;i=i+2*width){
    +            Merge(A,i,min(i+width,n),min(i+2*width,n),B);
    +           }
    +           CopyArray(B,0,n,A);
    +   }
    +}
    +// (iBegin,iEnd]
    +void Merge (int A[],int ileft,int iright,int iend,int B[]){
    +     int i=ileft,j=iright;
    +     for(int k=ileft;k<iend;k++){
    +         if(i<iright&&(j>=iend||A[i]<=A[j])){
    +            B[k]=A[i++];
    +         }
    +         else{B[k]=A[j++];}
    +    }
    +}
     

    Complexity

    \(T(n)=2T(n/2)+O(n)\)\(O(nlogn)\) @@ -3402,38 +3390,47 @@

    Implementation}

    Sorting Large Structures

    -

    Swapping large structures can be very much expensive. -* Add a pointer field to the structure and swap pointers instead – indirect sorting.
    -9 -* Physically rearrange the structures at last if it is really necessary. - In the worst case there are \([N/2]\)(down) cycles and requires \([3N/2]\) (down) record moves. - \(T = O( m N )\) where m is the size of a structure

    +

    Swapping large structures can be very much expensive.

    + +

    9

    +

    A General Lower Bound for Sorting

    Any algorithm that sorts by comparisons only must have a worst case computing time of \(\Omega( N log N )\).

    When sorting N distinct elements, there are \(N!\) (N factorial) different possible sorting outcomes. This arises from the numerous ways of arranging the elements, with \(N\) choices for the first element, \(N-1\) choices for the second, and so forth, yielding a total of \(N!\).

    In the context of decision trees representing the decision-making process of comparison-based sorting algorithms, the number of leaves in the tree is at least \(N!\). Each leaf node signifies a distinct sorting outcome.

    The relationship between the height of the decision tree \((k)\) and complete binary trees is emphasized. For a complete binary tree with \(k\) levels, it can have at most \(2^{k-1}\) leaves. Combining this with the earlier discussion, the inequality \(N! ≤ 2^{k-1}\) is established, where k is the height of the decision tree.

    -

    Expressing the relationship between height and N! using logarithms, we find that \(k ≥ log(N!) + 1\). -* Logarithms are preferred due to their intuitive representation of exponential growth in tree height.

    +

    Expressing the relationship between height and N! using logarithms, we find that \(k ≥ log(N!) + 1\).

    +

    These insights delineate theoretical limits for comparison-based sorting algorithms and underscore the significance of N log N as the theoretical lower bound for their time complexity.

    Bucket Sort and Radix Sort

    -

    Bucket Sort

    -

    Algorithm
    -{
    -    initialize count[ ];
    -    while (read in a students record)
    -        insert to list count[stdnt.grade];
    -    for (i=0; i<M; i++) {
    -        if (count[i])
    -            output list count[i];
    -    }
    -}
    -T(N,M)=O(M+N)
    +

    Bucket Sort \(T(N,M)=O(M+N)\)

    +

    Algorithm{
    +    initialize count[ ];
    +    while (read in a students record)
    +        insert to list count[stdnt.grade];
    +    for (i=0; i<M; i++) {
    +        if (count[i])
    +            output list count[i];
    +    }
    +}
     
    * What if \(M >> N\) ?

    Radix Sort

    10

    +

    Stableness

    +
      +
    • 稳定排序:冒泡、归并、插入、基数
    • +
    • 不稳定排序:快排、希尔、堆排、选择
    • +

    diff --git "a/note/\345\237\272\347\241\200\346\225\260\346\215\256\347\273\223\346\236\204/index.html" "b/note/\345\237\272\347\241\200\346\225\260\346\215\256\347\273\223\346\236\204/index.html" index e3759ff7..6459493b 100644 --- "a/note/\345\237\272\347\241\200\346\225\260\346\215\256\347\273\223\346\236\204/index.html" +++ "b/note/\345\237\272\347\241\200\346\225\260\346\215\256\347\273\223\346\236\204/index.html" @@ -1630,8 +1630,6 @@ - - @@ -1805,26 +1803,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git "a/note/\346\234\200\345\244\247\345\255\220\345\210\227\345\222\214/index.html" "b/note/\346\234\200\345\244\247\345\255\220\345\210\227\345\222\214/index.html" index b1b6bd5a..768735c9 100644 --- "a/note/\346\234\200\345\244\247\345\255\220\345\210\227\345\222\214/index.html" +++ "b/note/\346\234\200\345\244\247\345\255\220\345\210\227\345\222\214/index.html" @@ -1407,8 +1407,6 @@ - - @@ -1582,26 +1580,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git a/search/search_index.json b/search/search_index.json index a4200832..b94013a4 100644 --- a/search/search_index.json +++ b/search/search_index.json @@ -1 +1 @@ -{"config":{"lang":["en"],"separator":"[\\s\\u200b\\u3000\\-\u3001\u3002\uff0c\uff0e\uff1f\uff01\uff1b]+","pipeline":["stemmer"]},"docs":[{"location":"","title":"Welcome to Lily's Notebook!","text":""},{"location":"#about-me","title":"About me","text":""},{"location":"#my-github","title":"My GitHub","text":""},{"location":"#my-gmail-and-my-zju-email","title":"My Gmail and My ZJU Email","text":""},{"location":"#_1","title":"Welcome to Lily's Notebook!","text":""},{"location":"invisible/","title":"Invisible","text":"

    \\(\\hspace{1cm}\\) \u4eca\u5929\u65e9\u4e0a\u8d77\u6765\uff0c\u5929\u7a7a\u7070\u9eef\u9eef\u7684\uff0c\u5f53\u7136\uff0c\u65f6\u65f6\u662f\u8fd9\u6837\uff0c\u4e5f\u6b63\u662f\u8fd9\u6837\uff0c\u624d\u65f6\u65f6\u662f\u5371\u9669\u7684\u3002

    \\(\\hspace{1cm}\\) \u6211\u68b3\u4e86\u4e00\u4e2a\u9a6c\u5c3e\u8fab\u3002

    \\(\\hspace{1cm}\\) \u6253\u5f00\u7535\u89c6\uff0c\u55e1\u55e1\u7684\u58f0\u97f3\u50cf\u662f\u4e00\u4e0b\u4ece\u8fdc\u65b9\u62bd\u5438\u8fdb\u6765\uff0c\u6a21\u7cca\u51fa\u4e00\u7247\u6e05\u6f88\u3002\u201c\u6839\u636e\u8fd1\u4e9b\u5e74\u6765\u79d1\u5b66\u5bb6\u7814\u7a76\u7edf\u8ba1\uff0c\u5168\u7403\u660e\u7ea4\u5269\u4f59\u91cf\u5927\u7ea6\u4e3a0.03\u6839/\u5e73\u65b9\u5343\u7c73\uff0c\u5168\u7403\u5404\u56fd\u5fd7\u613f\u8005\u4e5f\u90fd\u5728\u4e3a\u626b\u9664\u660e\u7ea4\u5949\u732e\u7740\u9c9c\u8840\u548c\u6c57\u6c34\uff0c\u636e\u4f30\u8ba1\uff0c\u4ee5\u76ee\u524d\u8fdb\u7a0b\u5168\u7403\u57fa\u672c\u4e0a\u53ef\u4ee5\u5728X\u5e74\u57fa\u672c\u5f7b\u5e95\u6e05\u9664\u660e\u7ea4\u3002\u7136\u800c\u4e13\u5bb6\u4ecd\u7136\u5efa\u8bae\u5e7f\u5927\u7fa4\u4f17\u5728\u6b63\u5e38\u751f\u6d3b\u4e4b\u4f59\u505a\u597d\u660e\u7ea4\u65e5\u5e38\u9632\u62a4\u3002\u4e0b\u9762\u64ad\u653e\u51e0\u4e2a\u660e\u7ea4\u9632\u62a4\u65e5\u5e38\u8d34\u58eb\uff1a1.\u65e5\u5e38\u5e94\u8be5\u4fdd\u6301\u653e\u677e\u5fc3\u6001\uff0c\u4e0d\u8981\u8fc7\u4e8e\u7126\u8651\u660e\u7ea4\u95ee\u9898\u2026\u2026\u201d

    \\(\\hspace{1cm}\\) \u8001\u751f\u5e38\u8c08\uff0c\u6211\u6362\u4e86\u53f0\u3002

    \\(\\hspace{1cm}\\) \u201c\u636e\u672c\u53f0\u8bb0\u8005\u62a5\u9053\uff0c\u672c\u5e02\u4e8e\u6628\u65e5\u53d1\u751f\u4e00\u8d77\u2018\u62a2\u53d1\u6848\u2019 \uff0c\u53d7\u5bb3\u4ebaX\u5148\u751f\u88ab\u952f\u65ad\u8fd120cm\u5934\u53d1\uff0c\u5e02\u503c\u4f30\u8ba1\u572820000\u5143\u5de6\u53f3\uff0c\u73b0\u6b63\u7d27\u6025\u8c03\u67e5\u6d89\u5acc\u4eba\u5458\uff0c\u8bf7\u5e7f\u5927\u5e02\u6c11\u6ce8\u610f\u597d\u81ea\u8eab\u5b89\u5168\u4fdd\u62a4\u2026\u2026\u201d

    \\(\\hspace{1cm}\\) \u6211\u4e0d\u7531\u5f97\u6478\u4e86\u6478\u81ea\u5df1\u7684\u5934\u53d1\uff1a\u6211\u5f88\u559c\u6b22\u6211\u7684\u5934\u53d1\uff0c\u9ed1\u9ed1\u7684\uff0c\u4eae\u4eae\u7684\uff0c\u67d4\u987a\u7684\uff0c\u5e02\u4ef7\u5e94\u8be5\u5f88\u9ad8\uff0c\u6240\u4ee5\u6211\u4e00\u76f4\u6ca1\u6709\u5f88\u52aa\u529b\u5de5\u4f5c\uff0c\u5b9e\u5728\u4e0d\u884c\u4e86\uff0c\u6211\u5c31\u53bb\u628a\u5934\u53d1\u5356\u4e86\uff0c\u6211\u4e5f\u4e0d\u6015\u6b7b\uff0c\u4f46\u6211\u70ed\u7231\u751f\u6d3b\u3002

    \\(\\hspace{1cm}\\) \u81f3\u4e8e\u4e3a\u4ec0\u4e48\u73b0\u5728\u5934\u53d1\uff0c\u6216\u8005\u8bf4\u9ad8\u8d28\u91cf\u5047\u53d1\uff0c\u7adf\u7136\u4ef7\u683c\u5982\u6b64\u9ad8\u6602\uff0c\u662f\u4ece\u660e\u7ea4\u7684\u53d1\u73b0\u5f00\u59cb\u7684\u3002\u5927\u6982\u5728\u5341\u51e0\u5e74\u524d\uff0c\u5728Stephen\u5c0f\u9547\uff0c\u9065\u8fdc\u7684\u5317\u6b27\uff0c\u5728\u90a3\u7247\u5b81\u9759\uff0c\u6f2b\u957f\u4e0e\u5bd2\u51b7\u4e4b\u95f4\uff0c\u7a81\u7136\u6709\u4e86\u70ed\u8840\u6cb8\u817e\uff1a\u4e00\u4e2a\u4e0b\u5348\uff0c\u9633\u5149\u80fd\u6620\u51fa\u7a7a\u4e2d\u7684\u9648\u7c92\uff1b\u8857\u4e0a\uff0c\u884c\u4eba\u4e09\u4e24\uff1b\u7a81\u7136\u5c31\u6709\u4e86\u4e00\u9053\u8840\u5149\u3002\u5f53\u65f6\u8def\u4eba\u5927\u6982\u90fd\u60ca\u5446\u4e86\uff0c\u51bb\u5728\u90a3\u7247\u5bd2\u51b7\u7684\u8840\u8272\u91cc\u3002\u662f\u4e00\u4e2a\u884c\u4eba\uff0c\u4e00\u4e2a\u8001\u7237\u7237\uff0c\u5a46\u5a11\u7740\u80cc\uff0c\u6162\u6162\u5730\u8d70\u7740\uff0c\u7136\u540e\u7a81\u7136\u62e6\u8170\u65ad\u4e86\uff0c\u5012\u4e0b\uff0c\u5929\u8fb9\u4e00\u7247\u7ea2\u3002\u5728\u4e00\u6bb5\u53ef\u6016\u7684\u9759\u6b62\u548c\u6c89\u9ed8\u4e4b\u540e\uff0c\u6709\u4eba\u4e0a\u524d\u67e5\u770b\uff0c\u53c8\u5012\u4e0b\u4e86\u3002

    \\(\\hspace{1cm}\\) \u5bc2\u9759\u4e4b\u58f0\u3002

    \\(\\hspace{1cm}\\) \u540e\u6765\u7684\u540e\u6765\uff0c\u7ec8\u4e8e\u6709\u4eba\u53d1\u73b0\uff0c\u5728\u90a3\u5929\u707f\u70c2\u7684\u9633\u5149\u4e0b\uff0c\u90a3\u91cc\u98d8\u7740\u4e00\u6bb5\u5c0f\u5c0f\u7684\u7ea4\u7ef4\u72b6\u7684\u7ec6\u4e1d\uff0c\u5f88\u7ec6\uff0c\u80fd\u53d1\u73b0\u53ea\u662f\u56e0\u4e3a\u5728\u9633\u5149\u4e0b\u90a3\u7ec6\u4e1d\u6709\u4e9b\u5fae\u7684\u95ea\u70c1\u53d1\u5149,\u6240\u4ee5\uff0c\u5c31\u53eb\u505a\u660e\u7ea4\uff0c\u591a\u7f8e\u4e3d\u7684\u540d\u5b57\uff0c\u7ea4\u7ec6\u800c\u8106\u5f31\u3002

    \\(\\hspace{1cm}\\) \u6ca1\u6709\u4eba\u77e5\u9053\u660e\u7ea4\u662f\u54ea\u91cc\u6765\u7684\uff0c\u6709\u4eba\u8bf4\u662f\u4e00\u6b21\u9ad8\u7ea7\u6b66\u5668\u7684\u6ee5\u7528\uff0c\u67d0\u79cd\u5316\u5b66\u7269\u8d28\uff1b\u4e5f\u6709\u4eba\u8bf4\u662f\u67d0\u4e2a\u6050\u6016\u7ec4\u7ec7\u5455\u5c3d\u5fc3\u8840\u5728\u5168\u7403\u5e03\u7f6e\u4e0b\u51e0\u5904\u4ee5\u5f15\u8d77\u6050\u614c\u3002\u4e0d\u7ba1\u600e\u4e48\u6837\uff0c\u6050\u614c\u662f\u6709\u7684\uff1a\u636e\u76ee\u524d\u6240\u77e5\uff0c\u660e\u7ea4\u5206\u5e03\u4e0d\u5e7f\uff0c\u4f46\u6740\u4f24\u529b\u6781\u5927\u3002\u53d1\u73b0\u660e\u7ea4\u540e\uff0c\u4e5f\u53ea\u80fd\u5efa\u7acb\u7981\u884c\u533a\uff0c\u800c\u505a\u4e0d\u5230\u5f7b\u5e95\u7684\u201c\u6e05\u695a\u201d\u2014\u2014\u4e0d\u8fc7\u7528\u4ec0\u4e48\u60f3\u8981\u6e05\u695a\u660e\u7ea4\uff0c\u660e\u7ea4\u603b\u80fd\u5207\u65ad\uff0c\u4eba\u6216\u8005\u91d1\u5c5e\u3002

    \\(\\hspace{1cm}\\) \u636e\u8bf4\u88ab\u660e\u7ea4\u5207\u65ad\u7684\u4e00\u77ac\u95f4\u5e76\u6ca1\u6709\u4ec0\u4e48\u5177\u4f53\u611f\u53d7\uff0c\u5176\u5b9e\u8fd9\u662f\u4e00\u79cd\u63a8\u65ad\uff0c\u56e0\u4e3a\u5f88\u591a\u884c\u8fdb\u5f88\u6162\u7684\u4eba\uff0c\u5c31\u50cf\u7b2c\u4e00\u4f8b\u53d7\u5bb3\u8005\u8001\u7237\u7237\uff0c\u90fd\u6b7b\u4e8e\u8eaf\u4f53\u7684\u5b8c\u5168\u5206\u9694\u3002

    \\(\\hspace{1cm}\\) \u603b\u4e4b\uff0c\u5728\u90a3\u4e4b\u540e\uff0c\u4eba\u4eec\u90fd\u6709\u4e9b\u4e0d\u6562\u51fa\u95e8\u4e86\uff0c\u5728\u8857\u4e0a\u8d70\u4e5f\u5f88\u6162\u3002

    \\(\\hspace{1cm}\\) \u51e0\u5e74\u524d\u6709\u4e00\u4e2a\u5e78\u8fd0\u7684\u5973\u5b69\u5b50\u9047\u5230\u660e\u7ea4\u5374\u6beb\u53d1\u672a\u635f\u2014\u2014\u786e\u5207\u7684\u8bf4\uff0c\u53ea\u635f\u6beb\u53d1\uff1a\u5973\u5b69\u8d70\u8def\u65f6\u5f88\u7231\u7529\u5934\u53d1\uff0c\u53d1\u95f4\u5411\u5de6\u6643\u65f6\u4e00\u4e0b\u88ab\u5207\u65ad\u4e86\u4e00\u622a\uff0c\u98d8\u98d8\u6d12\u6d12\u3002\u540e\u6765\uff0c\u7537\u5b50\u4e5f\u5f00\u59cb\u84c4\u957f\u53d1\uff0c\u4f20\u8bf4\u4e2d\u6f02\u6d6e\u5ea6\u8303\u56f4\u5f88\u5e7f\u7684\u9ad8\u8d28\u91cf\u5047\u53d1\u4e5f\u5f00\u59cb\u5728\u5e02\u573a\u4e0a\u5d1b\u8d77\u4e86\u3002

    \\(\\hspace{1cm}\\) \u6211\u4e5f\u559c\u6b22\u8d70\u8def\u7684\u65f6\u5019\u9ad8\u9ad8\u5730\u7529\u5934\u53d1\uff0c\u6211\u89c9\u5f97\u771f\u5f88\u7f8e\uff0c\u5973\u5b69\u5b50\u7684\u9752\u6625\u7684\u7f8e\uff0c\u4e0d\u8fc7\uff0c\u4e5f\u8bb8\u662f\u56e0\u4e3a\u6211\u5728\u5fc3\u91cc\u7684\u4e00\u89d2\u6697\u81ea\u745f\u7f29\u5427\u3002

    \\(\\hspace{1cm}\\) \u601d\u7eea\u53c8\u548c\u7535\u89c6\u7684\u58f0\u97f3\u76f8\u9047\u4e86\u3002

    \\(\\hspace{1cm}\\) \u201c\u4e0b\u9762\u672c\u53f0\u4e3a\u60a8\u5e26\u6765\u5fd7\u613f\u6e05\u626b\u660e\u7ea4\u73b0\u573a\uff0c\u8ba9\u6211\u4eec\u4e3a\u5728\u573a\u7684\u6bcf\u4e00\u4f4d\u82f1\u96c4\u9f13\u638c\u559d\u5f69\uff01\u201d\u955c\u5934\u8f6c\u6362\uff0c\u4eba\u7fa4\u7199\u6518\uff0c\u6211\u770b\u89c1\u4e86\u5e74\u8f7b\u7684\u7537\u5973\uff0c\u4e2d\u5e74\u7684\u76b1\u7eb9\uff0c\u82b1\u767d\u7684\u5934\u53d1\uff0c\u4e73\u7259\uff0c\u9152\u7a9d\uff0c\u8033\u6d1e\u2026\u2026\u6240\u6709\u7684\u4e00\u5207\u90fd\u5728\u70ed\u70c8\u7684\u6c14\u6c1b\u4e2d\u6a21\u7cca\u6b86\u5c3d\uff0c\u8fd8\u6709\u9065\u9065\u7684\u70ed\u8840\u97f3\u4e50\u5728\u7a7a\u6c14\u4e2d\u6643\u8361\u3002

    \\(\\hspace{1cm}\\) \u5927\u6982\u662f\u5ba3\u5e03\u4e86\u5f00\u59cb\uff0c\u4eba\u7fa4\u52a8\u8d77\u6765\u4e86\uff0c\u8dd1\u8d77\u6765\u4e86\uff0c\u5374\u4e00\u76f4\u662f\u62e5\u6324\u7684\u53c8\u6a21\u7cca\u8d77\u6765\u4e86\u3002\u6211\u77e5\u9053\u4ed6\u4eec\u4e3a\u4ec0\u4e48\u5954\u8dd1\uff0c\u56e0\u4e3a\u636e\u8bf4\u5feb\u901f\u901a\u8fc7\u660e\u7ea4\u800c\u6b7b\u4ea1\u6ca1\u6709\u4efb\u4f55\u75db\u82e6\u3002\u6211\u4e5f\u77e5\u9053\u4ed6\u4eec\u4e3a\u4ec0\u4e48\u62e5\u6324\uff0c\u56e0\u4e3a\u53ea\u6709\u62e5\u5728\u4e00\u8d77\uff0c\u624d\u80fd\u4fdd\u8bc1\u7ecf\u8fc7\u7684\u6bcf\u4e00\u5904\u5730\u65b9\u90fd\u6ca1\u6709\u660e\u7ea4\u9003\u8fc7\u3002

    \\(\\hspace{1cm}\\) \u6211\u5374\u4e0d\u77e5\u9053\u4e3a\u4ec0\u4e48\u662f\u4eba\u3002\u4e3a\u4ec0\u4e48\u4e0d\u662f\u8f66\u6216\u8005\u673a\u5668\u6216\u8005\u6280\u672f\u2026\u2026\u4e5f\u6709\u5f88\u591a\u8bf4\u6cd5\uff0c\u6709\u4eba\u8bf4\u660e\u7ea4\u5206\u5e03\u5b9e\u5728\u7a00\u5c11\u4e0d\u5fc5\u4e3a\u6b64\u6295\u5165\u592a\u591a\u7cbe\u529b\uff0c\u786e\u5b9e\uff0c\u6bcf\u5e74\u636e\u62a5\u9053\u5927\u6982\u53ea\u67092-3\u4f8b\u53d7\u5bb3\u8005\u3002\u4e5f\u6709\u4eba\u8bf4\u8fd9\u6837\u7684\u6d3b\u52a8\u4ece\u6765\u6ca1\u6709\u8fc7\u727a\u7272\uff0c\u8fd8\u53ef\u4ee5\u57f9\u517b\u7fa4\u4f17\u7684\u56e2\u7ed3\u5408\u4f5c\u80fd\u529b\uff0c\u8fd8\u6709\u4eba\u8bf4\u8fd9\u662f\u4e2a\u9634\u8c0b\u8bba\u3002

    \\(\\hspace{1cm}\\) \u8fd8\u662f\u4e0d\u7ba1\u600e\u6837\uff0c\u603b\u6709\u5730\u65b9\u5728\u62db\u52df\u5fd7\u613f\u8005\uff0c\u4e5f\u603b\u6709\u8fd9\u6837\u7684\u5e74\u8f7b\u7f8e\u4e3d\uff0c\u70ed\u8840\u6f8e\u6e43\u7684\u5fd7\u613f\u8005\u81ea\u544a\u594b\u52c7\u3002

    \\(\\hspace{1cm}\\) \u4e00\u9635\u6c89\u90c1\u7ffb\u6d8c\uff0c\u6211\u5173\u4e0a\u4e86\u7535\u89c6\u3002

    \\(\\hspace{1cm}\\) \u6211\u6700\u6700\u4eb2\u7231\u7684\u8bfb\u8005\uff0c\u6211\u591a\u4e48\u96be\u5e0c\u671b\u548c\u4f60\u4eec\u4e00\u6837\u628a\u8fd9\u5f53\u6210\u4e00\u4e2a\u8981\u7231\u62a4\u5934\u53d1\u7684\u5c0f\u6545\u4e8b\uff0c\u53ef\u662f\u6211\u4e0d\u884c\uff0c\u6211\u9762\u5bf9\u7684\u4e0d\u662f\u865a\u7a7a\uff0c\u662f\u771f\u5b9e\u3002

    \\(\\hspace{1cm}\\) \u6574\u7406\u4e86\u4e0b\u5934\u53d1\uff0c\u6211\u51fa\u4e86\u5bb6\u95e8\uff0c\u62ac\u5934\uff0c\u53ea\u770b\u89c1\u90a3\u6c89\u6c89\u7684\u5929\u5728\u884c\u8272\u5306\u5306\u4e2d\u9759\u9ed8\u4e0d\u8a00\u3002

    "},{"location":"%E5%A4%A7%E4%BE%A0/","title":"\u5927\u4fa0","text":"

    \\(\\hspace{1cm}\\)\u5f88\u5c0f\u7684\u65f6\u5019\uff0c\u6211\u5c31\u77e5\u9053\uff0c\u6211\u4ee5\u540e\u8981\u505a\u4e00\u4ee3\u5927\u4fa0\uff0c\u884c\u8d70\u7eff\u6797\uff0c\u6d6a\u8361\u6c5f\u6e56\uff0c\u4e00\u8eab\u5251\u6c14\uff0c\u4e00\u8def\u6f47\u6d12\u3002

    \\(\\hspace{1cm}\\)\u6c5f\u6e56\u4e0a\u7684\u4e8b\u60c5\u6211\u4eec\u5927\u591a\u90fd\u6709\u8033\u95fb\uff1a\u8981\u6709\u6b66\u529f\uff0c\u8981\u6709\u809d\u80c6\uff0c\u8981\u4e00\u8eab\u6e05\u98ce\u6717\u6717\uff0c\u6063\u610f\u5e73\u751f\uff0c\u4e0e\u4e16\u5043\u4ef0\u3002

    \\(\\hspace{1cm}\\)\u4e8e\u662f\u6211\u4e0d\u65ad\u5730\u52aa\u529b\u7740\uff1a\u8d70\u5c71\u8d70\u6c34\uff0c\u95ef\u8361\u5929\u5730\uff0c\u56db\u5904\u8bbf\u5e08\uff0c\u56db\u5904\u5b66\u827a\u3002\u6768\u8fc7\u5927\u4fa0\u90a3\u6bb5\u4e0e\u6df1\u5c71\u4e3a\u4f34\u7684\u5c81\u6708\uff0c\u6211\u4e5f\u66fe\u76f8\u4f3c\u4eb2\u5386\u3002\u6211\u4ee5\u4e3a\u6211\u5c1d\u5c3d\u4e86\u6210\u957f\u4e3a\u4e00\u4ee3\u5927\u4fa0\u8fc7\u7a0b\u4e2d\u5e94\u6709\u7684\uff0c\u6240\u6709\u7684\u54c0\u621a\u4e0e\u5e78\u798f\uff0c\u6211\u4e3a\u6211\u7684\u4e00\u5207\u52aa\u529b\u800c\u611f\u5230\u5feb\u4e50\u4e0e\u6210\u5c31\u3002

    \\(\\hspace{1cm}\\)\u6bcf\u6b21\u6e38\u5386\u56de\u5bb6\u65f6\uff0c\u5988\u5988\u5e38\u7528\u7565\u5e26\u5fe7\u4f24\u7684\u773c\u795e\u770b\u7740\u6211\uff0c\u6211\u77e5\u9053\uff0c\u5979\u662f\u592a\u62c5\u5fc3\u6211\uff0c\u5bb3\u6015\u6c5f\u6e56\u4e0a\u7684\u9ed1\u6697\u4f1a\u5c06\u6211\u541e\u6ca1\uff0c\u4e0d\u5269\u9aa8\u5934\uff1b\u6211\u4e5f\u77e5\u9053\uff0c\u5979\u4ecd\u662f\u65e5\u65e5\u591c\u591c\u76fc\u671b\u6211\u6210\u529f\uff0c\u5e26\u7740\u8346\u68d8\u7684\u5fc3\u548c\u96be\u8a00\u7684\u60c6\u6005\u3002\u603b\u5f97\u6765\u8bf4\uff0c\u5988\u5988\u662f\u5f88\u652f\u6301\u6211\u7684\uff0c\u5c31\u50cf\u7ae5\u5e74\u7684\u7761\u524d\u6545\u4e8b\u2014\u2014\u90a3\u4e9b\u6ee1\u662f\u4fa0\u8005\u98ce\u8303\u7684\u5feb\u610f\u6c5f\u6e56\u3002

    \\(\\hspace{1cm}\\)\u90a3\u5929\uff0c\u6211\u6210\u5e74\u4e86\uff0c\u88f9\u4e86\u4e00\u4e2a\u5c0f\u5305\u88b1\uff1a\u4e00\u4e2a\u5988\u5988\u7ee3\u7684\u8377\u5305\uff0c\u51e0\u4e24\u94f6\u94b1\uff0c\u968f\u8eab\u8863\u7269\u3002\u7136\u540e\u6211\u5c31\u4e0a\u8def\u4e86\u2014\u2014\u6211\u51b3\u5b9a\u8981\u5f00\u542f\u81ea\u5df1\u7684\u4eba\u751f\uff1a\u5927\u4fa0\u7684\u4eba\u751f\u3002

    \\(\\hspace{1cm}\\)\u7b2c\u4e00\u5929\uff0c\u6211\u6551\u4e86\u4e00\u4e2a\u843d\u96be\u7684\u5973\u5b50\u3002\u5979\u8877\u5fc3\u5730\u611f\u8c22\u6211\uff0c\u7136\u540e\u53c8\u5e26\u7740\u5fe7\u4f24\u5730\uff0c\u621a\u621a\u5730\u770b\u7740\u6211\uff0c\u55eb\u5685\u7740\uff1a\u53ef\u662f\u4f60\u5e2e\u4e0d\u4e86\u6211\u2014\u2014\u90a3\u5fe7\u4f24\u548c\u5988\u5988\u7684\u5fe7\u4f24\u6709\u4e9b\u76f8\u4f3c\u3002\u6211\u628a\u968f\u8eab\u7684\u94f6\u4e24\u90fd\u585e\u7ed9\u4e86\u5979\uff0c\u5979\u6ca1\u6709\u6536\uff0c\u8885\u5a1c\u7740\u8d70\u4e86\u3002

    \\(\\hspace{1cm}\\)\u4e00\u4e9b\u8ff7\u832b\uff0c\u4e00\u4e9b\u611f\u52a8\uff0c\u548c\u4e00\u4e9b\u5fe7\u6101\u3002

    \\(\\hspace{1cm}\\)\u6211\u6ca1\u6709\u6e38\u79fb\u3002\u6211\u8fd8\u662f\u884c\u8d70\u7740\uff0c\u53c8\u89c1\u4e86\u4e00\u4e9b\u4e8b\uff0c\u6551\u4e86\u4e00\u4e9b\u4eba\uff0c\u8fd8\u662f\u8d70\u8fc7\u5c71\u5c71\u6c34\u6c34\u3002\u4ed6\u4eec\u90fd\u53d8\u6210\u4e86\u6211\u3002

    \\(\\hspace{1cm}\\)\u90a3\u5929\u6211\u4e8c\u5341\u4e94\u5c81\uff0c\u6211\u7ec8\u4e8e\u6765\u5230\u4e86\u6211\u4ece\u5c0f\u68a6\u91cc\u7684\u6bbf\u5802\uff1a\u4fa0\u4e4b\u95e8\u3002\u6211\u77e5\u9053\u6211\u4e0d\u662f\u540d\u95e8\u6b63\u6d3e\uff0c\u4f46\u6211\u60f3\uff0c\u7ecf\u5386\u4e86\u8fd9\u8bb8\u591a\uff0c\u6211\u4e00\u5b9a\u4f1a\u88ab\u8ba4\u53ef\u2014\u2014\u6b66\u529f\u4e5f\u597d\uff0c\u809d\u80c6\u4e5f\u7f62\uff0c\u4e0d\u81f3\u4e8e\u540d\u5782\u9752\u53f2\uff0c\u81f3\u5c11\u8db3\u591f\u6177\u6168\u3002

    \\(\\hspace{1cm}\\)\u6211\u8fdb\u4e86\u95e8\uff0c\u81ea\u62a5\u5bb6\u95e8\uff0c\u5b88\u95e8\u4eba\u5f15\u6211\u5411\u524d\uff0c\u5230\u4e86\u4e00\u5f20\u53e4\u6734\u7684\u684c\u5b50\uff0c\u684c\u524d\u5750\u7740\u4e00\u4f4d\u5782\u5782\u8001\u8005\u3002\u6211\u8840\u8109\u55b7\u6d8c\u2014\u2014\u50cf\u662f\u68a6\u91cc\u3002

    \\(\\hspace{1cm}\\)\u201c\u8981\u6210\u4e3a\u5927\u4fa0\uff1f\u201d

    \\(\\hspace{1cm}\\)\u201c\u662f\u7684\uff0c\u662f\u7684\u3002\u201d

    \\(\\hspace{1cm}\\)\u201c\u591a\u5927\uff1f\u201d

    \\(\\hspace{1cm}\\)\u201c\u4e8c\u5341\u4e94\u4e86\u3002\u201d

    \\(\\hspace{1cm}\\)\u6cdb\u9ec4\u7684\u7eb8\u9875\uff0c\u76d6\u4e86\u4e2a\u9c9c\u7ea2\u7684\u5370\u7ae0\uff0c\u5199\u7740\u4e9b\u4ec0\u4e48\u4fa0\u4e4b\u5927\u8005\uff0c\u63a8\u5411\u6211\u3002

    \\(\\hspace{1cm}\\)\u201c\u8d44\u683c\u8bc1\uff0c\u5927\u4fa0\u3002\u201d

    \\(\\hspace{1cm}\\)\u4e8e\u662f\uff0c\u6211\u591a\u4e86\u4e00\u7eb8\u8584\u8584\u7684\u4e66\u9875\uff0c\u8d70\u51fa\u4e86\u5c71\u95e8\u3002

    \\(\\hspace{1cm}\\)\u6211\u7a81\u7136\u60f3\u8d77\u5f88\u591a\u5e74\u524d\uff0c\u5728\u5988\u5988\u8fd8\u5728\u4e3a\u6211\u8bb2\u7761\u524d\u6545\u4e8b\u7684\u65f6\u5019\uff1a\u6211\u5e74\u7eaa\u5c0f\uff0c\u603b\u662f\u542c\u5230\u4e00\u534a\u5c31\u660f\u660f\u5165\u7761\uff0c\u4f46\u5988\u5988\u603b\u4f1a\u8bb2\u5b8c\u5979\u7684\u6545\u4e8b\u3002

    \\(\\hspace{1cm}\\)\u6211\u60f3\u8d77\u591a\u5e74\u524d\u7684\u90a3\u4e2a\u591c\u665a\uff0c\u661f\u661f\u5929\u771f\u5730\u5728\u591c\u7a7a\u6d82\u9e26\uff0c\u5988\u5988\u770b\u7740\u6211\u7761\u773c\u60fa\u5fea\uff0c\u8f7b\u58f0\u5730\u8bb2\u7740\u6545\u4e8b\u7684\u7ed3\u5c3e\uff1a\u4ed6\u6700\u7ec8\u6ca1\u80fd\u6210\u4e3a\u5927\u4fa0\uff0c\u4f46\u4ed6\u52c7\u6562\uff0c\u575a\u5b9a\uff0c\u5766\u8361\u800c\u6f84\u6f88\uff0c\u4ed6\u770b\u8fc7\u5c71\u7684\u9ad8\u5927\uff0c\u770b\u8fc7\u6d77\u7684\u8fbd\u9614\uff0c\u4eba\u4eec\u8bf4\u4ed6\u4e00\u4e8b\u65e0\u6210\uff0c\u53ea\u662f\u6d6a\u8361\u6c5f\u6e56\uff0c\u4ed6\u4e0d\u540e\u6094\u3002

    "},{"location":"AI/net/","title":"Neural Networks and Deep Learning","text":""},{"location":"AI/net/#convolutional-neural-networkcnn","title":"Convolutional Neural Network(CNN)","text":"

    https://leovan.me/cn/2018/08/cnn/

    "},{"location":"AI/net/#recurrent-neural-network-rnn","title":"Recurrent Neural Network \uff08RNN\uff09","text":"

    \\(O_t=g(V\\cdot S_t)\\)

    \\(S_t=\\Phi(U\\cdot X_t+W\\cdot S_{t-1})\\) \\(\\Phi\\)\uff08\u6fc0\u6d3b\u51fd\u6570\uff09

    "},{"location":"AI/net/#back-propagation","title":"Back propagation","text":""},{"location":"AI/net/#intro","title":"Intro","text":"

    \\(Cost=H(W_{11},W_{12},\u2026\u2026,W_{mn})\\)

    \\(\\triangledown H=\\frac{\\partial H}{\\partial W_{11}}e_{11}+\\frac{\\partial H}{\\partial W_{12}}e_{12}+\u2026\u2026+\\frac{\\partial H}{\\partial W_{mn}}e_{mn}\\)

    https://zhuanlan.zhihu.com/p/115571464

    https://towardsdatascience.com/understanding-backpropagation-algorithm-7bb3aa2f95fd

    \u53cd\u5411\u4f20\u64ad\uff08Backpropagation\uff09\u662f\u4e00\u79cd\u7528\u4e8e\u8bad\u7ec3\u795e\u7ecf\u7f51\u7edc\u7684\u4f18\u5316\u7b97\u6cd5\uff0c\u901a\u8fc7\u8ba1\u7b97\u635f\u5931\u51fd\u6570\u5173\u4e8e\u7f51\u7edc\u53c2\u6570\u7684\u68af\u5ea6\uff0c\u5e76\u5229\u7528\u8fd9\u4e9b\u68af\u5ea6\u6765\u66f4\u65b0\u53c2\u6570\uff0c\u4ee5\u6700\u5c0f\u5316\u635f\u5931\u51fd\u6570\u3002

    1. \u524d\u5411\u4f20\u64ad\uff08Forward Propagation\uff09\uff1a \u5c06\u8f93\u5165\u6570\u636e\u901a\u8fc7\u795e\u7ecf\u7f51\u7edc\u8fdb\u884c\u6b63\u5411\u4f20\u64ad\uff0c\u8ba1\u7b97\u6bcf\u4e00\u5c42\u7684\u8f93\u51fa\u3002
    2. \u8ba1\u7b97\u635f\u5931\uff08Compute Loss\uff09\uff1a \u4f7f\u7528\u7f51\u7edc\u7684\u8f93\u51fa\u548c\u771f\u5b9e\u6807\u7b7e\u8ba1\u7b97\u635f\u5931\u51fd\u6570\uff0c\u8861\u91cf\u7f51\u7edc\u7684\u6027\u80fd\u597d\u574f\u3002
    3. \u53cd\u5411\u4f20\u64ad\u68af\u5ea6\uff08Backward Pass\uff09\uff1a \u4ece\u8f93\u51fa\u5c42\u5f00\u59cb\uff0c\u8ba1\u7b97\u635f\u5931\u51fd\u6570\u5173\u4e8e\u6bcf\u4e2a\u53c2\u6570\u7684\u68af\u5ea6\u3002\u8fd9\u662f\u901a\u8fc7\u4f7f\u7528\u94fe\u5f0f\u6cd5\u5219\u6765\u8ba1\u7b97\u7684\uff0c\u5c06\u68af\u5ea6\u4ece\u8f93\u51fa\u5c42\u5411\u8f93\u5165\u5c42\u4f20\u64ad\u3002
    4. \u53c2\u6570\u66f4\u65b0\uff08Update Parameters\uff09\uff1a \u4f7f\u7528\u68af\u5ea6\u4e0b\u964d\u6216\u5176\u4ed6\u4f18\u5316\u7b97\u6cd5\uff0c\u901a\u8fc7\u5c06\u68af\u5ea6\u4e58\u4ee5\u4e00\u4e2a\u5b66\u4e60\u7387\uff0c\u6765\u66f4\u65b0\u7f51\u7edc\u53c2\u6570\u3002\u5b66\u4e60\u7387\u63a7\u5236\u4e86\u6bcf\u6b21\u53c2\u6570\u66f4\u65b0\u7684\u6b65\u957f\uff0c\u4ee5\u907f\u514d\u8df3\u8fc7\u6700\u4f18\u89e3\u3002
    5. \u91cd\u590d\u8fed\u4ee3\uff08Repeat\uff09\uff1a \u91cd\u590d\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u76f4\u5230\u635f\u5931\u51fd\u6570\u6536\u655b\u5230\u6ee1\u610f\u7684\u7a0b\u5ea6\u6216\u8fbe\u5230\u9884\u5b9a\u7684\u8bad\u7ec3\u6b21\u6570\u3002
    "},{"location":"AI/net/#_1","title":"\u68af\u5ea6\u7684\u8ba1\u7b97","text":"

    \u8ba1\u7b97\u635f\u5931\u51fd\u6570\u5bf9\u7f51\u7edc\u8f93\u51fa\u7684\u68af\u5ea6\uff08\u5373\u635f\u5931\u51fd\u6570\u5173\u4e8e\u8f93\u51fa\u7684\u5bfc\u6570\uff09\u3002

    • \u4f7f\u7528\u94fe\u5f0f\u6cd5\u5219\uff0c\u5c06\u68af\u5ea6\u4ece\u8f93\u51fa\u5c42\u4f20\u64ad\u5230\u8f93\u5165\u5c42\uff0c\u8ba1\u7b97\u6bcf\u4e00\u5c42\u7684\u68af\u5ea6\u3002
    • \u6839\u636e\u68af\u5ea6\u548c\u9009\u62e9\u7684\u4f18\u5316\u7b97\u6cd5\uff0c\u66f4\u65b0\u6bcf\u4e2a\u53c2\u6570\u3002

    \u8fd9\u4e2a\u8fc7\u7a0b\u662f\u901a\u8fc7\u53cd\u5411\u4f20\u64ad\u548c\u68af\u5ea6\u4e0b\u964d\u7b97\u6cd5\u7684\u7ed3\u5408\u6765\u5b9e\u73b0\u7684\uff0c\u4ee5\u6700\u5c0f\u5316\u635f\u5931\u51fd\u6570\u5e76\u4f18\u5316\u795e\u7ecf\u7f51\u7edc\u7684\u53c2\u6570\u3002

    "},{"location":"AI/net/#_2","title":"\u53c2\u6570\u66f4\u65b0","text":"

    \\(\u03b8_{new}=\u03b8_{old}\u2212\u03b1\u2207L(\u03b8_{old})\\)

    \u5176\u4e2d\uff1a

    • \\(\u03b8_{old}\\) \u662f\u5f53\u524d\u7684\u53c2\u6570\u503c\u3002
    • \\(\u2207L(\u03b8_{old}\\)\u662f\u635f\u5931\u51fd\u6570\u76f8\u5bf9\u4e8e\u53c2\u6570\u7684\u68af\u5ea6\u3002
    • \\(\u03b1\\) \u662f\u5b66\u4e60\u7387\uff0c\u662f\u4e00\u4e2a\u5c0f\u6b63\u6570\u3002

    \u8fd9\u4e2a\u66f4\u65b0\u89c4\u5219\u7684\u76f4\u89c2\u89e3\u91ca\u662f\uff0c\u6211\u4eec\u6cbf\u7740\u635f\u5931\u51fd\u6570\u4e0b\u964d\u6700\u5feb\u7684\u65b9\u5411\u66f4\u65b0\u53c2\u6570\u3002\u68af\u5ea6\u544a\u8bc9\u6211\u4eec\u635f\u5931\u51fd\u6570\u5728\u5f53\u524d\u70b9\u4e0a\u5347\u6700\u5feb\u7684\u65b9\u5411\uff0c\u6211\u4eec\u6cbf\u7740\u68af\u5ea6\u7684\u53cd\u65b9\u5411\u524d\u8fdb\uff0c\u4ee5\u964d\u4f4e\u635f\u5931\u3002

    \u5b66\u4e60\u7387\u7684\u9009\u62e9\u662f\u5173\u952e\u7684\u3002\u5982\u679c\u5b66\u4e60\u7387\u592a\u5c0f\uff0c\u6536\u655b\u901f\u5ea6\u4f1a\u5f88\u6162\uff0c\u800c\u5982\u679c\u5b66\u4e60\u7387\u592a\u5927\uff0c\u6211\u4eec\u53ef\u80fd\u4f1a\u8df3\u8fc7\u635f\u5931\u51fd\u6570\u7684\u6700\u5c0f\u503c\u3002\u56e0\u6b64\uff0c\u9009\u62e9\u4e00\u4e2a\u5408\u9002\u7684\u5b66\u4e60\u7387\u5bf9\u4e8e\u8bad\u7ec3\u795e\u7ecf\u7f51\u7edc\u81f3\u5173\u91cd\u8981\u3002

    \u901a\u5e38\uff0c\u5728\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\uff0c\u5b66\u4e60\u7387\u53ef\u80fd\u4f1a\u968f\u7740\u65f6\u95f4\u7684\u63a8\u79fb\u800c\u53d8\u5316\uff0c\u8fd9\u88ab\u79f0\u4e3a\u5b66\u4e60\u7387\u8c03\u5ea6\uff08learning rate scheduling\uff09\u3002\u4f8b\u5982\uff0c\u521d\u59cb\u65f6\u53ef\u4ee5\u4f7f\u7528\u8f83\u5927\u7684\u5b66\u4e60\u7387\u4ee5\u5feb\u901f\u6536\u655b\uff0c\u7136\u540e\u968f\u7740\u8bad\u7ec3\u7684\u8fdb\u884c\u9010\u6e10\u51cf\u5c0f\u5b66\u4e60\u7387\uff0c\u4ee5\u63d0\u9ad8\u6536\u655b\u7684\u7cbe\u5ea6\u3002

    \u603b\u7684\u6765\u8bf4\uff0c\u5b66\u4e60\u7387\u662f\u4e00\u4e2a\u5e73\u8861\u8bad\u7ec3\u901f\u5ea6\u548c\u6027\u80fd\u7684\u5173\u952e\u56e0\u7d20\u3002\u4e0d\u540c\u7684\u95ee\u9898\u53ef\u80fd\u9700\u8981\u4e0d\u540c\u7684\u5b66\u4e60\u7387\uff0c\u56e0\u6b64\u5b83\u901a\u5e38\u9700\u8981\u901a\u8fc7\u5b9e\u9a8c\u6765\u8c03\u6574\u3002

    "},{"location":"AI/net/#back-propagation-in-cnn","title":"Back propagation in CNN","text":"

    https://mmuratarat.github.io/2019-02-07/bptt-of-rnn

    "},{"location":"AI/net/#long-short-term-memory","title":"Long Short-Term Memory","text":"

    https://easyai.tech/ai-definition/rnn/

    https://blog.csdn.net/u012328159/article/details/87567358

    "},{"location":"AI/net/#attention","title":"Attention","text":"

    https://www.cnblogs.com/gczr/p/14693829.html

    https://zhuanlan.zhihu.com/p/379722366

    "},{"location":"AI/pca/","title":"\u6570\u636e\u7684\u5411\u91cf\u8868\u793a\u53ca\u964d\u7ef4\u95ee\u9898","text":"

    \u6ce8\u660e\uff1a\u6765\u6e90

    • \u57fa

    \u4e0b\u9762\u6211\u4eec\u7ee7\u7eed\u5728\u4e8c\u7ef4\u7a7a\u95f4\u5185\u8ba8\u8bba\u5411\u91cf\u3002\u4e0a\u6587\u8bf4\u8fc7\uff0c\u4e00\u4e2a\u4e8c\u7ef4\u5411\u91cf\u53ef\u4ee5\u5bf9\u5e94\u4e8c\u7ef4\u7b1b\u5361\u5c14\u76f4\u89d2\u5750\u6807\u7cfb\u4e2d\u4ece\u539f\u70b9\u51fa\u53d1\u7684\u4e00\u4e2a\u6709\u5411\u7ebf\u6bb5\u3002\u4f8b\u5982\u4e0b\u9762\u8fd9\u4e2a\u5411\u91cf\uff1a

    \u5728\u4ee3\u6570\u8868\u793a\u65b9\u9762\uff0c\u6211\u4eec\u7ecf\u5e38\u7528\u7ebf\u6bb5\u7ec8\u70b9\u7684\u70b9\u5750\u6807\u8868\u793a\u5411\u91cf\uff0c\u4f8b\u5982\u4e0a\u9762\u7684\u5411\u91cf\u53ef\u4ee5\u8868\u793a\u4e3a(3,2)\uff0c\u8fd9\u662f\u6211\u4eec\u518d\u719f\u6089\u4e0d\u8fc7\u7684\u5411\u91cf\u8868\u793a\u3002

    \u4e0d\u8fc7\u6211\u4eec\u5e38\u5e38\u5ffd\u7565\uff0c\u53ea\u6709\u4e00\u4e2a(3,2)\u672c\u8eab\u662f\u4e0d\u80fd\u591f\u7cbe\u786e\u8868\u793a\u4e00\u4e2a\u5411\u91cf\u7684\u3002\u6211\u4eec\u4ed4\u7ec6\u770b\u4e00\u4e0b\uff0c\u8fd9\u91cc\u76843\u5b9e\u9645\u8868\u793a\u7684\u662f\u5411\u91cf\u5728x\u8f74\u4e0a\u7684\u6295\u5f71\u503c\u662f3\uff0c\u5728y\u8f74\u4e0a\u7684\u6295\u5f71\u503c\u662f2\u3002\u4e5f\u5c31\u662f\u8bf4\u6211\u4eec\u5176\u5b9e\u9690\u5f0f\u5f15\u5165\u4e86\u4e00\u4e2a\u5b9a\u4e49\uff1a\u4ee5x\u8f74\u548cy\u8f74\u4e0a\u6b63\u65b9\u5411\u957f\u5ea6\u4e3a1\u7684\u5411\u91cf\u4e3a\u6807\u51c6\u3002\u90a3\u4e48\u4e00\u4e2a\u5411\u91cf(3,2)\u5b9e\u9645\u662f\u8bf4\u5728x\u8f74\u6295\u5f71\u4e3a3\u800cy\u8f74\u7684\u6295\u5f71\u4e3a2\u3002\u6ce8\u610f\u6295\u5f71\u662f\u4e00\u4e2a\u77e2\u91cf\uff0c\u6240\u4ee5\u53ef\u4ee5\u4e3a\u8d1f\u3002

    \u66f4\u6b63\u5f0f\u7684\u8bf4\uff0c\u5411\u91cf(x,y)\u5b9e\u9645\u4e0a\u8868\u793a\u7ebf\u6027\u7ec4\u5408\uff1a

    \\[x(1,0)^\\mathsf{T}+y(0,1)^\\mathsf{T}\\]

    \u4e0d\u96be\u8bc1\u660e\u6240\u6709\u4e8c\u7ef4\u5411\u91cf\u90fd\u53ef\u4ee5\u8868\u793a\u4e3a\u8fd9\u6837\u7684\u7ebf\u6027\u7ec4\u5408\u3002\u6b64\u5904(1,0)\u548c(0,1)\u53eb\u505a\u4e8c\u7ef4\u7a7a\u95f4\u4e2d\u7684\u4e00\u7ec4\u57fa\u3002

    \u6240\u4ee5\uff0c\u8981\u51c6\u786e\u63cf\u8ff0\u5411\u91cf\uff0c\u9996\u5148\u8981\u786e\u5b9a\u4e00\u7ec4\u57fa\uff0c\u7136\u540e\u7ed9\u51fa\u5728\u57fa\u6240\u5728\u7684\u5404\u4e2a\u76f4\u7ebf\u4e0a\u7684\u6295\u5f71\u503c\uff0c\u5c31\u53ef\u4ee5\u4e86\u3002\u53ea\u4e0d\u8fc7\u6211\u4eec\u7ecf\u5e38\u7701\u7565\u7b2c\u4e00\u6b65\uff0c\u800c\u9ed8\u8ba4\u4ee5(1,0)\u548c(0,1)\u4e3a\u57fa\u3002

    \u6211\u4eec\u4e4b\u6240\u4ee5\u9ed8\u8ba4\u9009\u62e9(1,0)\u548c(0,1)\u4e3a\u57fa\uff0c\u5f53\u7136\u662f\u6bd4\u8f83\u65b9\u4fbf\uff0c\u56e0\u4e3a\u5b83\u4eec\u5206\u522b\u662fx\u548cy\u8f74\u6b63\u65b9\u5411\u4e0a\u7684\u5355\u4f4d\u5411\u91cf\uff0c\u56e0\u6b64\u5c31\u4f7f\u5f97\u4e8c\u7ef4\u5e73\u9762\u4e0a\u70b9\u5750\u6807\u548c\u5411\u91cf\u4e00\u4e00\u5bf9\u5e94\uff0c\u975e\u5e38\u65b9\u4fbf\u3002\u4f46\u5b9e\u9645\u4e0a\u4efb\u4f55\u4e24\u4e2a\u7ebf\u6027\u65e0\u5173\u7684\u4e8c\u7ef4\u5411\u91cf\u90fd\u53ef\u4ee5\u6210\u4e3a\u4e00\u7ec4\u57fa\uff0c\u6240\u8c13\u7ebf\u6027\u65e0\u5173\u5728\u4e8c\u7ef4\u5e73\u9762\u5185\u53ef\u4ee5\u76f4\u89c2\u8ba4\u4e3a\u662f\u4e24\u4e2a\u4e0d\u5728\u4e00\u6761\u76f4\u7ebf\u4e0a\u7684\u5411\u91cf\u3002

    \u4f8b\u5982\uff0c(1,1)\u548c(-1,1)\u4e5f\u53ef\u4ee5\u6210\u4e3a\u4e00\u7ec4\u57fa\u3002\u4e00\u822c\u6765\u8bf4\uff0c\u6211\u4eec\u5e0c\u671b\u57fa\u7684\u6a21\u662f1\uff0c\u56e0\u4e3a\u4ece\u5185\u79ef\u7684\u610f\u4e49\u53ef\u4ee5\u770b\u5230\uff0c\u5982\u679c\u57fa\u7684\u6a21\u662f1\uff0c\u90a3\u4e48\u5c31\u53ef\u4ee5\u65b9\u4fbf\u7684\u7528\u5411\u91cf\u70b9\u4e58\u57fa\u800c\u76f4\u63a5\u83b7\u5f97\u5176\u5728\u65b0\u57fa\u4e0a\u7684\u5750\u6807\u4e86\uff01\u5b9e\u9645\u4e0a\uff0c\u5bf9\u5e94\u4efb\u4f55\u4e00\u4e2a\u5411\u91cf\u6211\u4eec\u603b\u53ef\u4ee5\u627e\u5230\u5176\u540c\u65b9\u5411\u4e0a\u6a21\u4e3a1\u7684\u5411\u91cf\uff0c\u53ea\u8981\u8ba9\u4e24\u4e2a\u5206\u91cf\u5206\u522b\u9664\u4ee5\u6a21\u5c31\u597d\u4e86\u3002\u4f8b\u5982\uff0c\u4e0a\u9762\u7684\u57fa\u53ef\u4ee5\u53d8\u4e3a\\((\\frac{1}{\\sqrt{2}},\\frac{1}{\\sqrt{2}})\\)\u548c\\((-\\frac{1}{\\sqrt{2}},\\frac{1}{\\sqrt{2}})\\)\u3002

    \u73b0\u5728\uff0c\u6211\u4eec\u60f3\u83b7\u5f97(3,2)\u5728\u65b0\u57fa\u4e0a\u7684\u5750\u6807\uff0c\u5373\u5728\u4e24\u4e2a\u65b9\u5411\u4e0a\u7684\u6295\u5f71\u77e2\u91cf\u503c\uff0c\u90a3\u4e48\u6839\u636e\u5185\u79ef\u7684\u51e0\u4f55\u610f\u4e49\uff0c\u6211\u4eec\u53ea\u8981\u5206\u522b\u8ba1\u7b97(3,2)\u548c\u4e24\u4e2a\u57fa\u7684\u5185\u79ef\uff0c\u4e0d\u96be\u5f97\u5230\u65b0\u7684\u5750\u6807\u4e3a\\((\\frac{5}{\\sqrt{2}},-\\frac{1}{\\sqrt{2}})\\)\u3002\u4e0b\u56fe\u7ed9\u51fa\u4e86\u65b0\u7684\u57fa\u4ee5\u53ca(3,2)\u5728\u65b0\u57fa\u4e0a\u5750\u6807\u503c\u7684\u793a\u610f\u56fe\uff1a

    \u53e6\u5916\u8fd9\u91cc\u8981\u6ce8\u610f\u7684\u662f\uff0c\u6211\u4eec\u5217\u4e3e\u7684\u4f8b\u5b50\u4e2d\u57fa\u662f\u6b63\u4ea4\u7684\uff08\u5373\u5185\u79ef\u4e3a0\uff0c\u6216\u76f4\u89c2\u8bf4\u76f8\u4e92\u5782\u76f4\uff09\uff0c\u4f46\u53ef\u4ee5\u6210\u4e3a\u4e00\u7ec4\u57fa\u7684\u552f\u4e00\u8981\u6c42\u5c31\u662f\u7ebf\u6027\u65e0\u5173\uff0c\u975e\u6b63\u4ea4\u7684\u57fa\u4e5f\u662f\u53ef\u4ee5\u7684\u3002\u4e0d\u8fc7\u56e0\u4e3a\u6b63\u4ea4\u57fa\u6709\u8f83\u597d\u7684\u6027\u8d28\uff0c\u6240\u4ee5\u4e00\u822c\u4f7f\u7528\u7684\u57fa\u90fd\u662f\u6b63\u4ea4\u7684\u3002

    • \u57fa\u53d8\u6362\u7684\u77e9\u9635\u8868\u793a

    \u4e0b\u9762\u6211\u4eec\u627e\u4e00\u79cd\u7b80\u4fbf\u7684\u65b9\u5f0f\u6765\u8868\u793a\u57fa\u53d8\u6362\u3002\u8fd8\u662f\u62ff\u4e0a\u9762\u7684\u4f8b\u5b50\uff0c\u60f3\u4e00\u4e0b\uff0c\u5c06(3,2)\u53d8\u6362\u4e3a\u65b0\u57fa\u4e0a\u7684\u5750\u6807\uff0c\u5c31\u662f\u7528(3,2)\u4e0e\u7b2c\u4e00\u4e2a\u57fa\u505a\u5185\u79ef\u8fd0\u7b97\uff0c\u4f5c\u4e3a\u7b2c\u4e00\u4e2a\u65b0\u7684\u5750\u6807\u5206\u91cf\uff0c\u7136\u540e\u7528(3,2)\u4e0e\u7b2c\u4e8c\u4e2a\u57fa\u505a\u5185\u79ef\u8fd0\u7b97\uff0c\u4f5c\u4e3a\u7b2c\u4e8c\u4e2a\u65b0\u5750\u6807\u7684\u5206\u91cf\u3002\u5b9e\u9645\u4e0a\uff0c\u6211\u4eec\u53ef\u4ee5\u7528\u77e9\u9635\u76f8\u4e58\u7684\u5f62\u5f0f\u7b80\u6d01\u7684\u8868\u793a\u8fd9\u4e2a\u53d8\u6362\uff1a

    \\[\\begin{pmatrix} 1/\\sqrt{2} & 1/\\sqrt{2} \\\\ -1/\\sqrt{2} & 1/\\sqrt{2} \\end{pmatrix} \\begin{pmatrix} 3 \\\\ 2 \\end{pmatrix} = \\begin{pmatrix} 5/\\sqrt{2} \\\\ -1/\\sqrt{2} \\end{pmatrix}\\]

    \u592a\u6f02\u4eae\u4e86\uff01\u5176\u4e2d\u77e9\u9635\u7684\u4e24\u884c\u5206\u522b\u4e3a\u4e24\u4e2a\u57fa\uff0c\u4e58\u4ee5\u539f\u5411\u91cf\uff0c\u5176\u7ed3\u679c\u521a\u597d\u4e3a\u65b0\u57fa\u7684\u5750\u6807\u3002\u53ef\u4ee5\u7a0d\u5fae\u63a8\u5e7f\u4e00\u4e0b\uff0c\u5982\u679c\u6211\u4eec\u6709m\u4e2a\u4e8c\u7ef4\u5411\u91cf\uff0c\u53ea\u8981\u5c06\u4e8c\u7ef4\u5411\u91cf\u6309\u5217\u6392\u6210\u4e00\u4e2a\u4e24\u884cm\u5217\u77e9\u9635\uff0c\u7136\u540e\u7528\u201c\u57fa\u77e9\u9635\u201d\u4e58\u4ee5\u8fd9\u4e2a\u77e9\u9635\uff0c\u5c31\u5f97\u5230\u4e86\u6240\u6709\u8fd9\u4e9b\u5411\u91cf\u5728\u65b0\u57fa\u4e0b\u7684\u503c\u3002\u4f8b\u5982(1,1)\uff0c(2,2)\uff0c(3,3)\uff0c\u60f3\u53d8\u6362\u5230\u521a\u624d\u90a3\u7ec4\u57fa\u4e0a\uff0c\u5219\u53ef\u4ee5\u8fd9\u6837\u8868\u793a\uff1a

    \\[\\begin{pmatrix} 1/\\sqrt{2} & 1/\\sqrt{2} \\\\ -1/\\sqrt{2} & 1/\\sqrt{2} \\end{pmatrix} \\begin{pmatrix} 1 & 2 & 3 \\\\ 1 & 2 & 3 \\end{pmatrix} = \\begin{pmatrix} 2/\\sqrt{2} & 4/\\sqrt{2} & 6/\\sqrt{2} \\\\ 0 & 0 & 0 \\end{pmatrix}\\]

    \u4e8e\u662f\u4e00\u7ec4\u5411\u91cf\u7684\u57fa\u53d8\u6362\u88ab\u5e72\u51c0\u7684\u8868\u793a\u4e3a\u77e9\u9635\u7684\u76f8\u4e58\u3002

    \u4e00\u822c\u7684\uff0c\u5982\u679c\u6211\u4eec\u6709M\u4e2aN\u7ef4\u5411\u91cf\uff0c\u60f3\u5c06\u5176\u53d8\u6362\u4e3a\u7531R\u4e2aN\u7ef4\u5411\u91cf\u8868\u793a\u7684\u65b0\u7a7a\u95f4\u4e2d\uff0c\u90a3\u4e48\u9996\u5148\u5c06R\u4e2a\u57fa\u6309\u884c\u7ec4\u6210\u77e9\u9635A\uff0c\u7136\u540e\u5c06\u5411\u91cf\u6309\u5217\u7ec4\u6210\u77e9\u9635B\uff0c\u90a3\u4e48\u4e24\u77e9\u9635\u7684\u4e58\u79efAB\u5c31\u662f\u53d8\u6362\u7ed3\u679c\uff0c\u5176\u4e2dAB\u7684\u7b2cm\u5217\u4e3aA\u4e2d\u7b2cm\u5217\u53d8\u6362\u540e\u7684\u7ed3\u679c\u3002

    \u6570\u5b66\u8868\u793a\u4e3a\uff1a

    \\[\\begin{pmatrix} p_1 \\\\ p_2 \\\\ \\vdots \\\\ p_R \\end{pmatrix} \\begin{pmatrix} a_1 & a_2 & \\cdots & a_M \\end{pmatrix} = \\begin{pmatrix} p_1a_1 & p_1a_2 & \\cdots & p_1a_M \\\\ p_2a_1 & p_2a_2 & \\cdots & p_2a_M \\\\ \\vdots & \\vdots & \\ddots & \\vdots \\\\ p_Ra_1 & p_Ra_2 & \\cdots & p_Ra_M \\end{pmatrix}\\]

    \u5176\u4e2d\\(p_i\\)\u662f\u4e00\u4e2a\u884c\u5411\u91cf\uff0c\u8868\u793a\u7b2ci\u4e2a\u57fa\uff0c\\(a_j\\)\u662f\u4e00\u4e2a\u5217\u5411\u91cf\uff0c\u8868\u793a\u7b2cj\u4e2a\u539f\u59cb\u6570\u636e\u8bb0\u5f55\u3002

    \u7279\u522b\u8981\u6ce8\u610f\u7684\u662f\uff0c\u8fd9\u91ccR\u53ef\u4ee5\u5c0f\u4e8eN\uff0c\u800cR\u51b3\u5b9a\u4e86\u53d8\u6362\u540e\u6570\u636e\u7684\u7ef4\u6570\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u4e00N\u7ef4\u6570\u636e\u53d8\u6362\u5230\u66f4\u4f4e\u7ef4\u5ea6\u7684\u7a7a\u95f4\u4e2d\u53bb\uff0c\u53d8\u6362\u540e\u7684\u7ef4\u5ea6\u53d6\u51b3\u4e8e\u57fa\u7684\u6570\u91cf\u3002\u56e0\u6b64\u8fd9\u79cd\u77e9\u9635\u76f8\u4e58\u7684\u8868\u793a\u4e5f\u53ef\u4ee5\u8868\u793a\u964d\u7ef4\u53d8\u6362\u3002

    \u6700\u540e\uff0c\u4e0a\u8ff0\u5206\u6790\u540c\u65f6\u7ed9\u77e9\u9635\u76f8\u4e58\u627e\u5230\u4e86\u4e00\u79cd\u7269\u7406\u89e3\u91ca\uff1a\u4e24\u4e2a\u77e9\u9635\u76f8\u4e58\u7684\u610f\u4e49\u662f\u5c06\u53f3\u8fb9\u77e9\u9635\u4e2d\u7684\u6bcf\u4e00\u5217\u5217\u5411\u91cf\u53d8\u6362\u5230\u5de6\u8fb9\u77e9\u9635\u4e2d\u6bcf\u4e00\u884c\u884c\u5411\u91cf\u4e3a\u57fa\u6240\u8868\u793a\u7684\u7a7a\u95f4\u4e2d\u53bb\u3002\u66f4\u62bd\u8c61\u7684\u8bf4\uff0c\u4e00\u4e2a\u77e9\u9635\u53ef\u4ee5\u8868\u793a\u4e00\u79cd\u7ebf\u6027\u53d8\u6362\u3002\u5f88\u591a\u540c\u5b66\u5728\u5b66\u7ebf\u6027\u4ee3\u6570\u65f6\u5bf9\u77e9\u9635\u76f8\u4e58\u7684\u65b9\u6cd5\u611f\u5230\u5947\u602a\uff0c\u4f46\u662f\u5982\u679c\u660e\u767d\u4e86\u77e9\u9635\u76f8\u4e58\u7684\u7269\u7406\u610f\u4e49\uff0c\u5176\u5408\u7406\u6027\u5c31\u4e00\u76ee\u4e86\u7136\u4e86\u3002

    "},{"location":"AI/pca/#_2","title":"\u534f\u65b9\u5dee\u77e9\u9635\u53ca\u4f18\u5316\u76ee\u6807","text":"

    \u4e0a\u9762\u6211\u4eec\u8ba8\u8bba\u4e86\u9009\u62e9\u4e0d\u540c\u7684\u57fa\u53ef\u4ee5\u5bf9\u540c\u6837\u4e00\u7ec4\u6570\u636e\u7ed9\u51fa\u4e0d\u540c\u7684\u8868\u793a\uff0c\u800c\u4e14\u5982\u679c\u57fa\u7684\u6570\u91cf\u5c11\u4e8e\u5411\u91cf\u672c\u8eab\u7684\u7ef4\u6570\uff0c\u5219\u53ef\u4ee5\u8fbe\u5230\u964d\u7ef4\u7684\u6548\u679c\u3002\u4f46\u662f\u6211\u4eec\u8fd8\u6ca1\u6709\u56de\u7b54\u4e00\u4e2a\u6700\u6700\u5173\u952e\u7684\u95ee\u9898\uff1a\u5982\u4f55\u9009\u62e9\u57fa\u624d\u662f\u6700\u4f18\u7684\u3002\u6216\u8005\u8bf4\uff0c\u5982\u679c\u6211\u4eec\u6709\u4e00\u7ec4N\u7ef4\u5411\u91cf\uff0c\u73b0\u5728\u8981\u5c06\u5176\u964d\u5230K\u7ef4\uff08K\u5c0f\u4e8eN\uff09\uff0c\u90a3\u4e48\u6211\u4eec\u5e94\u8be5\u5982\u4f55\u9009\u62e9K\u4e2a\u57fa\u624d\u80fd\u6700\u5927\u7a0b\u5ea6\u4fdd\u7559\u539f\u6709\u7684\u4fe1\u606f\uff1f

    \u8981\u5b8c\u5168\u6570\u5b66\u5316\u8fd9\u4e2a\u95ee\u9898\u975e\u5e38\u7e41\u6742\uff0c\u8fd9\u91cc\u6211\u4eec\u7528\u4e00\u79cd\u975e\u5f62\u5f0f\u5316\u7684\u76f4\u89c2\u65b9\u6cd5\u6765\u770b\u8fd9\u4e2a\u95ee\u9898\u3002

    \u4e3a\u4e86\u907f\u514d\u8fc7\u4e8e\u62bd\u8c61\u7684\u8ba8\u8bba\uff0c\u6211\u4eec\u4ecd\u4ee5\u4e00\u4e2a\u5177\u4f53\u7684\u4f8b\u5b50\u5c55\u5f00\u3002\u5047\u8bbe\u6211\u4eec\u7684\u6570\u636e\u7531\u4e94\u6761\u8bb0\u5f55\u7ec4\u6210\uff0c\u5c06\u5b83\u4eec\u8868\u793a\u6210\u77e9\u9635\u5f62\u5f0f\uff1a

    \\[\\begin{pmatrix} 1 & 1 & 2 & 4 & 2 \\\\ 1 & 3 & 3 & 4 & 4 \\end{pmatrix}\\]

    \u5176\u4e2d\u6bcf\u4e00\u5217\u4e3a\u4e00\u6761\u6570\u636e\u8bb0\u5f55\uff0c\u800c\u4e00\u884c\u4e3a\u4e00\u4e2a\u5b57\u6bb5\u3002\u4e3a\u4e86\u540e\u7eed\u5904\u7406\u65b9\u4fbf\uff0c\u6211\u4eec\u9996\u5148\u5c06\u6bcf\u4e2a\u5b57\u6bb5\u5185\u6240\u6709\u503c\u90fd\u51cf\u53bb\u5b57\u6bb5\u5747\u503c\uff0c\u5176\u7ed3\u679c\u662f\u5c06\u6bcf\u4e2a\u5b57\u6bb5\u90fd\u53d8\u4e3a\u5747\u503c\u4e3a0\uff08\u8fd9\u6837\u505a\u7684\u9053\u7406\u548c\u597d\u5904\u540e\u9762\u4f1a\u770b\u5230\uff09\u3002

    \u6211\u4eec\u770b\u4e0a\u9762\u7684\u6570\u636e\uff0c\u7b2c\u4e00\u4e2a\u5b57\u6bb5\u5747\u503c\u4e3a2\uff0c\u7b2c\u4e8c\u4e2a\u5b57\u6bb5\u5747\u503c\u4e3a3\uff0c\u6240\u4ee5\u53d8\u6362\u540e\uff1a

    \\[\\begin{pmatrix} -1 & -1 & 0 & 2 & 0 \\\\ -2 & 0 & 0 & 1 & 1 \\end{pmatrix}\\]

    \u6211\u4eec\u53ef\u4ee5\u770b\u4e0b\u4e94\u6761\u6570\u636e\u5728\u5e73\u9762\u76f4\u89d2\u5750\u6807\u7cfb\u5185\u7684\u6837\u5b50\uff1a

    \u73b0\u5728\u95ee\u9898\u6765\u4e86\uff1a\u5982\u679c\u6211\u4eec\u5fc5\u987b\u4f7f\u7528\u4e00\u7ef4\u6765\u8868\u793a\u8fd9\u4e9b\u6570\u636e\uff0c\u53c8\u5e0c\u671b\u5c3d\u91cf\u4fdd\u7559\u539f\u59cb\u7684\u4fe1\u606f\uff0c\u4f60\u8981\u5982\u4f55\u9009\u62e9\uff1f

    \u901a\u8fc7\u4e0a\u4e00\u8282\u5bf9\u57fa\u53d8\u6362\u7684\u8ba8\u8bba\u6211\u4eec\u77e5\u9053\uff0c\u8fd9\u4e2a\u95ee\u9898\u5b9e\u9645\u4e0a\u662f\u8981\u5728\u4e8c\u7ef4\u5e73\u9762\u4e2d\u9009\u62e9\u4e00\u4e2a\u65b9\u5411\uff0c\u5c06\u6240\u6709\u6570\u636e\u90fd\u6295\u5f71\u5230\u8fd9\u4e2a\u65b9\u5411\u6240\u5728\u76f4\u7ebf\u4e0a\uff0c\u7528\u6295\u5f71\u503c\u8868\u793a\u539f\u59cb\u8bb0\u5f55\u3002\u8fd9\u662f\u4e00\u4e2a\u5b9e\u9645\u7684\u4e8c\u7ef4\u964d\u5230\u4e00\u7ef4\u7684\u95ee\u9898\u3002

    \u90a3\u4e48\u5982\u4f55\u9009\u62e9\u8fd9\u4e2a\u65b9\u5411\uff08\u6216\u8005\u8bf4\u57fa\uff09\u624d\u80fd\u5c3d\u91cf\u4fdd\u7559\u6700\u591a\u7684\u539f\u59cb\u4fe1\u606f\u5462\uff1f\u4e00\u79cd\u76f4\u89c2\u7684\u770b\u6cd5\u662f\uff1a\u5e0c\u671b\u6295\u5f71\u540e\u7684\u6295\u5f71\u503c\u5c3d\u53ef\u80fd\u5206\u6563\u3002

    \u4ee5\u4e0a\u56fe\u4e3a\u4f8b\uff0c\u53ef\u4ee5\u770b\u51fa\u5982\u679c\u5411x\u8f74\u6295\u5f71\uff0c\u90a3\u4e48\u6700\u5de6\u8fb9\u7684\u4e24\u4e2a\u70b9\u4f1a\u91cd\u53e0\u5728\u4e00\u8d77\uff0c\u4e2d\u95f4\u7684\u4e24\u4e2a\u70b9\u4e5f\u4f1a\u91cd\u53e0\u5728\u4e00\u8d77\uff0c\u4e8e\u662f\u672c\u8eab\u56db\u4e2a\u5404\u4e0d\u76f8\u540c\u7684\u4e8c\u7ef4\u70b9\u6295\u5f71\u540e\u53ea\u5269\u4e0b\u4e24\u4e2a\u4e0d\u540c\u7684\u503c\u4e86\uff0c\u8fd9\u662f\u4e00\u79cd\u4e25\u91cd\u7684\u4fe1\u606f\u4e22\u5931\uff0c\u540c\u7406\uff0c\u5982\u679c\u5411y\u8f74\u6295\u5f71\u6700\u4e0a\u9762\u7684\u4e24\u4e2a\u70b9\u548c\u5206\u5e03\u5728x\u8f74\u4e0a\u7684\u4e24\u4e2a\u70b9\u4e5f\u4f1a\u91cd\u53e0\u3002\u6240\u4ee5\u770b\u6765x\u548cy\u8f74\u90fd\u4e0d\u662f\u6700\u597d\u7684\u6295\u5f71\u9009\u62e9\u3002\u6211\u4eec\u76f4\u89c2\u76ee\u6d4b\uff0c\u5982\u679c\u5411\u901a\u8fc7\u7b2c\u4e00\u8c61\u9650\u548c\u7b2c\u4e09\u8c61\u9650\u7684\u659c\u7ebf\u6295\u5f71\uff0c\u5219\u4e94\u4e2a\u70b9\u5728\u6295\u5f71\u540e\u8fd8\u662f\u53ef\u4ee5\u533a\u5206\u7684\u3002

    \u4e0b\u9762\uff0c\u6211\u4eec\u7528\u6570\u5b66\u65b9\u6cd5\u8868\u8ff0\u8fd9\u4e2a\u95ee\u9898\u3002

    "},{"location":"AI/pca/#_3","title":"\u65b9\u5dee","text":"

    \u4e0a\u6587\u8bf4\u5230\uff0c\u6211\u4eec\u5e0c\u671b\u6295\u5f71\u540e\u6295\u5f71\u503c\u5c3d\u53ef\u80fd\u5206\u6563\uff0c\u800c\u8fd9\u79cd\u5206\u6563\u7a0b\u5ea6\uff0c\u53ef\u4ee5\u7528\u6570\u5b66\u4e0a\u7684\u65b9\u5dee\u6765\u8868\u8ff0\u3002\u6b64\u5904\uff0c\u4e00\u4e2a\u5b57\u6bb5\u7684\u65b9\u5dee\u53ef\u4ee5\u770b\u505a\u662f\u6bcf\u4e2a\u5143\u7d20\u4e0e\u5b57\u6bb5\u5747\u503c\u7684\u5dee\u7684\u5e73\u65b9\u548c\u7684\u5747\u503c\uff0c\u5373\uff1a

    \\[Var(a)=\\frac{1}{m}\\sum_{i=1}^m{(a_i-\\mu)^2}\\]

    \u7531\u4e8e\u4e0a\u9762\u6211\u4eec\u5df2\u7ecf\u5c06\u6bcf\u4e2a\u5b57\u6bb5\u7684\u5747\u503c\u90fd\u5316\u4e3a0\u4e86\uff0c\u56e0\u6b64\u65b9\u5dee\u53ef\u4ee5\u76f4\u63a5\u7528\u6bcf\u4e2a\u5143\u7d20\u7684\u5e73\u65b9\u548c\u9664\u4ee5\u5143\u7d20\u4e2a\u6570\u8868\u793a\uff1a

    \\[Var(a)=\\frac{1}{m}\\sum_{i=1}^m{a_i^2}\\]

    \u4e8e\u662f\u4e0a\u9762\u7684\u95ee\u9898\u88ab\u5f62\u5f0f\u5316\u8868\u8ff0\u4e3a\uff1a\u5bfb\u627e\u4e00\u4e2a\u4e00\u7ef4\u57fa\uff0c\u4f7f\u5f97\u6240\u6709\u6570\u636e\u53d8\u6362\u4e3a\u8fd9\u4e2a\u57fa\u4e0a\u7684\u5750\u6807\u8868\u793a\u540e\uff0c\u65b9\u5dee\u503c\u6700\u5927\u3002

    "},{"location":"AI/pca/#_4","title":"\u534f\u65b9\u5dee","text":"

    \u5bf9\u4e8e\u4e0a\u9762\u4e8c\u7ef4\u964d\u6210\u4e00\u7ef4\u7684\u95ee\u9898\u6765\u8bf4\uff0c\u627e\u5230\u90a3\u4e2a\u4f7f\u5f97\u65b9\u5dee\u6700\u5927\u7684\u65b9\u5411\u5c31\u53ef\u4ee5\u4e86\u3002\u4e0d\u8fc7\u5bf9\u4e8e\u66f4\u9ad8\u7ef4\uff0c\u8fd8\u6709\u4e00\u4e2a\u95ee\u9898\u9700\u8981\u89e3\u51b3\u3002\u8003\u8651\u4e09\u7ef4\u964d\u5230\u4e8c\u7ef4\u95ee\u9898\u3002\u4e0e\u4e4b\u524d\u76f8\u540c\uff0c\u9996\u5148\u6211\u4eec\u5e0c\u671b\u627e\u5230\u4e00\u4e2a\u65b9\u5411\u4f7f\u5f97\u6295\u5f71\u540e\u65b9\u5dee\u6700\u5927\uff0c\u8fd9\u6837\u5c31\u5b8c\u6210\u4e86\u7b2c\u4e00\u4e2a\u65b9\u5411\u7684\u9009\u62e9\uff0c\u7ee7\u800c\u6211\u4eec\u9009\u62e9\u7b2c\u4e8c\u4e2a\u6295\u5f71\u65b9\u5411\u3002

    \u5982\u679c\u6211\u4eec\u8fd8\u662f\u5355\u7eaf\u53ea\u9009\u62e9\u65b9\u5dee\u6700\u5927\u7684\u65b9\u5411\uff0c\u5f88\u660e\u663e\uff0c\u8fd9\u4e2a\u65b9\u5411\u4e0e\u7b2c\u4e00\u4e2a\u65b9\u5411\u5e94\u8be5\u662f\u201c\u51e0\u4e4e\u91cd\u5408\u5728\u4e00\u8d77\u201d\uff0c\u663e\u7136\u8fd9\u6837\u7684\u7ef4\u5ea6\u662f\u6ca1\u6709\u7528\u7684\uff0c\u56e0\u6b64\uff0c\u5e94\u8be5\u6709\u5176\u4ed6\u7ea6\u675f\u6761\u4ef6\u3002\u4ece\u76f4\u89c2\u4e0a\u8bf4\uff0c\u8ba9\u4e24\u4e2a\u5b57\u6bb5\u5c3d\u53ef\u80fd\u8868\u793a\u66f4\u591a\u7684\u539f\u59cb\u4fe1\u606f\uff0c\u6211\u4eec\u662f\u4e0d\u5e0c\u671b\u5b83\u4eec\u4e4b\u95f4\u5b58\u5728\uff08\u7ebf\u6027\uff09\u76f8\u5173\u6027\u7684\uff0c\u56e0\u4e3a\u76f8\u5173\u6027\u610f\u5473\u7740\u4e24\u4e2a\u5b57\u6bb5\u4e0d\u662f\u5b8c\u5168\u72ec\u7acb\uff0c\u5fc5\u7136\u5b58\u5728\u91cd\u590d\u8868\u793a\u7684\u4fe1\u606f\u3002

    \u6570\u5b66\u4e0a\u53ef\u4ee5\u7528\u4e24\u4e2a\u5b57\u6bb5\u7684\u534f\u65b9\u5dee\u8868\u793a\u5176\u76f8\u5173\u6027\uff0c\u7531\u4e8e\u5df2\u7ecf\u8ba9\u6bcf\u4e2a\u5b57\u6bb5\u5747\u503c\u4e3a0\uff0c\u5219\uff1a

    \\[Cov(a,b)=\\frac{1}{m}\\sum_{i=1}^m{a_ib_i}\\]

    \u53ef\u4ee5\u770b\u5230\uff0c\u5728\u5b57\u6bb5\u5747\u503c\u4e3a0\u7684\u60c5\u51b5\u4e0b\uff0c\u4e24\u4e2a\u5b57\u6bb5\u7684\u534f\u65b9\u5dee\u7b80\u6d01\u7684\u8868\u793a\u4e3a\u5176\u5185\u79ef\u9664\u4ee5\u5143\u7d20\u6570m\u3002

    \u5f53\u534f\u65b9\u5dee\u4e3a0\u65f6\uff0c\u8868\u793a\u4e24\u4e2a\u5b57\u6bb5\u5b8c\u5168\u72ec\u7acb\u3002\u4e3a\u4e86\u8ba9\u534f\u65b9\u5dee\u4e3a0\uff0c\u6211\u4eec\u9009\u62e9\u7b2c\u4e8c\u4e2a\u57fa\u65f6\u53ea\u80fd\u5728\u4e0e\u7b2c\u4e00\u4e2a\u57fa\u6b63\u4ea4\u7684\u65b9\u5411\u4e0a\u9009\u62e9\u3002\u56e0\u6b64\u6700\u7ec8\u9009\u62e9\u7684\u4e24\u4e2a\u65b9\u5411\u4e00\u5b9a\u662f\u6b63\u4ea4\u7684\u3002

    \u81f3\u6b64\uff0c\u6211\u4eec\u5f97\u5230\u4e86\u964d\u7ef4\u95ee\u9898\u7684\u4f18\u5316\u76ee\u6807\uff1a\u5c06\u4e00\u7ec4N\u7ef4\u5411\u91cf\u964d\u4e3aK\u7ef4\uff08K\u5927\u4e8e0\uff0c\u5c0f\u4e8eN\uff09\uff0c\u5176\u76ee\u6807\u662f\u9009\u62e9K\u4e2a\u5355\u4f4d\uff08\u6a21\u4e3a1\uff09\u6b63\u4ea4\u57fa\uff0c\u4f7f\u5f97\u539f\u59cb\u6570\u636e\u53d8\u6362\u5230\u8fd9\u7ec4\u57fa\u4e0a\u540e\uff0c\u5404\u5b57\u6bb5\u4e24\u4e24\u95f4\u534f\u65b9\u5dee\u4e3a0\uff0c\u800c\u5b57\u6bb5\u7684\u65b9\u5dee\u5219\u5c3d\u53ef\u80fd\u5927\uff08\u5728\u6b63\u4ea4\u7684\u7ea6\u675f\u4e0b\uff0c\u53d6\u6700\u5927\u7684K\u4e2a\u65b9\u5dee\uff09\u3002

    "},{"location":"AI/pca/#_5","title":"\u534f\u65b9\u5dee\u77e9\u9635","text":"

    \u4e0a\u9762\u6211\u4eec\u5bfc\u51fa\u4e86\u4f18\u5316\u76ee\u6807\uff0c\u4f46\u662f\u8fd9\u4e2a\u76ee\u6807\u4f3c\u4e4e\u4e0d\u80fd\u76f4\u63a5\u4f5c\u4e3a\u64cd\u4f5c\u6307\u5357\uff08\u6216\u8005\u8bf4\u7b97\u6cd5\uff09\uff0c\u56e0\u4e3a\u5b83\u53ea\u8bf4\u8981\u4ec0\u4e48\uff0c\u4f46\u6839\u672c\u6ca1\u6709\u8bf4\u600e\u4e48\u505a\u3002\u6240\u4ee5\u6211\u4eec\u8981\u7ee7\u7eed\u5728\u6570\u5b66\u4e0a\u7814\u7a76\u8ba1\u7b97\u65b9\u6848\u3002

    \u6211\u4eec\u770b\u5230\uff0c\u6700\u7ec8\u8981\u8fbe\u5230\u7684\u76ee\u7684\u4e0e\u5b57\u6bb5\u5185\u65b9\u5dee\u53ca\u5b57\u6bb5\u95f4\u534f\u65b9\u5dee\u6709\u5bc6\u5207\u5173\u7cfb\u3002\u56e0\u6b64\u6211\u4eec\u5e0c\u671b\u80fd\u5c06\u4e24\u8005\u7edf\u4e00\u8868\u793a\uff0c\u4ed4\u7ec6\u89c2\u5bdf\u53d1\u73b0\uff0c\u4e24\u8005\u5747\u53ef\u4ee5\u8868\u793a\u4e3a\u5185\u79ef\u7684\u5f62\u5f0f\uff0c\u800c\u5185\u79ef\u53c8\u4e0e\u77e9\u9635\u76f8\u4e58\u5bc6\u5207\u76f8\u5173\u3002\u4e8e\u662f\u6211\u4eec\u6765\u4e86\u7075\u611f\uff1a

    \u5047\u8bbe\u6211\u4eec\u53ea\u6709a\u548cb\u4e24\u4e2a\u5b57\u6bb5\uff0c\u90a3\u4e48\u6211\u4eec\u5c06\u5b83\u4eec\u6309\u884c\u7ec4\u6210\u77e9\u9635X\uff1a

    \\[X=\\begin{pmatrix} a_1 & a_2 & \\cdots & a_m \\\\ b_1 & b_2 & \\cdots & b_m \\end{pmatrix}\\]

    \u7136\u540e\u6211\u4eec\u7528X\u4e58\u4ee5X\u7684\u8f6c\u7f6e\uff0c\u5e76\u4e58\u4e0a\u7cfb\u65701/m\uff1a

    \\[\\frac{1}{m}XX^\\mathsf{T}=\\begin{pmatrix} \\frac{1}{m}\\sum_{i=1}^m{a_i^2} & \\frac{1}{m}\\sum_{i=1}^m{a_ib_i} \\\\ \\frac{1}{m}\\sum_{i=1}^m{a_ib_i} & \\frac{1}{m}\\sum_{i=1}^m{b_i^2} \\end{pmatrix}\\]

    \u5947\u8ff9\u51fa\u73b0\u4e86\uff01\u8fd9\u4e2a\u77e9\u9635\u5bf9\u89d2\u7ebf\u4e0a\u7684\u4e24\u4e2a\u5143\u7d20\u5206\u522b\u662f\u4e24\u4e2a\u5b57\u6bb5\u7684\u65b9\u5dee\uff0c\u800c\u5176\u5b83\u5143\u7d20\u662fa\u548cb\u7684\u534f\u65b9\u5dee\u3002\u4e24\u8005\u88ab\u7edf\u4e00\u5230\u4e86\u4e00\u4e2a\u77e9\u9635\u7684\u3002

    \u6839\u636e\u77e9\u9635\u76f8\u4e58\u7684\u8fd0\u7b97\u6cd5\u5219\uff0c\u8fd9\u4e2a\u7ed3\u8bba\u5f88\u5bb9\u6613\u88ab\u63a8\u5e7f\u5230\u4e00\u822c\u60c5\u51b5\uff1a

    \u8bbe\u6211\u4eec\u6709m\u4e2an\u7ef4\u6570\u636e\u8bb0\u5f55\uff0c\u5c06\u5176\u6309\u5217\u6392\u6210n\u4e58m\u7684\u77e9\u9635X\uff0c\u8bbe\\(C=\\frac{1}{m}XX^\\mathsf{T}\\)\uff0c\u5219C\u662f\u4e00\u4e2a\u5bf9\u79f0\u77e9\u9635\uff0c\u5176\u5bf9\u89d2\u7ebf\u5206\u522b\u4e2a\u5404\u4e2a\u5b57\u6bb5\u7684\u65b9\u5dee\uff0c\u800c\u7b2ci\u884cj\u5217\u548cj\u884ci\u5217\u5143\u7d20\u76f8\u540c\uff0c\u8868\u793ai\u548cj\u4e24\u4e2a\u5b57\u6bb5\u7684\u534f\u65b9\u5dee\u3002

    "},{"location":"AI/pca/#_6","title":"\u534f\u65b9\u5dee\u77e9\u9635\u5bf9\u89d2\u5316","text":"

    \u6839\u636e\u4e0a\u8ff0\u63a8\u5bfc\uff0c\u6211\u4eec\u53d1\u73b0\u8981\u8fbe\u5230\u4f18\u5316\u76ee\u524d\uff0c\u7b49\u4ef7\u4e8e\u5c06\u534f\u65b9\u5dee\u77e9\u9635\u5bf9\u89d2\u5316\uff1a\u5373\u9664\u5bf9\u89d2\u7ebf\u5916\u7684\u5176\u5b83\u5143\u7d20\u5316\u4e3a0\uff0c\u5e76\u4e14\u5728\u5bf9\u89d2\u7ebf\u4e0a\u5c06\u5143\u7d20\u6309\u5927\u5c0f\u4ece\u4e0a\u5230\u4e0b\u6392\u5217\uff0c\u8fd9\u6837\u6211\u4eec\u5c31\u8fbe\u5230\u4e86\u4f18\u5316\u76ee\u7684\u3002\u8fd9\u6837\u8bf4\u53ef\u80fd\u8fd8\u4e0d\u662f\u5f88\u660e\u6670\uff0c\u6211\u4eec\u8fdb\u4e00\u6b65\u770b\u4e0b\u539f\u77e9\u9635\u4e0e\u57fa\u53d8\u6362\u540e\u77e9\u9635\u534f\u65b9\u5dee\u77e9\u9635\u7684\u5173\u7cfb\uff1a

    \u8bbe\u539f\u59cb\u6570\u636e\u77e9\u9635X\u5bf9\u5e94\u7684\u534f\u65b9\u5dee\u77e9\u9635\u4e3aC\uff0c\u800cP\u662f\u4e00\u7ec4\u57fa\u6309\u884c\u7ec4\u6210\u7684\u77e9\u9635\uff0c\u8bbeY=PX\uff0c\u5219Y\u4e3aX\u5bf9P\u505a\u57fa\u53d8\u6362\u540e\u7684\u6570\u636e\u3002\u8bbeY\u7684\u534f\u65b9\u5dee\u77e9\u9635\u4e3aD\uff0c\u6211\u4eec\u63a8\u5bfc\u4e00\u4e0bD\u4e0eC\u7684\u5173\u7cfb\uff1a

    \\[\\begin{array}{l l l} D & = & \\frac{1}{m}YY^\\mathsf{T} \\\\ & = & \\frac{1}{m}(PX)(PX)^\\mathsf{T} \\\\ & = & \\frac{1}{m}PXX^\\mathsf{T}P^\\mathsf{T} \\\\ & = & P(\\frac{1}{m}XX^\\mathsf{T})P^\\mathsf{T} \\\\ & = & PCP^\\mathsf{T} \\end{array}\\]

    \u73b0\u5728\u4e8b\u60c5\u5f88\u660e\u767d\u4e86\uff01\u6211\u4eec\u8981\u627e\u7684P\u4e0d\u662f\u522b\u7684\uff0c\u800c\u662f\u80fd\u8ba9\u539f\u59cb\u534f\u65b9\u5dee\u77e9\u9635\u5bf9\u89d2\u5316\u7684P\u3002\u6362\u53e5\u8bdd\u8bf4\uff0c\u4f18\u5316\u76ee\u6807\u53d8\u6210\u4e86\u5bfb\u627e\u4e00\u4e2a\u77e9\u9635P\uff0c\u6ee1\u8db3\\(PCP^\\mathsf{T}\\)\u662f\u4e00\u4e2a\u5bf9\u89d2\u77e9\u9635\uff0c\u5e76\u4e14\u5bf9\u89d2\u5143\u7d20\u6309\u4ece\u5927\u5230\u5c0f\u4f9d\u6b21\u6392\u5217\uff0c\u90a3\u4e48P\u7684\u524dK\u884c\u5c31\u662f\u8981\u5bfb\u627e\u7684\u57fa\uff0c\u7528P\u7684\u524dK\u884c\u7ec4\u6210\u7684\u77e9\u9635\u4e58\u4ee5X\u5c31\u4f7f\u5f97X\u4eceN\u7ef4\u964d\u5230\u4e86K\u7ef4\u5e76\u6ee1\u8db3\u4e0a\u8ff0\u4f18\u5316\u6761\u4ef6\u3002

    \u81f3\u6b64\uff0c\u6211\u4eec\u79bb\u201c\u53d1\u660e\u201dPCA\u8fd8\u6709\u4ec5\u4e00\u6b65\u4e4b\u9065\uff01

    \u73b0\u5728\u6240\u6709\u7126\u70b9\u90fd\u805a\u7126\u5728\u4e86\u534f\u65b9\u5dee\u77e9\u9635\u5bf9\u89d2\u5316\u95ee\u9898\u4e0a\uff0c\u6709\u65f6\uff0c\u6211\u4eec\u771f\u5e94\u8be5\u611f\u8c22\u6570\u5b66\u5bb6\u7684\u5148\u884c\uff0c\u56e0\u4e3a\u77e9\u9635\u5bf9\u89d2\u5316\u5728\u7ebf\u6027\u4ee3\u6570\u9886\u57df\u5df2\u7ecf\u5c5e\u4e8e\u88ab\u73a9\u70c2\u4e86\u7684\u4e1c\u897f\uff0c\u6240\u4ee5\u8fd9\u5728\u6570\u5b66\u4e0a\u6839\u672c\u4e0d\u662f\u95ee\u9898\u3002

    \u7531\u4e0a\u6587\u77e5\u9053\uff0c\u534f\u65b9\u5dee\u77e9\u9635C\u662f\u4e00\u4e2a\u662f\u5bf9\u79f0\u77e9\u9635\uff0c\u5728\u7ebf\u6027\u4ee3\u6570\u4e0a\uff0c\u5b9e\u5bf9\u79f0\u77e9\u9635\u6709\u4e00\u7cfb\u5217\u975e\u5e38\u597d\u7684\u6027\u8d28\uff1a

    1\uff09\u5b9e\u5bf9\u79f0\u77e9\u9635\u4e0d\u540c\u7279\u5f81\u503c\u5bf9\u5e94\u7684\u7279\u5f81\u5411\u91cf\u5fc5\u7136\u6b63\u4ea4\u3002

    2\uff09\u8bbe\u7279\u5f81\u5411\u91cf\\(\\lambda\\)\u91cd\u6570\u4e3ar\uff0c\u5219\u5fc5\u7136\u5b58\u5728r\u4e2a\u7ebf\u6027\u65e0\u5173\u7684\u7279\u5f81\u5411\u91cf\u5bf9\u5e94\u4e8e\\(\\lambda\\)\uff0c\u56e0\u6b64\u53ef\u4ee5\u5c06\u8fd9r\u4e2a\u7279\u5f81\u5411\u91cf\u5355\u4f4d\u6b63\u4ea4\u5316\u3002

    \u7531\u4e0a\u9762\u4e24\u6761\u53ef\u77e5\uff0c\u4e00\u4e2an\u884cn\u5217\u7684\u5b9e\u5bf9\u79f0\u77e9\u9635\u4e00\u5b9a\u53ef\u4ee5\u627e\u5230n\u4e2a\u5355\u4f4d\u6b63\u4ea4\u7279\u5f81\u5411\u91cf\uff0c\u8bbe\u8fd9n\u4e2a\u7279\u5f81\u5411\u91cf\u4e3a\\(e_1,e_2,\\cdots,e_n\\)\uff0c\u6211\u4eec\u5c06\u5176\u6309\u5217\u7ec4\u6210\u77e9\u9635\uff1a

    \\[E=\\begin{pmatrix} e_1 & e_2 & \\cdots & e_n \\end{pmatrix}\\]

    \u5219\u5bf9\u534f\u65b9\u5dee\u77e9\u9635C\u6709\u5982\u4e0b\u7ed3\u8bba\uff1a

    \\[E^\\mathsf{T}CE=\\Lambda=\\begin{pmatrix} \\lambda_1 & & & \\\\ & \\lambda_2 & & \\\\ & & \\ddots & \\\\ & & & \\lambda_n \\end{pmatrix}\\]

    \u5176\u4e2d\\(\\Lambda\\)\u4e3a\u5bf9\u89d2\u77e9\u9635\uff0c\u5176\u5bf9\u89d2\u5143\u7d20\u4e3a\u5404\u7279\u5f81\u5411\u91cf\u5bf9\u5e94\u7684\u7279\u5f81\u503c\uff08\u53ef\u80fd\u6709\u91cd\u590d\uff09\u3002

    \u4ee5\u4e0a\u7ed3\u8bba\u4e0d\u518d\u7ed9\u51fa\u4e25\u683c\u7684\u6570\u5b66\u8bc1\u660e\uff0c\u5bf9\u8bc1\u660e\u611f\u5174\u8da3\u7684\u670b\u53cb\u53ef\u4ee5\u53c2\u8003\u7ebf\u6027\u4ee3\u6570\u4e66\u7c4d\u5173\u4e8e\u201c\u5b9e\u5bf9\u79f0\u77e9\u9635\u5bf9\u89d2\u5316\u201d\u7684\u5185\u5bb9\u3002

    \u5230\u8fd9\u91cc\uff0c\u6211\u4eec\u53d1\u73b0\u6211\u4eec\u5df2\u7ecf\u627e\u5230\u4e86\u9700\u8981\u7684\u77e9\u9635P\uff1a

    \\[P=E^\\mathsf{T}\\]

    P\u662f\u534f\u65b9\u5dee\u77e9\u9635\u7684\u7279\u5f81\u5411\u91cf\u5355\u4f4d\u5316\u540e\u6309\u884c\u6392\u5217\u51fa\u7684\u77e9\u9635\uff0c\u5176\u4e2d\u6bcf\u4e00\u884c\u90fd\u662fC\u7684\u4e00\u4e2a\u7279\u5f81\u5411\u91cf\u3002\u5982\u679c\u8bbeP\u6309\u7167\\(\\Lambda\\)\u4e2d\u7279\u5f81\u503c\u7684\u4ece\u5927\u5230\u5c0f\uff0c\u5c06\u7279\u5f81\u5411\u91cf\u4ece\u4e0a\u5230\u4e0b\u6392\u5217\uff0c\u5219\u7528P\u7684\u524dK\u884c\u7ec4\u6210\u7684\u77e9\u9635\u4e58\u4ee5\u539f\u59cb\u6570\u636e\u77e9\u9635X\uff0c\u5c31\u5f97\u5230\u4e86\u6211\u4eec\u9700\u8981\u7684\u964d\u7ef4\u540e\u7684\u6570\u636e\u77e9\u9635Y\u3002

    \u81f3\u6b64\u6211\u4eec\u5b8c\u6210\u4e86\u6574\u4e2aPCA\u7684\u6570\u5b66\u539f\u7406\u8ba8\u8bba\u3002\u5728\u4e0b\u9762\u7684\u4e00\u8282\uff0c\u6211\u4eec\u5c06\u7ed9\u51faPCA\u7684\u4e00\u4e2a\u5b9e\u4f8b\u3002

    "},{"location":"AI/pca/#pca","title":"PCA\u7b97\u6cd5","text":"

    \u603b\u7ed3\u4e00\u4e0bPCA\u7684\u7b97\u6cd5\u6b65\u9aa4\uff1a

    \u8bbe\u6709m\u6761n\u7ef4\u6570\u636e\u3002

    1\uff09\u5c06\u539f\u59cb\u6570\u636e\u6309\u5217\u7ec4\u6210n\u884cm\u5217\u77e9\u9635X

    2\uff09\u5c06X\u7684\u6bcf\u4e00\u884c\uff08\u4ee3\u8868\u4e00\u4e2a\u5c5e\u6027\u5b57\u6bb5\uff09\u8fdb\u884c\u96f6\u5747\u503c\u5316\uff0c\u5373\u51cf\u53bb\u8fd9\u4e00\u884c\u7684\u5747\u503c

    3\uff09\u6c42\u51fa\u534f\u65b9\u5dee\u77e9\u9635\\(C=\\frac{1}{m}XX^\\mathsf{T}\\)

    4\uff09\u6c42\u51fa\u534f\u65b9\u5dee\u77e9\u9635\u7684\u7279\u5f81\u503c\u53ca\u5bf9\u5e94\u7684\u7279\u5f81\u5411\u91cf

    5\uff09\u5c06\u7279\u5f81\u5411\u91cf\u6309\u5bf9\u5e94\u7279\u5f81\u503c\u5927\u5c0f\u4ece\u4e0a\u5230\u4e0b\u6309\u884c\u6392\u5217\u6210\u77e9\u9635\uff0c\u53d6\u524dk\u884c\u7ec4\u6210\u77e9\u9635P

    6\uff09\\(Y=PX\\)\u5373\u4e3a\u964d\u7ef4\u5230k\u7ef4\u540e\u7684\u6570\u636e

    "},{"location":"AI/pca/#_7","title":"\u5b9e\u4f8b","text":"

    \u8fd9\u91cc\u4ee5\u4e0a\u6587\u63d0\u5230\u7684

    \\[\\begin{pmatrix} -1 & -1 & 0 & 2 & 0 \\\\ -2 & 0 & 0 & 1 & 1 \\end{pmatrix}\\]

    \u4e3a\u4f8b\uff0c\u6211\u4eec\u7528PCA\u65b9\u6cd5\u5c06\u8fd9\u7ec4\u4e8c\u7ef4\u6570\u636e\u5176\u964d\u5230\u4e00\u7ef4\u3002

    \u56e0\u4e3a\u8fd9\u4e2a\u77e9\u9635\u7684\u6bcf\u884c\u5df2\u7ecf\u662f\u96f6\u5747\u503c\uff0c\u8fd9\u91cc\u6211\u4eec\u76f4\u63a5\u6c42\u534f\u65b9\u5dee\u77e9\u9635\uff1a

    \\[C=\\frac{1}{5}\\begin{pmatrix} -1 & -1 & 0 & 2 & 0 \\\\ -2 & 0 & 0 & 1 & 1 \\end{pmatrix}\\begin{pmatrix} -1 & -2 \\\\ -1 & 0 \\\\ 0 & 0 \\\\ 2 & 1 \\\\ 0 & 1 \\end{pmatrix}=\\begin{pmatrix} \\frac{6}{5} & \\frac{4}{5} \\\\ \\frac{4}{5} & \\frac{6}{5} \\end{pmatrix}\\]

    \u7136\u540e\u6c42\u5176\u7279\u5f81\u503c\u548c\u7279\u5f81\u5411\u91cf\uff0c\u5177\u4f53\u6c42\u89e3\u65b9\u6cd5\u4e0d\u518d\u8be6\u8ff0\uff0c\u53ef\u4ee5\u53c2\u8003\u76f8\u5173\u8d44\u6599\u3002\u6c42\u89e3\u540e\u7279\u5f81\u503c\u4e3a\uff1a

    \\[\\lambda_1=2,\\lambda_2=2/5\\]

    \u5176\u5bf9\u5e94\u7684\u7279\u5f81\u5411\u91cf\u5206\u522b\u662f\uff1a

    \\[c_1\\begin{pmatrix} 1 \\\\ 1 \\end{pmatrix},c_2\\begin{pmatrix} -1 \\\\ 1 \\end{pmatrix}\\]

    \u5176\u4e2d\u5bf9\u5e94\u7684\u7279\u5f81\u5411\u91cf\u5206\u522b\u662f\u4e00\u4e2a\u901a\u89e3\uff0c\\(c_1\\)\u548c\\(c_2\\)\u53ef\u53d6\u4efb\u610f\u5b9e\u6570\u3002\u90a3\u4e48\u6807\u51c6\u5316\u540e\u7684\u7279\u5f81\u5411\u91cf\u4e3a\uff1a

    \\[\\begin{pmatrix} 1/\\sqrt{2} \\\\ 1/\\sqrt{2} \\end{pmatrix},\\begin{pmatrix} -1/\\sqrt{2} \\\\ 1/\\sqrt{2} \\end{pmatrix}\\]

    \u56e0\u6b64\u6211\u4eec\u7684\u77e9\u9635P\u662f\uff1a

    \\[P=\\begin{pmatrix} 1/\\sqrt{2} & 1/\\sqrt{2} \\\\ -1/\\sqrt{2} & 1/\\sqrt{2} \\end{pmatrix}\\]

    \u53ef\u4ee5\u9a8c\u8bc1\u534f\u65b9\u5dee\u77e9\u9635C\u7684\u5bf9\u89d2\u5316\uff1a

    \\[PCP^\\mathsf{T}=\\begin{pmatrix} 1/\\sqrt{2} & 1/\\sqrt{2} \\\\ -1/\\sqrt{2} & 1/\\sqrt{2} \\end{pmatrix}\\begin{pmatrix} 6/5 & 4/5 \\\\ 4/5 & 6/5 \\end{pmatrix}\\begin{pmatrix} 1/\\sqrt{2} & -1/\\sqrt{2} \\\\ 1/\\sqrt{2} & 1/\\sqrt{2} \\end{pmatrix}=\\begin{pmatrix} 2 & 0 \\\\ 0 & 2/5 \\end{pmatrix}\\]

    \u6700\u540e\u6211\u4eec\u7528P\u7684\u7b2c\u4e00\u884c\u4e58\u4ee5\u6570\u636e\u77e9\u9635\uff0c\u5c31\u5f97\u5230\u4e86\u964d\u7ef4\u540e\u7684\u8868\u793a\uff1a

    \\[Y=\\begin{pmatrix} 1/\\sqrt{2} & 1/\\sqrt{2} \\end{pmatrix}\\begin{pmatrix} -1 & -1 & 0 & 2 & 0 \\\\ -2 & 0 & 0 & 1 & 1 \\end{pmatrix}=\\begin{pmatrix} -3/\\sqrt{2} & -1/\\sqrt{2} & 0 & 3/\\sqrt{2} & -1/\\sqrt{2} \\end{pmatrix}\\]

    \u964d\u7ef4\u6295\u5f71\u7ed3\u679c\u5982\u4e0b\u56fe\uff1a

    "},{"location":"AI/pca/#_8","title":"\u8fdb\u4e00\u6b65\u8ba8\u8bba","text":"

    \u6839\u636e\u4e0a\u9762\u5bf9PCA\u7684\u6570\u5b66\u539f\u7406\u7684\u89e3\u91ca\uff0c\u6211\u4eec\u53ef\u4ee5\u4e86\u89e3\u5230\u4e00\u4e9bPCA\u7684\u80fd\u529b\u548c\u9650\u5236\u3002PCA\u672c\u8d28\u4e0a\u662f\u5c06\u65b9\u5dee\u6700\u5927\u7684\u65b9\u5411\u4f5c\u4e3a\u4e3b\u8981\u7279\u5f81\uff0c\u5e76\u4e14\u5728\u5404\u4e2a\u6b63\u4ea4\u65b9\u5411\u4e0a\u5c06\u6570\u636e\u201c\u79bb\u76f8\u5173\u201d\uff0c\u4e5f\u5c31\u662f\u8ba9\u5b83\u4eec\u5728\u4e0d\u540c\u6b63\u4ea4\u65b9\u5411\u4e0a\u6ca1\u6709\u76f8\u5173\u6027\u3002

    \u56e0\u6b64\uff0cPCA\u4e5f\u5b58\u5728\u4e00\u4e9b\u9650\u5236\uff0c\u4f8b\u5982\u5b83\u53ef\u4ee5\u5f88\u597d\u7684\u89e3\u9664\u7ebf\u6027\u76f8\u5173\uff0c\u4f46\u662f\u5bf9\u4e8e\u9ad8\u9636\u76f8\u5173\u6027\u5c31\u6ca1\u6709\u529e\u6cd5\u4e86\uff0c\u5bf9\u4e8e\u5b58\u5728\u9ad8\u9636\u76f8\u5173\u6027\u7684\u6570\u636e\uff0c\u53ef\u4ee5\u8003\u8651Kernel PCA\uff0c\u901a\u8fc7Kernel\u51fd\u6570\u5c06\u975e\u7ebf\u6027\u76f8\u5173\u8f6c\u4e3a\u7ebf\u6027\u76f8\u5173\uff0c\u5173\u4e8e\u8fd9\u70b9\u5c31\u4e0d\u5c55\u5f00\u8ba8\u8bba\u4e86\u3002\u53e6\u5916\uff0cPCA\u5047\u8bbe\u6570\u636e\u5404\u4e3b\u7279\u5f81\u662f\u5206\u5e03\u5728\u6b63\u4ea4\u65b9\u5411\u4e0a\uff0c\u5982\u679c\u5728\u975e\u6b63\u4ea4\u65b9\u5411\u4e0a\u5b58\u5728\u51e0\u4e2a\u65b9\u5dee\u8f83\u5927\u7684\u65b9\u5411\uff0cPCA\u7684\u6548\u679c\u5c31\u5927\u6253\u6298\u6263\u4e86\u3002

    \u6700\u540e\u9700\u8981\u8bf4\u660e\u7684\u662f\uff0cPCA\u662f\u4e00\u79cd\u65e0\u53c2\u6570\u6280\u672f\uff0c\u4e5f\u5c31\u662f\u8bf4\u9762\u5bf9\u540c\u6837\u7684\u6570\u636e\uff0c\u5982\u679c\u4e0d\u8003\u8651\u6e05\u6d17\uff0c\u8c01\u6765\u505a\u7ed3\u679c\u90fd\u4e00\u6837\uff0c\u6ca1\u6709\u4e3b\u89c2\u53c2\u6570\u7684\u4ecb\u5165\uff0c\u6240\u4ee5PCA\u4fbf\u4e8e\u901a\u7528\u5b9e\u73b0\uff0c\u4f46\u662f\u672c\u8eab\u65e0\u6cd5\u4e2a\u6027\u5316\u7684\u4f18\u5316\u3002

    \u5e0c\u671b\u8fd9\u7bc7\u6587\u7ae0\u80fd\u5e2e\u52a9\u670b\u53cb\u4eec\u4e86\u89e3PCA\u7684\u6570\u5b66\u7406\u8bba\u57fa\u7840\u548c\u5b9e\u73b0\u539f\u7406\uff0c\u501f\u6b64\u4e86\u89e3PCA\u7684\u9002\u7528\u573a\u666f\u548c\u9650\u5236\uff0c\u4ece\u800c\u66f4\u597d\u7684\u4f7f\u7528\u8fd9\u4e2a\u7b97\u6cd5\u3002

    "},{"location":"AI/pca/#dla","title":"DLA","text":"

    \\(or \\Rightarrow max Tr(w^TS_bS_w^{-1}w) constrained to\\ \\ ww^T=1\\)

    \\(m1 \\ m2 \u90fd\u662f\u5e73\u5747\u503c\\)

    https://zhuanlan.zhihu.com/p/32658341

    "},{"location":"CV/ML-4360/BS/lec2/","title":"Lec2 for ML-4360","text":""},{"location":"CV/ML-4360/BS/lec2/#21-primitives-transformations","title":"2.1 Primitives & Transformations","text":""},{"location":"CV/ML-4360/BS/lec2/#homogeneous","title":"\\(Homogeneous\\)","text":"
    • homogeneous coordinates & inhomogeneous coordinates
    • argmented vector[one element out of the whole equivalent class],homogeneous vectors,homogeneous vectors
    • points at infinity
    • In homogeneous coordinates, the intersection of two lines is given by:

      \\(\\tilde{x}\\)=\\(\\tilde{l1}\\) \u00d7 \\(\\tilde{l2}\\)

    • the line joining two points can be compactly written as:

      \\(\\tilde{l}\\)=\\(\\tilde{x1}\\) \u00d7 \\(\\tilde{x2}\\)

    "},{"location":"CV/ML-4360/BS/lec2/#transformations","title":"\\(Transformations\\)","text":"
    • translation 2DOF
    • Euclidean 3DOF \\(RR^T=I \\ der(R)=1\\)
    • \u6b63\u4ea4\u77e9\u9635\\(A^TA=I\\)

    \\(A^{-1}=A^T\\)

    \\(\\left|A\\right|\\) = +-1

    A\u7684\u884c\uff08\u5217\uff09\u5411\u91cf\u7ec4\u4e3an\u7ef4\u5355\u4f4d\u6b63\u4ea4\u5411\u91cf\u7ec4 * Similarity 4DOF * Affine: 6DOF arbitrary \\(2\u00d72\\) matrix

    Parallels Remain! * Projective :8DOF\u2014\u2014preserve straight lines

    DOF\uff082D\uff09:n(n-1)/2

    \\(\\tilde{l}'\\) = \\((\\tilde{H}^T)^{-1}\\)\\(\\tilde{l}\\)

    "},{"location":"CV/ML-4360/BS/lec2/#direct-linear-transform-for-homography-estimationalgorithm-dlt","title":"Direct Linear Transform for Homography Estimation[algorithm DLT","text":"
    • UDV\uff01 SVD!
    "},{"location":"CV/ML-4360/BS/lec2/#22-geometric-image-formation","title":"2.2 Geometric Image Formation","text":"

    Orthographic projection

    Perspective\u3000projection

    * Complete perspective projection

    lens distortion

    • radial and tangential distortion
    "},{"location":"CV/ML-4360/BS/lec2/#23-photometric-image-formation","title":"2.3 Photometric Image Formation","text":""},{"location":"CV/ML-4360/BS/lec2/#rendering-equation","title":"\\(Rendering Equation\\)","text":"
    • intensity :power per solid angle

      \\(dw=\\sin\\theta\\)\\(d\\theta\\)\\(d\\phi\\)

    • Irradiance \uff1a power per unit area

      E(x)=d\\(\\Phi(x)\\)/dA

    • Radiannce

      L(p,w)=\\(d^2\\Phi(p,\\omega)\\)/\\(d\\omega\\)\\(dAcos\\theta\\)

    "},{"location":"CV/ML-4360/BS/lec2/#brdf-radiance_outirradiance_in","title":"\\(BRDF\\) \"\\(Radiance_{out}/Irradiance_{in}\\)\"","text":""},{"location":"CV/ML-4360/BS/lec2/#the-reflection-equation","title":"\\(The Reflection Equation\\)","text":""},{"location":"CV/ML-4360/BS/lec2/#back-to-cameras","title":"Back To Cameras","text":""},{"location":"CV/ML-4360/BS/lec2/#chromatic-aberration","title":"\\(Chromatic Aberration\\)","text":""},{"location":"CV/ML-4360/BS/lec2/#24-image-sensing-pipeline","title":"2.4 Image Sensing Pipeline","text":""},{"location":"CV/ML-4360/PGM/lec5/","title":"Probabilistic Graphical Models","text":""},{"location":"CV/ML-4360/PGM/lec5/#structured-prediction","title":"Structured Prediction","text":""},{"location":"CV/ML-4360/PGM/lec5/#spatial-regularization","title":"Spatial regularization","text":"

    \\(p(D)\\propto e^{-\\sum_i\\phi_{data}(d_i)-\\lambda\\sum_{(i\uff0cj)\\in S}\\phi_{smooth}(d_i,d_j)}\\)

    • i~j neighbouring pixels (on a 4-connected grid).
    • $\\phi_{smooth} $ is a regularization term that encourages neighboring pixels to have similar disparities.

    \\(\\phi_{data}(di) =min(|I(xi, yi) - J(xi - di, yi)|, \u03c3)\\)

    \\(\\phi_{smooth} (di,dj) = min(|di - dj|,\u03c4)\\)

    where\\(I\\)and \\(J\\) are the image pairs

    \\(\u03c3\\) and \\(\u03c4\\) are truncation thresholds.

    • Structured Prediction:

    Probabilistic graphical models encode local dependencies of the problem

    Deep neural netwoks with image-based outputs (stereo, flow, semantics)

    "},{"location":"CV/ML-4360/PGM/lec5/#markov-random-fields","title":"Markov Random Fields","text":""},{"location":"CV/ML-4360/PGM/lec5/#undirected-graphical-models-ugm","title":"Undirected graphical models (UGM)","text":"
    • Pairwise (non-causal) relationships
    • Can write down model, and score specific configurations of the graph, but no explicit way to generate samples
    • Contingency constrains on node configurations
    "},{"location":"CV/ML-4360/PGM/lec5/#cliques","title":"cliques","text":"

    Refers to fully connected subgraphs in a graphical model, particularly in models like Markov Random Fields or Conditional Random Fields.

    In this context, a clique is a group of nodes in a graph where every pair of nodes is directly connected.

    "},{"location":"CV/ML-4360/PGM/lec5/#potential","title":"potential","text":"
    • A potential \\(\u03c6(x)\\)is a non-negative function of the variable x
    • A joint potential \\(\u03c6(x1, x2, . . . )\\) is a non-negative function of a set of variables.
    "},{"location":"CV/ML-4360/PGM/lec5/#definations-of-an-undirected-graphical-model","title":"Definations of an undirected graphical model","text":"

    \\((P(x_1\u2026\u2026x_n)=\\frac{1}{Z}\\prod_{c\\in C}\\phi_c(x_c)\\)

    \\((Z = \\sum_{x_1\u2026\u2026x_n}\\prod_{c\\in C}\\phi_c(x_c)\\)

    "},{"location":"CV/ML-4360/PGM/lec5/#defination-of-markov-random-field","title":"Defination of Markov Random Field","text":"
    • For a set of variables \\(X ={x_1,...,x_M}\\), a Markov Random Field is defined as a product of potentials over the (maximal) cliques \\({(X_k)}_{k=1}^K\\)of the undirected graph G

    \\(p(X)=\\frac{1}{Z}\\prod_{k=1}^K\\phi_k(X_k)\\)

    • \\(Z\\) normalizes the distribution and is called partition function
    • Examples\uff1a

    "},{"location":"CV/ML-4360/PGM/lec5/#properties","title":"Properties","text":"

    \\(Condition \\ One\\)

    "},{"location":"CV/ML-4360/PGM/lec5/#marginalizing-over-c-makes-a-and-b-dependent","title":"Marginalizing over c makes a and b dependent","text":"

    \\(Proof\\)

    • Explain:take \\(\\sum_c\\phi_1(a,c)\\phi_2(b,c)\\) for example
    a b c \u03c61(a,c) \u03c62(b,c) \u03c61(a,c)*\u03c62(b,c) sum 0 0 0 1 1 1 1 1 0 0 0 1 1 0 0 0 0 1 1 1 1 1 0 1 0 1 0 0 0 1 0 1 0 1 0 0 0 1 0 0 1 1 0 0"},{"location":"CV/ML-4360/PGM/lec5/#conditioning-on-c-makes-a-and-b-independent","title":"Conditioning on c makes a and b independent","text":"

    \\(Proof\\)

    • Global Markov Property

    Markov blanket

    "},{"location":"CV/ML-4360/PGM/lec5/#hammersley-clifford-theorem","title":"Hammersley-Clifford Theorem","text":"

    A probability distribution that has a strictly positive mass or density satisfies the Markov properties with respect to an undirected graph G if and only if it is a Gibbs random field,

    i.e. its density can be factorized over the (maximal) cliques of the graph.

    "},{"location":"CV/ML-4360/PGM/lec5/#factor-graphs","title":"Factor Graphs","text":"

    $p(X) = \\frac{1}{Z}\\prod_{k=1}^Kf_k(X_k)_{k=1}^K $

    "},{"location":"CV/ML-4360/PGM/lec5/#belief-propagation","title":"Belief Propagation","text":""},{"location":"CV/ML-4360/PGM/lec5/#inference-in-chain-structured-factor-graphs","title":"Inference in Chain Structured Factor Graphs","text":"

    \\(p(a, b, c, d) = \\frac{1}{Z}f_1(a, b)f_2(b, c)f_3(c, d)f4(d)\\)

    \\(p(a,b,c) = \\sum_{d}p(a,b,c,d)\\)

    \\(\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ = \\frac{1}{Z}f_1(a,b)f_2(b,c)\\underbrace{\\sum_{d}f_3(c,d)f_4(d)}_{\u03bc_{d\u2192c}(c)}\\)

    \\(p(a,b) = \\sum_{c}p(a,b,c)\\)

    \\(\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ = \\frac{1}{Z}f_1(a,b)\\underbrace{\\sum_{c}f_2(b,c)\u03bc_{d\u2192c}(c)}_{\u03bc_{c\u2192b}(b)}\\)

    \\(\u2026\u2026\\)

    Belief Propagation assumes a singly-connected graph G = (V,E), which means it has \\(|V|\u22121 = O(|V|)\\) many edges (in contrast to \\(|V|(|V| \u2212 1)/2 = O(|V|^2)\\) of a fully connected graph).

    That simplifies the computation of any marginal distribution significantly

    "},{"location":"CV/ML-4360/PGM/lec5/#inference-in-tree-structured-factor-graphs","title":"Inference in Tree Structured Factor Graphs","text":""},{"location":"CV/ML-4360/PGM/lec5/#factor-to-variable-messages","title":"Factor-to-Variable Messages","text":""},{"location":"CV/ML-4360/PGM/lec5/#variable-to-factor-messages","title":"Variable-to-Factor Messages","text":""},{"location":"CV/ML-4360/PGM/lec5/#sum-product-algorithm","title":"Sum-Product Algorithm","text":""},{"location":"CV/ML-4360/PGM/lec5/#belief-propagation_1","title":"Belief Propagation:","text":"
    • Algorithm to compute all messages efficiently
    • Assumes that the graph is singly-connected (chain, tree)
    "},{"location":"CV/ML-4360/PGM/lec5/#algorithm","title":"Algorithm:","text":"
    • Initialization
    • Variable to Factor message
    • Factor to Variable message
    • Repeat until all messages have been calculated
    • Calculate the desired marginals from the messages
    "},{"location":"CV/ML-4360/PGM/lec5/#log-representation","title":"Log Representation","text":""},{"location":"CV/ML-4360/PGM/lec5/#max-product-algorithm","title":"Max-Product Algorithm","text":"
    • Example: Chain

    \\(\\begin{align*}\\underset{\\text{a,b,c,d}}{\\text{max}}p(a,b,c,d)&= \\underset{\\text{a,b,c,d}}{\\text{max}}f_1(a,b)f2(b,c)f_3(c,d)\\\\&=\\underset{\\text{a,b,c}}{\\text{max}}f_1(a,b)f2(b,c)\\underbrace{\\underset{\\text{d}}{\\text{max}}f_3(c,d)}_{\\mu_{d->c}(c)}\\\\&=\u2026\u2026\\\\ &=\\underset{\\text{a}}{\\text{max}}\\mu_{b->a}(a)\\end{align*}\\)

    "},{"location":"CV/ML-4360/PGM/lec5/#loopy-belief-propagation","title":"Loopy Belief Propagation","text":"
    • Messages are also well defined for loopy graphs!
    • Simply apply them to loopy graphs as well
    • We loose exactness (\u21d2 approximate inference)
    • Even no guarantee of convergence [Yedida et al. 2004] I But often works surprisingly well in practice
    "},{"location":"CV/ML-4360/PGM/lec5/#summary","title":"Summary","text":""},{"location":"CV/ML-4360/PGM/lec5/#examples","title":"Examples","text":""},{"location":"CV/ML-4360/PGM/lec5/#example-1-vehicle-localization","title":"Example 1: Vehicle Localization","text":"

    # Max-Product Belief Propagation on chain structured Markov Random Fields for Vehicle Localization

    Let's consider an autonomous vehicle driving on a highway and tracking a vehicle in front in order to initiate an overtaking maneuver. Let \\(x_t\\in\\{1,2,3\\}\\) denote the lane the vehicle in front is driving on at time \\(t\\in\\{1,\\dots,10\\}\\). Unfortunately, the sensor readings are noisy as depicted below.

    Selecting the most likely lane at each time \\(t\\) independently (green) leads to wrong estimates for \\(t=\\{3,7,10\\}\\). To solve this problem, and recover the correct situation depicted below

    we can integrate prior knowledge and infer the most likely situation using max-product belief propagation. A sensible prior would favor staying on the same lane over changing one lane at a time over changing two lanes at a time. This prior can be integrated via a pairwise, chain-structured Markov Random Field (also called: Hidden Markov Model or HMM) where pairwise factors between adjacent frames modulate transition likelihoods:

    \\[g_\\theta(x_i,x_{i+1}) = \\begin{bmatrix}0.8 & 0.2 & 0.0\\\\ 0.2 & 0.6 & 0.2 \\\\ 0.0 & 0.2 & 0.8\\end{bmatrix}\\] \\[ p_\\theta({\\bf x}) \\propto \\prod_{1}^{10} f_i(x_i)\\prod_{1}^{9}g_{\\theta}(x_i, x_{i+1})\\]
    • Coding
    # import modules\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy import misc\n\n# plot function\n# input: Nx3 matrix of values & title string\ndef plot(vals,title=''):\n    plt.close()\n    vals /= np.tile(np.sum(vals,1),(3,1)).transpose()\n    f, axarr = plt.subplots(1,10,figsize=(10,2))\n    plt.suptitle(title, fontsize=16, fontweight='bold')\n    for i in range(vals.shape[0]):\n        axarr[i].barh([0,1,2],np.array([1,1,1]),color='white',edgecolor='black',linewidth=2)\n        axarr[i].barh([0,1,2],vals[i],color='red')\n        axarr[i].axis('off')\n    plt.show()\n\n# unary: Nx3 matrix specifying unary likelihood of each state\nunary = np.array([[0.7,0.1,0.2],[0.7,0.2,0.1],[0.2,0.1,0.7],[0.7,0.2,0.1],\n                  [0.2,0.6,0.2],[0.1,0.8,0.1],[0.4,0.3,0.3],[0.1,0.8,0.1],\n                  [0.1,0.1,0.8],[0.1,0.5,0.4]])\n# pairwise: 3x3 matrix specifying transition probabilities (rows=t -> columns=t+1)\npairwise = np.array([[0.8,0.2,0.0],[0.2,0.6,0.2],[0.0,0.2,0.8]])\n\n# model parameters (number of variables/states)\n[num_vars,num_states] = unary.shape\n\n# compute messages\nmsg = np.zeros([num_vars-1, num_states]) # (num_vars-1) x num_states matrix\nfor i in range(num_vars-2, -1, -1):\n    if i == num_vars-2:\n        msg[i, :] = np.max(pairwise*unary[i+1, :], 1)\n    else:\n        msg[i, :] = np.max(pairwise*unary[i+1, :]*msg[i+1, :],1)\n# calculate max-marginals (num_vars x num_states matrix) and MAP estimates (num_vars x 1 matrix)\nmax_marginals = np.zeros([num_vars,num_states])\nmap = np.zeros(num_vars, dtype=int)\nfor i in range(num_vars):\n    if i == 0:\n        max_marginals[i,:] = msg[i, :]\n    if i == num_vars-1:\n        max_marginals[i,:] = pairwise[map[i-1],:]*unary[i,:]\n    else:\n        max_marginals[i,:] = pairwise[map[i-1],:]*unary[i,:]*msg[i, :]\n    map[i] = np.argmax(max_marginals[i, :])\n# plot max-marginals\nplot(max_marginals,'Max Marginals')\n\n# print MAP state\nprint(\"MAP Estimate:\")\nprint(np.argmax(max_marginals,axis=1))\n
    "},{"location":"CV/ML-4360/PGM/lec5/#example-2-image-denoising","title":"Example 2: Image Denoising","text":""},{"location":"CV/ML-4360/PGM/lec5/#image-denoising","title":"Image Denoising","text":"

    You are given a noisy binary image (\\(10 \\times 10\\) pixels) which you want to denoise.

    Make use of the Ising model for that purpose where neighboring pixels are encouraged to take the same value: \\(\\(p(x_1,\\dots,x_{100}) \\propto \\exp \\left\\{\\sum_{i=1}^{100} \\psi_i(x_i) + \\sum_{i\\sim j} \\psi_{ij} (x_i,x_j) \\right\\}\\)\\)

    Here, \\(i\\) is the pixel index and \\(i\\sim j\\) are neighboring pixels on a 4-connected grid. The unary term \\(\\psi_i(x_i) = [x_i = o_i]\\) models the observation at pixel \\(i\\), and the pairwise term is the Ising prior \\(\\psi_{ij}(x_i,x_j) = \\alpha \\cdot [x_i = x_j]\\), where \\(\\alpha\\) controls the strength of the interaction/smoothing.

    Because we have large number of variables in this exercise, we use logarithm factors to avoid potential numerical underflow issues.

    Inputs: * num_vars, num_states, factors, msg_fv, msg_vf, ne_var

    Outputs: * max_marginals: num_vars x num_states array of estimated max-marginals * map_est: array comprising the estimated MAP state of each variable

    Algorithm Pseudocode:

    • For N=30 iterations do:
    • Update all unary factor-to-variable messages: \\(\\lambda_{f\\rightarrow x}(x) = f(x)\\)
    • Update all pairwise factor-to-variable messages: \\(\\lambda_{f\\rightarrow x}(x) = \\max_y \\left[f(x,y)+\\lambda_{y\\rightarrow f}(y)\\right]\\)
    • Update all variable-to-factor messages: \\(\\lambda_{x\\rightarrow f}(x) = \\sum_{g\\in\\{ ne(x)\\setminus f\\}}\\lambda_{g\\rightarrow x}(x)\\)

    • Calculate Max-Marginals: \\(\\gamma_x(x) = \\sum_{g\\in\\{ ne(x)\\}}\\lambda_{g\\rightarrow x}(x)\\)

    • Calculate MAP Solution: \\(x^* = \\underset{x}{\\mathrm{argmax}} ~ \\gamma_x(x)\\)

    CODE

    # import modules\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport imageio\n\n# load and plot input image\nimg = imageio.imread('gfx/image.png')/255\nplt.imshow(img,interpolation='nearest');\nplt.gray()\nplt.show()\n\n# model parameters\n[h,w] = img.shape # get width & height of image\nnum_vars = w*h    # number of variables = width * height\nnum_states = 2    # binary segmentation -> two states\n\n# initialize factors (list of dictionaries), each factor comprises:\n#   vars: array of variables involved\n#   vals: vector/matrix of factor values\nfactors = []\n# add unary factors\nfor u in range(w):\n  for v in range(h):\n    factors.append({'vars':np.array([v*w+u]), 'vals':np.array([1-img[v,u],img[v,u]])})\n\n# add pairwise factors\nalpha = 0.4 # smoothness weight\nE = alpha*np.array([[1,0],[0,1]]) # energy matrix for pairwise factor\nfor u in range(w):\n  for v in range(h):\n    if v<h-1:\n      factors.append({'vars':np.array([v*w+u,(v+1)*w+u]), 'vals':E})\n    if u<w-1:\n      factors.append({'vars':np.array([v*w+u,v*w+u+1]), 'vals':E})\n# initialize all messages\nmsg_fv = {} # f->v messages (dictionary)\nmsg_vf = {} # v->f messages (dictionary)\nne_var = [[] for i in range(num_vars)] # neighboring factors of variables (list of list)\n\n# set messages to zero; determine factors neighboring each variable\nfor [f_idx,f] in enumerate(factors):\n    for v_idx in f['vars']:\n        msg_fv[(f_idx,v_idx)] = np.zeros(num_states) # factor->variable message\n        msg_vf[(v_idx,f_idx)] = np.zeros(num_states) # variable->factor message\n        ne_var[v_idx].append(f_idx) # factors neighboring variable v_idx\n\n# status message\nprint(\"Messages initialized!\")\n\n# run inference\nfor it in range(30):\n\n    # for all factor-to-variable messages do\n    for [key,msg] in msg_fv.items():\n\n        # shortcuts to variables\n        f_idx = key[0] # factor (source)\n        v_idx = key[1] # variable (target)\n        f_vars = factors[f_idx]['vars'] # variables connected to factor\n        f_vals = factors[f_idx]['vals'] # vector/matrix of factor values \n\n        # unary factor-to-variable message\n        if np.size(f_vars)==1:\n            msg_fv[(f_idx,v_idx)] = f_vals\n\n        # pairwise factor-to-variable-message\n        else:\n\n            # if target variable is first variable of factor\n            if v_idx==f_vars[0]:\n                msg_in = np.tile(msg_vf[(f_vars[1],f_idx)],(num_states,1))\n                msg_fv[(f_idx,v_idx)] = (f_vals+msg_in).max(1) # max over columns\n\n            # if target variable is second variable of factor\n            else:\n                msg_in = np.tile(msg_vf[(f_vars[0],f_idx)],(num_states,1))\n                msg_fv[(f_idx,v_idx)] = (f_vals+msg_in.transpose()).max(0) # max over rows\n\n        # normalize\n        msg_fv[(f_idx,v_idx)] = msg_fv[(f_idx,v_idx)] - np.mean(msg_fv[(f_idx,v_idx)])\n\n    # for all variable-to-factor messages do\n    for [key,msg] in msg_vf.items():\n\n        # shortcuts to variables\n        v_idx = key[0] # variable (source)\n        f_idx = key[1] # factor (target)\n\n        # add messages from all factors send to this variable (except target factor)\n        # and send the result to the target factor\n        msg_vf[(v_idx,f_idx)] = np.zeros(num_states)\n        for f_idx2 in ne_var[v_idx]:\n            if f_idx2 != f_idx:\n                msg_vf[(v_idx,f_idx)] += msg_fv[(f_idx2,v_idx)]\n\n        # normalize\n        msg_vf[(v_idx,f_idx)] = msg_vf[(v_idx,f_idx)] - np.mean(msg_vf[(v_idx,f_idx)])\n\n# calculate max-marginals (num_vars x num_states matrix)\nmax_marginals = np.zeros([num_vars,num_states])\nfor v_idx in range(num_vars):\n\n    # add messages from all factors sent to this variable\n    max_marginals[v_idx] = np.zeros(num_states)\n    for f_idx in ne_var[v_idx]:\n        max_marginals[v_idx] += msg_fv[(f_idx,v_idx)]\n    #print max_marginals[v_idx]\n\n# get MAP solution\nmap_est = np.argmax(max_marginals,axis=1)\n\n# plot MAP estimate\nplt.imshow(map_est.reshape(h,w),interpolation='nearest');\nplt.gray()\nplt.show()\n
    "},{"location":"CV/ML-4360/SFM/lec3/","title":"Structure Form Motion","text":""},{"location":"CV/ML-4360/SFM/lec3/#preliminarynaries","title":"preliminarynaries","text":""},{"location":"CV/ML-4360/SFM/lec3/#point-features","title":"Point Features","text":"
    • Point features describe the appearance of local, salient regions in an image
    • They can be used to describe and match images taken from different viewpoints
    • They form the basis of sparse 3D reconstruction methods covered in this lecture
    • Features should be invariant to perspective effects and illumination
    • The same point should have similar vectors independent of pose/viewpoint
    • Plain RGB/intensity patches will not have this property, we need something better
    "},{"location":"CV/ML-4360/SFM/lec3/#scale-invariant-feature-transform-sift","title":"Scale Invariant Feature Transform (SIFT)","text":"

    Reference to https://medium.com/@deepanshut041/introduction-to-sift-scale-invariant-feature-transform-65d7f3a72d40 https://www.qixinbo.info/2021/10/26/sift/ - SIFT constructs a scale space by iteratively filtering the image with a Gaussian - Adjacent scales are subtracted, yielding Difference of Gaussian (DoG) images - Interest points (=blobs) are detected as extrema in the resulting scale space

    "},{"location":"CV/ML-4360/SFM/lec3/#1-scale","title":"(1) Scale","text":"

    \\(L(x,y,\u03c3)=G(x,y,\u03c3)\u2217I(x,y)\\)

    Note \uff1a\u5377\u79ef

    \u8fde\u7eed\u5f62\u5f0f\uff1a

    \\((f\u2217g)(n)=\\int_{-\\infty }^{\\infty}f(\\tau )g(n-\\tau)d\\tau\\)

    \u79bb\u6563\u5f62\u5f0f\uff1a

    \\((f\u2217g)(n)=\\sum_{\\tau=-\\infty }^{\\infty}f(\\tau)g(n-\\tau)\\)

    \u5bf9\u56fe\u50cf\u7684\u5904\u7406\u51fd\u6570\uff08\u5982\u5e73\u6ed1\uff0c\u6216\u8005\u8fb9\u7f18\u63d0\u53d6\uff09\uff0c\u4e5f\u53ef\u4ee5\u7528\u4e00\u4e2ag\u77e9\u9635\u6765\u8868\u793a\uff0c\u5982\uff1a

    \\(g=\\begin{bmatrix} &b_{-1,-1} &b_{-1,0} &b_{-1,1}\\\\ &b_{0,-1} &b_{0,0} &b_{0,1} \\\\ &b_{1,-1} &b_{1,0} &b_{1,1} \\end{bmatrix}\\)

    \\(f(x,y)=a_{x,y}\\)

    \\(g(x,y)=b_{x,y}\\)

    \u6309\u5377\u79ef\u7684\u5b9a\u4e49\uff0c\u4e8c\u7ef4\u79bb\u6563\u5f62\u5f0f\u7684\u5377\u79ef\u516c\u5f0f\u5e94\u8be5\u662f\uff1a

    \\((f\u2217g)(u,v)=\u2211_i\u2211_jf(i,j)g(u-i,v-j)=\\sum_{i} \\sum_{j} a_{i,j} b_{u-i,v-j}\\)

    \u9996\u5148\u6211\u4eec\u5728\u539f\u59cb\u56fe\u50cf\u77e9\u9635\u4e2d\u53d6\u51fa\uff08u,v)\u5904\u7684\u77e9\u9635\uff1a

    \\(f=\\begin{bmatrix} &a_{u-1,v-1} &a_{u-1,v} &a_{u-1,v+1}\\\\ &a_{u,v-1} &a_{u,v} &a_{u,v+1} \\\\ &a_{u+1,v-1} &a_{u+1,v} &a_{u+1,v+1} \\end{bmatrix}\\)

    \u7136\u540e\u5c06\u56fe\u50cf\u5904\u7406\u77e9\u9635\u7ffb\u8f6c

    • \u539f\u59cb\u77e9\u9635\uff1a

    • \u7ffb\u8f6c\u540e\u7684\u77e9\u9635\uff1a

    \\((g^{'}=\\begin{bmatrix} &b_{1,1} &b_{1,0} &b_{1,-1}\\\\ &b_{0,1} &b_{0,0} &b_{0,-1} \\\\ &b_{-1,1} &b_{-1,0} &b_{-1,-1} \\end{bmatrix}\\)

    "},{"location":"CV/ML-4360/SFM/lec3/#2construct-the-gaussian-pyramid","title":"(2)Construct the Gaussian Pyramid","text":"
    • Apply Gaussian blur at different scales to the image.
    • Downsample the image, typically reducing it by half in the horizontal and vertical directions before sampling.
    • To reflect the continuity of scale space ,Gaussian pyramids perform Gaussian blurring in addition to simple downsampling.
    • Different parameters are used for Gaussian blurring on each image in each level of the pyramid, resulting in multiple Gaussian-blurred images within each level of the pyramid. Here, each level of the pyramid with multiple images is referred to as a \"group\" (Octave).
    • Each level of the pyramid contains one group of images, and it's easy to see that the number of groups is equal to the number of levels in the pyramid. Each image within a group is referred to as a \"layer\" (Interval) in that group.
    • IGaussian pyramids consist of multiple groups, and each group contains multiple layers.
    • The scales between the layers within a group are different (meaning different Gaussian parameters \u03c3 are used),and the scale difference between adjacent layers is a factor of k.
    • If each group has S layers, then \\(k = 2^{1/S}\\). The bottommost image in the previous group is obtained by downsampling the image with a scale of 2\u03c3 from the previous group by a factor of 2 (Gaussian pyramids are built from the bottom-up).
    "},{"location":"CV/ML-4360/SFM/lec3/#3difference-of-gaussian-dog","title":"(3)Difference of Gaussian (DoG)","text":"

    Image feature points are composed of local extrema in the DoG (Difference of Gaussians) scale space. To find these extrema in the DoG space, each pixel is compared with all of its neighboring points to determine whether it is larger or smaller than its neighboring points in both the image domain and scale domain. As shown in the figure below, the central detection point is compared with its 8 neighboring points at the same scale and 18 points corresponding to the upper and lower adjacent scales, totaling 26 points to ensure the detection of extrema in both the two-dimensional image space and scale space. If a point is the maximum or minimum value among these 26 points in the DoG scale space at the current layer and the two neighboring layers, it is considered a feature point in the image at that scale.

    "},{"location":"CV/ML-4360/SFM/lec3/#4keypoint-localization","title":"\uff084\uff09Keypoint Localization","text":"

    Key0points generated in the previous step produce a lot of keypoints. Some of them lie along an edge, or they don\u2019t have enough contrast. In both cases, they are not as useful as features. So we get rid of them. The approach is similar to the one used in the Harris Corner Detector for removing edge features. For low contrast features, we simply check their intensities.

    They used Taylor series expansion of scale space to get a more accurate location of extrema, and if the intensity at this extrema is less than a threshold value (0.03 as per the paper), it is rejected. DoG has a higher response for edges, so edges also need to be removed. They used a 2x2 Hessian matrix (H) to compute the principal curvature.

    Detailed explanation:

    • Keypoint Filtering: Keypoints generated in the previous step might include features along edges or those with low contrast, which may not be sufficiently prominent or useful. For features with low contrast, their intensities are examined. If the intensity is below a specified threshold (as mentioned in the paper, 0.03), the feature is excluded.

    • Taylor Series Expansion: Utilizing a Taylor series expansion of the scale space to obtain a more accurate location of extrema, improving the precision of keypoint localization. Intensity Check and Exclusion: For extrema identified through the Taylor series expansion, their intensities are checked. If the intensity falls below the set threshold, they are excluded.

    • Edge Removal: Due to the higher response of the Difference of Gaussians (DoG) for edges, further removal of edge features is necessary. A 2x2 Hessian matrix is employed to calculate the principal curvature. If the principal curvature is small, indicating the point may lie along an edge, it can be excluded. (\\(f=\\frac{\\lambda_1\\lambda_2}{\\lambda_1+\\lambda_2}\\)) for the Harris operator Which means f is large indicates an edge

    "},{"location":"CV/ML-4360/SFM/lec3/#5-orientation-assignment","title":"(5) Orientation Assignment","text":"

    Now we have legitimate keypoints. They\u2019ve been tested to be stable. We already know the scale at which the keypoint was detected (it\u2019s the same as the scale of the blurred image). So we have scale invariance. The next thing is to assign an orientation to each keypoint to make it rotation invariance.

    A neighborhood is taken around the keypoint location depending on the scale, and the gradient magnitude and direction is calculated in that region. An orientation histogram with 36 bins covering 360 degrees is created. Let's say the gradient direction at a certain point (in the \u201corientation collection region\u201d) is 18.759 degrees, then it will go into the 10\u201319-degree bin. And the \u201camount\u201d that is added to the bin is proportional to the magnitude of the gradient at that point. Once you\u2019ve done this for all pixels around the keypoint, the histogram will have a peak at some point. The highest peak in the histogram is taken and any peak above 80% of it is also considered to calculate the orientation. It creates keypoints with same location and scale, but different directions. It contributes to the stability of matching.

    "},{"location":"CV/ML-4360/SFM/lec3/#6keypoint-descriptor","title":"(6)Keypoint descriptor","text":"

    At this point, each keypoint has a location, scale, orientation. Next is to compute a descriptor for the local image region about each keypoint that is highly distinctive and invariant as possible to variations such as changes in viewpoint and illumination.

    To do this, a 16x16 window around the keypoint is taken. It is divided into 16 sub-blocks of 4x4 size. For each sub-block, 8 bin orientation histogram is created.

    So 4 X 4 descriptors over 16 X 16 sample array were used in practice. 4 X 4 X 8 directions give 128 bin values. It is represented as a feature vector to form keypoint descriptor. This feature vector introduces a few complications. We need to get rid of them before finalizing the fingerprint.

    • Rotation dependence The feature vector uses gradient orientations. Clearly, if you rotate the image, everything changes. All gradient orientations also change. To achieve rotation independence, the keypoint\u2019s rotation is subtracted from each orientation. Thus each gradient orientation is relative to the keypoint\u2019s orientation.
    • Illumination dependence If we threshold numbers that are big, we can achieve illumination independence. So, any number (of the 128) greater than 0.2 is changed to 0.2. This resultant feature vector is normalized again. And now you have an illumination independent feature vector!
    "},{"location":"CV/ML-4360/SFM/lec3/#7keypoint-matching","title":"\uff087\uff09Keypoint Matching","text":"
    • Feature Descriptor Extraction: For each detected feature point, SIFT calculates the gradient direction histogram in its surrounding neighborhood and arranges these histograms into a 128-dimensional vector, acting as the feature descriptor of this feature point. This step is based on the detection of keypoints, ensuring the scale and rotation invariance of the descriptor.
    • Feature Matching: A feature descriptor is used to find the nearest neighbor in the feature descriptor set of another image. The nearest neighbor distance measurement often uses Euclidean distance, meaning the smaller the distance, the higher the match. If no obvious nearest neighbor can be found, this feature point will be discarded and not used for further matching.
    • Discarding Mismatches: To enhance the reliability of matches, SIFT employs a ratio test to discard potential mismatches. This criterion involves the ratio of the distance of the nearest neighbor to that of the second nearest neighbor of a feature descriptor. If this ratio exceeds a predetermined threshold (such as 0.8), then the nearest neighbor is deemed a mismatch and should be discarded.
    "},{"location":"CV/ML-4360/SFM/lec3/#epipolar-geometry","title":"Epipolar Geometry","text":"
    • Let R and t denote the relative pose between two perspective cameras

    • A 3D point x is projected to pixel \\(\\bar{x}_1\\)in image 1 and to pixel \\(\\bar{x_2}\\) in image 2

    • The 3D point x and the two cameracenters span the epipolar plane

    • The correspondence of pixel \\(\\bar{x}_1\\) in image 2 must lie on the epipolar line \\(\\widetilde{l2}\\)in image 2

    • All epipolar lines pass through the epipole

    • Equations:

    • Let \\(Ki \u2208 R_{3\u00d73}\\)denote the camera matrix of camera i.

    • Let \\(\\widetilde{x}i\\)= \\(K^{-1} x \u0304_i\\)denote the local ray direction of pixel \\(x \u0304_i\\) in camera i.

    • We have:

    • \\(x~_2 \u221d x_2 = Rx_1+t \u221d Rx~_1+st\\)

    • Taking the cross product of both sides with t we obtain:

    • \\([t]\u00d7x~2 \u221d [t]\u00d7R x~1\\)

    • Taking the dotproduct of both sides with\\(x~^\u22a4_2\\)yields (triple product):

    • \\(x~^\u22a4_2 [t]\u00d7R x~1 \u221d x~^\u22a4_2 [t]\u00d7x~2 = 0 \u21d2 x~^\u22a4_2 [t]\u00d7R x~1 = 0\\)

    • We arrive at the epipolar constraintwith essential matrix:

    • \\(x~^\u22a4_2 E~ x~ _1 = 0 \\ \\ \\widetilde{E} = [ t ] \u00d7 R\\)

    • \\(\\widetilde{E}\\) maps a point \\(x~_1\\) in image 1 to the corresponding epipolar line in image 2 \\(\\widetilde{l}_2=\\widetilde{E} x~ 1\\)

    • Similarly, by transposition, we obtain the epipolar line in image 1:\\(\\widetilde{l}_1 = \\widetilde{E}^\u22a4 x~ 2\\)

    • For any point \\(x~1\\)in the first image, the corresponding epipolar line \\(\\widetilde{l}_2 = \\widetilde{E}x~_1\\)in the second image passes through the so-called epipole \\(\\tilde{e}_2\\) which therefore satisfies \\(\\widetilde{e}^\u22a4_2 \\ \\widetilde{l}_2 = \\widetilde{e}^\u22a4_2 \\widetilde{E}x~_1 = 0\\) for all \\(x~_1.\\)

    • It follows that:\\(\\widetilde{e}^\u22a4_2 \\widetilde{E} = 0\\)Thus,\\(e~^\u22a4_2\\)is the leftnull-space (left singular vector with singular value 0)of\\(\\widetilde{E}\\).Further:\\(\\widetilde{E}e~_1 = 0\\) Thus,\\(e~^\u22a4_1\\) is the rightnull-space (right singular vector with singular value 0)of \\(\\widetilde{E}.\\)

    • Recover R & t

    • Derivation

    \\(\\widetilde{x_{2i}}^T \\widetilde{E} \\widetilde{x_{1i}}=0\\)

    • \\(\\widetilde{E}=\\begin{pmatrix} e_{11} & e_{12} & e_{13} \\\\ e_{21} & e_{22} & e_{23} \\\\ e_{31} & e_{32} & e_{33} \\end{pmatrix} \\ \\ \\ \\ \\ \\ \\ \\ E = \\begin{pmatrix} e_{11} \\\\ e_{12} \\\\ e_{13} \\\\ e_{21} \\\\ e_{22} \\\\ e_{23} \\\\ e_{31} \\\\ e_{32} \\\\ e_{33} \\end{pmatrix}\\)\\(\\Rightarrow x_1x_2e_{11} + y_1x_2e_{12} + x_2e_{13}+ x_1y_2e_{21} + y_1y_2e_{22} + y_2e_{23}+ x_1e{31} + y_1e_{32} + e_{33 }= 0\\)

    • As \\(\\widetilde{E}\\) is homogeneous we use singular value decomposition to constrain the scale.

    • Note that some terms are products of two image measurements and hence amplify measurement noise asymmetrically. Thus, the normalized 8-point algorithm whitens the observations to have zero-mean and unit variance before the calculation and back-transforms the matrix recovered by SVD accordingly.

    • SVD Method

    • Rearranging the product, so E is on the left hand side:\\(\\widetilde{x_2}^T\\widetilde{E}\\widetilde{x_1} =\\begin{pmatrix} x_{11}x_{12} & y_{11}x_{12} & x_{12}&x_{11}y_{12}&y_{11}y_{12}&y_{12}&x_{11}&y_{11}&1 \\\\ \u2026\u2026 \\\\ x_{i1}x_{i2} & y_{i1}x_{i2} & x_{i2}&x_{i1}y_{i2}&y_{i1}y_{i2}&y_{i2}&x_{i1}&y_{i1}&1 \\\\\u2026\u2026 \\\\x_{81}x_{82} & y_{81}x_{82} & x_{82}&x_{81}y_{82}&y_{81}y_{82}&y_{82}&x_{81}&y_{81}&1\\end{pmatrix} \\begin{pmatrix} e_{11} \\\\ e_{12} \\\\ e_{13} \\\\ e_{21} \\\\ e_{22} \\\\ e_{23} \\\\ e_{31} \\\\ e_{32} \\\\ e_{33} \\end{pmatrix} =0\\)\\(\\Rightarrow AE = 0\\)

    • If there are more than 8 point correspondences, the system is usually over-determined and an exact solution is not possible. Instead, we solve a least squares problem for AE

    • \\(min(||AE||),||E||=1\\)

    Credits to Carnegie Mellon University and Kris Kitani, http://www.cs.cmu.edu/~16385/s17/Slides/11.5_SVD.pdf

    • Properties of the \\(\\widetilde{E}\\)

    • by readjustment:

    • \\(\\widetilde{E} =\\begin{bmatrix} u0&u1&u2 \\end{bmatrix}\\begin{bmatrix} s&0&0\\\\0&s&0\\\\0&0&s \\end{bmatrix} \\begin{bmatrix}v0^T\\\\v1^T\\\\v2^T \\end{bmatrix} =U\\sum V^T\\)

    • \\(s=\\frac{\\lambda_1+\\lambda_2}{2}\\) \\(\\lambda_1\\ge \\lambda_2\\ge\\lambda_3\\)

    • Proof

    • \u8bc1\u660e\u672c\u8d28\u77e9\u9635E EE\u5947\u5f02\u503c\u5177\u6709\\([\u03c3,\u03c3,0]^ T\\)\u7684\u5f62\u5f0f\uff0c\u53ea\u9700\u8bc1\u660e\u77e9\u9635\\(E^TE\\)\u7684\u7279\u5f81\u503c\u5177\u6709\\([\\lambda, \\lambda, 0]^T\\)\u7684\u5f62\u5f0f\u3002\u7531\u4e8e\u77e9\u9635 \\(EE^T\\)\u4e0e \\(E^{T}E\\)\u6709\u76f8\u540c\u7684\u975e\u96f6\u7279\u5f81\u503c\uff0c\u6240\u4ee5\u8bc1\u660e\u5185\u5728\u6027\u8d28\u4e5f\u7b49\u4ef7\u4e8e\u8bc1\u660e\u77e9\u9635\\(EE^T\\)\u7684\u7279\u5f81\u503c\u5177\u6709\\([\\lambda, \\lambda, 0]^T\\)\u7684\u5f62\u5f0f

    • \u5177\u4f53\u8bc1\u660e\u89c1https://blog.csdn.net/weixin_44387324/article/details/119182590

    • Thus we have

    \\(W=\\begin{bmatrix} 0&-1&0\\\\1&0&0\\\\0&0&1 \\\\ \\end{bmatrix} \\\\ t_x=UW\\sum U^T \\\\ R=UW^{-1}V^T \\\\E=U\\sum V^T\\)

    • Fundamental matrix (if Ki unknown):

    • \\(\\widetilde{x_2}^T\\widetilde{E}\\widetilde{x_1}=\\bar{x_2}^T\\widetilde{F}\\bar{x_1}\\)

    • \\(\\widetilde{F} = K_2^{-1}\\widetilde{E} K_1^{-1}\\)

    "},{"location":"CV/ML-4360/SFM/lec3/#triangulation","title":"Triangulation","text":"
    • Let \\(x~^s_i = \\widetilde{P}_ i x~_w\\) denote the projection of a 3D world point \\(x~_w\\) onto the image of the i\u2019th camera \\(x~^s_i\\).

    • Consider the cross product \\(x \u0304^s_i \u00d7 \\widetilde{P}_ix~_w =0\\).

    • Using \\(p~^\u22a4_{ik}\\) to denote the k\u2019th row of the i\u2019th camera\u2019s projection matrix \\(\\widetilde{P_i}\\), we obtain:

    • \\(\\begin{bmatrix}x^s_i\\widetilde{p}_{i3}^T - \\widetilde{p}_{i1} \\\\ y^s_i\\widetilde{p}_{i3}^T - \\widetilde{p}_{i2} \\end{bmatrix}\\widetilde{x}_w=0\\)

    • \\(\\bar{x}_i^s=(x_i^s,y_i^s,1)\\)

    • Stacking N \u2265 2 observations of a point, we obtain a linear system \\(Ax~_w = 0.\\)As \\(x~_w\\) is homogeneous this leads to a constrained least squares problem. The solution to this problem is the right singular vector corresponding to the smallest singular value of A. This is the Direct Linear Transformation we are already familiar with from Lecture 2.

    • Proof https://blog.csdn.net/u011178262/article/details/86729887

    • Reprojection Error Minimization:

    While DLT often works well, it is not invariant to perspective transformations.The gold standard is to minimize the reprojection error using numerical methods:

    • This allows to take measurement noise appropriately into account
    • The minimum can also be obtained in closed form as the solution of a sixth degree polynomial, see Hartley & Zisserman, Section 12.5 for details.
    "},{"location":"CV/ML-4360/SFM/lec3/#factorization","title":"Factorization","text":""},{"location":"CV/ML-4360/SFM/lec3/#orthographic-factorization","title":"Orthographic Factorization","text":""},{"location":"CV/ML-4360/SFM/lec3/#algorithm","title":"Algorithm:","text":"

    1.Take measurements \\(\\hat{W}\\)

    2.Compute SVD $\\hat{W} = U\u03a3V^\u22a4 $and keep the top 3 SVs

    3.Define\\(\\hat{R} =U\u03a3^{\\frac{1}{2}}\\) and \\(\\hat{X} =\\sum^{\\frac{1}{2}}V^T\\)

    4.Compute \\(QQ^\u22a4\\) and from this Q

    5.Compute\\(R=\\hat{R}Q\\)and\\(X=Q^{-1}\\hat{X}\\)

    Remarks:

    • Advantage: closed form solution (determined up to an arbitrary global rotation)
    • Disadvantage: complete feature tracks required (\u21d2 cannot handle occlusions)
    • Solution: Apply to subsets of features/frames and propagate (see T&K, Sec. 5)
    "},{"location":"CV/ML-4360/SFM/lec3/#bundle-adjustment","title":"Bundle Adjustment","text":""},{"location":"CV/ML-4360/SFM/lec3/#appendix","title":"Appendix","text":"
    • CNN https://www.zhihu.com/question/52668301/answer/1231346589
    "},{"location":"CV/ML-4360/SR/lec4/","title":"Stereo Reconstruction","text":""},{"location":"CV/ML-4360/SR/lec4/#preliminaries","title":"Preliminaries","text":""},{"location":"CV/ML-4360/SR/lec4/#epipolar-geometry","title":"Epipolar Geometry","text":"
    • A point\\(\\bar{x}\\)in the left image must be located on the epipolar line\\(\\widetilde{l}_2\\)
    • This reduces correspondence search to a (much simpler) 1D problem I For VGA images: \uff5e640 instead of \uff5e300k hypotheses (factor 480 less)
    "},{"location":"CV/ML-4360/SR/lec4/#image-rectification","title":"Image Rectification","text":"

    What if both cameras face exactly the same direction?

    • Image planes are co-planar \u21d2 Epipoles at infinity, epipolar lines parallel.
    • Correspondences search along horizontal scanlines (simplifies implementation)
    • Let\\(K1 = K2 = R = I\\) and\\(t = (t,0,0)^\u22a4\\)

    • \\(\\bar{x_2}^T\\tilde{E}\\bar{x_1}=\\bar{x_2}^T \\begin{bmatrix}0&0&0\\\\0&0&-t\\\\0&t&0\\end{bmatrix}\\bar{x1}=ty1-ty2=0\\)

    • Thus \\(y1=y2\\)

    What if the images are not in the required setup?

    • There is a trick: We can rewarp them through rotation, mapping both image planes to a common plane parallel to the baseline, this is called
    • For this rotation around the camera center, the 3D structure must not be known

    How can we make epipolar lines horizontal?

    • Step1:Estimate\\(\\tilde{E}\\) , decompose into \\(t\\)and \\(R\\)

    • Step2: Find \\(R_{rect}\\)

    Choose \\(OO^\u2032=t=(t_x,t_y,t_z)^T\\)

    \\(e_1=\\frac{T}{\u2223\u2223T\u2223\u2223}\\)

    \\(e_2=\\frac{1}{\\sqrt{T_x^2+T_y^2}}(-Ty,Tx,0)^T= [(0, 0, 1)^\u22a4]\u00d7r_1\\)

    \\(e_3=e_2\\) x \\(e_1\\)

    \\(\\Rightarrow R_{rect}=\\begin{bmatrix}e_1^T\\\\e_2^T\\\\e_3^T\\end{bmatrix}\\)

    • Step3:Adjust \\(\\tilde{x}_i\\)

    Warp pixels in the first image as follows: \\(\\tilde{x}_1^{'}= KR_{rect}K_1^{-1}x \u0304_1\\)

    Warp pixels in the second image as follows: \\(\\tilde{x}_2^{'}=KRR_{rect}K_2^{-1}x \u0304_2\\)

    NOTE \uff1aDifferent coordinate systems result in different perception of \\(R_{rect}\\),Thus the \\(R_{rect}^{'}=RR_{rect}\\)

    K is a shared projection matrix that can be chosen arbitrarily (e.g., K = K1)

    In practice, the inverse transformation is used for warping (i.e. query the source)

    "},{"location":"CV/ML-4360/SR/lec4/#disparity-to-depth","title":"Disparity to Depth","text":""},{"location":"CV/ML-4360/SR/lec4/#block-matching","title":"Block Matching","text":"
    • Choosedisparityrange[0,D]
    • For all pixels x = (x, y) compute the best disparity \u21d2 winner-takes-all (WTA)
    • Do this for both images and apply left-right consistency check to remove outliers
    "},{"location":"CV/ML-4360/SR/lec4/#zero-normalized-cross-correlation","title":"Zero Normalized Cross-Correlation","text":""},{"location":"CV/ML-4360/SR/lec4/#sum-of-squared-differences-ssd","title":"Sum of squared differences (SSD)","text":""},{"location":"CV/ML-4360/SR/lec4/#assumption-violations","title":"Assumption Violations","text":"
    • Block matching assumes that all pixels inside the window are displaced by d

    • This is called the fronto-parallel assumption which is often invalid

    • Slanted surfaces deform perspectively when the viewpoint changes

    • Effect of Window Size

    • Small windows lead to matching ambiguities and noise in the disparity maps

    • Larger windows lead to smoother results, but loss of details and border bleeding

    • Border Bleeding:

    • Left-Right Consistency Test:
    "},{"location":"CV/ML-4360/SR/lec4/#siamese-networks","title":"Siamese Networks","text":""},{"location":"CV/ML-4360/SR/lec4/#training","title":"Training","text":""},{"location":"CV/ML-4360/SR/lec4/#loss-function","title":"Loss Function","text":"

    Hinge Loss:\\(L = max(0, m + s_- - s_+)\\)

    • \\(s_- / s_+\\) is the score of the network for the negative/positive example

    • The loss is zero when the similarity of the positive example is greater than the similarity of the negative example by at least margin m

    • The network is trained by minimizing a hinge loss.

    • The loss is computed by considering pairs of examples centered around the same image position where one example belongs to the positive and one to the negative class.

    • Let \\(s_+\\)be the output of the network for the positive example, \\(s_-\\) be the output of the network for the negative example

    • Let m, the margin, be a positive real number.

    • The hinge loss for that pair of examples is defined as \\(L = max(0, m + s_- - s_+)\\) The loss is zero when the similarity of the positive example is greater than the similarity of the negative example by at least the margin m.

    • Set the margin to 0.2 in our experiments.

    "},{"location":"CV/ML-4360/SR/lec4/#paper","title":"Paper","text":"

    https://www.jmlr.org/papers/volume17/15-535/15-535.pdf

    "},{"location":"CV/ML-4360/SR/lec4/#spatial-regularization","title":"Spatial Regularization","text":"
    • Add Pairwise terms: Smoothness between adjacent pixels in addition to matching costs;

    • Potts: \\(\u03c8_{smooth}(d, d^\u2032) = [d\\ne d^\u2032]\\)

    • Truncated\\(l_1:\u03c8+{smooth}(d,d^\u2032)=min(|d-d^\u2032|,\u03c4)\\)

    • Paper

    https://dash.harvard.edu/bitstream/handle/1/3637107/Mumford_StatRangeImage.pdf?sequence=3&isAllowed=y

    "},{"location":"CV/ML-4360/SR/lec4/#end-to-end-learning","title":"End-to-End Learning","text":"

    End to End learning in the context of AI and ML is a technique where the model learns all the steps between the initial input phase and the final output result. This is a deep learning process where all of the different parts are simultaneously trained instead of sequentially.

    "},{"location":"CV/ML-4360/SR/lec4/#dispnet","title":"DISPNET","text":""},{"location":"CV/ML-4360/SR/lec4/#gcnet","title":"GCNET","text":""},{"location":"CV/ML-4360/SR/lec4/#stereo-mixture-density-networks-smd-nets","title":"STEREO MIXTURE DENSITY NETWORKS (SMD-NETS)","text":""},{"location":"DIP/Basic/DIP/","title":"Basic concept and programming introduction","text":""},{"location":"DIP/Basic/DIP/#image-format","title":"Image Format","text":"

    Digital image can be represented as a 2D array or matrix.

    • Grayscale:Each pixel in a grayscale image is represented by a byte (8 bits), which covers 256 degrees by [0..255]

    • Colour image: Each pixel in a color image is represented by 3 bytes (24 bits), which are for R (red), G (Green) and B (Blue), respectively.

    \u76ee\u7684\uff1a\u5b58\u50a8\u56fe\u50cf

    \u4fe1\u606f\u56fe\u50cf\u7279\u70b9\uff1a\u4ee5\u50cf\u7d20\u4e3a\u5355\u4f4d\uff0c\u77e9\u5f62\u533a\u57df\u4fe1\u606f\u91cf\u5927

    \u6709\u4e9b\u6587\u4ef6\u683c\u5f0f\u4e0e\u64cd\u4f5c\u7cfb\u7edf\u6709\u5173\uff1awindows\u3001unix\u3001mac\u7f16\u7801\u65b9\u5f0f\uff1a\u65e0\u538b\u7f29\u3001\u65e0\u635f\u538b\u7f29\u3001\u6709\u635f\u538b\u7f29

    "},{"location":"DIP/Basic/DIP/#1bmp","title":"1.BMP\u7684\u6587\u4ef6\u683c\u5f0f\uff1a","text":"

    \u200b BMP\uff08Bitmap\uff09\u662f\u4e00\u79cd\u5e38\u89c1\u7684\u56fe\u50cf\u6587\u4ef6\u683c\u5f0f\uff0c\u662fWindows\u7cfb\u7edf\u7684\u4e00\u79cd\u6807\u51c6\u6587\u4ef6\u683c\u5f0f\u3002BMP \u4f4d\u56fe\u6587\u4ef6\u9ed8\u8ba4\u7684\u6587\u4ef6\u6269\u5c55\u540d\u662f bmp \u6216\u8005 dib\u3002\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0cBMP \u56fe\u50cf\u91c7\u7528\u975e\u538b\u7f29\u65b9\u5f0f\uff1b\u7136\u800c\uff0c\u5b83\u4e5f\u652f\u6301\u56fe\u50cf\u538b\u7f29\uff0c\u4f8b\u5982 RLE \u683c\u5f0f\u3002\u4e0b\u9762\u4ecb\u7ecdBMP\u6587\u4ef6\u7684\u5177\u4f53\u6587\u4ef6\u7ed3\u6784\u3002

    BMP \u56fe\u50cf\u6bcf\u4e00\u884c\u626b\u63cf\u7531\u8868\u793a\u56fe\u50cf\u50cf\u7d20\u7684\u8fde\u7eed\u7684\u5b57\u8282\u7ec4\u6210\uff0c\u6bcf\u4e00\u884c\u4ee5\u56db\u5b57\u8282\u5bf9\u9f50\uff08\u4ee50\u8865\u9f50\uff09\u3002\u56fe\u50cf\u7684\u626b\u63cf\u884c\u662f\u7531\u5e95\u5411\u4e0a\u5b58\u50a8\u7684\uff0c\u8fd9\u5c31\u662f\u8bf4\uff0c\u9635\u5217\u4e2d\u7684\u7b2c\u4e00\u4e2a\u5b57\u8282\u8868\u793a\u4f4d\u56fe\u5de6\u4e0b\u89d2\u7684\u50cf\u7d20\uff0c\u800c\u6700\u540e\u4e00\u4e2a\u5b57\u8282\u8868\u793a\u4f4d\u56fe\u53f3\u4e0a\u89d2\u7684\u50cf\u7d20\u3002

    // \u5b9a\u4e49BMP\u6587\u4ef6\u5934\u7684\u5927\u5c0f\u4e3a54\u4e2a\u5b57\u8282\uff0c\u901a\u5e38\u60c5\u51b5\u4e0b\u56fa\u5b9a\u4e0d\u53d8\n#define HEADERSIZE 54\n\n// \u5b9a\u4e49\u51e0\u79cd\u4e0d\u540c\u6570\u636e\u7c7b\u578b\u7684\u522b\u540d\uff0c\u4ee5\u4fbf\u5728\u4ee3\u7801\u4e2d\u4f7f\u7528\u66f4\u5177\u53ef\u8bfb\u6027\u7684\u540d\u79f0\ntypedef unsigned char byte;\ntypedef unsigned short word;\ntypedef unsigned int dword;\n\n// \u4f7f\u7528#pragma pack(1)\u6307\u4ee4\u8bbe\u7f6e\u7ed3\u6784\u4f53\u7684\u5b57\u8282\u5bf9\u9f50\u65b9\u5f0f\u4e3a1\u5b57\u8282\n#pragma pack(1)\n\n// \u5b9a\u4e49BMP\u6587\u4ef6\u5934\u7684\u7ed3\u6784\u4f53\ntypedef struct {\n    word bfType;          // BMP\u6587\u4ef6\u7684\u7c7b\u578b\u6807\u8bc6\uff0c\u901a\u5e38\u4e3a\"BM\"\n    dword bfSize;         // BMP\u6587\u4ef6\u7684\u5927\u5c0f\uff0c\u4ee5\u5b57\u8282\u4e3a\u5355\u4f4d\n    word reserved1;       // \u4fdd\u7559\u5b57\u6bb5\uff0c\u8bbe\u7f6e\u4e3a0\n    word reserved2;       // \u4fdd\u7559\u5b57\u6bb5\uff0c\u8bbe\u7f6e\u4e3a0\n    dword bfOffset;       // \u4f4d\u56fe\u6570\u636e\u7684\u504f\u79fb\u91cf\uff0c\u5373\u6587\u4ef6\u5934\u7684\u5927\u5c0f\n} BMPHeader;\n\n// \u5b9a\u4e49BMP\u4fe1\u606f\u5934\u7684\u7ed3\u6784\u4f53\ntypedef struct {\n    dword size;           // \u4fe1\u606f\u5934\u7684\u5927\u5c0f\uff0c\u901a\u5e38\u4e3a40\u5b57\u8282\n    int width;            // \u56fe\u50cf\u7684\u5bbd\u5ea6\uff0c\u4ee5\u50cf\u7d20\u4e3a\u5355\u4f4d\n    int height;           // \u56fe\u50cf\u7684\u9ad8\u5ea6\uff0c\u4ee5\u50cf\u7d20\u4e3a\u5355\u4f4d\n    word planes;          // \u989c\u8272\u5e73\u9762\u6570\uff0c\u901a\u5e38\u4e3a1\n    word bitCount;        // \u6bcf\u4e2a\u50cf\u7d20\u7684\u4f4d\u6570\n    dword compression;    // \u538b\u7f29\u7c7b\u578b\n    dword imageSize;      // \u4f4d\u56fe\u6570\u636e\u7684\u5927\u5c0f\uff0c\u4ee5\u5b57\u8282\u4e3a\u5355\u4f4d\n    int xPixelsPerMeter;  // \u6c34\u5e73\u5206\u8fa8\u7387\uff0c\u6bcf\u7c73\u7684\u50cf\u7d20\u6570\n    int yPixelsPerMeter;  // \u5782\u76f4\u5206\u8fa8\u7387\uff0c\u6bcf\u7c73\u7684\u50cf\u7d20\u6570\n    dword colorsUsed;     // \u4f7f\u7528\u7684\u989c\u8272\u6570\n    dword colorsImportant; // \u91cd\u8981\u989c\u8272\u6570\n} BMPInfoHeader;\n\n// \u5b9a\u4e49\u8c03\u8272\u677f\u4e2d\u7684\u4e00\u4e2a\u989c\u8272\u7684\u7ed3\u6784\u4f53\ntypedef struct {\n    byte blue;     // \u84dd\u8272\u5206\u91cf\n    byte green;    // \u7eff\u8272\u5206\u91cf\n    byte red;      // \u7ea2\u8272\u5206\u91cf\n    byte reserved; // \u4fdd\u7559\u5b57\u6bb5\uff0c\u901a\u5e38\u8bbe\u7f6e\u4e3a0\n} pallete;\n\n// \u5b9a\u4e49\u5305\u542bBMP\u6587\u4ef6\u5934\u3001BMP\u4fe1\u606f\u5934\u3001\u8c03\u8272\u677f\u548c\u4f4d\u56fe\u6570\u636e\u7684\u5b8c\u6574BMP\u56fe\u50cf\u7684\u7ed3\u6784\u4f53\ntypedef struct {\n    BMPHeader bmph;         // BMP\u6587\u4ef6\u5934\n    BMPInfoHeader bmpih;    // BMP\u4fe1\u606f\u5934\n    pallete colours[256];   // \u8c03\u8272\u677f\uff0c\u901a\u5e38\u7528\u4e8e8\u4f4d\u989c\u8272\u7d22\u5f15\u56fe\u50cf\n    byte *bitmap;           // \u4f4d\u56fe\u6570\u636e\n} BMP;\n
    "},{"location":"DIP/Basic/DIP/#1bmp_1","title":"(1)BMP\u6587\u4ef6\u6574\u4f53\u7ed3\u6784\uff1a","text":""},{"location":"DIP/Basic/DIP/#_1","title":"Basic concept and programming introduction","text":"

    BMP \u6587\u4ef6 \u5927\u4f53\u4e0a\u5206\u4e3a\u56db\u4e2a\u90e8\u5206:\u56fe\u50cf\u6587\u4ef6\u5934\uff08Image file header\uff09\u3001\u56fe\u50cf\u4fe1\u606f\u5934\uff08Image information header\uff09\u3001\u8c03\u8272\u677f\uff08Palette\uff09\u3001\u56fe\u50cf\u6570\u636e\u5b57\u8282\u9635\u5217\uff08Image data\uff09

    • \u5bf9\u7528\u5230\u8c03\u8272\u677f\u7684\u4f4d\u56fe\uff0c\u56fe\u50cf\u6570\u636e\u4e3a\u8be5\u50cf\u7d20\u989c\u8272\u5728\u8c03\u8272\u677f\u4e2d\u7684\u7d22\u5f15\u503c
    • \u5bf9\u4e8e\u771f\u5f69\u8272\u56fe\uff0c\u56fe\u50cf\u6570\u636e\u5c31\u662f\u5b9e\u9645\u7684 R\u3001G\u3001B \u503c\u3002
    "},{"location":"DIP/Basic/DIP/#2bmpimage-file-header","title":"(2)BMP\u56fe\u50cf\u6587\u4ef6\u5934\uff08Image file header\uff09","text":"Start Size(Byte) Name Purpose 1 2 bfType Must always be set to 'BM'(0x4D42) to declare that this is a .bmp-file 3 4 bfSize Specifies the size of the file in bytes. 7 2 bfReserved1 Must always be set to zero. 9 2 bfReserved2 Must always be set to zero. 11 4 bfOffBits Specifies the offset from the beginning of the file to the bitmap data
    • \\(bfOffbits\\) \u8bf4\u660e\u4ece\u6587\u4ef6\u5934\u5f00\u59cb\u5230\u5b9e\u9645\u7684\u56fe\u8c61\u6570\u636e\u4e4b\u95f4\u7684\u5b57\u8282\u7684\u504f\u79fb\u91cf\u3002\u8fd9\u4e2a\u53c2\u6570\u662f\u975e\u5e38\u6709\u7528\u7684\uff0c\u56e0\u4e3a\u4f4d\u56fe\u4fe1\u606f\u5934\u548c\u8c03\u8272\u677f\u7684\u957f\u5ea6\u4f1a\u6839\u636e\u4e0d\u540c\u60c5\u51b5\u800c\u53d8\u5316\uff0c\u6240\u4ee5\u4f60\u53ef\u4ee5\u7528\u8fd9\u4e2a\u504f\u79fb\u503c\u8fc5\u901f\u7684\u4ece\u6587\u4ef6\u4e2d\u8bfb\u53d6\u5230\u4f4d\u6570\u636e\u3002
    "},{"location":"DIP/Basic/DIP/#3bmpimage-information-header","title":"(3)BMP\u56fe\u50cf\u4fe1\u606f\u5934\uff08image information header\uff09","text":"Size(Byte) Name Purpose 4 biSize Number of bytes to define BITMAPINFOHEADER structure 4 biWidth Image width (number of pixels) 4 biHeight Image height (number of pixels). 2 biPlane Number of planes. Always be 1. 2 biBitCount Bits per pixel (Bits/pixel), which is 1, 4, 8, 16, 24 or 32. 4 biCompression Compression type. Only non-compression is discussed here: BI_RGB. 4 biSizeImage Image size with bytes. When biCompression=BI_RGB, biSizeImage=0. 4 biXPelsPerMeter Horizontal resolution, pixels/meter. 4 biYPelsPerMeter Vertical resolution, pixels/meter 4 biClrUsed Number of color indices used in the bitmap (0->all the palette items are used). 4 biClrImportant Number of important color indices for image display. 0->all items are important.
    • \u6ce8\u660e \\(biHeight\\) \u53ef\u4ee5\u8868\u793a\u56fe\u50cf\u662f\u5426\u5012\u7f6e\uff0c\\(biHeight\\) \u4e3a\u6b63\u6570\u8868\u793a\u5012\u7f6e\uff08inverted\uff09\uff0c \u8d1f\u6570\u8868\u793a\u6b63\u5e38\uff08upright)\uff0c\u5927\u591a\u6570BMP\u6587\u4ef6\u662f\u5012\u7f6e\u7684\u4f4d\u56fe\uff0c\u5373 \\(biHeight\\)>0
    • biClrUsed\u8bf4\u660e\u4f4d\u56fe\u5b9e\u9645\u4f7f\u7528\u7684\u5f69\u8272\u8868\u4e2d\u7684\u989c\u8272\u7d22\u5f15\u6570\uff08\u8bbe\u4e3a0\u7684\u8bdd\uff0c\u5219\u8bf4\u660e\u4f7f\u7528\u6240\u6709\u8c03\u8272\u677f\u9879
    • biClrImportant\u8bf4\u660e\u5bf9\u56fe\u8c61\u663e\u793a\u6709\u91cd\u8981\u5f71\u54cd\u7684\u989c\u8272\u7d22\u5f15\u7684\u6570\u76ee\uff0c\u5982\u679c\u662f0\uff0c\u8868\u793a\u90fd\u91cd\u8981
    "},{"location":"DIP/Basic/DIP/#4palette","title":"(4)\u8c03\u8272\u677f\uff08Palette\uff09","text":"
    • \u8c03\u8272\u677f\u7684\u5927\u5c0f\u4e3a\\(N*4\\) (bytes)\u3002\u8c03\u8272\u677f\u4e2d\u7684\u6bcf\u4e00\u9879\u75281 \u5b57\u8282\u8868\u793a\u84dd\u8272\u5206\u91cf\u30011 \u5b57\u8282\u8868\u793a\u7eff\u8272\u5206\u91cf\u30011 \u5b57\u8282\u8868\u793a\u7ea2\u8272\u5206\u91cf\u30011 \u5b57\u8282\u7528\u4e8e\u586b\u5145\u7b26 (\u8bbe\u7f6e\u4e3a 0)

    \u6709\u4e00\u4e2a\u957f\u5bbd\u5404\u4e3a200\u4e2a\u8c61\u7d20\uff0c\u989c\u8272\u6570\u4e3a16\u8272\u7684\u5f69\u8272\u56fe\uff0c\u6bcf\u4e00\u4e2a\u8c61\u7d20\u90fd\u7528R\u3001G\u3001B\u4e09\u4e2a\u5206\u91cf\u8868\u793a

    \u56e0\u4e3a\u6bcf\u4e2a\u5206\u91cf\u6709256\u4e2a\u7ea7\u522b\uff0c\u8981\u75288\u4f4d(bit)\uff0c\u5373\u4e00\u4e2a\u5b57\u8282(byte)\u6765\u8868\u793a\uff0c\u6240\u4ee5\u6bcf\u4e2a\u8c61\u7d20\u9700\u8981\u75283\u4e2a\u5b57\u8282\u3002\u6574\u4e2a\u56fe\u8c61\u8981\u7528200\u00d7200\u00d73\uff0c\u7ea6120k\u5b57\u8282\uff0c\u53ef\u4e0d\u662f\u4e00\u4e2a\u5c0f\u6570\u76ee\u5440\uff01\u5982\u679c\u6211\u4eec\u7528\u4e0b\u9762\u7684\u65b9\u6cd5\uff0c\u5c31\u80fd\u7701\u7684\u591a\u3002

    \u56e0\u4e3a\u662f\u4e00\u4e2a16\u8272\u56fe\uff0c\u4e5f\u5c31\u662f\u8bf4\u8fd9\u5e45\u56fe\u4e2d\u6700\u591a\u53ea\u670916\u79cd\u989c\u8272\uff0c\u6211\u4eec\u53ef\u4ee5\u7528\u4e00\u4e2a\u8868\uff1a\u8868\u4e2d\u7684\u6bcf\u4e00\u884c\u8bb0\u5f55\u4e00\u79cd\u989c\u8272\u7684R\u3001G\u3001B\u503c\u3002\u8fd9\u6837\u5f53\u6211\u4eec\u8868\u793a\u4e00\u4e2a\u8c61\u7d20\u7684\u989c\u8272\u65f6\uff0c\u53ea\u9700\u8981\u6307\u51fa\u8be5\u989c\u8272\u662f\u5728\u7b2c\u51e0\u884c\uff0c\u5373\u8be5\u989c\u8272\u5728\u8868\u4e2d\u7684\u7d22\u5f15\u503c\u3002\u4e3e\u4e2a\u4f8b\u5b50\uff0c\u5982\u679c\u8868\u7684\u7b2c0\u884c\u4e3a255\uff0c0\uff0c0(\u7ea2\u8272)\uff0c\u90a3\u4e48\u5f53\u67d0\u4e2a\u8c61\u7d20\u4e3a\u7ea2\u8272\u65f6\uff0c\u53ea\u9700\u8981\u6807\u660e0\u5373\u53ef

    \u8fd9\u5f20R\u3001G\u3001B\u7684\u8868\uff0c\u5c31\u662f\u6211\u4eec\u5e38\u8bf4\u7684\u8c03\u8272\u677f(Palette)\uff0c\u53e6\u4e00\u79cd\u53eb\u6cd5\u662f\u989c\u8272\u67e5\u627e\u8868LUT(Look Up Table)\uff0c\u4f3c\u4e4e\u66f4\u786e\u5207\u4e00\u4e9b\u3002Windows\u4f4d\u56fe\u4e2d\u4fbf\u7528\u5230\u4e86\u8c03\u8272\u677f\u6280\u672f\u3002\u5176\u5b9e\u4e0d\u5149\u662fWindows\u4f4d\u56fe\uff0c\u8bb8\u591a\u56fe\u8c61\u6587\u4ef6\u683c\u5f0f\u5982pcx\u3001tif\u3001gif\u7b49\u90fd\u7528\u5230\u4e86\u3002\u6240\u4ee5\u5f88\u597d\u5730\u638c\u63e1\u8c03\u8272\u677f\u7684\u6982\u5ff5\u662f\u5341\u5206\u6709\u7528\u7684\u3002

    "},{"location":"DIP/Basic/DIP/#5image-data","title":"(5)\u56fe\u50cf\u6570\u636e\u5b57\u8282\u9635\u5217\uff08Image data\uff09","text":"
    • \u56fe\u50cf\u6570\u636e\u5b57\u8282\u9635\u5217\u5b58\u50a8\u4e86\u8c03\u8272\u677f\u7684\u7d22\u5f15\u53f7\uff0c\u6216\u8005\u53d6\u51b3\u4e8e\u989c\u8272\u6df1\u5ea6\u7684RGB\u503c

    • \u5176\u5927\u5c0f\u53d6\u51b3\u4e8e\u56fe\u50cf\u5927\u5c0f\u548c\u989c\u8272\u6df1\u5ea6\u3002

    (1)\u6bcf\u4e00\u884c\u7684\u5b57\u8282\u6570\u5fc5\u987b\u662f4\u7684\u6574\u500d\u6570\uff0c\u5982\u679c\u4e0d\u662f\uff0c\u5219\u9700\u8981\u8865\u9f50(append zero)

    (2)\u4e00\u822c\u6765\u8bf4\uff0c.bMP\u6587\u4ef6\u7684\u6570\u636e\u4ece\u4e0b\u5230\u4e0a\uff0c\u4ece\u5de6\u5230\u53f3\u7684

    • \u4e5f\u5c31\u662f\u8bf4\uff0c\u4ece\u6587\u4ef6\u4e2d\u6700\u5148\u8bfb\u5230\u7684\u662f\u56fe\u8c61\u6700\u4e0b\u9762\u4e00\u884c\u7684\u5de6\u8fb9\u7b2c\u4e00\u4e2a\u8c61\u7d20\uff0c\u7136\u540e\u662f\u5de6\u8fb9\u7b2c\u4e8c\u4e2a\u8c61\u7d20\u2026\u2026\u63a5\u4e0b\u6765\u662f\u5012\u6570\u7b2c\u4e8c\u884c\u5de6\u8fb9\u7b2c\u4e00\u4e2a\u8c61\u7d20\uff0c\u5de6\u8fb9\u7b2c\u4e8c\u4e2a\u8c61\u7d20\u2026\u2026\u4f9d\u6b21\u7c7b\u63a8 \uff0c\u6700\u540e\u5f97\u5230\u7684\u662f\u6700\u4e0a\u9762\u4e00\u884c\u7684\u6700\u53f3\u4e00\u4e2a\u8c61\u7d20\u3002

    • You do not need to turn around the rows manually. The API functions which also display the bitmap will do that for you automatically.

    6 bytes that represent a row in the bitmap: A0 37 F2 8B 31 C4 must be saved as: A0 37 F2 8B 31 C4 00 00"},{"location":"DIP/Basic/DIP/#2bmp","title":"2.BMP\u6587\u4ef6\u7684\u8bfb\u5165\u548c\u5b58\u50a8","text":"

    \u5229\u7528 C \u8bed\u8a00\u4e2d\u7684 fopen fread fwrite \u8fdb\u884c\u8bfb\u5165\u3001\u5199\u51fa\u5373\u53ef

    \u5728\u8bfb\u5165\u4e0e\u5199\u51fa\u7684\u8fc7\u7a0b\u4e2d\uff0c\u9700\u8981\u6ce8\u610f BMP\u6587\u4ef6\u4fe1\u606f\u7684\u8c03\u6574\uff0c\u4f8b\u5982\u753124\u4f4d\u5f69\u8272BMP\u8f6c\u4e3a\u7070\u8272\u56fe\u65f6\uff0c\u9700\u8981\u6ce8\u610f\u8c03\u8272\u677f\u3001\u4f4d\u6df1\u7b49\u7684\u8c03\u6574\u3002

    FILE *inputFile = fopen(\"input.bmp\", \"rb\");\n // \u68c0\u67e5\u6587\u4ef6\u662f\u5426\u6210\u529f\u6253\u5f00\nif (!inputFile) {\n    printf(\"Unable to open input BMP file.\\n\"); // \u8f93\u51fa\u9519\u8bef\u4fe1\u606f\n    return 0; // \u9000\u51fa\u7a0b\u5e8f\n}\nprintf(\"successfully loaded!\"); // \u6210\u529f\u52a0\u8f7d\u7684\u63d0\u793a\u4fe1\u606f\nBMP bmp; // \u521b\u5efa\u4e00\u4e2aBMP\u7ed3\u6784\u4f53\u53d8\u91cf\u7528\u4e8e\u5b58\u50a8BMP\u6587\u4ef6\u7684\u4fe1\u606f\u548c\u6570\u636e\n// \u4ece\u6587\u4ef6\u4e2d\u8bfb\u53d6BMP\u6587\u4ef6\u5934\u548c\u4fe1\u606f\u5934\nfread(&(bmp), HEADERSIZE, 1, inputFile);\nint width = bmp.bmpih.width; // \u83b7\u53d6\u56fe\u50cf\u7684\u5bbd\u5ea6\nint height = bmp.bmpih.height; // \u83b7\u53d6\u56fe\u50cf\u7684\u9ad8\u5ea6\n// \u5982\u679c\u56fe\u50cf\u5927\u5c0f\u4e3a0\uff0c\u5219\u8ba1\u7b97\u56fe\u50cf\u6570\u636e\u5927\u5c0f\nif (bmp.bmpih.imageSize == 0) {bmp.bmpih.imageSize = bmp.bmph.bfSize - bmp.bmph.bfOffset;}\n// \u4e3a\u4f4d\u56fe\u6570\u636e\u5206\u914d\u5185\u5b58\nbmp.bitmap = (byte*)malloc(sizeof(byte) * (bmp.bmph.bfSize - HEADERSIZE));\n// \u4ece\u6587\u4ef6\u4e2d\u8bfb\u53d6\u4f4d\u56fe\u6570\u636e\nfread(bmp.bitmap, bmp.bmph.bfSize - HEADERSIZE, 1, inputFile);\nfclose(inputFile); // \u5173\u95ed\u6587\u4ef6\n
    "},{"location":"DIP/Basic/DIP/#visual-intelligence-and-pattern-analysis","title":"Visual Intelligence and Pattern Analysis","text":""},{"location":"DIP/Basic/DIP/#history","title":"History","text":""},{"location":"DIP/Basic/DIP/#_2","title":"\u9488\u5b54\u6210\u50cf","text":"
    • \u6295\u5f71\u4fbf\u6210\u4e3a\u5012\u7acb\u7684\uff1b\u7269\u8ddd\u8d8a\u8fdc,\u50cf\u8d8a\u5c0f\uff1b\u7269\u8ddd\u8d8a\u8fd1,\u50cf\u8d8a\u5927

    • \u5982\u524d\u9762\u63d0\u5230\u7684\u60c5\u51b5\uff0c\u5149\u5708\u5b54\u5f84\u5927\u7684\u65f6\u5019\uff0c\u4f1a\u5bfc\u81f4\u6a21\u7cca\uff1b\u90a3\u662f\u4e0d\u662f\u53ef\u4ee5\u5c3d\u91cf\u7f29\u5c0f\u5149\u5708\u7684\u5b54\u5f84\u5462\uff1f

    NO.\u5982\u679c\u5b54\u5f84\u592a\u5c0f\uff0c\u53ef\u901a\u8fc7\u7684\u5149\u7ebf\u5c31\u5f88\u5c11\uff0c\u5bfc\u81f4\u5149\u5f3a\u592a\u5f31\uff0c\u540c\u65f6\u5f53\u5b54\u5f84\u5c0f\u5230\u4e00\u5b9a\u7a0b\u5ea6\u65f6\uff0c\u4f1a\u4ea7\u751f\u884d\u5c04\u73b0\u8c61\u3002

    "},{"location":"DIP/Basic/DIP/#lenses","title":"Lenses","text":"
    • \u901a\u8fc7\u4f7f\u7528\u900f\u955c\u53ef\u4ee5\u4f1a\u805a\u66f4\u591a\u7684\u5149\u7ebf\u5230\u4e00\u4e2a\u6210\u50cf\u70b9\uff0c\u53ea\u662f\u53ea\u6709\u5728\u7279\u6b8a\u7684\u4f4d\u7f6e\u4e0a\u624d\u80fd\u8fbe\u5230\u8fd9\u4e2a\u76ee\u6807\uff0c\u5373\u5927\u5bb6\u4ee5\u524d\u5c31\u5b66\u4e60\u8fc7\u7684\u900f\u955c\u805a\u7126

    • \u4f4d\u4e8e\u5408\u9002\u8ddd\u79bb\u7684\u7269\u4f53\u70b9\u53ef\u4ee5\u6210\u6e05\u6670\u50cf\uff0c\u5176\u4ed6\u7684\u70b9\u5219\u4f1a\u4ea7\u751f\u5f25\u6563\u5706 \u901a\u8fc7\u6539\u53d8\u955c\u5934\u7684\u5f62\u72b6\u53ef\u4ee5\u6539\u53d8\u805a\u7126\u65f6\u7684\u7269\u4f53\u70b9\u6240\u9700\u8981\u7684\u8ddd\u79bb

    • \u5f25\u6563\u5706(circle of confusion) \uff1a\u5728\u7126\u70b9\u524d\u540e\uff0c\u5149\u7ebf\u5f00\u59cb\u805a\u96c6\u548c\u6269\u6563\uff0c\u70b9\u7684\u5f71\u50cf\u53d8\u6a21\u7cca\uff0c\u5f62\u6210\u4e00\u4e2a\u6269\u5927\u7684\u5706
    • \u5982\u679c\u5f25\u6563\u5706\u7684\u76f4\u5f84\u5c0f\u4e8e\u4eba\u773c\u7684\u9274\u522b\u80fd\u529b\uff0c\u5728\u4e00\u5b9a\u8303\u56f4\u5185\u5b9e\u9645\u5f71\u50cf\u4ea7\u751f\u7684\u6a21\u7cca\u662f\u4e0d\u80fd\u8fa8\u8ba4\u7684\u3002\u4e0d\u80fd\u8fa8\u8ba4\u7684\u76f4\u5f84\u53eb\u505a\u5bb9\u8bb8\u5f25\u6563\u5706\u3002\u7126\u70b9\u524d\u540e\u5404\u6709\u4e00\u4e2a\u5bb9\u8bb8\u5f25\u6563\u5706
    • \u5bf9\u4e8e6\u5bf8\u7167\u7247\uff0c\u89c2\u5bdf\u8ddd\u79bb25\uff0d30cm \uff0c\u5927\u6982\u662f\u5e95\u7247\u5bf9\u89d2\u7ebf1/1000-1/1500.

    • \u5149\u5708\u7684\u5927\u5c0f\u4e0e\u666f\u6df1\u6709\u5bc6\u5207\u5173\u7cfb\uff1a\u7126\u70b9\u524d\u540e\u5404\u6709\u4e00\u4e2a\u5bb9\u8bb8\u5f25\u6563\u5706\uff0c\u4ed6\u4eec\u4e4b\u95f4\u7684\u8ddd\u79bb\u53eb\u505a\u666f\u6df1

    \u666f\u6df1\u968f\u955c\u5934\u7684\u7126\u8ddd\u3001\u5149\u5708\u503c\u3001\u62cd\u6444\u8ddd\u79bb\u800c\u53d8\u5316

    (1)\u955c\u5934\u5149\u5708\uff1a\u5149\u5708\u8d8a\u5927\uff0c\u666f\u6df1\u8d8a\u5c0f\uff1b\u5149\u5708\u8d8a\u5c0f\uff0c\u666f\u6df1\u8d8a\u5927

    (2)\u955c\u5934\u7126\u8ddd\uff1a\u955c\u5934\u7126\u8ddd\u8d8a\u957f\uff0c\u666f\u6df1\u8d8a\u5c0f\uff1b\u7126\u8ddd\u8d8a\u77ed\uff0c\u666f\u6df1\u8d8a\u5927

    (3)\u62cd\u6444\u8ddd\u79bb\uff1a\u8ddd\u79bb\u8d8a\u8fdc\uff0c\u666f\u6df1\u8d8a\u5927\uff1b\u8ddd\u79bb\u8d8a\u8fd1\uff0c\u666f\u6df1\u8d8a\u5c0f

    For a given subject framing and camera position, the DOF is controlled by the lens aperture diameter, which is usually specified as the f-number, the ratio of lens focal length to aperture diameter.

    Reducing the aperture diameter (increasing the f-number) increases the DOF; however, it also reduces the amount of light transmitted, and increases diffraction, placing a practical limit on the extent to which DOF can be increased by reducing the aperture diameter.

    "},{"location":"DIP/Basic/DIP/#digital-camera","title":"Digital camera","text":"
    • \u62cd\u6444\u666f\u7269\u65f6\uff0c\u666f\u7269\u53cd\u5c04\u7684\u5149\u7ebf\u901a\u8fc7\u6570\u7801\u76f8\u673a\u7684\u955c\u5934\u900f\u5c04\u5230CCD\u4e0a
    • \u5f53CCD\u66dd\u5149\u540e\uff0c\u5149\u7535\u4e8c\u6781\u7ba1\u53d7\u5230\u5149\u7ebf\u7684\u6fc0\u53d1\u800c\u91ca\u653e\u51fa\u7535\u8377\uff0c\u751f\u6210\u611f\u5149\u5143\u4ef6\u7684\u7535\u4fe1\u53f7

    • CCD\u63a7\u5236\u82af\u7247\u5229\u7528\u611f\u5149\u5143\u4ef6\u4e2d\u7684\u63a7\u5236\u4fe1\u53f7\u7ebf\u8def\u5bf9\u53d1\u5149\u4e8c\u6781\u7ba1\u4ea7\u751f\u7684\u7535\u6d41\u8fdb\u884c\u63a7\u5236\uff0c\u7531\u7535\u6d41\u4f20\u8f93\u7535\u8def\u8f93\u51fa\uff0cCCD\u4f1a\u5c06\u4e00\u6b21\u6210\u50cf\u4ea7\u751f\u7684\u7535\u4fe1\u53f7\u6536\u96c6\u8d77\u6765\uff0c\u7edf\u4e00\u8f93\u51fa\u5230\u653e\u5927\u5668\u3002

    • \u7ecf\u8fc7\u653e\u5927\u548c\u6ee4\u6ce2\u540e\u7684\u7535\u4fe1\u53f7\u88ab\u4f20\u9001\u5230ADC\uff0c\u7531ADC\u5c06\u7535\u4fe1\u53f7\uff08\u6a21\u62df\u4fe1\u53f7\uff09\u8f6c\u6362\u4e3a\u6570\u5b57\u4fe1\u53f7\uff0c\u6570\u503c\u7684\u5927\u5c0f\u548c\u7535\u4fe1\u53f7\u7684\u5f3a\u5ea6\u4e0e\u7535\u538b\u7684\u9ad8\u4f4e\u6210\u6b63\u6bd4\uff0c\u8fd9\u4e9b\u6570\u503c\u5176\u5b9e\u4e5f\u5c31\u662f\u56fe\u50cf\u7684\u6570\u636e\u3002
    • \u6b64\u65f6\u8fd9\u4e9b\u56fe\u50cf\u6570\u636e\u8fd8\u4e0d\u80fd\u76f4\u63a5\u751f\u6210\u56fe\u50cf\uff0c\u8fd8\u8981\u8f93\u51fa\u5230DSP\uff08\u6570\u5b57\u4fe1\u53f7\u5904\u7406\u5668\uff09\u4e2d\uff0c\u5728DSP\u4e2d\uff0c\u5c06\u4f1a\u5bf9\u8fd9\u4e9b\u56fe\u50cf\u6570\u636e\u8fdb\u884c\u8272\u5f69\u6821\u6b63\u3001\u767d\u5e73\u8861\u5904\u7406\uff0c\u5e76\u7f16\u7801\u4e3a\u6570\u7801\u76f8\u673a\u6240\u652f\u6301\u7684\u56fe\u50cf\u683c\u5f0f\u3001\u5206\u8fa8\u7387\uff0c\u7136\u540e\u624d\u4f1a\u88ab\u5b58\u50a8\u4e3a\u56fe\u50cf\u6587\u4ef6\u3002
    • \u5f53\u5b8c\u6210\u4e0a\u8ff0\u6b65\u9aa4\u540e\uff0c\u56fe\u50cf\u6587\u4ef6\u5c31\u4f1a\u88ab\u4fdd\u5b58\u5230\u5b58\u50a8\u5668\u4e0a,\u6211\u4eec\u5c31\u53ef\u4ee5\u6b23\u8d4f\u4e86\u3002
    "},{"location":"DIP/Basic/DIP/#physical-meaning-of-color","title":"Physical meaning of color","text":"

    Colorful view is generated by the interactions between light and objects, e.g., reflection, refraction, scattering, transmission, absorption, and diffraction.

    \u8272\u5f69\u573a\u666f\u662f\u7531\u5149\u4e0e\u7269\u4f53\u4e4b\u95f4\u7684\u4ea4\u4e92\u8fc7\u7a0b\u4ea7\u751f\u7684\u3002\u5982\uff1a\u53cd\u5c04\u3001\u6298\u5c04\u3001\u6563\u5c04\u3001\u4f20\u64ad\u3001\u5438\u6536\u4ee5\u53ca\u884d\u5c04\u7b49\u7b49

    \u8272\u5f69\u53ef\u4ee5\u5206\u4e3a\u5f69\u8272\uff08chromatic color\uff09\u548c\u6d88\u8272\uff08achromatic color\uff09\u4e24\u5927\u7c7b

    • \u5f69\u8272\u662f\u6307\u7ea2\u3001\u9ec4\u3001\u84dd\u7b49\u5355\u8272\u4ee5\u53ca\u5b83\u4eec\u7684\u6df7\u5408\u8272\uff0c\u5f69\u8272\u7269\u4f53\u5bf9\u5149\u8c31\u5404\u6ce2\u957f\u7684\u53cd\u5c04\u5177\u6709\u9009\u62e9\u6027\uff0c\u6240\u4ee5\u5b83\u4eec\u5728\u767d\u5149\u7167\u5c04\u4e0b\u5448\u73b0\u51fa\u4e0d\u540c\u7684\u989c\u8272
    • \u6d88\u8272\uff0c\u53c8\u79f0\u975e\u5f69\u8272\uff0c\u4e5f\u5c31\u662f\u6211\u4eec\u901a\u5e38\u6240\u8bf4\u7684\u7070\u5ea6\uff0c\u662f\u6307\u767d\u8272\uff0c\u9ed1\u8272\u4ee5\u53ca\u5404\u79cd\u6df1\u6d45\u4e0d\u540c\u7684\u7070\u8272\u3002\u6d88\u8272\u7269\u4f53\u5bf9\u5149\u8c31\u5404\u6ce2\u957f\u7684\u53cd\u5c04\u6ca1\u6709\u9009\u62e9\u6027\uff0c\u5b83\u4eec\u662f\u4e2d\u6027\u8272
    "},{"location":"DIP/Basic/DIP/#light-and-colour","title":"Light and Colour","text":"

    \u8272\u89c9(colour vision)\u662f\u6307\u4e0d\u540c\u6ce2\u957f\u7684\u5149\u7ebf\u4f5c\u7528\u4e8e\u89c6\u7f51\u819c\u800c\u5728\u5927\u8111\u4e2d\u5f15\u8d77\u7684\u611f\u89c9

    • \u4eba\u773c\u53ef\u89c1\u5149\u7ebf\u7684\u6ce2\u957f\u662f390nm\uff5e780nm\uff0c\u4e00\u822c\u53ef\u8fa8\u51fa\u5305\u62ec\u7d2b\u3001\u84dd\u3001\u9752\u3001\u7eff\u3001\u9ec4\u3001\u6a59\u3001\u7ea27\u79cd\u4e3b\u8981\u989c\u8272\u5728\u5185\u7684120\uff5e180\u79cd\u4e0d\u540c\u7684\u989c\u8272

    • \u89c6\u7f51\u819c\u662f\u4eba\u773c\u4e2d\u6700\u91cd\u8981\u7684\u7ec4\u6210\u90e8\u5206\uff0c\u5c31\u50cf\u76f8\u673a\u91cc\u7684\u611f\u5149\u5e95\u7247\uff0c\u4e13\u95e8\u8d1f\u8d23\u611f\u5149\u6210\u50cf\u3002\u89c6\u7f51\u819c\u4e0a\u5206\u5e03\u7740\u4e24\u79cd\u89c6\u89c9\u7ec6\u80de\uff0c\u4e00\u79cd\u4e3a\u6746\u72b6\u4f53\uff0c\u53e6\u4e00\u79cd\u4e3a\u9525\u72b6\u4f53

    \u6746\u72b6\u4f53\u7ec6\u80de\u6bd4\u8f83\u591a\uff0c\u5927\u7ea6\u6709\u4e0a\u4ebf\u4e2a\uff0c\u5b83\u5bf9\u5149\u6781\u4e3a\u7075\u654f\uff0c\u4f46\u6ca1\u6709\u533a\u5206\u8272\u5f69\u7684\u80fd\u529b

    \u9525\u72b6\u4f53\u7ec6\u80de\u5219\u53ea\u6709\u516d\u3001\u4e03\u767e\u4e07\u4e2a\uff0c\u5b83\u8981\u5728\u8f83\u5f3a\u7684\u7167\u5ea6\u4e0b\u624d\u80fd\u6fc0\u53d1\uff0c\u5b83\u7684\u5b58\u5728\u4f7f\u6211\u4eec\u80fd\u591f\u8fa8\u522b\u5404\u79cd\u4e0d\u540c\u7684\u989c\u8272

    • \\(\\lambda:\\ Red>Green>Blue\\)

    "},{"location":"DIP/Basic/DIP/#three-primary-colors","title":"Three-primary colors","text":"

    \u89c6\u7f51\u819c\u4e0a\u5b58\u5728\u4e09\u79cd\u5206\u522b\u5bf9\u7ea2\u7eff\u84dd\u5149\u6ce2\u957f\u7279\u522b\u654f\u611f\u7684\u89c6\u9525\u7ec6\u80de\u6216\u76f8\u5e94\u7684\u611f\u5e94\u8272\u7d20\uff0c\u4e0d\u540c\u6ce2\u957f\u7684\u5149\u8fdb\u5165\u773c\u775b\u540e\uff0c\u4e0e\u4e4b\u76f8\u7b26\u6216\u76f8\u8fd1\u7684\u89c6\u9525\u7ec6\u80de\u53d1\u751f\u4e0d\u540c\u7a0b\u5ea6\u7684\u5174\u594b\uff0c\u4e8e\u662f\u5728\u5927\u8111\u4ea7\u751f\u76f8\u5e94\u7684\u8272\u89c9\uff1b\u82e5\u4e09\u79cd\u89c6\u9525\u7ec6\u80de\u53d7\u5230\u540c\u7b49\u7a0b\u5ea6\u7684\u523a\u6fc0\uff0c\u90a3\u4e48\u4ea7\u751f\u6d88\u8272

    "},{"location":"DIP/Basic/DIP/#perception-priority-and-sensitivity","title":"Perception priority and sensitivity","text":"
    • Priority: Under the same setting, human notices first the hue (H) (\u8272\u8c03)changes, then the saturation (S) (\u9971\u548c\u5ea6), then the lightness value (V) (\u4eae\u5ea6).

    • Sensitivity: Human eyes are the most sensitive to the lightness changes and have the best resolution, which is responsible for the eyes\u2019 HDR capacity

    \u4eba\u773c\u5bf9\u4e8e\u4eae\u5ea6\u7684\u53d8\u5316\u6700\u4e3a\u654f\u611f\uff0c\u5206\u8fa8\u80fd\u529b\u6700\u5f3a\u3002\u6070\u597d\u4e0e\u4eba\u773c\u7684\u9ad8\u52a8\u6001\u80fd\u529b\u76f8\u5339\u914d\u3002

    "},{"location":"DIP/Basic/DIP/#definition-of-color-space","title":"Definition of color space","text":"
    • Device dependent color space model:RGB CMY HSV (HSV more similar to human's sensation)
    • Device independent color space model:Most of them are defined by CIE :CIE XYZ, CIE \\(L^*a^*b\\), CIE YUV
    "},{"location":"DIP/Basic/DIP/#rgb-color-model","title":"RGB color model","text":"

    RGB color model is a unit cube in a Cartesian coordinates system.

    • The magnitudes of each primary color are equivalent on the main diagonal line, which lead to the white color from darkness to brightness, i.e., grayscale. (0,0,0)-dark, (1,1,1)-bright.

    • The other 6 corners are respectively red, yellow, cyan, blue and magenta.(\u7ea2\u3001\u9ec4\u3001\u7eff\u3001\u9752\u3001\u84dd\u548c\u54c1\u7ea2)

    • RGB is a subset of CIE primary color space.

    • RGB is usually used in Color cathode ray tube and Color raster graphics display (computer , TV).

    RGB\u989c\u8272\u6a21\u578b\u901a\u5e38\u7528\u4e8e\u5f69\u8272\u9634\u6781\u5c04\u7ebf\u7ba1\u548c\u5f69\u8272\u5149\u6805\u56fe\u5f62\u663e\u793a\u5668\uff08\u8ba1\u7b97\u673a\u548c\u7535\u89c6\u673a\u91c7\u7528\uff09

    "},{"location":"DIP/Basic/DIP/#cmy-color-model","title":"CMY color model","text":"
    • \u5f69\u8272\u5370\u5237\u6216\u8005\u5f69\u8272\u6253\u5370\u7684\u7eb8\u5f20\u4e0d\u80fd\u53d1\u5c04\u5149\u7ebf\uff0c\u56e0\u800c\u5370\u5237\u673a\u6216\u6253\u5370\u673a\u5c31\u53ea\u80fd\u4f7f\u7528\u4e00\u4e9b\u80fd\u591f\u5438\u6536\u7279\u5b9a\u5149\u6ce2\u800c\u53cd\u5c04\u5176\u4ed6\u5149\u6ce2\u7684\u6cb9\u58a8\u6216\u8005\u989c\u8272

    • \u6cb9\u58a8\u6216\u989c\u6599\u76843\u79cd\u57fa\u8272\u662f\u4ee5\u7ea2\u3001\u7eff\u3001\u84dd\u4e09\u8272\u7684\u8865\u8272 : \u9752\uff08Cyan\uff09\u3001\u54c1\u7ea2\uff08Magenta\uff09\u3001\u9ec4\uff08Yellow\uff09\u4e3a\u57fa\u8272

    • \u7528CMY\u6a21\u578b\u4ea7\u751f\u7684\u989c\u8272\u79f0\u4e3a\u76f8\u51cf\u8272\uff0c\u662f\u56e0\u4e3a\u5b83\u51cf\u6389\u4e86\u4e3a\u89c6\u89c9\u7cfb\u7edf\u8bc6\u522b\u989c\u8272\u6240\u9700\u8981\u7684\u53cd\u5c04\u5149

    • CMY\u7a7a\u95f4\u4e0eRGB\u7a7a\u95f4\u4e92\u8865\uff0c\u4e5f\u5c31\u662f\u7528\u767d\u8272\u51cf\u53bbRGB\u7a7a\u95f4\u4e2d\u7684\u67d0\u4e00\u989c\u8272\u503c\u5c31\u7b49\u4e8e\u540c\u6837\u989c\u8272\u5728CMY\u7a7a\u95f4\u4e2d\u7684\u503c

    "},{"location":"DIP/Basic/DIP/#hsv-color","title":"HSV color","text":"

    HIS/HSV color space is defined based on human visual system.

    \u8272\u8c03\uff08Hue)\u3001\u8272\u9971\u548c\u5ea6\uff08Saturation\uff09\u548c\u4eae\u5ea6\uff08Intensity\uff0c\u6216\u8005Value\uff09

    • Hue, Saturation, Intensity/ValueHIS can be depicted as a cone
    • Top surface of cone: \\(V=1\\), which includes R=1, G=1, B=1.
    • Hue: around the axis: RED-- \\(0^o\\) , GREEN-- \\(120^o\\) , BLUE-- \\(240^o\\)
    • Saturation: along the radial direction.
    • Bottom point of cone: \\(V=0\\)\uff0c\\(H =null, S=null\\), for darkness.
    • Center of the top surface: \\(S=0, V=1, H=null\\), for brightness.

    Advantages:

    • Close to human color vision.
    • When using RGB or CMY, if you want to change hue, you must adjust R, G, and B at the same time. But using HSV, you DON\u2019T have to do that. Only ONE channel is adjusted.
    • HSV color model is a uniform color space, linearly distributed. The color difference perception is proportional to Euclidean distance on the HSV cone volume.

    "},{"location":"DIP/Basic/DIP/#cie-color-model","title":"CIE color model","text":""},{"location":"DIP/Basic/DIP/#cie-color-model_1","title":"CIE color model","text":"
    • A series of color models according to the response of human eyes to RGB, which are carefully measured.

    Device independent:

    • Such color models are used to define device-independent color.
    • Help people to reproduce color consistently on different devices such as scanner, monitor, and printer. CIE color modelsCIE XYZ, CIE \\(L^*a^*b\\) CIE YUV etc.
    "},{"location":"DIP/Basic/DIP/#cie-xyz","title":"CIE XYZ","text":"

    XYZ concept is based on the three-primary color theory, which describes human eyes have RGB receptors and all other color are mixture of RBG.

    • Computed by using functions\\(\\overline{x(\\lambda)},\\overline{y(\\lambda)},\\overline{z(\\lambda)}\\)

    • \\(Y_{xy}\\)color space given in 1931: Y->luminance, x,y are color coordinates computed based XYZ.

    • Describes the color range human can perceives.
    "},{"location":"DIP/Basic/DIP/#cie-lab","title":"CIE \\(L^*a^*b\\)","text":"
    • Defined in 1976
    • Modification of CIE XYZ
    • Overcomes the un-proportional problem in Yxy color space: \\(x,y\\) distance does not reflect the color difference you observe.
    • L: lightness a: green to red b: blue to yellow
    • L,a, b can be adjust separately.
    • \u662fCIE XYZ\u989c\u8272\u6a21\u578b\u7684\u6539\u8fdb\u578b\uff0c\u4ee5\u4fbf\u514b\u670d\u539f\u6765\u7684Yxy\u989c\u8272\u7a7a\u95f4\u5b58\u5728\u7684\u5728x\uff0cy\u8272\u5ea6\u56fe\u4e0a\u76f8\u7b49\u7684\u8ddd\u79bb\u5e76\u4e0d\u76f8\u5f53\u4e8e\u6211\u4eec\u6240\u89c9\u5bdf\u5230\u7684\u76f8\u7b49\u8272\u5dee\u7684\u95ee\u9898
    • \u5b83\u7684\u201cL\u201d\uff08\u660e\u4eae\u5ea6\uff09\uff0c\u201ca\u201d\uff08\u7eff\u8272\u5230\u7ea2\u8272\uff09\u548c\u201cb\u201d(\u84dd\u8272\u5230\u9ec4\u8272)\u4ee3\u8868\u8bb8\u591a\u7684\u503c
    • \u4e0eXYZ\u6bd4\u8f83\uff0cCIE \\(L^*a^*b*\\) \u989c\u8272\u66f4\u9002\u5408\u4e8e\u4eba\u773c\u7684\u611f\u89c9
    • \u989c\u8272\u7684\u4eae\u5ea6\uff08L\uff09\u3001\u7070\u9636\u548c\u9971\u548c\u5ea6\uff08a,b\uff09\u53ef\u4ee5\u5355\u72ec\u4fee\u6b63\uff0c\u8fd9\u6837\uff0c\u56fe\u50cf\u7684\u6574\u4e2a\u989c\u8272\u90fd\u53ef\u4ee5\u5728\u4e0d\u6539\u53d8\u56fe\u50cf\u6216\u5176\u4eae\u5ea6\u7684\u60c5\u51b5\u4e0b\uff0c\u53d1\u751f\u6539\u53d8\u3002
    "},{"location":"DIP/Basic/DIP/#cie-yuv","title":"CIE YUV","text":"

    \u5728\u73b0\u4ee3\u5f69\u8272\u7535\u89c6\u7cfb\u7edf\u4e2d\uff0c\u901a\u5e38\u91c7\u7528\u4e09\u7ba1\u5f69\u8272\u6444\u50cf\u673a\u6216\u5f69\u8272CCD\uff08\u7535\u8377\u8026\u5408\u5668\u4ef6\uff09\u6444\u50cf\u673a\uff0c\u5b83\u628a\u6444\u5f97\u7684\u5f69\u8272\u56fe\u50cf\u4fe1\u53f7\uff0c\u7ecf\u5206\u8272\uff0c\u5206\u522b\u653e\u5927\u6821\u6b63\u5f97\u5230RGB\uff0c\u518d\u7ecf\u8fc7\u77e9\u9635\u53d8\u6362\u7535\u8def\u5f97\u5230\u4eae\u5ea6\u4fe1\u53f7Y\u548c\u4e24\u4e2a\u8272\u5dee\u4fe1\u53f7R\uff0dY\u3001B\uff0dY\uff0c\u6700\u540e\u53d1\u9001\u7aef\u5c06\u4eae\u5ea6\u548c\u8272\u5dee\u4e09\u4e2a\u4fe1\u53f7\u5206\u522b\u8fdb\u884c\u7f16\u7801\uff0c\u7528\u540c\u4e00\u4fe1\u9053\u53d1\u9001\u51fa\u53bb,\u8fd9\u5c31\u662f\u6211\u4eec\u5e38\u7528\u7684YUV\u989c\u8272\u7a7a\u95f4

    \u91c7\u7528YUV\u989c\u8272\u7a7a\u95f4\u7684\u91cd\u8981\u6027\u662f\u5b83\u7684\u4eae\u5ea6\u4fe1\u53f7Y\u548c\u8272\u5ea6\u4fe1\u53f7U\u3001V\u662f\u5206\u79bb\u7684

    • \u5982\u679c\u53ea\u6709Y\u4fe1\u53f7\u5206\u91cf\u800c\u6ca1\u6709U\u3001V\u5206\u91cf\uff0c\u90a3\u4e48\u8fd9\u6837\u8868\u793a\u7684\u56fe\u5c31\u662f\u9ed1\u767d\u7070\u5ea6\u56fe
    • \u5f69\u8272\u7535\u89c6\u91c7\u7528YUV\u7a7a\u95f4\u6b63\u662f\u4e3a\u4e86\u7528\u4eae\u5ea6\u4fe1\u53f7Y\u89e3\u51b3\u5f69\u8272\u7535\u89c6\u673a\u4e0e\u9ed1\u767d\u7535\u89c6\u673a\u7684\u517c\u5bb9\u95ee\u9898\uff0c\u4f7f\u9ed1\u767d\u7535\u89c6\u673a\u4e5f\u80fd\u63a5\u6536\u5f69\u8272\u4fe1\u53f7\u3002
    "},{"location":"DIP/Basic/DIP/#transformation-between-color-spaces","title":"Transformation between color spaces","text":""},{"location":"DIP/Basic/DIP/#rgb-cmy","title":"RGB<->CMY","text":"

    \\(RGB->CMY\\\\ C = 255 \u2013 R\\\\ M = 255 \u2013 G\\\\ Y = 255 \u2013 B\\\\\\)

    "},{"location":"DIP/Basic/DIP/#rgb-hsv","title":"RGB<->HSV","text":"

    Search in table:

    • CIE has defined transformation tables

    \\(RGB<->XYZ\\\\HSV<->XYZ\\)

    • Compute directly

    "},{"location":"DIP/Basic/DIP/#rgb-cie-xyz-in-a-computable-way","title":"RGB<->CIE XYZ in a computable way","text":"

    \\(\\begin{gathered}\\begin{bmatrix} X \\\\ Y \\\\ Z\\end{bmatrix}=\\begin{bmatrix} 0.608 & 0.714 & 0.200 \\\\0.299& 0.587&0.133 \\\\0.000 &0.066& 1.112\\end{bmatrix}\\begin{bmatrix} R \\\\ G\\\\ B\\end{bmatrix}\\quad\\end{gathered}\\)

    "},{"location":"DIP/Basic/DIP/#cie-xyz-cie-lab","title":"CIE XYZ<->CIE Lab*","text":""},{"location":"DIP/Basic/DIP/#rgb-yuv","title":"RGB \u548c YUV \u7684\u76f8\u4e92\u8f6c\u5316","text":"

    RGB\uff08\u7ea2\u7eff\u84dd\uff09\u548cYUV\u662f\u4e24\u79cd\u989c\u8272\u8868\u793a\u65b9\u5f0f\uff0c\u5e38\u7528\u4e8e\u56fe\u50cf\u548c\u89c6\u9891\u5904\u7406\u4e2d\u3002RGB\u662f\u4e00\u79cd\u76f4\u63a5\u8868\u793a\u989c\u8272\u7684\u65b9\u5f0f\uff0c\u5176\u4e2d\u7ea2\u8272\uff08R\uff09\u3001\u7eff\u8272\uff08G\uff09\u548c\u84dd\u8272\uff08B\uff09\u5206\u91cf\u7684\u503c\u51b3\u5b9a\u4e86\u989c\u8272\u7684\u5177\u4f53\u5916\u89c2

    • RGB\u53ef\u4ee5\u6d6e\u70b9\u8868\u793a\u65b9\u5f0f\uff1a\u53d6\u503c\u8303\u56f4\u4e3a 0.0 ~ 1.0
    • \u6216\u4ee5\u6574\u6570\u8868\u793a\uff1a\u53d6\u503c\u8303\u56f4\u4e3a 0 ~ 255 \u6216\u8005 00 ~ FF\u3002RGB \u989c\u8272\u6a21\u578b \u901a\u5e38\u7528\u4e8e\u5f69\u8272\u9634\u6781\u5c04\u7ebf\u7ba1\u548c\u5f69\u8272\u5149\u6805\u56fe\u5f62\u663e\u793a\u5668(\u8ba1\u7b97\u673a\u548c\u7535\u89c6\u673a\u91c7\u7528)\u3002

    • YUV\u662f\u4e00\u79cd\u989c\u8272\u7a7a\u95f4\uff0c\u57fa\u4e8e YUV \u7684\u989c\u8272\u7f16\u7801\u662f\u6d41\u5a92\u4f53\u7684\u5e38\u7528\u7f16\u7801\u65b9\u5f0f\uff0c\u8fd9\u79cd\u8868\u8fbe\u65b9\u5f0f\u8d77\u521d\u662f\u4e3a\u4e86\u5f69\u8272\u7535\u89c6\u4e0e\u9ed1\u767d\u7535\u89c6\u4e4b\u95f4\u7684\u4fe1\u53f7\u517c\u5bb9\uff1b\u5176\u4e2d\uff1aY\uff1a\u8868\u793a\u660e\u4eae\u5ea6\uff08Luminance \u6216 Luma\uff09\uff0c\u4e5f\u79f0\u7070\u5ea6\u56fe\u3002U\u3001V\uff1a\u8868\u793a\u8272\u5ea6\uff08Chrominance \u6216 Chroma\uff09\uff0c\u4f5c\u7528\u662f\u63cf\u8ff0\u5f71\u50cf\u7684\u8272\u5f69\u53ca\u9971\u548c\u5ea6\uff0c\u7528\u4e8e\u6307\u5b9a\u50cf\u7d20\u7684\u989c\u8272\u3002

    • RGB\u8f6c\u5316\u4e3aYUV\u7684\u516c\u5f0f\u5982\u4e0b\uff1a

    \\(\\begin{gathered}\\begin{bmatrix} Y \\\\ U \\\\ V\\end{bmatrix}=\\begin{bmatrix} 0.299 & 0.587 & 0.114 \\\\ \u22120.147& \u22120.289 &0.435 \\\\0.615 &\u22120.515& \u22120.100\\end{bmatrix}\\begin{bmatrix} R \\\\ G\\\\ B\\end{bmatrix}\\quad\\end{gathered}\\)

    • YUV \u8f6c\u5316\u4e3aRGB\u7684\u516c\u5f0f\u5982\u4e0b\uff1a

    \\(\\begin{gathered}\\quad\\quad\\begin{bmatrix} R \\\\ G \\\\ B\\end{bmatrix}=\\begin{bmatrix} 1.0000 &0.0000& 1.3707 \\\\1.0000& \u22120.3376 &-0.6980 \\\\ 1.0000&1.7324& 0.0000\\end{bmatrix}\\begin{bmatrix} Y \\\\ U\\\\ V\\end{bmatrix}\\quad\\end{gathered}\\)

    • \u7531BMP\u5f69\u8272\u56fe\u8f6c\u4e3a\u7070\u5ea6\u56fe\u65f6\uff0c\u53ea\u9700\u5c06RGB\u8f6c\u4e3aYUV\uff0c\u5e76\u53ea\u4fdd\u7559 Y\u5206\u91cf \u5373\u53ef\u5f97\u5230\u7070\u5ea6\u56fe\u5728\u8c03\u8282BMP\u56fe\u7247\u4eae\u5ea6\u65f6\uff0c\u53ea\u9700\u5c06RGB\u8f6c\u4e3aYUV\uff0c\u6539\u53d8 Y \u5206\u91cf\u7684\u503c\uff0c\u968f\u540e\u5c06 YUV \u8f6c\u56de RGB \u5373\u53ef\u5f97\u5230\u88ab\u66f4\u6539\u8fc7\u4eae\u5ea6\u7684\u56fe\u7247
    "},{"location":"DIP/Basic/DIP/#jpeg-format","title":"JPEG Format","text":"
    • File extension: .JPEG, .JFIF, .JPG, .JPE

    • Compression format for static image :

    As a counterpart of Moving Picture Expert Group.

    Lossy encoding method

    Allow user to make balance between image quality and image size.

    • Encoding based on transformation, e.g. Discrete Cosine Transformation (DCT)JPEG2000 is based on wavelet.

    • Different manipulations for high-frequency signal and low-frequency signal.

    "},{"location":"DIP/Basic/DIP/#compression-strategy","title":"Compression Strategy","text":"

    Compression strategy: According to the requirement of compression ratio, remove information from high frequency to low frequency.

    Advantages:

    • High frequency information occupies much more memory. Hence, high frequency removal leads to high compression ratio
    • Low frequency information preserves the principle structure and color distribution of object, which is the key factors of an image.
    • Suitable for internet based visual media.

    \u538b\u7f29\u7b56\u7565\uff1a\u6839\u636e\u538b\u7f29\u6bd4\u8981\u6c42\uff0c\u4ece\u9ad8\u9891\u5230\u4f4e\u9891\u9010\u6b65\u524a\u51cf\u4fe1\u606f

    • \u9ad8\u9891\u4fe1\u606f\u5360\u7528\u5b58\u50a8\u7a7a\u95f4\u5927\uff0c\u51cf\u5c11\u9ad8\u9891\u4fe1\u606f\u66f4\u5bb9\u6613\u83b7\u5f97\u9ad8\u538b\u7f29\u6bd4
    • \u4f4e\u9891\u4fe1\u606f\u53ef\u4ee5\u4fdd\u7559\u7269\u4f53\u7684\u57fa\u672c\u8f6e\u5ed3\u548c\u8272\u5f69\u5206\u5e03\uff0c\u6700\u5927\u9650\u5ea6\u7ef4\u6301\u56fe\u50cf\u8d28\u91cf
    • \u9002\u5408\u7528\u4e8e\u4e92\u8054\u7f51
    • \u4eba\u773c\u5bf9\u4e8e\u4e00\u4e2a\u76f8\u5bf9\u8f83\u5927\u8303\u56f4\u7684\u533a\u57df\uff0c\u8fa8\u522b\u8272\u5f69\u7ec6\u5fae\u5dee\u5f02\u80fd\u529b\u6bd4\u8f83\u5f3a\uff08\u4f4e\u9891\uff09\uff0c\u4f46\u5bf9\u4e8e\u9ad8\u9891\u533a\u57df\uff0c\u5374\u8868\u73b0\u4e00\u822c
    • \u53d7\u6b64\u542f\u53d1\uff0c\u4eba\u4eec\u53ef\u4ee5\u5bf9\u9ad8\u9891\u90e8\u5206\u8fdb\u884c\u91cf\u5316\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u628a\u9891\u57df\u4e0a\u7684\u6bcf\u4e2a\u5206\u91cf\uff0c\u9664\u4ee5\u9488\u5bf9\u8be5\u5206\u91cf\u7684\u5e38\u6570\uff0c\u7136\u540e\u56db\u820d\u4e94\u5165\u53d6\u6574\uff0c\u8fd9\u6837\u4e00\u822c\u4f1a\u628a\u9ad8\u9891\u5206\u91cf\u53d8\u4e3a0
    • \u4f46\u8fd9\u6837\u64cd\u4f5c\u5c31\u8981\u6c42\u9488\u5bf9\u6bcf\u4e00\u4e2a\u5206\u91cf\u8bbe\u7f6e\u4e00\u4e2a\u5e38\u6570\u503c\uff0c\u6240\u4ee5\u5c31\u6700\u7ec8\u5f62\u6210\u4e86\u91cf\u5316\u8868\u3002

    More specifically,refer to the PPT(Chapter I)

    "},{"location":"DIP/Basic/DIP/#disadvantages","title":"Disadvantages","text":"
    • Not for line drawing, text, symbol, icon, etc..
    • Its lossy compression leads to unavoidable artifacts.

    \u4e0d\u9002\u5408\u7528\u4e8e\u7ebf\u6761\u753b\u3001\u6587\u5b57\u3001\u56fe\u6807\u7b49\uff0c\u5176\u6709\u635f\u538b\u7f29\u4f1a\u5bfc\u81f4\u8fd9\u7c7b\u5bf9\u8c61\u7684\u7455\u75b5\u4e25\u91cd

    "},{"location":"DIP/Basic/DIP/#tiff-format","title":"TIFF format","text":""},{"location":"DIP/Basic/DIP/#gif-format","title":"GIF format","text":""},{"location":"DIP/Basic/DIP/#chains","title":"Chains","text":"

    Chains are used for description of object borders

    Chains can be represented using static data structures (e.g., 1D arrays); their size is the longest length of the chain expected.

    "},{"location":"DIP/Basic/DIP/#run-length-encoding-rle","title":"Run length encoding (RLE)","text":"

    RLE is run-length encoding. It is used to encode the location of foreground objects in segmentation. Instead of outputting a mask image, you give a list of start pixels and how many pixels after each of those starts is included in the mask.

    • In binary images, run length coding records only areas that belong to the object in the image,the area is then represented as a list of lists.
    • Each row of the image is described by a sublist, the first element of which is the row number. Subsequent terms are coordinate pairs; the first element of a pair is the beginning of a run and the second is the end.
    • There can be several such sequences in the row.

    "},{"location":"DIP/DL/DL/","title":"Deep Learning","text":"
    • CNNs have won several competitions
    • ImageNet, Kaggle Facial Expression, Kaggle Multimodal Learning, German Traffic Signs, Handwriting, \u2026.

    • CNNs are deployed in many practical applications

    • Image recognition, speech recognition, Google\u2019s and Baidu\u2019s photo taggers

    • xCNNs are applicable to array data where nearby values are correlated

    • Images, sound, time-frequency representations, video, volumetric images, RGB-Depth images, \u2026

    • CNN is one of the few deep models that can be trained in supervised way.

    • Easy to understand and implement.
    "},{"location":"DIP/DL/DL/#what-is-the-neural","title":"What is the neural ?","text":""},{"location":"DIP/DL/DL/#multilayer-neural-network","title":"Multilayer neural network","text":"
    • And return to repeat step 1-3 until error is smaller than threshold
    "},{"location":"DIP/DL/DL/#back-propagation","title":"Back propagation","text":"

    https://towardsdatascience.com/understanding-backpropagation-algorithm-7bb3aa2f95fd

    http://galaxy.agh.edu.pl/%7Evlsi/AI/backp_t_en/backprop.html

    • Proof https://towardsdatascience.com/backpropagation-the-natural-proof-946c5abf63b1

    • \\(\\eta\\) \u5b66\u4e60\u7387

    \u5b66\u4e60\u7387\u4f4e\uff0c\u6536\u655b\u6162\uff0c\u5bb9\u6613\u6389\u5230\u5751\u91cc\u9677\u5165\u5c40\u90e8\u6700\u4f18\uff1b\u5b66\u4e60\u7387\u9ad8\uff0c\u53ef\u80fd\u4f7f\u5f97\u6536\u655b\u8fc7\u7a0b\u4e0d\u7a33\u5b9a\uff0c\u6765\u56de\u9707\u8361\uff0c\u4e00\u76f4\u4e0d\u6536\u655b

    idea:

    • \u8bbe\u7f6e\u4e0d\u540c\u7684\u5b66\u4e60\u7387\uff0c\u770b\u54ea\u79cd\u60c5\u51b5\u6700\u597d
    • \u8bbe\u8ba1\u4e00\u4e2a\u81ea\u9002\u5e94\u5b66\u4e60\u7387\u3002\u6b64\u65f6\u5b66\u4e60\u7387\u4e0d\u518d\u56fa\u5b9a\uff0c\u53ef\u4ee5\u901a\u8fc7\u5916\u5728\u6761\u4ef6\u7b97(\u68af\u5ea6\uff0c\u5b66\u4e60\u8981\u6709\u591a\u5feb\uff0c\u7279\u5f81\u6743\u91cd\u7684\u5927\u5c0f...)
    "},{"location":"DIP/DL/DL/#deep-learning-for-image-understanding","title":"Deep Learning For Image Understanding","text":""},{"location":"DIP/DL/DL/#advantages-for-convolution","title":"Advantages for convolution","text":"

    Example:

    • 200x200 image
    • 10 filters of size 10x10
    • 10 feature maps of size 200x200
    • 400,000 hidden units with 10x10
    • fields=1000 parameters

    \u4e3a\u4ec0\u4e48\u5f15\u5165CNN\u53ef\u4ee5\u5927\u89c4\u6a21\u51cf\u5c11\u6743\u6570\u53c2\u6570\u8bad\u7ec3\u91cf\u56e0\u4e3aCNN\u901a\u8fc7

    1\uff09 \u5c40\u90e8\u8fde\u63a5\uff08Local Connectivity\uff09

    2\uff09 \u6743\u503c\u5171\u4eab\uff08Shared Weights\uff09

    3\uff09 \u6c60\u5316\uff08Pooling\uff09

    • \u6765\u964d\u4f4e\u53c2\u6570\u91cf
    "},{"location":"DIP/DL/DL/#pooling","title":"Pooling","text":"

    CNN\u6c60\u5316\u53ef\u4ee5\u901a\u8fc7\u6c60\u5316\u5c42\u6765\u964d\u4f4e\u5377\u79ef\u5c42\u8f93\u51fa\u7684\u7279\u5f81\u7ef4\u5ea6\uff0c\u5728\u6709\u6548\u51cf\u5c11\u7f51\u7edc\u53c2\u6570\u7684\u540c\u65f6\u8fd8\u53ef\u4ee5\u9632\u6b62\u8fc7\u62df\u5408\u73b0\u8c61

    https://zhuanlan.zhihu.com/p/78760534

    "},{"location":"DIP/DL/DL/#cnn-in-detail","title":"CNN in Detail","text":"
    • \u6b65\u957f\uff1f

    • Refer to the PPT !

    • \u4f20\u7edf\u56fe\u50cf\u5206\u7c7b\uff1a\u5206\u6bb5\uff1b\u6df1\u5ea6\u5b66\u4e60\u56fe\u50cf\u5206\u7c7b\uff1a\u7aef\u5230\u7aef
    • \u4ea4\u53c9\u5546

    • Minimize Loss - Gradient Descent.
    "},{"location":"DIP/Fourier/Fourier/","title":"Fourier transform","text":"

    Many mathematicians tried to find a way to approximate a complex function by some simple functions for many years. Apart from the theoretical concern, this technique is invaluable for many practical applications.

    Before the invention of differential calculus, this problem kept open.

    "},{"location":"DIP/Fourier/Fourier/#fourier-transform","title":"Fourier Transform","text":"
    • British mathematician Taylor invented a method to represent one analytic function by infinite linear combination of power functions.
    • In the middle of 18th century, Fourier found that the infinite linear combination of trigonometric functions could represent a general function in a finite interval, when he was studying the heat propagation problem.
    Fourier

    \\(\\begin{align*}f(x)&=\\frac{1}{2}a_0+\\sum_{n=1}^{\\infty}a_ncos(nx)+\\sum_{n=1}^{\\infty}b_nsin(nx)\\\\ a_0 &= \\frac{1}{\\pi}\\int_{-\\pi}^{\\pi}f(x)dx\\\\a_n &= \\frac{1}{\\pi}\\int_{-\\pi}^{\\pi}f(x)cos(nx)dx\\\\b_n &= \\frac{1}{\\pi}\\int_{-\\pi}^{\\pi}f(x)sin(nx)dx \\end{align*}\\)

    Just like Calculus invented by Newton, Fourier analysis is another mathematical tool

    • BIOM: fake iris detection
    • CS: anti-aliasing in computer graphics
    "},{"location":"DIP/Fourier/Fourier/#complex-numbers","title":"Complex Numbers","text":"
    • Magnitude-Phase\uff08vector\uff09\\(x=|x|e^{j\\phi(x)}\\) where \\(|x|=\\sqrt{a^2+b^2}\\ \\phi(x)=tan^{-1(\\frac{b}{a})}\\)

    • Basic Properties

    \\(xy=|x|e^{j\\phi(x)}|y|e^{j\\phi(y)}=|x||y|e^{j(\\phi(x)+\\phi(y))}\\)

    \\(|x|=|x^*|\\)

    \\(\\phi(x)=-\\phi(x^*)\\)

    \\(xx^*=|x|^2\\)

    • Euler\u2019s formula \\(e^{j\\theta}=cos\\theta + isin\\theta\\)
    Basic Properties

    "},{"location":"DIP/Fourier/Fourier/#image-transform","title":"Image Transform","text":"

    Many times, image processing tasks are best performed in transformed domain other than the spatial domain.

    Key steps:

    (1) Transform the image

    (2) Carry out the task(s) in the transformed domain.

    (3) Apply inverse transform to return to the spatial domain.

    "},{"location":"DIP/Fourier/Fourier/#transformation-kernels","title":"Transformation Kernels","text":""},{"location":"DIP/Fourier/Fourier/#continuous-fourier-transform-ft","title":"Continuous Fourier Transform (FT)","text":"
    • \\(1-D\\)

    Transforms a signal (i.e., function) from the spatial domain to the frequency domain.

    • Example: Removing undesirable frequencies

    To remove certain frequencies, set their corresponding F(u) coefficients to zero!

    • How do frequencies show up in an image?

    Low frequencies correspond to slowly varying information (e.g., continuous surface).

    High frequencies correspond to quickly varying information (e.g., edges)

    • \\(2-D\\)

    "},{"location":"DIP/Fourier/Fourier/#discrete-fourier-transform-dft","title":"Discrete Fourier Transform (DFT)","text":"
    • \\(2-D\\)

    \u4e8c\u7ef4\u79bb\u6563\u5085\u7acb\u53f6\u53d8\u6362\u5b9a\u4e49\u4e3a

    \u4e8c\u7ef4\u79bb\u6563\u5085\u7acb\u53f6\u9006\u53d8\u6362\u5b9a\u4e49\u4e3a

    \u4e3a\u4e86\u65b9\u4fbf\uff0c\u6211\u4eec\u53ef\u5c06\u4e0a\u8ff0\u4e24\u5f0f\u6539\u4e3a\u5411\u91cf\u5f62\u5f0f

    \u5176\u4e2d \u3002

    For Images

    \\((u,v)\\)-- \u76f8\u4f4d

    \\(F(u,v)\\)-- \u5e45\u503c

    "},{"location":"DIP/Fourier/Fourier/#fast-fourier-transformfft","title":"Fast Fourier Transform\uff08FFT\uff09","text":"

    Speed up the discrete Fourier Transform

    There are many repetitive work in the computation.

    Cooley and Tukey presented in 1965:

    • Divide the original N-points sequence into several short sequence successively
    • Compute the Discrete Fourier Transform of these short sequences
    • Make up the wanted transform value
    • Computational workload: \\(2N^2\\rightarrow2Nlog_2N\\)
    "},{"location":"DIP/Fourier/Fourier/#fft-principle","title":"FFT Principle","text":"
    • \u52d8\u8bef\uff1a \\(F(k)=\\frac{1}{N}\\sum_{n=0}^{N-1}f(n)e^{-j2\\pi kn/N}\\)
    • HENCE \\(F(k+M)=\\lfloor F_e(k)-F_o(k)W_{2M}^k\\rfloor\\)!!

    • \u610f\u4e49\uff1a\u5bf9\u4e00\u4e2a\u957f\u5ea6\u4e3a N \u7684\u5e8f\u5217\u8fdb\u884c\u5085\u7acb\u53f6\u53d8\u6362\u53ef\u4ee5\u901a\u8fc7\u5c06\u5176\u5206\u6210\u4e24\u534a\u8ba1\u7b97\uff0c\u5bf9\u7b2c\u4e00\u90e8\u5206\u7684\u8ba1\u7b97\u9700\u8981\u901a\u8fc7\u8ba1\u7b97\u4e24\u4e2a\u957f\u5ea6\u4e3a N/2 \u957f\u5ea6\u5e8f\u5217\u7684\u5085\u7acb\u53f6\u53d8\u6362\u5f0f\u8fdb\u884c\uff0c\u7136\u540e\u5229\u7528\u8fd9\u4e24\u4e2a\u957f\u5ea6\u4e3a N/2 \u7684\u5e8f\u5217\u53ef\u4ee5\u5f97\u5230\u7b2c\u4e8c\u90e8\u5206\u7684\u503c

    "},{"location":"DIP/Fourier/Fourier/#magnitude-and-phase-of-dft","title":"Magnitude and Phase of DFT","text":"

    Hint: use inverse DFT to reconstruct the image by magnitude or phase only information

    • magnitude determines the contribution of each component!(cannot be used to reconstruct a image!)

    • phase determines which components are present!

    • PHASE is more important!

    "},{"location":"DIP/chap2/chap2/","title":"Binary Image and Morphological Operation","text":""},{"location":"DIP/chap2/chap2/#binary-image","title":"Binary image","text":"

    \u4f18\u70b9\uff1a\u66f4\u5c0f\u7684\u5185\u5b58\u9700\u6c42 \u8fd0\u884c\u901f\u5ea6\u66f4\u5feb \u4e3a\u4e8c\u503c\u56fe\u50cf\u5f00\u53d1\u7684\u7b97\u6cd5\u5f80\u5f80\u53ef\u4ee5\u7528\u4e8e\u7070\u5ea6\u7ea7\u56fe\u50cf \u66f4\u4fbf\u5b9c \u7f3a\u70b9\uff1a\u5e94\u7528\u8303\u56f4\u6bd5\u7adf\u6709\u9650\uff1b \u66f4\u65e0\u6cd5\u63a8\u5e7f\u5230\u4e09\u7ef4\u7a7a\u95f4\u4e2d\u8868\u73b0\u529b\u6b20\u7f3a\uff0c\u4e0d\u80fd\u8868\u73b0\u7269\u4f53\u5185\u90e8\u7ec6\u8282\u65e0\u6cd5\u63a7\u5236\u5bf9\u6bd4\u5ea6

    "},{"location":"DIP/chap2/chap2/#_1","title":"\u56fe\u50cf\u4e8c\u503c\u5316\uff1a","text":""},{"location":"DIP/chap2/chap2/#1","title":"\uff081\uff09\u4e8c\u503c\u56fe\u50cf","text":"

    \u4e8c\u503c\u56fe\u50cf\uff08Binary Image\uff09\u4e2d\uff0c\u50cf\u7d20\u503c\u9650\u5b9a\u4e3a \\(0\\) \u6216 \\(1\\)\uff08\u7f16\u7a0b\u4e2d\u4e00\u822c\u7528 \\(0\\) \u548c\\(255\\) \u6765\u6784\u9020\u4e8c\u503c\u56fe\u50cf)\u3002

    • \u4f18\u70b9\uff1a\u5360\u7528\u66f4\u5c11\u5185\u5b58\u3001\u66f4\u9ad8\u6548\uff0c\u6709\u65f6\u53ef\u5e94\u7528\u4e8e\u7070\u5ea6\u56fe\u50cf\uff0c\u540c\u65f6\u66f4\u52a0\u4fbf\u5b9c\u3002
    • \u7f3a\u70b9\uff1a\u5e94\u7528\u9886\u57df\u6709\u9650\uff0c\u4e0d\u80fd\u7528\u4e8e\u4e09\u7ef4\u6570\u636e\uff0c\u8868\u8fbe\u80fd\u529b\u8f83\u5f31\uff0c\u96be\u4ee5\u4f20\u8fbe\u89c6\u89c9\u7ec6\u8282\uff0c\u4e5f\u4e0d\u80fd\u63a7\u5236\u5bf9\u6bd4\u5ea6\u3002
    "},{"location":"DIP/chap2/chap2/#2otsus-algorithm","title":"\uff082\uff09\u5927\u6d25\u7b97\u6cd5\uff08Otsu's algorithm\uff09","text":"

    \u5728\u628a\u7070\u5ea6\u56fe\u8f6c\u6362\u4e3a\u4e8c\u503c\u56fe\u50cf\u7684\u65f6\u5019\uff0c\u4e00\u4e2a\u57fa\u672c\u7684\u60f3\u6cd5\u662f\u627e\u5230\u4e00\u4e2a\u5408\u9002\u7684\u9608\u503c\uff08Threshold\uff09\uff0c\u50cf\u7d20\u70b9\u503c\u6bd4\u9608\u503c\u5927\u7684\u8bbe\u4e3a\\(255\\)\uff0c\u6bd4\u9608\u503c\u5c0f\u7684\u8bbe\u4e3a\\(0\\)\u3002\u5373\u4e3a\u5982\u4e0b\uff1a

    \\(\\left\\{ \\begin{array}{**lr**} I(x,y) = 0\\ if\\ I(x,y)\\leq Threshold \\\\ I(x,y) = 255\\ if\\ I(x,y)\\geq Threshold \\\\ \\end{array} \\right.\\)

    • \u800c\u5927\u6d25\u7b97\u6cd5\u5c31\u662f\u4e00\u79cd\u81ea\u52a8\u786e\u5b9a\u8be5\u5408\u9002\u9608\u503c\u7684\u65b9\u6cd5\uff0c\u65e8\u5728\u627e\u5230\u4e00\u4e2a\u9608\u503c\uff0c\u5c06\u56fe\u50cf\u5206\u6210\u4e24\u4e2a\u7c7b\u522b\uff08\u524d\u666f\u548c\u80cc\u666f\uff09\uff0c\u4ee5\u4f7f\u4e24\u4e2a\u7c7b\u522b\u5185\u7684\u65b9\u5dee\u6700\u5c0f\uff0c\u540c\u65f6\u4e24\u4e2a\u7c7b\u522b\u4e4b\u95f4\u7684\u65b9\u5dee\u6700\u5927\uff0c\u6b65\u9aa4\u5982\u4e0b\u3002

    a.\u7edf\u8ba1\u50cf\u7d20\u70b9\u7684\u6700\u5927\u503c\u548c\u6700\u5c0f\u503c

    b.\u5bf9\u4e8e\u6bcf\u4e2a\u53ef\u80fd\u7684\u9608\u503c\uff0c\u8ba1\u7b97\u5206\u6210\u4e24\u4e2a\u7c7b\u522b\u540e\u7684\u80cc\u666f\u548c\u524d\u666f\u7684\u5185\u90e8\u534f\u65b9\u5dee\u548c\u5916\u90e8\u534f\u65b9\u5dee\u3002

    c.\u9009\u62e9\u6700\u5927\u5916\u90e8\u548c\u6700\u5c0f\u5185\u90e8\u534f\u65b9\u5dee\u5bf9\u5e94\u7684 threshold\u4f5c\u4e3a\u4e8c\u503c\u5316\u9608\u503c\u3002

    d.\u5e94\u7528\u9009\u62e9\u7684\u9608\u503c\u5c06\u56fe\u50cf\u5206\u5272\u6210\u524d\u666f\u548c\u80cc\u666f\u3002

    \u5176\u4e2d\uff0c\u6700\u5927\u5916\u90e8\u65b9\u5dee\u548c\u6700\u5c0f\u5185\u90e8\u65b9\u5dee\u662f\u7b49\u4ef7\u7684\uff0c\u6211\u4eec\u9009\u62e9\u627e\u5230\u6700\u5927\u5916\u90e8\u65b9\u5dee\uff0c\u63a8\u5bfc\u8fc7\u7a0b\u5982\u4e0b\uff1a

    \u8bbe\u56fe\u50cf\u5c3a\u5bf8\u4e3a\\(M\\ *\\ N\\)\uff0c\u5176\u4e8c\u503c\u5316\u7684\u6700\u4f73\u9608\u503c\u4e3a\\(T\\)\uff0c\u8be5\u9608\u503c\u5c06\u56fe\u50cf\u5206\u4e3a\u80cc\u666f\u548c\u76ee\u6807\u4e24\u4e2a\u7c7b\u522b\u3002\u5176\u4e2d\u5c5e\u4e8e\u80cc\u666f\u7684\u50cf\u7d20\u70b9\u6570\u91cf\u4e3a\\(N0\\),\u5c5e\u4e8e\u76ee\u6807\u7684\u50cf\u7d20\u70b9\u6570\u91cf\u4e3a\\(N1\\),\u80cc\u666f\u50cf\u7d20\u70b9\u6570\u5360\u6574\u5e45\u56fe\u50cf\u7684\u6bd4\u4f8b\\(\\omega0\\),\u5176\u7070\u5ea6\u5747\u503c\\(\u03bc0\\),\u76ee\u6807\u50cf\u7d20\u70b9\u6570\u5360\u6574\u5e45\u56fe\u50cf\u7684\u6bd4\u4f8b\u4e3a\\(\u03c91\\),\u5176\u7070\u5ea6\u5747\u503c\u4e3a\\(\u03bc1\\) \uff0c\u6574\u5e45\u56fe\u50cf\u7684\u7070\u5ea6\u5747\u503c\u4e3a\\(\\mu\\)\u3002

    \\(\\omega_0=\\frac{N0}{M*N}\\\\\\) \\(\\omega_1=\\frac{N1}{M*N}\\) \\(N0+N1=M*N\\\\\\) \\(\\omega0\\ + \\omega1\\ = 1\\\\\\)

    \\(\\mu = \\frac{\\mu0*N0+\\mu1*N1}{M*N}=\\mu0\\omega0\\ + \\mu1\\omega1\\\\\\)

    \\(\u7c7b\u5185\u65b9\u5dee(Within-class\\ variance)\u516c\u5f0f:\\)

    \\(\\sigma_{Withen}^{2}=\\omega_{0} \\sigma_{0}^{2}+\\omega_{1} \\sigma_{1}^{2} \\\\\\)

    \\(\u7c7b\u95f4\u65b9\u5dee(Between-class\\ variance)\u7684\u516c\u5f0f:\\sigma_{Between}^{2}=\\sigma^{2}-\\sigma_{Within}^{2}\\\\\\)

    \\(\u6709\u6b64\u53ef\u63a8\u5bfc\u5f97\u5230\\)

    \\(\\sigma_{Between}^{2}=\\omega_{0}(\\mu_{0}-\\mu)^{2}+\\omega_{1}(\\mu_{1}-\\mu)^{2}\\)

    \\(\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ =\\omega0(\\mu0-\\omega0\\mu0-\\omega1\\mu1)^{2}+\\omega1(\\mu1-\\omega0\\mu0-\\omega1\\mu1)^{2}\\) \\(\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ =\\omega0(\\omega1\\mu0-\\omega1\\mu1)^{2}+\\omega1(\\omega0\\mu1-\\omega0\\mu0)^{2}\\\\\\) \\(\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ =(\\omega0\\omega1^{2}+\\omega1\\omega0^{2})(\\mu1-\\mu0)^{2}\\\\\\)

    \\(\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ =\\omega0\\omega1(\\mu0-\\mu1)^{2}\\\\\\)

    • \u5373\u5728\u8ba1\u7b97\u6700\u5927\u5916\u90e8\u548c\u6700\u5c0f\u5185\u90e8\u65b9\u5dee\u65f6\uff0c\u53ea\u9700\u5224\u65ad\\(\\omega0\\omega1(\\mu0-\\mu1)^{2}\\)\u53d6\u5f97\u6700\u5927\u503c\u5373\u53ef

    Step 1: \u786e\u5b9a\u539f\u59cb\u56fe\u50cf\u4e2d\u50cf\u7d20\u7684\u6700\u5927\u503c\u548c\u6700\u5c0f\u503c

    Step 2: \u6700\u5c0f\u503c\u52a01\u4f5c\u4e3a\u521d\u59cbthreshold\u5bf9\u539f\u59cb\u56fe\u50cf\u8fdb\u884c\u4e8c\u503c\u5316\u64cd\u4f5c

    Step 3: \u6839\u636e\u5bf9\u5e94\u5173\u7cfb\u786e\u5b9a\u524d\u666f\u548c\u80cc\u666f\uff0c\u5206\u522b\u8ba1\u7b97\u5f53\u524dthreshold\u4e0b\u7684\u5185\u90e8\u534f\u65b9\u5dee\u548c\u5916\u90e8\u534f\u65b9\u5dee

    Step 4: \u56de\u5230Step 2\u76f4\u5230\u8fbe\u5230\u50cf\u7d20\u6700\u5927\u503c

    Step 5\uff1a\u627e\u5230\u6700\u5927\u5916\u90e8\u548c\u6700\u5c0f\u5185\u90e8\u534f\u65b9\u5dee\u5bf9\u5e94\u7684threshold.

    • \u524d\u8ff0thresholding\u7b56\u7565\u63a8\u5e7f\u5230\u5f69\u8272\u56fe\u50cf\uff0c\u540c\u65f6\u8003\u8651rgb\u4e09\u4e2a\u901a\u9053\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u9488\u5bf9\u7279\u5b9a\u7684\u8272\u5f69\u8fdb\u884cthresholding\u64cd\u4f5c\uff0c
    "},{"location":"DIP/chap2/chap2/#_2","title":"\u6539\u8fdb","text":"
    • \u5c40\u90e8\u81ea\u9002\u5e94\u64cd\u4f5c\u8bbe\u5b9a\u4e00\u4e2a\u5c40\u90e8\u7a97\u53e3\uff0c\u5728\u6574\u4e2a\u56fe\u50cf\u4e0a\u6ed1\u52a8\u8be5\u7a97\u53e3
    • \u5bf9\u4e8e\u6bcf\u4e00\u7a97\u53e3\u4f4d\u7f6e\uff0c\u786e\u5b9a\u9488\u5bf9\u8be5\u7a97\u53e3\u7684threshold

    • \u76f8\u6bd4\u5168\u5c40\u5927\u6d25\u6cd5\uff0c\u6211\u4eec\u4f9d\u6b21\u679a\u4e3e\u7070\u5ea6\u56fe\u4e2d\u7684\u6bcf\u4e2a\u50cf\u7d20\\(\uff08i,j)\\)\uff0c\u4ee5\u7528\u6237\u8f93\u5165\u4e00\u4e2a\u6574\u6570\u4e3a\u8fb9\u957f\uff0c\u5728\\((i - length / 2, j - length / 2, i + length / 2, j + length / 2, i, j)\\)\u8fd9\u4e2a\u6b63\u65b9\u5f62\u4e2d\u8fdb\u884c\u5927\u6d25\u6cd5\uff0c\u5f97\u5230\u9608\u503c\u540e\u4ec5\u5bf9\\((i,j)\\)\u70b9\u8fdb\u884c\u4e8c\u503c\u5316\u5904\u7406\u3002

    • \u76f8\u6bd4\u5168\u5c40\u5927\u6d25\u6cd5\uff0c\u5c40\u90e8\u5927\u6d25\u6cd5\u8017\u65f6\u663e\u8457\u589e\u52a0\u3002

    "},{"location":"DIP/chap2/chap2/#morphological-operation","title":"Morphological Operation","text":"

    \u200b \u6570\u5b66\u5f62\u6001\u5b66\uff08\u4e5f\u79f0\u56fe\u50cf\u4ee3\u6570\uff09\u662f\u4e00\u79cd\u7528\u4e8e\u5206\u6790\u56fe\u50cf\u5f62\u6001\u548c\u7ed3\u6784\u7684\u5de5\u5177\u3002\u5176\u57fa\u672c\u601d\u60f3\u662f\u901a\u8fc7\u5229\u7528\u7ed3\u6784\u5143\u7d20\u6765\u5ea6\u91cf\u548c\u63d0\u53d6\u5f62\u72b6\uff0c\u4ece\u800c\u5b9e\u73b0\u5bf9\u56fe\u50cf\u7684\u5206\u6790\u548c\u8bc6\u522b\u3002\u56fe\u50cf\u5f62\u6001\u5b66\u64cd\u4f5c\u57fa\u4e8e\u96c6\u5408\u8bba\uff0c\u53ef\u4ee5\u7b80\u5316\u56fe\u50cf\uff0c\u53bb\u9664\u4e0d\u9700\u8981\u7684\u7ed3\u6784\uff0c\u540c\u65f6\u4fdd\u7559\u4e3b\u8981\u7684\u5f62\u72b6\u7279\u5f81\u3002\u5728\u8fd9\u91cc\u6709\u56db\u79cd\u5f62\u6001\u5b66\u64cd\u4f5c\u7b26\uff1a\u81a8\u80c0\u3001\u8150\u8680\u3001\u5f00\u8fd0\u7b97\u548c\u95ed\u8fd0\u7b97\u3002

    \u200b \u5728\u4e0b\u9762\u7684\u4ecb\u7ecd\u4e2d\uff0c\u6211\u4eec\u7684 A \u6307\u4e8c\u503c\u56fe\u50cf; B \u6307\u4e8c\u503c\u6a21\u677f\uff0c\u79f0\u4e3a\u7ed3\u6784\u5143(structure element)\u3002

    "},{"location":"DIP/chap2/chap2/#_3","title":"\u81a8\u80c0","text":"

    \u200b \u5f62\u6001\u5b66\u7684\u81a8\u80c0\u64cd\u4f5c\u662f\u56fe\u50cf\u5904\u7406\u4e2d\u7684\u4e00\u79cd\u57fa\u672c\u64cd\u4f5c\uff0c\u901a\u5e38\u7528\u4e8e\u589e\u5f3a\u56fe\u50cf\u4e2d\u7684\u7279\u5b9a\u76ee\u6807\u6216\u7ed3\u6784\uff0c\u4f7f\u5176\u66f4\u52a0\u663e\u8457\u548c\u5bb9\u6613\u68c0\u6d4b\u3002\u81a8\u80c0\u64cd\u4f5c\u7684\u4e3b\u8981\u601d\u60f3\u662f\u5229\u7528\u4e00\u4e2a\u79f0\u4e3a\u7ed3\u6784\u5143\u7d20\u7684\u5c0f\u7a97\u53e3\u6216\u6a21\u677f\uff0c\u6cbf\u7740\u56fe\u50cf\u7684\u5404\u4e2a\u65b9\u5411\u626b\u63cf\uff0c\u5e76\u6839\u636e\u7ed3\u6784\u5143\u7d20\u4e0e\u56fe\u50cf\u7684\u91cd\u53e0\u7a0b\u5ea6\u6765\u6539\u53d8\u56fe\u50cf\u7684\u50cf\u7d20\u503c\u3002

    \u200b \u81a8\u80c0\u64cd\u4f5c\u7684\u7ed3\u679c\u901a\u5e38\u662f\u589e\u5f3a\u4e86\u539f\u59cb\u56fe\u50cf\u4e2d\u7684\u76ee\u6807\u6216\u7279\u5b9a\u7ed3\u6784\u3002\u8fd9\u662f\u56e0\u4e3a\u5b83\u53ef\u4ee5\u5c06\u76ee\u6807\u533a\u57df\u6269\u5c55\uff0c\u586b\u5145\u7a7a\u6d1e\uff0c\u4f7f\u8fb9\u7f18\u66f4\u52a0\u6e05\u6670\u3002\u56e0\u6b64\uff0c\u81a8\u80c0\u64cd\u4f5c\u53ef\u7528\u4e8e\u6539\u5584\u56fe\u50cf\u4e2d\u7684\u7279\u5b9a\u7279\u5f81\uff0c\u4f7f\u5b83\u4eec\u66f4\u5bb9\u6613\u68c0\u6d4b\u548c\u5206\u6790\u3002 $$ A\u2295B={ z|(B)_z \u2229A\\ne\u2205 } $$

    • Dilation: Bridging gaps in images

    • \u7531B\u5bf9A\u81a8\u80c0\u6240\u4ea7\u751f\u7684\u4e8c\u503c\u56fe\u8c61D\u662f\u6ee1\u8db3\u4ee5\u4e0b\u6761\u4ef6\u7684\u70b9(x,y)\u7684\u96c6\u5408\uff1a

    \u5982\u679cB\u7684\u539f\u70b9\u5e73\u79fb\u5230\u70b9(x,y)\uff0c\u90a3\u4e48\u5b83\u4e0eA\u7684\u4ea4\u96c6\u975e\u7a7a\u3002

    "},{"location":"DIP/chap2/chap2/#_4","title":"\u8150\u8680","text":"

    \u200b \u5f62\u6001\u5b66\u7684\u8150\u8680\u64cd\u4f5c\u662f\u56fe\u50cf\u5904\u7406\u4e2d\u7684\u4e00\u79cd\u57fa\u672c\u64cd\u4f5c\uff0c\u901a\u5e38\u7528\u4e8e\u51cf\u5c0f\u56fe\u50cf\u4e2d\u7684\u7279\u5b9a\u76ee\u6807\u6216\u7ed3\u6784\uff0c\u4ece\u800c\u5f31\u5316\u6216\u6d88\u9664\u4e00\u4e9b\u7279\u5f81\u3002\u8150\u8680\u64cd\u4f5c\u7684\u4e3b\u8981\u601d\u60f3\u662f\u5229\u7528\u4e00\u4e2a\u79f0\u4e3a\u7ed3\u6784\u5143\u7d20\u7684\u5c0f\u7a97\u53e3\u6216\u6a21\u677f\uff0c\u6cbf\u7740\u56fe\u50cf\u7684\u5404\u4e2a\u65b9\u5411\u626b\u63cf\uff0c\u5e76\u6839\u636e\u7ed3\u6784\u5143\u7d20\u4e0e\u56fe\u50cf\u7684\u91cd\u53e0\u7a0b\u5ea6\u6765\u6539\u53d8\u56fe\u50cf\u7684\u50cf\u7d20\u503c\u3002

    \u200b \u8150\u8680\u64cd\u4f5c\u7684\u7ed3\u679c\u901a\u5e38\u662f\u51cf\u5c0f\u4e86\u539f\u59cb\u56fe\u50cf\u4e2d\u7684\u76ee\u6807\u6216\u7279\u5b9a\u7ed3\u6784\u3002\u8fd9\u662f\u56e0\u4e3a\u5b83\u53ef\u4ee5\u53bb\u9664\u5c0f\u7684\u7279\u5f81\u3001\u7f29\u5c0f\u76ee\u6807\u533a\u57df\u6216\u6d88\u9664\u566a\u58f0\u3002\u8150\u8680\u64cd\u4f5c\u53ef\u7528\u4e8e\u5f31\u5316\u56fe\u50cf\u4e2d\u7684\u7279\u5b9a\u7279\u5f81\uff0c\u4f7f\u5176\u66f4\u5bb9\u6613\u68c0\u6d4b\u548c\u5206\u6790\u3002 $$ A\u2296B={(x,y)|(B)_{xy} \u2286A} $$

    • \u7531B\u5bf9A\u8150\u8680\u6240\u4ea7\u751f\u7684\u4e8c\u503c\u56fe\u8c61E\u662f\u6ee1\u8db3\u4ee5\u4e0b\u6761\u4ef6\u7684\u70b9(x,y)\u7684\u96c6\u5408\uff1a

    \u5982\u679cB\u7684\u539f\u70b9\u5e73\u79fb\u5230\u70b9(x,y)\uff0c\u90a3\u4e48B\u5c06\u5b8c\u5168\u5305\u542b\u4e8eA\u4e2d

    "},{"location":"DIP/chap2/chap2/#duality","title":"Duality","text":""},{"location":"DIP/chap2/chap2/#application-boundary-extraction","title":"Application: Boundary Extraction","text":""},{"location":"DIP/chap2/chap2/#application-filling-holes","title":"Application: Filling holes\uff01","text":""},{"location":"DIP/chap2/chap2/#_5","title":"\u5f00\u64cd\u4f5c","text":"

    \u200b \u5f62\u6001\u5b66\u7684\u5f00\u64cd\u4f5c\u662f\u4e00\u79cd\u5e38\u89c1\u7684\u56fe\u50cf\u5904\u7406\u64cd\u4f5c\uff0c\u5b83\u7ed3\u5408\u4e86\u8150\u8680\uff08erosion\uff09\u548c\u81a8\u80c0\uff08dilation\uff09\u64cd\u4f5c\uff0c\u901a\u5e38\u7528\u4e8e\u53bb\u566a\u548c\u5206\u5272\u56fe\u50cf\u4e2d\u7684\u76ee\u6807\u3002\u5f00\u64cd\u4f5c\u7684\u4e3b\u8981\u601d\u60f3\u662f\u9996\u5148\u5bf9\u56fe\u50cf\u6267\u884c\u8150\u8680\u64cd\u4f5c\uff0c\u7136\u540e\u518d\u5bf9\u5176\u6267\u884c\u81a8\u80c0\u64cd\u4f5c\uff0c\u8fd9\u4e2a\u8fc7\u7a0b\u901a\u5e38\u4f7f\u7528\u4e00\u4e2a\u7279\u5b9a\u7684\u7ed3\u6784\u5143\u7d20\u8fdb\u884c\u3002

    \u200b \u5f00\u64cd\u4f5c\u5728\u56fe\u50cf\u5904\u7406\u4e2d\u5e38\u7528\u4e8e\u53bb\u9664\u566a\u58f0\u3001\u5206\u5272\u76ee\u6807\u3001\u51cf\u5c0f\u76ee\u6807\u533a\u57df\u7684\u4e0d\u89c4\u5219\u6027\u4ee5\u53ca\u51cf\u5c0f\u76ee\u6807\u4e4b\u95f4\u7684\u5e72\u6270\u3002\u5b83\u4e5f\u6709\u52a9\u4e8e\u6539\u5584\u4e8c\u503c\u5316\u56fe\u50cf\u7684\u8d28\u91cf\uff0c\u4ee5\u4fbf\u540e\u7eed\u7684\u5206\u6790\u548c\u7279\u5f81\u63d0\u53d6\u3002 $$ A \u25e6 B = (A \u2296 B) \u2295 B $$

    • \u7528\u6765\u5728\u7ea4\u7ec6\u70b9\u5904\u5206\u79bb\u7269\u4f53\uff0c\u6d88\u9664\u5c0f\u7269\u4f53\u3001\u5e73\u6ed1\u5176\u8fb9\u754c\u7684\u540c\u65f6\u5e76\u4e0d\u660e\u663e\u6539\u53d8\u5176\u9762\u79ef\u3002
    "},{"location":"DIP/chap2/chap2/#_6","title":"\u95ed\u64cd\u4f5c","text":"

    \u200b \u5f62\u6001\u5b66\u7684\u5f00\u64cd\u4f5c\u662f\u4e00\u79cd\u5e38\u89c1\u7684\u56fe\u50cf\u5904\u7406\u64cd\u4f5c\uff0c\u5b83\u7ed3\u5408\u4e86\u8150\u8680\uff08erosion\uff09\u548c\u81a8\u80c0\uff08dilation\uff09\u64cd\u4f5c\uff0c\u901a\u5e38\u7528\u4e8e\u53bb\u566a\u548c\u5206\u5272\u56fe\u50cf\u4e2d\u7684\u76ee\u6807\u3002\u5f00\u64cd\u4f5c\u7684\u4e3b\u8981\u601d\u60f3\u662f\u9996\u5148\u5bf9\u56fe\u50cf\u6267\u884c\u8150\u8680\u64cd\u4f5c\uff0c\u7136\u540e\u518d\u5bf9\u5176\u6267\u884c\u81a8\u80c0\u64cd\u4f5c\uff0c\u8fd9\u4e2a\u8fc7\u7a0b\u901a\u5e38\u4f7f\u7528\u4e00\u4e2a\u7279\u5b9a\u7684\u7ed3\u6784\u5143\u7d20\u8fdb\u884c\u3002

    \u200b \u95ed\u64cd\u4f5c\u5728\u56fe\u50cf\u5904\u7406\u4e2d\u5e38\u7528\u4e8e\u53bb\u9664\u5c0f\u5b54\u3001\u8fde\u63a5\u65ad\u5f00\u7684\u7ebf\u6761\u3001\u586b\u5145\u4e0d\u89c4\u5219\u76ee\u6807\u7684\u5185\u90e8\u7a7a\u6d1e\u3001\u589e\u5f3a\u56fe\u50cf\u4e2d\u7684\u8fde\u901a\u533a\u57df\uff0c\u5e73\u6ed1\u5176\u8fb9\u754c\u7684\u540c\u65f6\u5e76\u4e0d\u660e\u663e\u6539\u53d8\u5176\u9762\u79ef\u3002\u5b83\u4e5f\u6709\u52a9\u4e8e\u6539\u5584\u4e8c\u503c\u5316\u56fe\u50cf\u7684\u8d28\u91cf\uff0c\u4ee5\u4fbf\u540e\u7eed\u7684\u5206\u6790\u548c\u7279\u5f81\u63d0\u53d6\u3002 $$ A \u2022 B = (A \u2295 B) \u2296 B $$

    "},{"location":"DIP/chap3/chap3/","title":"Basic Operation","text":""},{"location":"DIP/chap3/chap3/#visibility-enhancement","title":"Visibility enhancement","text":""},{"location":"DIP/chap3/chap3/#logarithmic-operation","title":"logarithmic operation","text":"

    \u4e3a\u4e86\u589e\u5f3a\u56fe\u50cf\u7684\u53ef\u89c6\u4fe1\u606f\uff0c\u5bf9\u56fe\u50cf\u4e2d\u7684\u50cf\u7d20\u8fdb\u884c\u57fa\u4e8e\u5bf9\u6570\u7684\u64cd\u4f5c \\(L_d = \\frac{log{({L_{w}+1})}}{log{({L_{max}+1})}}\\) \u5176\u4e2d\uff0c\\(L_d\\)\u662f\u663e\u793a\u4eae\u5ea6\uff0c\\(L_w\\)\u662f\u771f\u5b9e\u4e16\u754c\u4eae\u5ea6\uff0c\\(L_{max}\\)\u662f\u573a\u666f\u4e2d\u7684\u6700\u4eae\u503c\u3002

    • \u8fd9\u4e2a\u6620\u5c04\u80fd\u591f\u786e\u4fdd\u4e0d\u7ba1\u573a\u666f\u7684\u52a8\u6001\u8303\u56f4\u662f\u600e\u4e48\u6837\u7684\uff0c\u5176\u6700\u5927\u503c\u90fd\u80fd\u6620\u5c04\u5230 1(\u767d)\uff0c\u5176\u4ed6\u7684\u503c\u80fd\u591f\u6bd4\u8f83\u5e73\u6ed1\u5730\u53d8\u5316\u3002
    "},{"location":"DIP/chap3/chap3/#grayscale-perception","title":"Grayscale perception","text":""},{"location":"DIP/chap3/chap3/#histogram-equalization","title":"Histogram equalization","text":""},{"location":"DIP/chap3/chap3/#1","title":"(1)\u76f4\u65b9\u56fe","text":""},{"location":"DIP/chap3/chap3/#a","title":"a.\u7070\u5ea6\u76f4\u65b9\u56fe","text":"
    • \u7070\u5ea6\u76f4\u65b9\u56fe\u662f\u4e00\u79cd\u7edf\u8ba1\u56fe\uff0c\u5b83\u8868\u793a\u7ed9\u5b9a\u56fe\u50cf\u4e2d\u4e0d\u540c\u7070\u5ea6\u7ea7\u7684\u50cf\u7d20\u6570\u5360\u603b\u50cf\u7d20\u6570\u7684\u6bd4\u4f8b\u3002
    • \u8ba1\u7b97\u516c\u5f0f\u5982\u4e0b\uff1a \\(p(r_k)=\\frac{n_k}{MN}\\)

    \\(r_k - \u50cf\u7d20\u7684\u7070\u5ea6\u7ea7\\)

    \\(n_k - \u5177\u6709\u7070\u5ea6rk\u7684\u50cf\u7d20\u7684\u4e2a\u6570\\)

    \\(MN - \u56fe\u50cf\u4e2d\u603b\u7684\u50cf\u7d20\u4e2a\u6570\\)

    \\(\\sum_{k=0}^{MN-1}P(r_k)=1\\)

    "},{"location":"DIP/chap3/chap3/#b","title":"b.\u5f69\u8272\u76f4\u65b9\u56fe","text":"
    • \u5f69\u8272\u76f4\u65b9\u56fe\u8868\u793a\u7ed9\u5b9a\u56fe\u50cf\u4e2d\u4e0d\u540c R\u3001G\u3001B\u7b49\u7ea7\u7684\u50cf\u7d20\u6570\u5360\u603b\u50cf\u7d20\u6570\u7684\u6bd4\u4f8b,\u8ba1\u7b97\u65b9\u6cd5\u4e0e\u7070\u5ea6\u76f4\u65b9\u56fe\u7c7b\u4f3c
    "},{"location":"DIP/chap3/chap3/#2","title":"\uff082\uff09\u76f4\u65b9\u56fe\u5747\u8861\u5316","text":"

    \u76f4\u65b9\u56fe\u5747\u8861\u5316\uff08Histogram Equalization\uff09\u662f\u4e00\u79cd\u7528\u4e8e\u589e\u5f3a\u6570\u5b57\u56fe\u50cf\u5bf9\u6bd4\u5ea6\u7684\u56fe\u50cf\u5904\u7406\u6280\u672f\u3002\u5b83\u901a\u8fc7\u91cd\u65b0\u5206\u5e03\u56fe\u50cf\u7684\u50cf\u7d20\u503c\uff0c\u4f7f\u76f4\u65b9\u56fe\u53d8\u5f97\u66f4\u5747\u5300\uff0c\u4ece\u800c\u6539\u5584\u56fe\u50cf\u7684\u89c6\u89c9\u8d28\u91cf

    \u76f4\u65b9\u56fe\u5747\u8861\u5316\u5e38\u88ab\u7528\u4e8e\u63d0\u9ad8\u56fe\u50cf\u7684\u53ef\u89c6\u6027\u3001\u5206\u6790\u6027\u80fd\u548c\u81ea\u52a8\u56fe\u50cf\u5904\u7406\u5e94\u7528\u4e2d\u3002\u4f8b\u5982\uff0c\u8fc7\u66dd\u5149\u56fe\u50cf\u7684\u7070\u5ea6\u7ea7\u96c6\u4e2d\u5728\u9ad8\u4eae\u5ea6\u8303\u56f4\u5185\uff0c\u800c\u66dd\u5149\u4e0d\u8db3\u5c06\u4f7f\u56fe\u50cf\u7070\u5ea6\u7ea7\u96c6\u4e2d\u5728\u4f4e\u4eae\u5ea6\u8303\u56f4\u5185\u3002\u91c7\u7528\u76f4\u65b9\u56fe\u5747\u8861\u5316\uff0c\u53ef\u4ee5\u628a\u539f\u59cb\u56fe\u50cf\u7684\u76f4\u65b9\u56fe\u53d8\u6362\u4e3a\u5747\u5300\u5206\u5e03(\u5747\u8861)\u7684\u5f62\u5f0f\uff0c\u8fd9\u6837\u5c31\u589e\u52a0\u4e86\u50cf\u7d20\u4e4b\u95f4\u7070\u5ea6\u503c\u5dee\u522b\u7684\u52a8\u6001\u8303\u56f4\uff0c\u4ece\u800c\u8fbe\u5230\u589e\u5f3a\u56fe\u50cf\u6574\u4f53\u5bf9\u6bd4\u5ea6\u7684\u6548\u679c

    \u6362\u8a00\u4e4b\uff0c\u76f4\u65b9\u56fe\u5747\u8861\u5316\u7684\u57fa\u672c\u539f\u7406\u662f:\u5bf9\u5728\u56fe\u50cf\u4e2d\u50cf\u7d20\u4e2a\u6570\u591a\u7684\u7070\u5ea6\u503c(\u5373\u5bf9\u753b\u9762\u8d77\u4e3b\u8981\u4f5c\u7528\u7684\u7070\u5ea6\u503c)\u8fdb\u884c\u5c55\u5bbd\uff0c\u800c\u5bf9\u50cf\u7d20\u4e2a\u6570\u5c11\u7684\u7070\u5ea6 \u503c(\u5373\u5bf9\u753b\u9762\u4e0d\u8d77\u4e3b\u8981\u4f5c\u7528\u7684\u7070\u5ea6\u503c)\u8fdb\u884c\u5f52\u5e76\uff0c\u4ece\u800c\u589e\u5927\u5bf9\u6bd4\u5ea6\uff0c\u4f7f\u56fe\u50cf\u6e05\u6670\uff0c\u8fbe\u5230\u589e\u5f3a\u7684\u76ee\u7684

    \u5c3d\u7ba1\u76f4\u65b9\u56fe\u5747\u8861\u5316\u5177\u6709\u663e\u8457\u7684\u4f18\u70b9\uff0c\u4f46\u5b83\u4e5f\u6709\u4e00\u4e9b\u9650\u5236\u3002\u5b83\u53ef\u80fd\u5bfc\u81f4\u56fe\u50cf\u51fa\u73b0\u566a\u70b9\u6216\u8fc7\u5ea6\u589e\u5f3a\u7ec6\u8282\uff0c\u7279\u522b\u662f\u5728\u566a\u97f3\u5b58\u5728\u7684\u60c5\u51b5\u4e0b

    • \u6b64\u5916\uff0c\u5747\u8861\u5316\u53ef\u80fd\u6539\u53d8\u56fe\u50cf\u7684\u6574\u4f53\u4eae\u5ea6\uff0c\u8fd9\u53ef\u80fd\u4e0d\u9002\u7528\u4e8e\u6240\u6709\u56fe\u50cf

    • \u8fde\u7eed\u60c5\u51b5\u7684\u8f6c\u6362\\(T\\):

    • \u8bbe r \u4e3a\u8f6c\u6362\u524d\u7684\u7070\u5ea6\u7ea7\uff0c s \u4e3a\u53d8\u6362\u524d\u540e\u7684\u7070\u5ea6\u7ea7

    • \\(0 \u2264 r,s \u2264 1\\) [\u5bf9\u5e94\\((0,255)\\)]

    • P\u00ae \u548c P(s) \u662f\u5bf9\u5e94\u4e8e r \u548c s \u7684\u6982\u7387\u3002\u8f6c\u6362\u89c4\u5219\u4e3a:

      • T\u00ae\u662f\u5355\u8c03\u9012\u589e\u51fd\u6570\uff0c\\(0\u2264r\u22641\\)\u4e14\\(0\u2264T(r)\u22641\\)

      • \u9006\u53d8\u6362 r = \\(T^{-1}(s)\\)\u4e5f\u662f\u4e00\u4e2a\u5355\u8c03\u9012\u589e\u51fd\u6570 \u8003\u8651\u5230\u7070\u5ea6\u53d8\u6362\u4e0d\u4f1a\u6539\u53d8\u4f4d\u7f6e\u548c\u50cf\u7d20\u6570

      • \u6211\u4eec\u6709 \\(\\int_0^rP(r)dr = \\int_0^sP(s)ds=\\int_0^s 1*ds = s = T(r)\\)

      \\(Thus: T(r)=\\int_0^rP(r)dr\\)

    • \u79bb\u6563\u60c5\u51b5\u7684\u8f6c\u6362 \\(T\\):

    \u8bbe\u4e00\u5e45\u56fe\u50cf\u7684\u50cf\u7d20\u603b\u6570\u4e3an\uff0c\u5206L\u4e2a\u7070\u5ea6\u7ea7\uff0c\\(n_k\\)\u4e3a\u7b2ck\u4e2a\u7070\u5ea6\u7ea7\u51fa\u73b0\u7684\u50cf\u7d20\u6570\uff0c\u5219\u7b2c\\(k\\)\u4e2a\u7070\u5ea6\u7ea7\u51fa\u73b0\u7684\u6982\u7387\u4e3a\uff1a $$ P(r_k)= \\frac{n_k}{n}(0\u2264n_k \u22641,k=0,1,2,...,MN\u22121) $$

    • \u79bb\u6563\u7070\u5ea6\u76f4\u65b9\u56fe\u5747\u8861\u5316\u7684\u8f6c\u6362\u516c\u5f0f\u4e3a $$ s_k = T(r_k)=\\sum_{i=0}^kP(ri)=\\frac{1}{n}\\sum_{i=0}^{k}ni $$

    \u5bf9\u4e8e\u539f\u76f4\u65b9\u56fe\u4e2d\u7684\u4efb\u610f\u4e00\u4e2a\u7070\u5ea6\u7ea7\\(r_k\\)\uff0c\u53ea\u9700\u5c06\u7070\u5ea6\u7ea7\u4e3a\\([0,r_k]\\)\u4ee5\u5185\u7684\u6240\u6709\u50cf\u7d20\u4e2a\u6570\u7684\u548c\u9664\u4ee5\u56fe\u50cf\u7684\u50cf\u7d20\u603b\u6570\uff0c\u5c31\u53ef\u4ee5\u5f97\u5230\u8f6c\u6362\u4e4b\u540e\u7684\u5bf9\u5e94\u7070\u5ea6\u7ea7\\(s_k\\)

    • Problem

    \u6309\u7167\u5747\u8861\u5316\u7684\u8981\u6c42\uff0c\u5728\u5747\u8861\u5316\u540e\u7684\u7ed3\u679c\u76f4\u65b9\u56fe\u4e2d\uff0c\u5404\u7070\u5ea6\u7ea7\u53d1\u751f\u7684\u6982\u7387\u5e94\u8be5\u662f\u76f8\u540c\u7684\uff0c\u5982\u53f3\u4e0a\u56fe\u6240\u793a\u8fde\u7eed\u7070\u5ea6\u7ea7\u5747\u8861\u5316\u7ed3\u679c\u90a3\u6837\u3002\u4f46\u662f\uff0c\u53f3\u4e0b\u56fe\u4e2d\u79bb\u6563\u7070\u5ea6\u7ea7\u5747\u8861\u5316\u540e\uff0c\u5404\u7070\u5ea6\u7ea7\u51fa\u73b0\u7684\u6982\u7387\u5e76\u4e0d\u5b8c\u5168\u4e00\u6837\u3002\u4e3a\u4ec0\u4e48\uff1f

    • \u6b65\u9aa42\u4e2d\uff0c\u6240\u5f97\u7684\\(s_k\\)\u4e0d\u53ef\u80fd\u6b63\u597d\u7b49\u4e8e8\u7ea7\u7070\u5ea6\u503c\u4e2d\u7684\u67d0\u4e00\u7ea7\uff0c\u56e0\u6b64\u9700\u8981\u5c31\u8fd1\u5f52\u5165\u67d0\u4e00\u4e2a\u7070\u5ea6\u7ea7\u4e2d

    \u8fd9\u6837\uff0c\u76f8\u90bb\u7684\u591a\u4e2a\\(s_k\\)\u5c31\u53ef\u80fd\u843d\u5165\u540c\u4e00\u4e2a\u7070\u5ea6\u7ea7\uff0c\u9700\u8981\u5728\u6b65\u9aa43\u65f6\u5c06\u5904\u4e8e\u540c\u4e00\u4e2a\u7070\u5ea6\u7ea7\u7684\u50cf\u7d20\u4e2a\u6570\u7d2f\u52a0,\u56e0\u6b64\uff0c\u79bb\u6563\u7070\u5ea6\u76f4\u65b9\u56fe\u5747\u8861\u5316\u64cd\u4f5c\u4ee5\u540e\uff0c\u6bcf\u4e2a\u7070\u5ea6\u7ea7\u5904\u7684\u6982\u7387\u5bc6\u5ea6\uff08\u6216\u50cf\u7d20\u4e2a\u6570\uff09\u5e76\u4e0d\u5b8c\u5168\u4e00\u6837\u3002

    "},{"location":"DIP/chap3/chap3/#histogram-fitting","title":"Histogram fitting","text":"
    • \u6240\u8c13\u76f4\u65b9\u56fe\u5339\u914d\uff0c\u5c31\u662f\u4fee\u6539\u4e00\u5e45\u56fe\u50cf\u7684\u76f4\u65b9\u56fe\uff0c\u4f7f\u5f97\u5b83\u4e0e\u53e6\u4e00\u5e45\u56fe\u50cf\u7684\u76f4\u65b9\u56fe\u5339\u914d\u6216\u5177\u6709\u4e00\u79cd\u9884\u5148\u89c4\u5b9a\u7684\u51fd\u6570\u5f62\u72b6
    • \u76f4\u65b9\u56fe\u5339\u914d\u7684\u76ee\u6807\uff0c\u662f\u7a81\u51fa\u6211\u4eec\u611f\u5174\u8da3\u7684\u7070\u5ea6\u8303\u56f4\uff0c\u4f7f\u56fe\u50cf\u8d28\u91cf\u6539\u5584
    • \u5229\u7528\u76f4\u65b9\u56fe\u5747\u8861\u5316\u64cd\u4f5c\uff0c\u53ef\u4ee5\u5b9e\u73b0\u76f4\u65b9\u56fe\u5339\u914d\u8fc7\u7a0b\u3002
    "},{"location":"DIP/chap3/chap3/#steps","title":"Steps","text":"
    • Step 1 : Base on the equation \\(s=T(r)=\\int_0^rP(r)dr\\) map r in the original histogram to be s
    • Step 2 : Based on equation \\(v=T(z)=\\int_0^zP(z)dz\\) map the gray level z in the resulted histogram to be \\(v\\)
    • Step 3 : obtain \\(z=G^{-1}(v)\\) from \\(v=G(z)\\) beacuse s and v have the same distribution obtain \\(z=G^{-1}(s)\\) corresponding \\(r\\)
    • Simple version:

    \u5728\u6b65\u9aa41\u548c2\u4e2d\uff0c\u5206\u522b\u8ba1\u7b97\u83b7\u5f97\u4e24\u5f20\u8868\uff08\u53c2\u89c1\u76f4\u65b9\u56fe\u5747\u8861\u5316\u4e2d\u7684\u7b97\u4f8b\uff09\uff0c\u4ece\u4e2d\u9009\u53d6\u4e00\u5bf9\\(v_k\u3001s_j\\)\uff0c\u4f7f\\(v_k = s_j\\)\uff0c\u5e76\u4ece\u4e24\u5f20\u8868\u4e2d\u67e5\u51fa\u5bf9\u5e94\u7684\\(z_k\\)\u3001\\(r_j\\)

    \u8fd9\u6837\uff0c\u539f\u59cb\u56fe\u50cf\u4e2d\u7070\u5ea6\u7ea7\u4e3a\\(r_j\\)\u7684\u6240\u6709\u50cf\u7d20\u90fd\u6620\u5c04\u6210\u7070\u5ea6\u7ea7\\(z_k\\)\uff0c\u6700\u7ec8\u5f97\u5230\u6240\u671f\u671b\u7684\u56fe\u50cf\u3002

    "},{"location":"DIP/chap3/chap3/#histogram-transform","title":"Histogram transform","text":""},{"location":"DIP/chap3/chap3/#linear-histogram-transform","title":"Linear histogram transform","text":"
    • Contrast stretching
    • Piecewise linear grayscale transform

    Linear grayscale transform by using a piecewise function, which strengthen the region of interest, weaken the region of no-interest.

    \u5229\u7528\u5206\u6bb5\u76f4\u65b9\u56fe\u53d8\u6362\uff0c\u53ef\u4ee5\u5c06\u611f\u5174\u8da3\u7684\u7070\u5ea6\u8303\u56f4\u7ebf\u6027\u6269\u5c55\uff0c\u540c\u65f6\u76f8\u5bf9\u6291\u5236\u4e0d\u611f\u5174\u8da3\u7684\u7070\u5ea6\u533a\u57df

    "},{"location":"DIP/chap3/chap3/#nonlinear-histogram-transform","title":"Nonlinear histogram transform","text":"

    Logarithmic function and Exponential function are two popular nonlinear transform functions.

    Logarithmic

    • Stretch low grayscale region
    • Compress high grayscale region

    Expoential

    • Stretch high grayscale region
    • Compress low grayscale region

    "},{"location":"DIP/chap3/chap3/#geometric-transform","title":"Geometric transform","text":""},{"location":"DIP/chap3/chap3/#1_1","title":"1.\u57fa\u672c\u51e0\u4f55\u53d8\u5316","text":""},{"location":"DIP/chap3/chap3/#translation","title":"\u5e73\u79fb\uff08Translation\uff09","text":"

    \u5c06\u56fe\u50cf\u6cbf\u6c34\u5e73\u548c\u7ad6\u76f4\u65b9\u5411\u79fb\u52a8\uff0c\u4ece\u800c\u4ea7\u751f\u65b0\u56fe\u50cf\u7684\u8fc7\u7a0b\u3002

    \u5e73\u79fb\u540e\u7684\u666f\u7269\u4e0e\u539f\u56fe\u50cf\u76f8\u540c\uff0c\u4f46\u201c\u753b\u5e03\u201d\u4e00\u5b9a\u662f\u6269\u5927\u4e86\uff0c\u5426\u5219\u5c31\u4f1a\u4e22\u5931\u4fe1\u606f\u3002 * \u77e9\u9635\u8868\u793a \\(\\begin{bmatrix}x^{'}\\\\y^{'}\\\\1\\end{bmatrix}=\\begin{bmatrix}1&0&x_0\\\\0&1&y_0\\\\0&0&1\\end{bmatrix}\\begin{bmatrix}x\\\\y\\\\1\\end{bmatrix}\\)

    "},{"location":"DIP/chap3/chap3/#rotation","title":"\u65cb\u8f6c\uff08Rotation\uff09","text":"
    • \u7ed5\u539f\u70b9\u65cb\u8f6c\\(\\theta\\)\u89d2\uff0c\u5f97\u5230\u65b0\u56fe\u50cf\u7684\u8fc7\u7a0b
    • \u6ce8\u610f\uff1a\u65cb\u8f6c\u53d8\u6362\u7684\u8fc7\u7a0b\u4e2d\uff0c\u56fe\u50cf\u4e2d\u4f1a\u4ea7\u751f\u7a7a\u6d1e\uff0c\u7528\u63d2\u503c\u6cd5\u8865\u5168(\u884c\u63d2\u503c\u2014\u2014\u6309\u987a\u5e8f\u5bfb\u627e\u6bcf\u4e00\u884c\u4e2d\u7684\u7a7a\u6d1e\u50cf\u7d20\uff0c\u8bbe\u7f6e\u5176\u50cf\u7d20\u503c\u4e0e\u540c\u4e00\u884c\u4e2d\u524d\u4e00\u4e2a\u50cf\u7d20\u7684\u50cf\u7d20\u503c\u76f8\u540c\u3002)
    • \u77e9\u9635\u8868\u793a \\(\\begin{bmatrix}x^{'}\\\\y^{'}\\\\1\\end{bmatrix}=\\begin{bmatrix}cos\\theta&-sin\\theta&0\\\\sin\\theta&cos\\theta&0\\\\0&0&1\\end{bmatrix}\\begin{bmatrix}x\\\\y\\\\1\\end{bmatrix}\\)
    "},{"location":"DIP/chap3/chap3/#3-scale","title":"\uff083\uff09\u7f29\u653e (Scale)","text":"

    \u5c06\u56fe\u50cf\u4e58\u4ee5\u4e00\u5b9a\u7cfb\u6570\uff0c\u4ece\u800c\u4ea7\u751f\u65b0\u56fe\u50cf\u7684\u8fc7\u7a0b

    • \u6cbfx\u8f74\u65b9\u5411\u7f29\u653ec\u500d\uff08c>1\u65f6\u4e3a\u653e\u5927\uff0c0<c<1\u65f6\u4e3a\u7f29\u5c0f\uff09

    \u6cbfy\u8f74\u65b9\u5411\u7f29\u653ed\u500d\uff08d>1\u65f6\u4e3a\u653e\u5927\uff0c0<d<1\u65f6\u4e3a\u7f29\u5c0f\uff09

    • \u5f53c=d\u65f6\uff0c\u56fe\u50cf\u7b49\u6bd4\u7f29\u653e\uff1b\u5426\u5219\u4e3a\u975e\u7b49\u6bd4\u7f29\u653e\uff0c\u5bfc\u81f4\u56fe\u50cf\u53d8\u5f62\u3002
    • \u7f29\u5c0f \uff1a\u6309\u4e00\u5b9a\u95f4\u9694\u9009\u53d6\u67d0\u4e9b\u884c\u548c\u5217\u7684\u50cf\u7d20\u6784\u6210\u7f29\u5c0f\u540e\u7684\u65b0\u56fe\u50cf\uff1b
    • \u653e\u5927 \uff1a\u65b0\u56fe\u50cf\u51fa\u73b0\u7a7a\u884c\u548c\u7a7a\u5217\uff0c\u53ef\u91c7\u7528\u63d2\u503c\u7684\u65b9\u6cd5\u52a0\u4ee5\u586b\u8865\uff0c\u4f46\u5b58\u5728\u201c\u9a6c\u8d5b\u514b\u201d\u73b0\u8c61\u3002

    • \u77e9\u9635\u8868\u793a \\(\\begin{bmatrix}x^{'}\\\\y^{'}\\\\1\\end{bmatrix}=\\begin{bmatrix}c&0&0\\\\0&d&0\\\\0&0&1\\end{bmatrix}\\begin{bmatrix}x\\\\y\\\\1\\end{bmatrix}\\)

    "},{"location":"DIP/chap3/chap3/#shear","title":"\u56fe\u50cf\u526a\u5207 (Shear)","text":"

    \u56fe\u50cf\u7684\u9519\u5207\u53d8\u6362\u5b9e\u9645\u4e0a\u662f\u666f\u7269\u5728\u5e73\u9762\u4e0a\u7684\u975e\u5782\u76f4\u6295\u5f71\u6548\u679c

    \\(Shear\\ on\\ x-axis:\\left\\{\\begin{aligned}&a(x, y) = x + d_xy \\\\&b(x, y) = y\\end{aligned}\\right.\\) \\(Shear\\ on\\ y-axis:\\left\\{\\begin{aligned}&a(x, y) = x \\\\&b(x, y) = y+d_yx\\end{aligned}\\right.\\)

    • \u77e9\u9635\u8868\u793a \\(\\begin{bmatrix}x^{'}\\\\y^{'}\\\\1\\end{bmatrix}=\\begin{bmatrix}1&d_x&0\\\\d_y&1&0\\\\0&0&1\\end{bmatrix}\\begin{bmatrix}x\\\\y\\\\1\\end{bmatrix}\\)
    "},{"location":"DIP/chap3/chap3/#mirror","title":"\u955c\u50cf\u53d8\u6362 (Mirror)","text":"

    \u7ed5x\u8f74\u6216y\u8f74\u7ffb\u8f6c\uff0c\u4ece\u800c\u4ea7\u751f\u4e0e\u539f\u56fe\u50cf\u5bf9\u79f0\u7684\u65b0\u56fe\u50cf\u7684\u8fc7\u7a0b * \u77e9\u9635\u8868\u793a \\(\\begin{bmatrix}x^{'}\\\\y^{'}\\\\1\\end{bmatrix}=\\begin{bmatrix}s_x&0&0\\\\0&s_y&0\\\\0&0&1\\end{bmatrix}\\begin{bmatrix}x\\\\y\\\\1\\end{bmatrix}\\)

    • \u5f53\\(S_x\\) =\\(1\\)\uff0c\u4e14\\(S_y\\) =\\(-1\\)\u65f6\u5b9e\u73b0\u7ed5x\u8f74\u7684\u955c\u50cf\u53d8\u6362
    • \u5f53\\(S_x\\) = \\(-1\\)\uff0c\u4e14\\(S_y\\) =\\(1\\)\u65f6\u5b9e\u73b0\u7ed5y\u8f74\u7684\u955c\u50cf\u53d8\u6362
    "},{"location":"DIP/chap3/chap3/#_1","title":"\u590d\u5408\u51e0\u4f55\u53d8\u6362","text":"\\[\\begin{bmatrix}x^{'}\\\\y^{'}\\\\1\\end{bmatrix}=\\begin{bmatrix}a&b&c\\\\d&e&f\\\\g&h&1\\end{bmatrix}\\begin{bmatrix}x\\\\y\\\\1\\end{bmatrix}\\]"},{"location":"DIP/chap3/chap3/#_2","title":"\u63d2\u503c","text":""},{"location":"DIP/chap3/chap3/#nearest-neighbor","title":"\u6700\u90bb\u8fd1\u63d2\u503c (Nearest neighbor)","text":"
    • \u6700\u90bb\u8fd1\u63d2\u503c\uff0c\u5373\u8f93\u51fa\u50cf\u7d20\u7684\u7070\u5ea6\u503c\u7b49\u4e8e\u79bb\u5b83\u6240\u6620\u5c04\u5230\u7684\u4f4d\u7f6e\u6700\u8fd1\u7684\u8f93\u5165\u50cf\u7d20\u7684\u7070\u5ea6\u503c\u3002

    \u4e3a\u4e86\u8ba1\u7b97\u51e0\u4f55\u53d8\u6362\u540e\u65b0\u56fe\u50cf\u4e2d\u67d0\u4e00\u70b9\\(P\u2019\\)\u5904\u7684\u50cf\u7d20\u503c\uff0c\u53ef\u4ee5\u9996\u5148\u8ba1\u7b97\u8be5\u51e0\u4f55\u53d8\u6362\u7684\u9006\u53d8\u6362\uff0c\u8ba1\u7b97\u51fa \\(P\u2019\\) \u6240\u5bf9\u5e94\u7684\u539f\u56fe\u50cf\u4e2d\u7684\u4f4d\u7f6e \\(P\\)

    \u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\\(P\\) \u7684\u4f4d\u7f6e\u4e0d\u53ef\u80fd\u6b63\u597d\u5904\u5728\u539f\u56fe\u50cf\u7684\u67d0\u4e00\u4e2a\u50cf\u7d20\u4f4d\u7f6e\u4e0a(\u5373 $P $\u70b9 \u7684\u5750\u6807\u901a\u5e38\u90fd\u4e0d\u4f1a\u6b63\u597d\u662f\u6574\u6570)

    \u5bfb\u627e\u4e0e \\(P\\) \u70b9\u6700\u63a5\u8fd1\u7684\u50cf\u7d20\\(Q\\)\uff0c\u628a \\(Q\\) \u70b9\u7684\u50cf\u7d20\u503c\u4f5c\u4e3a\u65b0\u56fe\u50cf\u4e2d \\(P\u2019\\)\u70b9\u7684 \u50cf\u7d20\u503c\u3002

    • \\(Steps\\) \\((x^{'},y^{'})\\Rightarrow{\\text{Inverse Transtion}}(x,y)\\\\ \\Rightarrow{\\text{rounding operation}}(x_{int},y_{int})\\\\ \\Rightarrow{\\text{assign value}}I_{new}(x^{'},y^{'})=I_{old}(x_{int},y_{int})\\\\\\)

    • \u5f53\u56fe\u50cf\u4e2d\u5305\u542b\u660e\u663e\u7684\u51e0\u4f55\u7ed3\u6784\u65f6\uff0c\u7ed3\u679c\u5c06\u4e0d\u592a\u5149\u6ed1\u8fde\u7eed\uff0c\u4ece\u800c\u5728\u56fe\u50cf\u4e2d\u4ea7\u751f\u4eba\u4e3a\u7684\u75d5\u8ff9

    "},{"location":"DIP/chap3/chap3/#linear-interpolation","title":"\u7ebf\u6027\u63d2\u503c (Linear interpolation)","text":"
    • \u5728\u4e00\u7ef4\u60c5\u51b5\u4e0b\uff0c\u5df2\u77e5x1\u548cx2\u5904\u7684\u7070\u5ea6\u503c\u5206\u522b\u4e3ag1\u548cg2\uff0c\u5219x3\u5904\u7684\u7070\u5ea6\u503cg3\u4e3a\uff1a $$ g_3 = \\frac{g_2-g_1}{x_2-x_1}(x_3-x_1)+g1 $$

    • \u5728\u4e8c\u7ef4\u60c5\u51b5\u4e0b\uff0c\u79f0\u4e3a\u53cc\u7ebf\u6027\u63d2\u503c

    • \u6ce8\uff1a\u53ef\u7531\u4e00\u7ef4\u7684\u60c5\u51b5\u63a8\u5bfc\u800c\u6765\uff0c\u5f97\u5230\u53cc\u7ebf\u6027\u65b9\u7a0bg(x,y)\u4e3a $$ g(x,y)=\\frac{(y_1-y)(x_1-x)}{(y_1-y_0)(x_1-x_0)}g(0,0)+\\frac{(y_1-y)(x-x_0)}{(y_1-y_0)(x_1-x_0)}g(1,0)+\\frac{(y-y_0)(x_1-x)}{(y_1-y_0)(x_1-x_0)}g(0,1)+\\frac{(y-y_0)(x-x_0)}{(y_1-y_0)(x_1-x_0)}g(1,1) $$ \u5373\u6ee1\u8db3\\(g(x,y)=ax+by+cxy+d\\)\u7684\u5f62\u5f0f

    • \u5df2\u77e5\u56fe\u50cf\u7684\u6b63\u65b9\u5f62\u7f51\u683c\u4e0a\u56db\u4e2a\u70b9A\u3001B\u3001C\u3001D\u7684\u7070\u5ea6\uff0c\u6c42P\u70b9\u7684\u7070\u5ea6:

      • \u5b9a\u4e49\u53cc\u7ebf\u6027\u65b9\u7a0b$g(x,y)=ax+by+cxy+d $
      • \u5206\u522b\u5c06\\(A\\ B\\ C\\ D\\)\u56db\u70b9\u7684\u4f4d\u7f6e\u548c\u7070\u5ea6\u4ee3\u5165\u65b9\u7a0b\uff0c\u5f97\u5230\u65b9\u7a0b\u7ec4
      • \u89e3\u65b9\u7a0b\u7ec4\uff0c\u89e3\u51fa\\(a\\ b\\ c\\ d\\)\u56db\u4e2a\u7cfb\u6570
      • \u5c06P\u70b9\u7684\u4f4d\u7f6e\u4ee3\u5165\u65b9\u7a0b\uff0c\u5f97\u5230P\u70b9\u7684\u7070\u5ea6
    "},{"location":"DIP/chap3/chap3/#radial-basis-function-rbf-based-interpolation","title":"\u5f84\u5411\u57fa\u51fd\u6570\u63d2\u503c[Radial Basis Function (RBF) based interpolation]","text":"
    • \u5f84\u5411\u57fa\u51fd\u6570\\(\\phi(x)\\)

    • \u6700\u5e38\u89c1\u4e3a\u9ad8\u65af\u51fd\u6570\\(\u03c6(r)=e^{\\frac{\u2212r^2}{2\u03c3^2}}\\)

    • Multiquadrics:\\(\\phi(r)=\\sqrt{1+\\frac{r^2}{\\sigma^2}}\\)

    • Linear: \\(\\phi(r)=r\\)

    • Cubic:\\(\\phi(r)=r^3\\)

      \u2026\u2026

    • \u63d2\u503c\u51fd\u6570 \\(\\hat{f}(x)=\\sum_{i=1}^Nw_i\\phi(||x-x_i||)\\) where \\(w_i=\\frac{\\phi(|x-c_i|)}{\\sum_{i=1}^n\\phi(|x-c_i|)}\\)

    "},{"location":"DIP/feature/feature/","title":"Feature detection","text":""},{"location":"DIP/feature/feature/#feature-detection-the-math","title":"Feature detection: the math","text":"

    Consider shifting the window \\(W\\) by \\((u,v)\\)

    \\(\\begin{align*}Error(u,v)&=\\sum_{(x,y)\\in W}[I(x+u,y+v)-I(x,y)]^2\\\\ &\\approx\\sum_{(x,y)\\in W}[I(x,y)+\\frac{\\partial I}{\\partial x}u+\\frac{\\partial I}{\\partial y}v-I(x,y)]^2\\\\ &\\approx\\sum_{(x,y)\\in W}[u,v]\\begin{bmatrix}I_x^2&I_xI_y\\\\I_yI_x&I_y^2\\end{bmatrix}\\begin{bmatrix}u\\\\v\\end{bmatrix} \\\\ \\end{align*}\\)

    • Which directions will result in the largest and smallest E values?

    We can find these directions by looking at the eigenvectors of H \\((\\begin{bmatrix}I_x^2&I_xI_y\\\\I_yI_x&I_y^2\\end{bmatrix})\\)

    Eigenvalues and eigenvectors of H

    • Define shifts with the smallest and largest change (E value)
    • \\(x_+\\) = direction of largest increase in E.
    • \\(\\lambda_+\\) = amount of increase in direction x+ \\(Hx_{+}=\\lambda_{x_+}x_+\\)
    • \\(x_-\\) = direction of smallest increase in E.
    • \\(\\lambda_-\\) = amount of increase in direction x- . \\(Hx_{-}=\\lambda_{x_-}x_-\\)

    Since \\(H\\) is symmetric ,so \\(H=R^{-1}\\begin{bmatrix}\\lambda_1&0\\\\0&\\lambda_2\\end{bmatrix}R\\)

    • Compute the gradient at each point in the image
    • Create the \\(H\\) matrix from the entries in the gradient
    • Compute the eigenvalues.
    • Find points with large response (\\(\\lambda_-\\) > threshold)
    • Choose those points where \\(\\lambda_-\\) is a local maximum as features
    "},{"location":"DIP/feature/feature/#the-harris-operator","title":"The Harris operator","text":"
    • \\(\\lambda_-\\) is a variant of the Harris operator for feature detection

    \\(f=\\frac{\\lambda_1\\lambda_2}{\\lambda_1+\\lambda_2}=\\frac{determinant(H)}{trace(H)}\\)

    • The trace is the sum of the diagonals, i.e., \\(trace(H) = h_{11} + h_{22}\\)
    • Very similar to \\(\\lambda_-\\) but less expensive (no square root)
    • Called the \u201cHarris Corner Detector\u201d or \u201cHarris Operator\u201dLots of other detectors, this is one of the most popular
    "},{"location":"DIP/feature/feature/#some-properties","title":"Some Properties","text":"
    • Rotation Invariance

    • Partial Invariance to additive and multiplicative intensity changes

    • Not invariance to scaling. !!!

    "},{"location":"DIP/feature/feature/#scale-invariant-detection","title":"Scale Invariant Detection","text":"
    • Eg. Take a local \\(MAXIMUM\\)
    "},{"location":"DIP/feature/feature/#harris-laplacian","title":"Harris-Laplacian","text":"

    We define the characteristic scale as the scale that produces peak of Laplacian response

    Stage 1: Initialization--Multiscale Harris Corner Detection

    1. Image Pyramid Construction: Begin by constructing a scale-space pyramid of the image, generating different scales by applying Gaussian smoothing and downsampling.
    2. Computation of Harris Corner Response: At each scale, calculate the corner response using the Harris corner detection method. This typically involves computing local gradients at each pixel position, forming the autocorrelation matrix, calculating the corner response function, and identifying local maxima as keypoints.
    3. Non-Maximum Suppression: For each scale, perform non-maximum suppression to eliminate redundant keypoints in the corner response function, retaining only the keypoints corresponding to local maxima.

    Stage 2: Scale Selection Based on Laplacian

    1. Laplacian Scale Selection:

    The Laplacian is an operator used to detect edges and texture variations in an image by computing the second derivative at each point.

    In the context of scale selection, the Laplacian serves to measure the changes in the image at different scales.

    • Example: Consider an image containing a circle. As you view this circle at different scales, its edges will exhibit varying degrees of change. By applying the Laplacian at different scales, we can observe the intensity of edge variations.

    The optimal scale for a keypoint is where the maximum edge response occurs, indicating that the details of the keypoint are most pronounced at that scale.

    1. Keypoint Filtering:

    For the same corner, even with changes in scale, the corner remains detectable, indicating robustness in terms of repeatability.

    The content within the feature scale range of the same corner in images of different sizes should be consistent.

    Therefore, the pixel locations within the feature scale range of corners in images of varying scales are proportional to the scale.(\u4e0d\u540c\u5c3a\u5bf8\u56fe\u7247\u4e2d\u7684\u76f8\u540c\u89d2\u70b9\u7684\u7279\u5f81\u5c3a\u5ea6\u8303\u56f4\u4e2d\u7684\u5185\u5bb9\u8981\u76f8\u540c\uff0c\u56e0\u6b64\uff0c\u4e0d\u540c\u5c3a\u5ea6\u7684\u56fe\u7247\u7684\u89d2\u70b9\u7684\u7279\u5f81\u5c3a\u5ea6\u8303\u56f4\u5185\u7684\u50cf\u7d20\u70b9\u4e0e\u5c3a\u5ea6\u6210\u6bd4\u4f8b\u5173\u7cfb\u3002)

    "},{"location":"DIP/feature/feature/#local-extrema-detection","title":"Local Extrema Detection","text":"
    • Maxima and minima
    • Compare \\(x\\) with its 26 neighbors at 3 scales
    "},{"location":"DIP/feature/feature/#orientation","title":"Orientation","text":""},{"location":"DIP/feature/feature/#sift","title":"SIFT","text":"

    Let's illustrate the construction process of a Gaussian pyramid with a simple example. We assume that each group contains S layers, and the scale differences within each group are achieved through downsampling by a factor of 2 and using different Gaussian blur parameters \u03c3.

    1. Initial Image: Suppose we have an initial image, labeled as Group 0, containing image A.
    2. Group 1: - We apply Gaussian blur to image A in Group 0, obtaining image B in Group 1. The Gaussian blur parameter here is \u03c31. - Next, we downsample (reduce by half) image B, resulting in image C in Group 1.
    3. Group 2: - We apply Gaussian blur to image B in Group 1, obtaining image D in Group 2. The Gaussian blur parameter here is \u03c32. - We then downsample image D, obtaining image E in Group 2.
    4. Group 3: - Gaussian blur is applied to image D in Group 2, resulting in image F in Group 3. The Gaussian blur parameter here is \u03c33. - Image F is then downsampled, resulting in image G in Group 3.

    This process can be repeated iteratively, and each round of Gaussian blur and downsampling constructs one level of the pyramid. Within each group, we have S images at different scales (determined by different Gaussian blur parameters), and each image, obtained by downsampling, aligns with the corresponding image from the previous group in terms of scale.

    This ensures that the construction of the pyramid is \"bottom-up,\" reflecting the features of the image at different scales.

    • REFER TO ML-4360 Structure from motion

    "},{"location":"DIP/feature/feature/#visual-word-generation","title":"Visual Word Generation","text":"

    Based on the collected images we detect their interest points with Difference of Gaussian, and extract the SIFT descriptors.

    The extracted descriptors are then clustered to generate the vocabulary tree with the hierarchical k-means clustering. In this experiment we generated a visual vocabulary containing 32357 visual words

    "},{"location":"DIP/feature/feature/#surf-detectors-and-descriptors","title":"SURF detectors and descriptors","text":"

    Reference to https://medium.com/@deepanshut041/introduction-to-surf-speeded-up-robust-features-c7396d6e7c4e

    • speeded up robust features

    "},{"location":"DIP/feature/feature/#1feature-extraction","title":"(1)Feature Extraction","text":"

    Basic Hessian matrix approximation.

    "},{"location":"DIP/feature/feature/#aintegral-images","title":"a.Integral images","text":"

    The Integral Image or Summed-Area Table was introduced in 1984. The Integral Image is used as a quick and effective way of calculating the sum of values (pixel values) in a given image \u2014 or a rectangular subset of a grid (the given image). It can also, or is mainly, used for calculating the average intensity within a given image.

    "},{"location":"DIP/feature/feature/#bhessian-matrix-based-interest-points","title":"b.Hessian matrix-based interest points","text":"

    \\(SURF\\) uses the Hessian matrix because of its good performance in computation time and accuracy. Rather than using a different measure for selecting the location and the scale (Hessian-Laplace detector), surf relies on the determinant of the Hessian matrix for both.

    For adapt to any scale, we filtered the image by a Gaussian kernel, so given a point \\(X = (x, y)\\), the Hessian matrix \\(H(x, \u03c3)\\) in x at scale \u03c3 is defined as:

    \\(H(\\vec{x},\\sigma)=\\begin{bmatrix}L_{xx}(x,\\sigma)&L_{xy}(x,\\sigma)\\\\ L_{xy}(x,\\sigma)&L_{yy}(x,\\sigma)\\end{bmatrix}\\)

    where \\(L_{xx}(x, \u03c3)\\) is the convolution of the Gaussian second order derivative with the image \\(I\\) in point \\(x\\), and similarly for \\(L_{xy} (x, \u03c3)\\) and \\(L_{yy} (x, \u03c3)\\).

    Gaussians are optimal for scale-space analysis but in practice, they have to be discretized and cropped. This leads to a loss in repeatability under image rotations around odd multiples of \\(\u03c0 /4\\). This weakness holds for Hessian-based detectors in general. Nevertheless, the detectors still perform well, and the slight decrease in performance does not outweigh the advantage of fast convolutions brought by the discretization and cropping.

    After Lowe\u2019s success with LoG approximations(SIFT), SURF pushes the approximation(both convolution and second-order derivative) even further with box filters. These approximate second-order Gaussian derivatives and can be evaluated at a very low computational cost using integral images and independently of size, and this is part of the reason why SURF is fast.

    • eg.

    \\(d^2L(x)/dx^2=(L(x+1)-L(x))-(L(x)-L(x-1))=-2*L(x)+L(x+1)+L(x-1)\\)

    The \\(9 \u00d7 9\\) box filters in the above images are approximations for Gaussian second order derivatives with \u03c3 = 1.2.

    We denote these approximations by \\(D_{xx}, D_{yy}, and D_{xy}\\).

    Now we can represent the determinant of the Hessian (approximated) as:\\(det(H_{approx})=D_{xx}D_{yy}-(wD_{xy})^2\\) \\(w=0.9 (Bay\u2019s\\ suggestion)\\)

    "},{"location":"DIP/feature/feature/#cscale-space-representation","title":"c.Scale-space representation","text":"

    SURF can be considered as a faster feature extraction method compared to SIFT.

    It processes the original image directly using box filters at different scales, eliminating the need to build multiple layers of a pyramid like SIFT. This makes SURF computationally more efficient, especially in scenarios where large-scale image databases or real-time applications are involved.

    • \u6211\u7684\u7406\u89e3\uff0c\u56e0\u4e3a\u76d2\u5b50\u6ee4\u6ce2\u53ef\u4ee5\u7528\u540c\u6837\u5904\u7406\u5728\u4e00\u5f20\u56fe\u4e0a\u5b8c\u6210\u8c61\u5f81\u7740\u6539\u53d8\u5c3a\u5ea6\uff08\u5bf9\u4e0d\u540c\u5c3a\u5ea6\u7684\u64cd\u4f5c\uff09\uff08\u6bd4\u5982\u4e0a\u56fe\u5c31\u662f\u5728\u505a\u5bf9\u5df2\u7ecf\uff08\u5bf9\u539f\u56fe\uff09\u964d\u91c7\u6837\u540e\u56fe\u7247\uff0c\u7684\u4e8c\u9636\u5fae\u5206)

    If you use a 9x9 box filter on a 36x36 image, and you start from the center of the filter, moving the width of the filter at each step, you would end up with a 4x4 grid, deriving 16 new coordinate detection points. This is because 36 divided by 9 equals 4, thus, you can get 4 coordinate points in each direction.

    However, this is just a logical understanding, and the actual results may vary due to the details of filter processing, such as edge handling, stride of the filter, and other factors.

    \u8fd9\u91cc\u53ef\u4ee5\u770b\u5230\u4e00\u4e2a\u95ee\u9898\uff0c\u627e\u5230\u7684\u5c40\u90e8\u6700\u5927\u503c\u5982\u679c\u653e\u56de\u539f\u56fe\u7684\u5c3a\u5ea6\uff0c\u5176\u5b9e\u662f\u5bf9\u5e94\u7740\u4e00\u4e2a\u533a\u57df\u7684\uff0c\u90a3\u4e48\u5982\u4f55\u786e\u5b9a\u4e00\u4e2a\u7cbe\u786e\u7684\u5750\u6807\u5462\uff1f

    To locate the precise position of feature points, we apply a Taylor expansion to the Hessian matrix at the local maximum points. This approximates a smooth surface depicting the variation of image intensity around the feature points. Then, we identify the peak of this smooth surface. Compared to the original discrete maximum point, the location of this peak is more accurate. Hence, we refer to it as the true location of the feature point.

    "},{"location":"DIP/feature/feature/#interpolation","title":"Interpolation","text":"

    For each local maximum, need to interpolate to get true location (to overcome discretization effects)

    "},{"location":"DIP/feature/feature/#2feature-description","title":"(2)Feature Description","text":""},{"location":"DIP/feature/feature/#orientation-assignment","title":"Orientation Assignment","text":"
    1. First calculate the Haar-wavelet responses in \\(x\\) and \\(y\\)-direction, and this in a circular neighborhood of radius \\(6*s\\) around the keypoint, with \\(s\\) the scale at which the keypoint was detected.

    Also, the sampling step is scale dependent and chosen to be s, and the wavelet responses are computed at that current scale s.

    Accordingly, at high scales the size of the wavelets is big. Therefore integral images are used again for fast filtering.

    1. Then we calculate the sum of vertical and horizontal wavelet responses in a scanning area, then change the scanning orientation (add \\(\u03c0/3\\)), and re-calculate, until we find the orientation with largest sum value, this orientation is the main orientation of feature descriptor.

    "},{"location":"DIP/feature/feature/#descriptor-components","title":"Descriptor Components","text":"

    Now it\u2019s time to extract the descriptor

    1. The first step consists of constructing a square region centered around the keypoint and oriented along the orientation we already got above. The size of this window is 20s.

    2. Then the region is split up regularly into smaller 4 \u00d7 4 square sub-regions. For each sub-region, we compute a few simple features at 5\u00d75 regularly spaced sample points.

    For reasons of simplicity, we call dx the Haar wavelet response in the horizontal direction and dy the Haar wavelet response in the vertical direction (filter size 2s).

    To increase the robustness towards geometric deformations and localization errors, the responses dx and dy are first weighted with a Gaussian (\u03c3 = 3.3s) centered at the keypoint.

    Then, the wavelet responses dx and dy are summed up over each subregion and form a first set of entries to the feature vector.

    In order to bring in information about the polarity of the intensity changes, we also extract the sum of the absolute values of the responses, |dx| and |dy|.

    Hence, each sub-region has a four-dimensional descriptor vector \\(\\vec{v}\\) for its underlying intensity structure \\(V = (\u2211 dx, \u2211 dy, \u2211|dx|, \u2211|dy|)\\).

    This results in a descriptor vector for all 4\u00d74 sub-regions of length 64.

    • (In \\(SIFT\\), our descriptor is the 128-D vector, so this is part of the reason that SURF is faster than Sift).
    "},{"location":"DIP/feature/feature/#image-stitching","title":"Image Stitching","text":"

    Procedure

    • Detect feature points in both images. --Build SIFT descriptors
    • Find correponding pairs -- Match SIFT descriptors (Euclidean distance)
    • Use these pairs to align the images -- Fitting the transformation
    • RANSAC
    • Image Blending
    "},{"location":"DIP/feature/feature/#ransac","title":"RANSAC","text":"

    A further refinement of matches.--RANdom SAmple Consensus

    In short words, \\(RANSAC\\) fits \\(N\\) models using different random sample S of the whole available data each time. Then, for each model it evaluates its performance P (i.e. number of inliers or outliers) and chooses the best one. Note that RANSAC doesn\u2019t determine what method should you use to find model parameters.(least squares for example)

    • How many samples are needed?

    • Suppose \\(w\\) is fraction of inliers (points from line).

    • \\(n\\) points needed to define hypothesis (2 for lines)

    • \\(k\\) samples chosen.

      Prob. that a single sample of n points is correct \\(w^n\\)

      Prob. that all k samples fail is: \\((1-w^n)^k\\)

      • Choose k high enough to keep this below desired failure rate.

    • k-- iterations

    • RANSAC divides data into inliers and outliers and yields estimate computed from minimal set of inliers.Improve this initial estimate with estimation over all inliers (e.g. with standard least-squares minimization).

    • But this may change inliers, so alternate fitting with re-classification as inlier/outlier.

    "},{"location":"DIP/feature/feature/#pros","title":"Pros:","text":"
    • General method suited for a wide range of model fitting problems
    • Easy to implement and easy to calculate its failure rate
    "},{"location":"DIP/feature/feature/#cons","title":"Cons:","text":"
    • Only handles a moderate percentage of outliers without cost blowing up
    • Many real problems have high rate of outliers (but sometimes selective choice of random subsets can help)

    A voting strategy, the Hough transform, can handle high percentage of outliers

    "},{"location":"DIP/feature/feature/#image-blending","title":"Image Blending","text":""},{"location":"DIP/feature/feature/#image-pyramids","title":"Image Pyramids","text":"
    • An image pyramid can be constructed by repeatedly downsampling (or upsampling) an image and creating a set of images at different resolutions.

    • The resulting images are referred to as \u201clevels\u201d of the pyramid, with the highest resolution image at the top and the lowest resolution image at the bottom.

    "},{"location":"DIP/feature/feature/#gaussian-pyramids","title":"Gaussian Pyramids","text":"

    This type of pyramid is constructed by repeatedly applying a Gaussian blur filter to an image and downsampling it by a factor of two. The resulting images are smoother and have lower resolution than the original image because Gaussians are low pass filters.

    "},{"location":"DIP/feature/feature/#laplacian-pyramid","title":"Laplacian Pyramid","text":"

    This type of pyramid is constructed by subtracting a downsampled version of an image from the original image.

    • The resulting images are high-pass filtered versions of the original image, which highlight the fine details and edges.
    "},{"location":"DIP/feature/feature/#procedure","title":"Procedure","text":"

    \u2022 Build Laplacian pyramid for both images: \\(L_A, L_B\\).

    \u2022 Build Gaussian pyramid for mask: \\(G\\).

    \u2022 Build a combined Laplacian pyramid: \\(L(j) = G(j) LA(j) + (1-G(j)) LB(j).\\)

    \u2022 Collapse \\(L\\) to obtain the blended image.

    "},{"location":"DIP/filter/filter/","title":"\u6ee4\u6ce2","text":""},{"location":"DIP/filter/filter/#_2","title":"\u5377\u79ef","text":"

    \\(L(x,y,\u03c3)=G(x,y,\u03c3)\u2217I(x,y)\\)

    \u8fde\u7eed\u5f62\u5f0f\uff1a\\((f\u2217g)(n)=\\int_{-\\infty }^{\\infty}f(\\tau )g(n-\\tau)d\\tau\\)

    \u79bb\u6563\u5f62\u5f0f\uff1a\\((f\u2217g)(n)=\\frac{1}{M}\\sum_{\\tau=0 }^{M-1}f(\\tau)g(n-\\tau)\\)

    "},{"location":"DIP/filter/filter/#properties","title":"Properties","text":"

    \\(f(x)*h(x)=h(x)*f(x)\\\\ f*(g+h)=f*g+f*h\\\\f*(g*h)=(f*g)*h\\)

    "},{"location":"DIP/filter/filter/#examples","title":"Examples","text":"
    • Effective range\uff1a

    Covers all the points that \\(h(t)\\) go through during the sliding operation.

    In this example, the effective range of x is from 0 to 799.

    "},{"location":"DIP/filter/filter/#_3","title":"\u57fa\u672c\u6982\u5ff5","text":"

    \u6ee4\u6ce2\u5668\u662f\u4e00\u4e2a\u5927\u5c0f\u4e3a \\(M\\times N\\) \u7684\u7a97\u53e3\uff0c\u5176\u4e2d\u7a97\u53e3\u4e2d\u7684\u5143\u7d20\u5bf9\u5e94\u4e8e\u539f\u59cb\u56fe\u50cf\u4e2d\u7684\u76f8\u5e94\u50cf\u7d20\u8fdb\u884c\u64cd\u4f5c\uff0c\u7ed3\u679c\u4fdd\u5b58\u4e3a\u65b0\u56fe\u50cf\u4e2d\u7684\u50cf\u7d20

    \u6ee4\u6ce2\u4e5f\u88ab\u79f0\u4f5c:\u906e\u7f69 (mask)\u3001\u5185\u6838 (kernel)\u3001\u6a21\u677f (template) \u7b49\u3002\u6ee4\u6ce2\u5668\u4e2d\u7684\u5143\u7d20\u662f\u7cfb\u6570\u800c\u4e0d\u662f\u50cf\u7d20\u503c\uff0c\u5b83\u4eec\u8868\u793a\u5e94\u7528\u4e8e\u539f\u59cb\u56fe\u50cf\u4e2d\u50cf\u7d20\u7684\u6743\u91cd\u3002\u5728\u5f85\u5904\u7406\u56fe\u50cf\u4e2d\u9010\u70b9\u79fb\u52a8\u63a9\u6a21\uff0c\u5728\u6bcf\u4e00\u70b9(x,y)\u5904\uff0c\u6ee4\u6ce2\u5668\u5728\u8be5\u70b9\u7684\u54cd\u5e94\u901a\u8fc7\u5b9e\u73b0\u5b9a\u4e49\u7684\u5173\u7cfb\u6765\u8ba1\u7b97\u3002\u5bf9\u4e8e\u7ebf\u6027\u7a7a\u95f4\u6ee4\u6ce2\uff0c\u5176\u54cd\u5e94\u7531\u6ee4\u6ce2\u5668\u7cfb\u6570\u4e0e\u6ee4\u6ce2\u63a9\u6a21\u626b\u8fc7\u533a\u57df\u7684\u5bf9\u5e94\u50cf\u7d20\u503c\u7684\u4e58\u79ef\u4e4b\u548c\u7ed9\u51fa\u3002

    \u901a\u5e38\uff0c\u63a9\u6a21\u7684\u957f\u5bbd\u90fd\u4e3a\u5947\u6570

    • \u5047\u8bbe\u5206\u522b\u4e3a\\(2a+1\\)\u548c\\(2b+1\\)\u3002\u5f53\u7a97\u53e3\u4e2d\u5fc3\u5904\u4e8e\u50cf\u7d20\\((x,y)\\)\u5904\u65f6\uff0c\u65b0\u7684\u50cf\u7d20\u503c\u4e3a\uff1a\\(g(x,y)=\\sum_{s=-a}^a\\sum_{t=-b}^b w(s,t)f(x+s,y+t)\\).\u5bf9\u56fe\u50cff\u4e2d\u6240\u6709\u50cf\u7d20\u90fd\u4e0e\u63a9\u6a21\u8fdb\u884c\u8fd0\u7b97\u4e4b\u540e\uff0c\u6700\u7ec8\u4ea7\u751f\u4e00\u5e45\u65b0\u56fe\u50cfg (\u8fd9\u5b9e\u9645\u4e0a\u662f\u4e00\u79cd\u5377\u79ef\u64cd\u4f5c)

    \u56fe\u50cf\u5728\u4f20\u8f93\u8fc7\u7a0b\u4e2d\uff0c\u7531\u4e8e\u4f20\u8f93\u4fe1\u9053\u3001\u91c7\u6837\u7cfb\u7edf\u8d28\u91cf\u8f83\u5dee\uff0c\u6216\u53d7\u5404\u79cd\u5e72\u6270\u7684\u5f71\u54cd\uff0c\u800c\u9020\u6210\u56fe\u50cf\u6bdb\u7cd9\uff0c\u6b64\u65f6\uff0c\u5c31\u9700\u5bf9\u56fe\u50cf\u8fdb\u884c\u5e73\u6ed1\u5904\u7406\u3002\u5e73\u6ed1\u53ef\u4ee5\u6291\u5236\u9ad8\u9891\u6210\u5206\uff0c\u4f46\u4e5f\u4f7f\u56fe\u50cf\u53d8\u5f97\u6a21\u7cca\u3002 \u5e73\u6ed1\u7a7a\u95f4\u6ee4\u6ce2\u5668\u7528\u4e8e\u6a21\u7cca\u5904\u7406\u548c\u51cf\u5c11\u566a\u58f0\u3002\u6a21\u7cca\u5904\u7406\u7ecf\u5e38\u7528\u4e8e\u9884\u5904\u7406\uff0c\u4f8b\u5982\uff0c\u5728\u63d0\u53d6\u5927\u7684\u76ee\u6807\u4e4b\u524d\u53bb\u9664\u56fe\u50cf\u4e2d\u4e00\u4e9b\u7410\u788e\u7684\u7ec6\u8282\uff0c\u6865\u63a5\u76f4\u7ebf\u6216\u66f2\u7ebf\u7684\u7f1d\u9699\u3002

    "},{"location":"DIP/filter/filter/#_4","title":"\u5e73\u6ed1\u7ebf\u6027\u7a7a\u95f4\u6ee4\u6ce2\u5668","text":"

    \u5e73\u6ed1\u7ebf\u6027\u7a7a\u95f4\u6ee4\u6ce2\u5668\u7684\u8f93\u51fa\u662f\u5305\u542b\u5728\u6ee4\u6ce2\u63a9\u6a21\u90bb\u57df\u5185\u50cf\u7d20\u7684\u7b80\u5355\u5e73\u5747\u503c\u3002\u56e0\u6b64\uff0c\u8fd9\u4e9b\u6ee4\u6ce2\u5668\u4e5f\u79f0\u4e3a\u5747\u503c\u6ee4\u6ce2\u5668\u3002

    • \u7b80\u5355\u5e73\u5747(simple mean)\uff0c\u8868\u793a\u7a97\u53e3\u4e2d\u6bcf\u4e00\u4e2a\u50cf\u7d20\u5bf9\u54cd\u5e94\u7684\u8d21\u732e\u662f\u4e00\u6837\u7684, \u6ee4\u6ce2\u7a97\u53e3\uff1a\\(\\frac{1}{9} \\times \\begin{bmatrix}1&1&1 \\\\ 1&1&1\\\\ 1&1&1\\end{bmatrix}\\)

    • \u52a0\u6743\u5e73\u5747(weighted mean)\uff0c\u8868\u793a\u7a97\u53e3\u4e2d\u7684\u50cf\u7d20\u5bf9\u76f8\u5e94\u7684\u8d21\u732e\u6709\u5927\u5c0f\u4e4b\u5206\uff0c\u6ee4\u6ce2\u7a97\u53e3\uff1a\\(\\frac{1}{16} \\times \\begin{bmatrix}1&2&1 \\\\ 2&4&2\\\\ 1&2&1\\end{bmatrix}\\)

    • General Equation

    \u5176\u4e2d\uff0c\u6ee4\u6ce2\u5668\u5927\u5c0f\u4e3a\\((2a+1) \u00d7(2b+1)\\)\uff0c\\(w\\)\u4e3a\u6ee4\u6ce2\u5668\uff0c\\(f\\)\u4e3a\u8f93\u5165\u56fe\u50cf\uff0c\\(g\\)\u4e3a\u8f93\u51fa\u56fe\u50cf\u3002

    • \u6ee4\u6ce2\u63a9\u6a21\u7684\u5927\u5c0f\u4e0e\u56fe\u50cf\u7684\u5e73\u6ed1\u6548\u679c\u6709\u76f4\u63a5\u7684\u5173\u7cfb

    \u5f53\u63a9\u6a21\u6bd4\u8f83\u5c0f\u65f6\uff0c\u53ef\u4ee5\u89c2\u5bdf\u5230\u5728\u6574\u5e45\u56fe\u50cf\u4e2d\u6709\u8f7b\u5fae\u7684\u6a21\u7cca

    \u5f53\u63a9\u6a21\u5927\u5c0f\u589e\u52a0\uff0c\u6a21\u7cca\u7a0b\u5ea6\u4e5f\u968f\u4e4b\u589e\u52a0

    • \u4e3a\u4e86\u5bf9\u611f\u5174\u8da3\u7269\u4f53\u5f97\u5230\u4e00\u4e2a\u7c97\u7565\u7684\u63cf\u8ff0\u800c\u6a21\u7cca\u4e00\u5e45\u56fe\u50cf\uff0c\u8fd9\u6837\uff0c\u90a3\u4e9b\u8f83\u5c0f\u7269\u4f53\u7684\u5f3a\u5ea6\u4e0e\u80cc\u666f\u6df7\u5408\u5728\u4e00\u8d77\u4e86\uff0c\u8f83\u5927\u7269\u4f53\u53d8\u5f97\u50cf\u201c\u6591\u70b9\u201d\u800c\u6613\u4e8e\u68c0\u6d4b\u3002\u63a9\u6a21\u7684\u5927\u5c0f\u7531\u90a3\u4e9b\u5373\u5c06\u878d\u5165\u80cc\u666f\u4e2d\u53bb\u7684\u7269\u4ef6\u5c3a\u5bf8\u6765\u51b3\u5b9a\u3002
    "},{"location":"DIP/filter/filter/#_5","title":"\u7edf\u8ba1\u6ee4\u6ce2\u5668","text":"

    \u7edf\u8ba1\u6ee4\u6ce2\u5668\u662f\u4e00\u79cd\u975e\u7ebf\u6027\u7684\u7a7a\u95f4\u6ee4\u6ce2\u5668\uff0c\u5b83\u7684\u54cd\u5e94\u662f\u57fa\u4e8e\u7a97\u53e3\u5185\u56fe\u50cf\u533a\u57df\u4e2d\u50cf\u7d20\u503c\u7684\u6392\u5e8f\uff0c\u7531\u7edf\u8ba1\u6392\u5e8f\u7ed3\u679c\u51b3\u5b9a\u7684\u503c\u4ee3\u66ff\u4e2d\u5fc3\u50cf\u7d20\u7684\u503c\u3002

    • \u7edf\u8ba1\u6ee4\u6ce2\u5668\u4e2d\u6700\u5e38\u89c1\u7684\u4f8b\u5b50\u5c31\u662f\u4e2d\u503c\u6ee4\u6ce2\u5668\u3002
    • \u7528\u50cf\u7d20\u90bb\u57df\u5185\u7070\u5ea6\u7684\u4e2d\u503c\u4ee3\u66ff\u8be5\u50cf\u7d20\u7684\u503c
    • \u63d0\u4f9b\u4e86\u4f18\u79c0\u7684\u53bb\u566a\u80fd\u529b\uff0c\u6bd4\u5c0f\u5c3a\u5bf8\u7684\u7ebf\u6027\u5e73\u6ed1\u6ee4\u6ce2\u5668\u7684\u6a21\u7cca\u7a0b\u5ea6\u660e\u663e\u8981\u4f4e
    • \u5bf9\u5904\u7406\u8109\u51b2\u566a\u58f0\uff08\u4e5f\u79f0\u4e3a\u6912\u76d0\u566a\u58f0\uff09\u975e\u5e38\u6709\u6548\uff0c\u56e0\u4e3a\u8fd9\u79cd\u566a\u58f0\u662f\u4ee5\u9ed1\u767d\u70b9\u53e0\u52a0\u5728\u56fe\u50cf\u4e0a\u7684\u3002

    • \u4e3a\u4e86\u5bf9\u4e00\u5e45\u56fe\u50cf\u4e0a\u7684\u67d0\u4e2a\u70b9\u4f5c\u4e2d\u503c\u6ee4\u6ce2\u5904\u7406\u3002\u5fc5\u987b\u5148\u5c06\u63a9\u6a21\u5185\u6b32\u6c42\u7684\u50cf\u7d20\u53ca\u5176\u90bb\u57df\u7684\u50cf\u7d20\u503c\u6392\u5e8f\uff0c\u786e\u5b9a\u51fa\u4e2d\u503c\uff0c\u5e76\u5c06\u4e2d\u503c\u8d4b\u4e88\u8be5\u50cf\u7d20\u70b9

    \u4e2d\u503c\\(\u03be\\) --\u6570\u503c\u96c6\u5408\u4e2d\uff0c\u6709\u4e00\u534a\u6570\u503c\u5c0f\u4e8e\u6216\u7b49\u4e8e\\(\u03be\\)\uff0c\u8fd8\u6709\u4e00\u534a\u5927\u4e8e\u6216\u7b49\u4e8e\\(\u03be\\)

    \u4e3a\u4e86\u5bf9\u4e00\u5e45\u56fe\u50cf\u4e0a\u7684\u67d0\u4e2a\u70b9\u4f5c\u4e2d\u503c\u6ee4\u6ce2\u5904\u7406,\u5fc5\u987b\u5148\u5c06\u63a9\u6a21\u5185\u6b32\u6c42\u7684\u50cf\u7d20\u53ca\u5176\u90bb\u57df\u7684\u50cf\u7d20\u503c\u6392\u5e8f\uff0c\u786e\u5b9a\u51fa\u4e2d\u503c\uff0c\u5e76\u5c06\u4e2d\u503c\u8d4b\u4e88\u8be5\u50cf\u7d20\u70b9

    • \u5e38\u7528\\(n\\times n\\)\u7684\u4e2d\u503c\u6ee4\u6ce2\u5668\u53bb\u9664\u90a3\u4e9b\u76f8\u5bf9\u4e8e\u5176\u90bb\u57df\u50cf\u7d20\u66f4\u4eae\u6216\u66f4\u6697\uff0c\u5e76\u4e14\u5176\u533a\u57df\u5c0f\u4e8e\\(n^2/2\\)\uff08\u6ee4\u6ce2\u5668\u533a\u57df\u7684\u4e00\u534a\uff09\u7684\u5b64\u7acb\u50cf\u7d20\u96c6
    "},{"location":"DIP/filter/filter/#sharpening-spatial-filter","title":"Sharpening spatial filter","text":"

    \u62c9\u666e\u62c9\u65af\u9510\u5316\u662f\u4e00\u79cd\u56fe\u50cf\u5904\u7406\u6280\u672f\uff0c\u65e8\u5728\u7a81\u51fa\u56fe\u50cf\u4e2d\u7684\u8fb9\u7f18\u548c\u7ec6\u8282\uff0c\u4f7f\u56fe\u50cf\u770b\u8d77\u6765\u66f4\u52a0\u9510\u5229\u3002\u8fd9\u79cd\u6280\u672f\u4f7f\u7528\u62c9\u666e\u62c9\u65af\u7b97\u5b50\uff08Laplacian operator\uff09\u6216\u62c9\u666e\u62c9\u65af\u6ee4\u6ce2\u5668\u5bf9\u56fe\u50cf\u8fdb\u884c\u5377\u79ef\u64cd\u4f5c\uff0c\u4ee5\u589e\u5f3a\u56fe\u50cf\u4e2d\u7684\u9ad8\u9891\u4fe1\u606f\u3002

    "},{"location":"DIP/filter/filter/#1","title":"(1)\u62c9\u666e\u62c9\u65af\u7b97\u5b50","text":"

    \u4e00\u9636\u5fae\u5206\u7b97\u5b50:\\(\\frac{\\partial{f}}{\\partial{x}}\\)$= f(x + 1) \u2212 f(x) $

    \u4e8c\u9636\u5fae\u5206\u7b97\u5b50:\\(\\frac{\\partial^2{f}}{\\partial{x}^2}\\)\\(= f(x + 1) +f(x-1)\u2212 2f(x)\\)

    • \u5bf9\u4e8e\u51fd\u6570f(x,y)\uff0c\u9996\u5148\u5b9a\u4e49\u4e00\u4e2a\u4e8c\u7ef4\u5217\u5411\u91cf\uff1a

    • \u5bf9\u6574\u5e45\u56fe\u50cf\u8ba1\u7b97\u68af\u5ea6\u65f6\uff0c\u8fd0\u7b97\u91cf\u4f1a\u5f88\u5927\uff0c\u56e0\u6b64\uff0c\u5728\u5b9e\u9645\u64cd\u4f5c\u4e2d\uff0c\u5e38\u7528\u7edd\u5bf9\u503c\u4ee3\u66ff\u5e73\u65b9\u4e0e\u5e73\u65b9\u6839\u8fd0\u7b97\u8fd1\u4f3c\u6c42\u68af\u5ea6\u7684\u6a21\u503c \\(\\triangledown f \\approx |G_x|+|G_y|\\)

    • \u79bb\u6563\u5f62\u5f0f

    \\(\\ \\ \\ \\triangledown^2f=f(x+1,y)+f(x-1,y)+f(x,y+1),F(x,y-1)-4f(x,y)\\)

    • Laplacian operator is defined as \\(\\triangledown^2 f=\\frac{\\partial^2f}{\\partial x ^2}+\\frac{\\partial^2f}{\\partial y ^2}\\)
    • Along x axis \\(\\frac{\\partial^2{f}}{\\partial{x}^2}= f(x + 1,y) +f(x-1,y)\u2212 2f(x,y)\\)
    • Along y axis \\(\\frac{\\partial^2{f}}{\\partial{y}^2}= f(x,y+1) +f(x,y-1)\u2212 2f(x,y)\\)
    • discrete Laplacian operator \\(\\triangledown^2f=f(x+1,y)+f(x-1,y)+f(x,y+1),F(x,y-1)-4f(x,y)\\)
    "},{"location":"DIP/filter/filter/#2","title":"(2)\u62c9\u666e\u62c9\u65af\u53d8\u6362\u56fe\u50cf\u9510\u5316","text":"
    • \u63a9\u6a21

    \u5982\u679c\u8003\u8651\u5bf9\u89d2\u7ebf\u5143\u7d20

    • \u7531\u4e8e\u62c9\u666e\u62c9\u65af\u7b97\u5b50\u662f\u4e00\u79cd\u5bfc\u6570\u7b97\u5b50\uff0c\u5b83\u7684\u4f7f\u7528\u4f1a\u7a81\u51fa\u663e\u793a\u56fe\u50cf\u4e2d\u7684\u5f3a\u5ea6\u4e0d\u8fde\u7eed\u6027\uff0c\u800c\u4e0d\u5f3a\u8c03\u5177\u6709\u7f13\u6162 \u53d8\u5316\u7684\u5f3a\u5ea6\u7ea7\u522b\u7684\u533a\u57df\u3002\u8fd9\u5c06\u503e\u5411\u4e8e\u751f\u6210\u5177\u6709\u7070\u8272\u8fb9\u7f18\u7ebf\u548c\u5176\u4ed6\u4e0d\u8fde\u7eed\u6027\u7684\u56fe\u50cf\uff0c\u6240\u6709\u8fd9\u4e9b\u56fe\u50cf\u90fd\u53e0\u52a0\u5728\u9ed1\u6697\u3001\u65e0\u7279\u5f81\u7684\u80cc\u666f\u4e0a\u3002\u53ea\u9700\u5c06\u62c9\u666e\u62c9\u65af\u56fe\u50cf\u6dfb\u52a0\u5230\u539f\u59cb\u56fe\u50cf\u4e2d\uff0c\u5373\u53ef\u201c\u6062\u590d\u201d\u80cc\u666f\u7279\u5f81\uff0c\u540c\u65f6\u4ecd\u4fdd\u6301\u62c9 \u666e\u62c9\u65af\u56fe\u50cf\u7684\u9510\u5316\u6548\u679c

    • \u4e5f\u5c31\u662f\u8bf4\uff0c\u5982\u679c\u4f7f\u7528\u7684\u5b9a\u4e49\u5177\u6709\u8d1f\u4e2d\u5fc3\u7cfb\u6570\uff0c\u5219\u6211\u4eec\u51cf\u53bb\u800c\u4e0d\u662f\u6dfb\u52a0\u62c9\u666e\u62c9\u65af\u56fe\u50cf\u4ee5\u83b7\u5f97\u9510\u5316\u7ed3\u679c

    • \u56e0\u6b64\uff0c\u6211\u4eec\u4f7f\u7528\u62c9\u666e\u62c9\u65af\u51fd\u6570\u8fdb\u884c\u56fe\u50cf\u9510\u5316\u7684\u57fa\u672c\u65b9\u6cd5\u662f:

    \\(g(x,y)=\\left\\{\\begin{array}{ll}f(x,y)-\\triangledown^2f(x,y)& if\\ the\\ center\\ of\\ the\\ mask\\ is\\ negative \\\\ f(x,y)+\\triangledown^2f(x,y)& if\\ the\\ center\\ of\\ the\\ mask\\ is\\ positive \\end{array} \\right.\\)

    • \u5c06\u539f\u59cb\u56fe\u50cf\u548c\u62c9\u666e\u62c9\u65af\u56fe\u50cf\u53e0\u52a0\u5728\u4e00\u8d77\u7684\u7b80\u5355\u65b9\u6cd5\u53ef\u4ee5\u4fdd\u62a4\u62c9\u666e\u62c9\u65af\u9510\u5316\u5904\u7406\u7684\u6548\u679c\uff0c\u540c\u65f6\u53c8\u80fd\u590d\u539f\u80cc\u666f\u4fe1\u606f\u3002
    "},{"location":"DIP/filter/filter/#_6","title":"\u9ad8\u65af\u6ee4\u6ce2","text":"

    \u9ad8\u65af\u6ee4\u6ce2\u662f\u4e00\u79cd\u5e38\u7528\u7684\u56fe\u50cf\u5904\u7406\u6ee4\u6ce2\u5668\uff0c\u5176\u4e3b\u8981\u76ee\u7684\u662f\u5bf9\u56fe\u50cf\u8fdb\u884c\u5e73\u6ed1\u5904\u7406\u3002\u5b83\u7684\u540d\u79f0\u6765\u6e90\u4e8e\u6240\u4f7f\u7528\u7684\u6ee4\u6ce2\u6838\uff08\u5377\u79ef\u6838\uff09\u662f\u4e00\u4e2a\u4e8c\u7ef4\u9ad8\u65af\u51fd\u6570\u3002\u9ad8\u65af\u6ee4\u6ce2\u5728\u53bb\u9664\u56fe\u50cf\u4e2d\u7684\u566a\u58f0\u3001\u6a21\u7cca\u5904\u7406\u3001\u8fb9\u7f18\u68c0\u6d4b\u7b49\u65b9\u9762\u6709\u7740\u5e7f\u6cdb\u7684\u5e94\u7528\u3002

    \u9ad8\u65af\u6ee4\u6ce2\u7684\u6838\u5fc3\u601d\u60f3\u662f\u5bf9\u56fe\u50cf\u4e2d\u7684\u6bcf\u4e2a\u50cf\u7d20\u70b9\u8fdb\u884c\u52a0\u6743\u5e73\u5747\uff0c\u5176\u4e2d\u6743\u503c\u662f\u7531\u4e8c\u7ef4\u9ad8\u65af\u51fd\u6570\u786e\u5b9a\u7684\u3002\u8fd9\u610f\u5473\u7740\u79bb\u4e2d\u5fc3\u50cf\u7d20\u8d8a\u8fdc\u7684\u50cf\u7d20\u5bf9\u4e2d\u5fc3\u50cf\u7d20\u7684\u5f71\u54cd\u8d8a\u5c0f\uff0c\u8fd9\u79cd\u6743\u503c\u7684\u5206\u5e03\u7b26\u5408\u9ad8\u65af\u5206\u5e03\u3002\u901a\u8fc7\u8c03\u6574\u9ad8\u65af\u51fd\u6570\u7684\u6807\u51c6\u5dee\\(\u03c3\\)\uff0c\u53ef\u4ee5\u63a7\u5236\u6743\u503c\u7684\u5206\u5e03\u8303\u56f4\uff0c\u4ece\u800c\u8c03\u6574\u6ee4\u6ce2\u6548\u679c\u3002

    "},{"location":"DIP/filter/filter/#1_1","title":"(1)\u6570\u5b66\u8868\u8fbe","text":"
    • \u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u4e8c\u7ef4\u9ad8\u65af\u51fd\u6570\u8868\u793a\u4e3a\\(f(x,y)=\\frac{1}{\\sqrt{2\\pi}\\sigma_x}e^{-\\frac{(x-\\mu_x)^2}{2\\sigma_x^2}}\\cdot \\frac{1}{\\sqrt{2\\pi}\\sigma_y}e^{-\\frac{(y-\\mu_y)^2}{2\\sigma_y^2}}\\)

    \u5728\u56fe\u50cf\u6ee4\u6ce2\u4e2d,\u4e00\u822c\u60c5\u51b5\u4e0b\\(\u03bc_x = \u03bc_y = 0\\)\u56e0\u6b64\u4e8c\u7ef4\u9ad8\u65af\u51fd\u6570\u53ef\u8868\u793a\u4e3a\\(f(x,y)=\\frac{1}{2\\pi\\sigma^2}e^{-\\frac{x^2+y^2}{2\\sigma^2}}\\)

    "},{"location":"DIP/filter/filter/#2_1","title":"(2)\u6ee4\u6ce2\u8fc7\u7a0b","text":"
    • \u9ad8\u65af\u6838\u7684\u6c42\u89e3\uff1a

    \u5c06\u5404\u4e2a\u4f4d\u7f6e\u7684\u5750\u6807\u4ee3\u5165\u5230\u9ad8\u65af\u51fd\u6570\u4e2d,\u5f97\u5230\u7684\u503c\u5c31\u662f\u521d\u6b65\u7684\u9ad8\u65af\u6838

    • \u5f52\u4e00\u5316\uff1a

    "},{"location":"DIP/filter/filter/#3","title":"(3) \u5206\u79bb\u5b9e\u73b0\u9ad8\u65af\u6ee4\u6ce2","text":"

    \u5229\u7528\u9ad8\u65af\u51fd\u6570\u8fdb\u884c\u5377\u79ef(\u9ad8\u65af\u6ee4\u6ce2)\u7684\u8fc7\u7a0b\u5177\u6709\u53ef\u5206\u79bb\u6027\u3002

    "},{"location":"DIP/filter/filter/#_7","title":"\u53cc\u8fb9\u6ee4\u6ce2","text":"

    \u53cc\u8fb9\u6ee4\u6ce2\uff08Bilateral filter\uff09\u662f\u4e00\u79cd\u975e\u7ebf\u6027\u7684\u6ee4\u6ce2\u65b9\u6cd5\uff0c\u662f\u7ed3\u5408\u56fe\u50cf\u7684\u7a7a\u95f4\u90bb\u8fd1\u5ea6\u548c\u50cf\u7d20\u503c\u76f8\u4f3c\u5ea6\u7684\u4e00\u79cd\u6298\u8877\u5904\u7406\uff0c\u540c\u65f6\u8003\u8651\u7a7a\u57df\u4fe1\u606f\u548c\u7070\u5ea6\u76f8\u4f3c\u6027\uff0c\u8fbe\u5230\u4fdd\u8fb9\u53bb\u566a\u7684\u76ee\u7684\u3002\u5177\u6709\u7b80\u5355\u3001\u975e\u8fed\u4ee3\u3001\u5c40\u90e8\u7684\u7279\u70b9

    • \u53bb\u566a\uff0c\u5e73\u6ed1\uff0c\u4fdd\u7559\u8fb9\u7f18

    \u53cc\u8fb9\u6ee4\u6ce2\u5668\u7684\u597d\u5904\u662f\u53ef\u4ee5\u505a\u8fb9\u7f18\u4fdd\u5b58\uff08edge preserving\uff09\uff0c\u4e00\u822c\u7528\u9ad8\u65af\u6ee4\u6ce2\u53bb\u964d\u566a\uff0c\u4f1a\u8f83\u660e\u663e\u5730\u6a21\u7cca\u8fb9\u7f18\uff0c\u5bf9\u4e8e\u9ad8\u9891\u7ec6\u8282\u7684\u4fdd\u62a4\u6548\u679c\u5e76\u4e0d\u660e\u663e\u3002\u53cc\u8fb9\u6ee4\u6ce2\u5668\u987e\u540d\u601d\u4e49\u6bd4\u9ad8\u65af\u6ee4\u6ce2\u591a\u4e86\u4e00\u4e2a\u9ad8\u65af\u65b9\u5deesigma\uff0dd\uff0c\u5b83\u662f\u57fa\u4e8e\u7a7a\u95f4\u5206\u5e03\u7684\u9ad8\u65af\u6ee4\u6ce2\u51fd\u6570\uff0c\u6240\u4ee5\u5728\u8fb9\u7f18\u9644\u8fd1\uff0c\u79bb\u7684\u8f83\u8fdc\u7684\u50cf\u7d20\u4e0d\u4f1a\u592a\u591a\u5f71\u54cd\u5230\u8fb9\u7f18\u4e0a\u7684\u50cf\u7d20\u503c\uff0c\u8fd9\u6837\u5c31\u4fdd\u8bc1\u4e86\u8fb9\u7f18\u9644\u8fd1\u50cf\u7d20\u503c\u7684\u4fdd\u5b58\u3002\u4f46\u662f\u7531\u4e8e\u4fdd\u5b58\u4e86\u8fc7\u591a\u7684\u9ad8\u9891\u4fe1\u606f\uff0c\u5bf9\u4e8e\u5f69\u8272\u56fe\u50cf\u91cc\u7684\u9ad8\u9891\u566a\u58f0\uff0c\u53cc\u8fb9\u6ee4\u6ce2\u5668\u4e0d\u80fd\u591f\u5e72\u51c0\u7684\u6ee4\u6389\uff0c\u53ea\u80fd\u591f\u5bf9\u4e8e\u4f4e\u9891\u4fe1\u606f\u8fdb\u884c\u8f83\u597d\u7684\u6ee4\u6ce2

    • \u5f15\u5165\u4e86\u5feb\u901f\u5085\u7acb\u53f6\u53d8\u6362\u624d\u5b9e\u73b0\u4e86\u52a0\u901f!
    "},{"location":"DIP/filter/filter/#brute-force-implementation","title":"Brute-force Implementation","text":"
    • Nonlinear

    • Complex, spatially varying kernels

    • Cannot be pre-computed

    • Brute-force implementation is slow > 10min

    "},{"location":"DIP/filter/filter/#1_2","title":"(1)\u6570\u5b66\u63a8\u5bfc","text":"

    \\(h(x)=k_r^{\u22121}(x)\u222b^{+\u221e}_{\u2212\u221e}\u222b^{+\u221e}_{\u2212\u221e}f(\u03be)c(\u03be,x)s(f(\u03be),f(x))d\u03be\\)

    \\(c(\u03be,x)=\\frac{1}{2\\pi\\sigma_s^2}e^{-\\frac{||\u03be-x||^2}{2\\sigma_s^2}}\\)

    \\(s(f(\u03be),f(x))=\\frac{1}{2\\pi\\sigma_r^2}e^{-\\frac{||f(\u03be)-f(x)||^2}{2\\sigma_r^2}}\\)

    • \\(Which\\) \\(is\\) \\(BF[I]p=\\frac{1}{W_p}\\sum_{q\\in S}G_{\\sigma_s}(||p-q||)G_{\\sigma_r}(|O_p-I_q|)I_q\\) !!!

    • \\(\\frac{1}{W_p}\\)\u4e3a\u5f52\u4e00\u5316\u56e0\u5b50

    "},{"location":"DIP/filter/filter/#2_2","title":"(2)\u53c2\u6570\u8bbe\u7f6e","text":"
    • \\(\u03c3_s\\) \u8d8a\u5927\uff0c\u56fe\u50cf\u8d8a\u5e73\u6ed1\uff0c\u8d8b\u4e8e\u65e0\u7a77\u5927\u65f6\uff0c\u6bcf\u4e2a\u6743\u91cd\u90fd\u4e00\u6837\uff0c\u7c7b\u4f3c\u5747\u503c\u6ee4\u6ce2.

    \\(\u03c3_s\\) \u8d8a\u5c0f\uff0c\u4e2d\u5fc3\u70b9\u6743\u91cd\u8d8a\u5927\uff0c\u5468\u56f4\u70b9\u6743\u91cd\u8d8a\u5c0f\uff0c\u5bf9\u56fe\u50cf\u7684\u6ee4\u6ce2\u4f5c\u7528\u8d8a\u5c0f\uff0c\u8d8b\u4e8e\u96f6\u65f6\uff0c\u8f93\u51fa\u7b49\u540c\u4e8e\u539f\u56fe.

    • \\(\u03c3_r\\) \u8d8a\u5927\uff0c\u8fb9\u7f18\u8d8a\u6a21\u7cca\uff0c\u6781\u9650\u60c5\u51b5\u4e3a\\(\u03c3_r\\) \u65e0\u7a77\u5927\uff0c\u503c\u57df\u7cfb\u6570\u8fd1\u4f3c\u76f8\u7b49(\u5ffd\u7565\u5e38\u6570\u65f6\uff0c\u5c06\u8fd1\u4e3a \\(e_0 = 1\\))\uff0c\u4e0e\u9ad8\u65af\u6a21\u677f(\u7a7a\u95f4\u57df\u6a21\u677f)\u76f8\u4e58\u540e\u53ef\u8ba4\u4e3a\u7b49\u6548\u4e8e\u9ad8\u65af\u6ee4\u6ce2.

    \\(\u03c3_r\\) \u8d8a\u5c0f\uff0c\u8fb9\u7f18\u8d8a\u6e05\u6670\uff0c\u6781\u9650\u60c5\u51b5\u4e3a \\(\u03c3_r\\) \u65e0\u9650\u63a5\u8fd1 0\uff0c\u503c\u57df\u7cfb\u6570\u9664\u4e86\u4e2d\u5fc3\u4f4d\u7f6e\uff0c\u5176\u4ed6\u8fd1\u4f3c\u4e3a 0(\u63a5\u8fd1 \\(e_\u221e = 0\\))\uff0c\u4e0e\u9ad8\u65af\u6a21\u677f(\u7a7a\u95f4\u57df\u6a21\u677f)\u76f8\u4e58\u8fdb\u884c\u6ee4\u6ce2\u7684\u7ed3\u679c\u7b49\u6548\u4e8e\u539f\u56fe\u50cf.

    "},{"location":"DIP/filter/filter/#how-to-set-the-parameters","title":"How to Set the Parameters","text":"

    Depends on the application. For instance:

    • space parameter: proportional to image size

    e.g., 2% of image diagonal

    • intensity parameter: proportional to edge amplitude

    e.g., mean or median of image gradients

    • independent of resolution and exposure

    • Iterating the Bilateral Filter

    "},{"location":"DIP/filter/filter/#bilateral-filtering-color-images","title":"Bilateral Filtering Color Images","text":""},{"location":"DIP/filter/filter/#denoising","title":"Denoising","text":"
    • Small spatial sigma (e.g. 7x7 window)

    • Adapt intensity sigma to noise level

    • Maybe not best denoising method, but best simplicity/quality trade-off
    • No need for acceleration (small kernel)But the denoising feature in e.g. Photoshop is better
    "},{"location":"DIP/filter/filter/#tone-mapping","title":"Tone mapping","text":"
    • Match limited contrast of the medium
    • Preserve details
    "},{"location":"DIP/filter/filter/#disadvantages","title":"Disadvantages","text":"
    • Nonlinear
    • Vompex spatially varying kernels
    • Connot be pre-computed
    • Brute-force implementation is slow
    • \u68af\u5ea6\u7ffb\u8f6c
    "},{"location":"DIP/filter/filter/#a-fast-approximation-of-the-bilateral-filter-using-a-signal-processing-approach","title":"A Fast Approximation of the bilateral filter using a signal processing approach","text":""},{"location":"DIP/filter/filter/#preknowledge","title":"PreKnowledge","text":"

    \u5377\u79ef\u5b9a\u7406\u544a\u8bc9\u6211\u4eec\uff0c\u5728\u9891\u57df\u4e2d\uff0c\u5377\u79ef\u7b49\u4ef7\u4e8e\u76f8\u4e58\u3002\u6240\u4ee5\uff0c\u5728\u9891\u57df\u4e2d\uff0c\u56fe\u50cf F(u,v*) \u4e0e\u6ee4\u6ce2\u6838 Hb(u,v)\u7684\u5377\u79ef\u7ed3\u679c G(u,v)\u53ef\u4ee5\u8868\u793a\u4e3a\uff1a

    \\(G(u,v)=F(u,v)\u22c5H_b(u,v)\\)

    \u53c2\u8003 https://blog.csdn.net/xijuezhu8128/article/details/111304006

    \u5176\u57fa\u672c\u601d\u60f3\u5c31\u662f\u5c06\u975e\u7ebf\u6027\u7684\u53cc\u8fb9\u6ee4\u6ce2\u6539\u6210\u53ef\u5206\u79bb\u7684\u7ebf\u6027\u64cd\u4f5c\u548c\u975e\u7ebf\u6027\u64cd\u4f5c\u3002\u6362\u53e5\u8bdd\u8bf4\uff0c\u539f\u6765\u7684\u53cc\u8fb9\u6ee4\u6ce2\u5728\u56fe\u50cf\u4e0d\u540c\u4f4d\u7f6e\u5e94\u7528\u4e0d\u540c\u7684\u6743\u91cd\uff0c\u4e5f\u5c31\u662f\u4f4d\u79fb\u6539\u53d8\u5377\u79ef\uff0c\u4ed6\u4eec\u901a\u8fc7\u589e\u52a0\u4e00\u4e2a\u7ef4\u5ea6\uff0c\u4e5f\u5c31\u662f\u5c06\u7070\u5ea6\u503c\u4f5c\u4e3a\u4e00\u4e2a\u65b0\u7684\u7ef4\u5ea6\uff0c\u5c06\u53cc\u8fb9\u6ee4\u6ce2\u8868\u8fbe\u62103D\u7a7a\u95f4\u4e2d\u7684\u7ebf\u6027\u4f4d\u79fb\u4e0d\u53d8\u5377\u79ef\uff0c\u6700\u540e\u518d\u6267\u884c\u975e\u7ebf\u6027\u7684\u5f52\u4e00\u5316\u64cd\u4f5c\u3002

    "},{"location":"DIP/filter/filter/#derivation","title":"Derivation","text":"

    (1\uff09 \u9996\u5148\u5c06\u539f\u59cb\u53cc\u8fb9\u6ee4\u6ce2\u516c\u5f0f\u7b49\u5f0f\u5de6\u53f3\u7686\u5de6\u4e58\\(W_p^b\\)\uff0c\u5e76\u5c06\u4e24\u4e2a\u516c\u5f0f\u901a\u8fc7\u4e8c\u7ef4\u5411\u91cf\u8868\u8fbe\u6210\u5355\u4e2a\u516c\u5f0f\uff1a

    \uff082\uff09\u7b49\u5f0f\u53f3\u4fa7\u4e58\u4ee5\\(W_q\\)\uff0c\\(W_q\\)=1\uff1a

    \u4e0a\u56fe\u4e2d\uff0c\u5982\u679c\u5ffd\u7565\u7b49\u5f0f\u53f3\u4fa7\u7684\\(G_{\\sigma_r}(|I_p-I_q|)\\)\u8fd9\u4e00\u9879\uff0c\u90a3\u4e48\u8be5\u7b49\u5f0f\u8868\u8fbe\u7684\u5c31\u662f\u7ecf\u5178\u7684\u9ad8\u65af\u6ee4\u6ce2

    \u53ef\u4ee5\u7b80\u5199\u4e3a\u4ee5\u4e0b\u5377\u79ef\u7684\u5f62\u5f0f\uff1a\\(\\begin{pmatrix}W^bI^b\\\\W^b\\end{pmatrix}=G_{\\sigma_r}*\\begin{pmatrix}WI\\\\W\\end{pmatrix}\\)

    \uff083\uff09\u589e\u7ef4\uff0c\u589e\u52a0\u5f3a\u5ea6\u7ef4\uff08\u4e5f\u5c31\u662f\u7070\u5ea6\u503c\uff09\uff1a

    \u4f7f\u7528\\(Kronecker\\)\u51fd\u6570\uff0c\\(\\delta\\)\u53ea\u5728\\(0\\)\u70b9\u4e3a\\(1\\)\uff0c\u5176\u4ed6\u4e3a0

    THUS

    \u4e0a\u5f0f\u53ef\u4ee5\u8868\u8fbe\u4e3a\u5728\u70b9\uff08\\(p\\), \\(I_p\\)\uff09\u4f4d\u7f6e\u5904\u4e09\u7ef4\u5377\u79ef\u7684\u5f62\u5f0f\uff1a

    \uff085\uff09\u6574\u4e2a\u6d41\u7a0b\uff1a\u7ebf\u6027\u5377\u79ef+\u975e\u7ebf\u6027\u5f52\u4e00\u5316

    \u5728\u8fd9\u4e2a\u8fc7\u7a0b\u4e2d\uff0c\u4e3b\u8981\u7684\u52a0\u901f\u6765\u81ea\u4e8e\u5728\u9891\u57df\u4e2d\u6267\u884c\u5377\u79ef\u64cd\u4f5c\u3002\u9891\u57df\u5377\u79ef\u901a\u5e38\u6bd4\u65f6\u57df\u5377\u79ef\u66f4\u5feb\uff0c\u5c24\u5176\u662f\u5728\u4f7f\u7528\u5feb\u901f\u5085\u91cc\u53f6\u53d8\u6362\uff08FFT\uff09\u7b49\u9ad8\u6548\u7b97\u6cd5\u65f6\u3002

    "},{"location":"DIP/filter/filter/#guided-filter","title":"Guided Filter","text":"
    • \u4fdd\u6301\u68af\u5ea6\u662fbilateral\uff08\u4fdd\u6301\u7684\u662f\u68af\u5ea6\u7684\u7edd\u5bf9\u503c\uff09\u505a\u4e0d\u5230\u7684\uff0c\u56e0\u4e3a\u4f1a\u6709\u68af\u5ea6\u7ffb\u8f6c\u73b0\u8c61\uff08Preserves edges, but not gradients\uff09\u800c\u5bfc\u5411\u6ee4\u6ce2\u53ef\u4ee5\u907f\u514d\u8fd9\u4e00\u7f3a\u70b9

    \u5f15\u5165 guided image \\(I\\)

    • \u4fdd\u6301\u68af\u5ea6\uff0cso \\(q_i(output\\ image)=aI_i(guided\\ image)+b\\)

    • Use Lagrange multiplier method , we can get \\(a=\\frac{cov(I,p)}{var(I)+\\epsilon} \\ \\ \\ b=\\bar{p}-a\\bar{I}\\)

    • \\(\\epsilon\\) -- Degree of edge preserving !!

    • No Distortion

    • Limitation : LOCAL FILTER

    \u5bf9\u8fb9\u7f18\u7684\u5b9a\u4e49\u4e0d\u6e05\u6dc5\uff0c\u800c\u4e14\u8fb9\u7f18\u662f context-dependent \u7684\u3002\u8089\u773c\u4e2d\u7684\u8fb9\u754c\uff0c\u53ef\u80fd\u4e0d\u88ab\u8ba4\u4e3a\u662f\u8fb9\u754c\uff0c\u6700\u7ec8\u8fd8\u662f\u4f1a\u51fa\u73b0 halo \u7684\u73b0\u8c61\u3002

    "},{"location":"DIP/filter/filter/#sparse-norm-filter","title":"Sparse Norm Filter","text":"

    https://note.hobbitqia.cc/dip/dip9/#core-algorithm

    "},{"location":"DIP/filter/filter/#p1","title":"p=1","text":"

    \\(l^1\\) norm filter is the median filter(\u4e2d\u503c\u6ee4\u6ce2)

    • Because the diffusion in SNF is non-local, it is less likely to be trapped as in gradient descent based algorithms.
    "},{"location":"DIP/filter/filter/#p2","title":"p=2","text":"

    \\(l^2\\) norm mean filter(\u5747\u503c\u6ee4\u6ce2)

    "},{"location":"DIP/morph/morph/","title":"Morph","text":"

    Morph is not warp (geometric transformation)Morph is a kind of morphological changing, which makes an image change to another image gradually. Morph handles both the location and the intensity of a pixel.The beginning image and end image are two key frames. Other frames between the two key frames are generated automatically.

    • \u5927\u5c0f\u76f8\u540c\u7684\u4e24\u5e45\u56fe\u7684\u8f6c\u6362\u4f5c\u9759\u6001\u53d8\u6362\u4ece\u4e00\u5e45\u56fea\u9010\u6e10\u53d8\u5316\u6210\u7b2c\u4e8c\u5e45\u56feb
    • \u539f\u7406\uff1a\u8ba9\u56fea\u4e2d\u6bcf\u4e2a\u50cf\u7d20\u7684\u989c\u8272\uff0c\u9010\u6e10\u53d8\u6210\u56feb\u76f8\u540c\u4f4d\u7f6e\u50cf\u7d20\u7684\u989c\u8272
    • \u65b9\u6cd5\uff1a\u6839\u636e\u53d8\u6362\u7684\u5feb\u6162\uff0c\u8bbe\u7f6e\u76f8\u5e94\u7684\u6b65\u957f\uff0c\u5c06\u56fea\u6bcf\u4e00\u70b9\u7684RGB\u9010\u6e10\u53d8\u6210\u56feb\u76f8\u540c\u4f4d\u7f6e\u8c61\u7d20\u7684RGB,\u53ef\u4ee5\u9009\u62e9\u7b49\u6bd4\u6216\u7b49\u5dee\u7684\u65b9\u5f0f\uff0c\u6216\u5176\u5b83\u65b9\u5f0f\u8ba9\uff1a\\(ra-->rb\\)
    • \u5bf9\u4e8e\u7070\u5ea6\u56fe\u50cf\uff0c\u53ef\u4ee5\u76f4\u63a5\u7528\u7b49\u6bd4\u6216\u7b49\u5dee\u7ea7\u6570\u5b9a\u4e49\u6b65\u957f\uff0c\u4f7f\u989c\u8272\u4ece\u539f\u56fe\u53d8\u5230\u76ee\u6807\u56fe\u3002

    • \u5bf9\u4e8e\u5f69\u8272\u56fe\u50cf\uff0cRGB\u4e09\u8272\u540c\u65f6\u4ece\u539f\u56fe\u53d8\u5230\u76ee\u6807\u56fe\u50cf\u3002\u53ef\u4ee5\u5206\u522b\u53d8\u5316\uff0c\u4e5f\u53ef\u8003\u8651RGB\u7684\u76f8\u5bf9\u6bd4\u4f8b\u5173\u7cfb\u540c\u65f6\u53d8\u5316\u3002

    • \u9009\u62e9\u4e24\u5e45\u7ed3\u6784\u76f8\u4f3c\u3001\u5927\u5c0f\u76f8\u540c\u7684\u753b\u9762\u4f5c\u4e3a\u8d77\u59cb\u548c\u7ed3\u675f\u5173\u952e\u5e27\uff0c\u8fd9\u6837\u624d\u80fd\u6bd4\u8f83\u5bb9\u6613\u5730\u5b9e\u73b0\u81ea\u7136\u3001\u8fde\u7eed\u7684\u4e2d\u95f4\u53d8\u5f62\u8fc7\u7a0b\u3002

    • \u5728\u8d77\u59cb\u548c\u7ed3\u675f\u753b\u9762\u4e0a\u786e\u5b9a\u548c\u52fe\u753b\u51fa\u5404\u90e8\u5206\uff08\u4e3b\u8981\u8f6e\u5ed3\uff09\u7684\u7ed3\u6784\u5bf9\u5e94\u5173\u7cfb\uff0c\u4e5f\u5373\u4ece\u8d77\u59cb\u753b\u9762\u4e0a\u7684\u4e00\u4e2a\u70b9\u53d8\u5230\u7ed3\u675f\u753b\u9762\u4e0a\u7684\u53e6\u4e00\u4e2a\u5bf9\u5e94\u70b9\u7684\u4f4d\u7f6e\uff0c\u8fd9\u662f\u53d8\u5f62\u8fd0\u7b97\u6240\u9700\u8981\u7684\u53c2\u6570

    \u6839\u636e\u9700\u8981\uff0c\u5bf9\u5e94\u70b9\u7684\u4f4d\u7f6e\u53ef\u4ee5\u4efb\u610f\u79fb\u52a8\u3002\u8c03\u6574\u8d77\u59cb\u5e27\u7684\u5bf9\u5e94\u70b9\u4f4d\u7f6e\uff0c\u53ef\u4ee5\u6a21\u62df\u6444\u50cf\u4e2d\u7684\u955c\u5934\u6e10\u53d8\u6548\u679c

    "},{"location":"DIP/morph/morph/#morph-based-on-segment-two-points","title":"Morph based on segment (two points)","text":""},{"location":"DIP/morph/morph/#morph-based-on-grid","title":"Morph based on grid","text":"
    • \u89c6\u70b9\u53d8\u6362\u5c31\u662f\u6c42\u5728\u89c6\u70b9\u79fb\u52a8\u540e\u539f\u59cb\u56fe\u50cf\u53d8\u6362\u751f\u6210\u7684\u65b0\u89c6\u56fe

    • \u5728\u7528\u76f8\u673a\u62cd\u6444\u7269\u4f53\u65f6\uff0c\u4fdd\u6301\u7269\u4f53\u7684\u4f4d\u7f6e\u4e0d\u52a8\uff0c\u800c\u5c06\u76f8\u673a\u79fb\u79bb\u7269\u4f53\uff0c\u8fd9\u5c31\u76f8\u5f53\u4e8e\u89c6\u70b9\u53d8\u6362

    • \u5982\u679c\u6211\u4eec\u4fdd\u6301\u76f8\u673a\u56fa\u5b9a\u4f4d\u7f6e\uff0c\u5c06\u7269\u4f53\u79fb\u79bb\u76f8\u673a\uff0c\u8fd9\u5c31\u76f8\u5f53\u4e8e\u6a21\u578b\u8f6c\u6362\u3002\u89c6\u70b9\u53d8\u5f62\u8981\u6c42\u5bf9\u7269\u4f53\u6709\u4e09\u7ef4\u5750\u6807\u77e5\u8bc6\u3002

    "},{"location":"DIP/morph/morph/#application","title":"Application","text":"

    Expressive Expression Mapping with Ratio Images

    "},{"location":"DIP/morph/morph/#lambertian-model","title":"Lambertian model","text":"

    Assume there are m point light sources:

    \\(I=\\rho\\sum_{1\\le i\\le m}S_iI_in\u00b7l_i=\\rho E(n)\\)

    \\(S_i=\\left\\{\\begin{array}{ll}0 & \\text{if the point cannot be seen from light i }\\\\1& \\text{Otherwise}\\end{array}\\right.\\)

    • \u5176\u4e2d \\(l_i\\) \u7b2c i \u4e2a\u5149\u6e90\u7167\u8fc7\u6765\u7684\u89d2\u5ea6

    • \\(n\\) \u8868\u793a\u5f53\u524d\u8fd9\u4e2a\u66f2\u9762\u7684\u6cd5\u5411\u91cf\uff0c\u6240\u4ee5\\(n\u00b7l_i\\)\u76f8\u5f53\u4e8e\u4f59\u5f26\u5173\u7cfb

    • \\(I_i\\) \u8868\u793a\u7b2c i \u4e2a\u5149\u6e90\u7684\u4eae\u5ea6

    • \\(S_i\\)\u8868\u793a\u66f2\u9762\u80fd\u4e0d\u80fd\u88ab\u7b2c i \u4e2a\u70b9\u5149\u6e90\u7167\u5230

    • \\(\\rho\\) \u8868\u793a\u66f2\u9762\u7684\u6750\u8d28

    "},{"location":"DIP/morph/morph/#expression-ratio-image","title":"Expression ratio image","text":"
    • Before deformation \\(I=\\rho E(n)\\)
    • After deformation \\(I'=\\rho E(n')\\)
    • Expression ratio image \\(\\frac{I'}{I}=\\frac{E(n')}{E(n)}\\)
    "},{"location":"DIP/morph/morph/#surface-deformation-mapping","title":"Surface deformation mapping","text":"
    • Assumption : HUman faces have approxiamtely the same normals
    "},{"location":"DIP/morph/morph/#algorithm","title":"Algorithm","text":""},{"location":"DIP/morph/morph/#image-alignment","title":"Image alignment","text":"
    • Use image wraping to obtain pixel correspondence
    "},{"location":"GP/AMAS/AMAS/","title":"Angular Momentum and Spin","text":"
    • Question \\(p_x=i\\bar{h}\\frac{\\partial}{\\partial x}\\)

    ?(12-17\u8bfe\u7a0b\u7ed3\u675f)

    The wave function of a particular quantum state of the hydrogen atom can be labeled by a set of quantum numbers \\((n, l, m_l)\\).

    • The corresponding energy only depends on the principal quantum number \\(n = 1,2,3,....\\)

    • The orbital quantum number \\(l = 0, 1, 2, . . . , n \u2212 1\\) is a measure of the magnitude of the angular momentum of the quantum state. States with \\(l = 0, 1, 2, 3\\) are called \\(s, p, d, f\\) .

    • The orbital magnetic quantum number

    \\(ml =\u2212l,\u2212l+1,...,l\u22121,l\\) is related to the space orientation of this angular momentum vector.

    "},{"location":"GP/AMAS/AMAS/#classical-loop-model-for-electron-orbits","title":"Classical Loop Model for Electron Orbits","text":"
    • Heuristically,\\(\u2206L_x,\u2206L_y\\) involves \\(\u2206_z,\u2206p_z\\), therefore cannot vanish due to the uncertainty principle. In other words, one cannot simultaneously measure any two components of \\(L\\). However, one can simultaneously measure \\(L^2\\) and \\(L_z\\) .
    • Quantized by \\(\\bar{h}\\)

    • We can measure definite values of a component \\(L_z\\) along a chosen measurement axis(usally taken to be a z axis) as given by \\(L_z=m_l\\bar{h}\\) for \\(m_l=0,\u00b11,\u00b12,\u2026\u2026\u00b1l\\)

    • In general , if the electron has a definite value of \\(L_z\\) it may not have definite values of \\(L_x\\) and \\(L_y\\)

    • This is a manifestation of Heisenberg's uncertainty principle.

    • Therefore, the orbital magnetic dipole moment is also quantized

    \\(\\mu_{orb}=|\\gamma|L=\\frac{e}{2m}\\sqrt{l(l+1)}\\bar{h}\\)

    \\(\\mu_{orb},z=\\gamma L_z=-m_l\\frac{e\\bar{h}}{2m}=-m_l\\mu_B\\)

    \u200b Define the Bohr magneton \\(\\mu_B=\\frac{eh}{4\\pi m}=\\frac{e\\bar{h}}{2m}=9.274*10^{-24}J/T\\)

    "},{"location":"GP/AMAS/AMAS/#dynamics-in-a-uniform-magnetic-field","title":"Dynamics in a Uniform Magnetic Field","text":"

    An external magnetic field B\u20d7 will rotate a magnetic dipole moment \u03bc\u20d7 with a total torque \\(\\vec{\\tau}=\\vec{\\mu}\\times\\vec{B}\\) , or, for an electron with orbital angular momentum \\(\\vec{L}\\) , \\(\\vec{\\tau}=\\frac{d\\vec{L}}{dt}=\\gamma\\vec{L}\\times\\vec{B}\\)

    "},{"location":"GP/AMAS/AMAS/#dipole-in-a-nonuniform-magnetic-field","title":"Dipole in a Nonuniform Magnetic Field","text":"

    \u300cdiphole parallel to the magnetic field.\u300d

    "},{"location":"GP/AMAS/AMAS/#the-stern-gerlach-experiment","title":"The Stern-Gerlach Experiment","text":"

    In the Stern-Gerlach experiment, a narrow beam of silver atoms passes through an electromagnet (with a nonuniform magnetic field) and then lands on a glass detector plate.

    • Classical View

    • In the old quantum theory by Bohr (and Sommerfeld)

    An atom in a state with angular momentum equal to one \\((L = 1)\\) would have a magnetic moment with two components relative to the direction of the magnetic field.

    In this case the spot on the receiving plate will therefore be split into two, each of them having the same size but half the intensity of the original spot.

    • In (Then) New Quantum Theory

    The later, or new, quantum theory developed by Heisenberg, Schroedinger, and others, predicted that for an \\(L = 1\\) state the beam should split into three components.

    In fact, we now know that a silver atom consists of many electrons ([Kr]4d105s1).

    We also know that all those magnetic moments vectorially cancel out except for a single electron \\((5s1)\\), and the orbital dipole moment of that electron is zero.

    Therefore, the Stern-Gerlach result posed a serious problem for the new quantum theory.

    This was solved when Uhlenbeck and Goudsmit (1925, 1926) proposed that the electron had an intrinsic angular momentum, not associated with its orbital motion.

    "},{"location":"GP/AMAS/AMAS/#spin","title":"Spin","text":"

    The Stern-Gerlach experiment belongs to a class of quantum phenomena involving a quantum degree of freedom called spin, which has no classical counterpart.

    Fortunately, one can describe spin and its dynamics without appealing to any mechanical model (such as that of a spinning top), starting with just the observed fact that it is a form of angular momentum.

    "},{"location":"GP/AMAS/AMAS/#electron-spin","title":"Electron Spin","text":"

    Every electron, whether trapped in an atom or free, has a spin angular momentum and a spin magnetic dipole moment that are as intrinsic as its mass and charge. The existence of electron spin was postulated on experimental evidence by George Uhlenbeck and Samuel Goudsmit from their studies of atomic spectra.

    For every electron, \\(spin s = 1/2\\) and the electron is said to be a \\(spin-1/2\\) particle. (Protons and neutrons are also \\(spin-1/2\\) particles.)

    As with the angular momentum associated with motion, spin angular momentum can have a definite magnitude but does not have a definite direction.

    The best we can do is to measure its component along the \\(z\\) axis (or along any axis), and that component can have only the definite values given by \\(S_z =m_s\\bar{h}, for\\ m_s =\u00b1s=\u00b11/2\\).

    Here \\(m_s\\) is the spin magnetic quantum number, which can have only two values: \\(m_s = +s = +1/2\\) (the electron is said to be spin up) and \\(m_s = \u2212s = \u22121/2\\) (the electron is said to be spin down).

    • The electron is not spinning
    • As with the orbital angular momentum, a magnetic dipole moment is associated with the spin angular momentum. Let us write \\(\\vec{\\mu}_s = g \u03b3\\vec{S}\\) where \\(\u03b3 = \u2212e/(2m)\\) and the constant g is referred to as the \\(g-factor\\).
    • It turns out that the spin angular momentum generates a magnetic moment twice as large as the orbital angular momentum does, i.e. g = 2.

    "},{"location":"GP/AMAS/AMAS/#nuclear-spin-and-magnetic-resonance","title":"Nuclear Spin and Magnetic Resonance","text":"
    • Such absorption is called magnetic resonance or, as originally, nuclear magnetic resonance (NMR).
    • In practice, the photons required for magnetic resonance have an associated frequency in the radio-frequency (RF)range.
    • NMR is usually detected by sweeping the magnitude \\(B_{ext}\\) through a range of values while the frequency \\(\u03c9\\) of the RF source is kept at a predetermined value and the energy loss of the RF source is monitored.

    Proton NMR, which studies the precession of the proton spin in the magnetic field, is a practical medical imaging technique.

    • A strong magnetic field produces partial polarization of the protons (hydrogen nuclei) in a human body.
    • A strong RF field is also imposed to excite some of the nuclear spins into their higher energy state.
    • When this strong RF signal is switched off, the spins tend to return to their lower state, producing a small amount of radiation at the Larmor frequency associated with that field.
    • The emission of radiation is associated with the \u201cspin relaxation\u201d of the protons from their excited state.
    • It induces a radio frequency (RF) signal in a detector coil which is amplified to display the NMR signal.

    Since the Larmor frequency depends on the applied magnetic field, placing a magnetic field gradient across the human body allows you to locate the source of the MRI signal (hence the name Magnetic Resonance Imaging).

    "},{"location":"GP/AMAS/AMAS/#spin-orbit-coupling","title":"Spin-Orbit Coupling","text":"
    • Crudely speaking, to the electron the nucleus appears to rotate around it and the moving nuclear charge or current creates a magnetic field \\(B^\u2217 \u221d L\\).

    Orbital motion cause relative motion of the nucleus to the electron ,creating a magnetic filed(connected with spin)

    • The spin\u2013orbit interaction Hamiltonian is given by \\(H_{SO}=\\epsilon_{nl}\\vec{L}\\vec{S}\\) where the spin-orbit coupling constant \\(\u03be_{nl}\\), which is positive, is essentially the averaged gradient of the Coulomb interaction.

    • To solve the Hamiltonian with such an interaction, we need to introduce the total angular momentum \\(\\vec{J}=\\vec{L}+\\vec{S}\\) and and use the expression \\(\\vec{J}\u00b7\\vec{J}=(\\vec{L}+\\vec{S})\u00b7(\\vec{L}+\\vec{S})=\\vec{S}\u00b7\\vec{S}+2\\vec{L}\u00b7\\vec{S}+\\vec{L}\u00b7\\vec{L}\\)

    • \\(S^2 =s(s+1)\\bar{h} \\\\ L^2 =l(l+1)\\bar{h}^2\\\\J^2=j(j+1)\\bar{h}^2\\)

    • \\(\\vec{L}\\vec{S}=\\frac{\\bar{h}^2}{2}[j(j+1)-l(l+1)-s(s+1)]\\)

    "},{"location":"GP/AMAS/AMAS/#the-pauli-exclusion-principle","title":"The Pauli Exclusion Principle","text":"

    For multiple electrons in the same trap, we must consider the Pauli exclusion principle, named after \\(Wolfgang\\ Pauli\\).

    The Pauli principle states that no two electrons confined to the same trap can have the same set of values for their quantum numbers.In other words, there can be two electrons at most at any energy level; they have opposite spins.

    This principle applies not only to electrons but also to protons and neutrons, all of which have \\(s = 1/2\\); they are known as fermions.

    A remark on fermions and bosons

    More generally, fermions are particles with half-integer spin s \\((i.e., s = 1/2, 3/2, etc.)\\). On the other hand, particles with integer s \\((i.e., s = 0, 1, 2, etc.)\\) are called bosons.

    Fermions follow the Pauli principle, but bosons do not.

    Many particles consisting of matter, such as electrons, protons, and neutrons (s = \u00bd for either of them) are fermions. On the other hand, photons(s = 1) are bosons.

    Regarding composite particles consisting of multiple fermions (such as atoms), those with odd number of fermions can behave as fermions while those with even number of fermions as bosons. (\\(^3He\\): \\(2p + 1n + 2e \u2192\\) fermion; \\(^4He: 2p + 2n + 2e\\) \u2192 boson)

    "},{"location":"GP/AMAS/AMAS/#the-helium-atom","title":"The Helium Atom","text":"

    The second simplest atom is the heliuxim atom, which has two 1s electrons (spin up and spin down) in the Coulomb potential of the charge 2e nucleus that obey time-independent Schroedinger\u2019s equation of the form \\((H_1+H_2+V_{12})\u03a8(\\vec{r_1},\\vec{r_2})=E\u03a8(\\vec{r_1},\\vec{r_2})\\) where \\(H_i=-\\frac{\\bar{h^2}}{2m}\\triangledown_i^2\uff08Kinetic\uff09-\\frac{2e^2}{4\\pi\\epsilon_0r_i}\uff08Potential\uff09\\ and\\ V_{12}=\\frac{e^2}{4\\pi\\epsilon_0|\\vec{r_1}-\\vec{r_2}|}\\)

    • An approximation starts from throwing away the interaction term, which we have not learned to deal with, i.e.,\\((H_1 + H_2) \u03a8_0 = E_0\u03a8_0\\),

    • The ground state of either \\(H_1\\) or \\(H_2\\) has an energy \\(\u22124E_R\\) (Because of two protons so raidus gets smaller)

    • and a wave function \\(\u03c8_{100}(\\vec{r})=\\frac{1}{\\pi}(\\frac{2}{a_B})^{3/2}e^{-2r/a_B}\\)

    • One may verify that \\(\u03a8_0(\\vec{r}_1,\\vec{r}_2)=\u03c8_{100}(\\vec{r_1})\u03c8_{100}(\\vec{r_2})\\) is an exact solution.

    • The corresponding energy is \\(E_0=-8E_R\\approx -109eV\\)

    Others pleae refer to the related PPT

    "},{"location":"GP/AMAS/AMAS/#shells-and-subshells","title":"Shells and Subshells","text":""},{"location":"GP/HA/HA/","title":"The Hydrogen Atom","text":"

    https://www.youtube.com/watch?v=-Y0XL-K0jy0

    https://youtube.com/watch?v=acN7E7AUHPk

    "},{"location":"GP/HA/HA/#quiz","title":"Quiz","text":"

    https://www.youtube.com/watch?v=9GOuZAh9Wg0

    "},{"location":"GP/HA/HA/#mystery-of-the-hydrogen-atom","title":"Mystery of the Hydrogen Atom","text":"

    Because the proton\u2019s mass is much greater than the electron\u2019s mass, we shall assume that the proton is fixed in place. So, the atom is a fixed potential trap with the electron moving around inside it.

    A hydrogen atom contains an electron that is trapped by the Coulomb force it experiences from the proton, which is the nucleus of the atom.

    Under Newtonian laws, the electron would move around the proton, like planets around the Sun, i.e. \\(\\frac{1}{4\\pi\\epsilon_0}\\frac{e^2}{r^2}=m\\frac{v^2}{r}\\)

    Multiplying by \u2212r, we obtain \\(E_c=-\\frac{e^2}{4\\pi \\epsilon _0 r}=-mv^2=-2E_k\\)

    Alternatively, the total energy of the electron is\\(E=E_k+E_c=\\frac{E_c}{2}=-E_k\\)

    However, any charged particle which moves in a curved path will emit electromagnetic radiation, hence losing energy continuously. Why doesn\u2019t the electrical attraction between the electron and the positive charge simply cause the two to collapse together?

    • One clue lies in the experimental fact that a hydrogen atom can emit and absorb only four wavelengths in the visible spectrum (656 nm, 486 nm, 434 nm, and 410 nm).
    "},{"location":"GP/HA/HA/#the-bohr-model-of-hydrogen-1913","title":"The Bohr Model of Hydrogen (1913)","text":"

    Bohr made two bold (and completely unjustified) assumptions:

    • The electron in a hydrogen atom orbits the nucleus in a circlemuch like Earth orbits the Sun.
    • The magnitude of the angular momentum \\(\\vec{L}\\) of the electron in its orbit is restricted (quantized) to the values \\(L = n\\bar{h}\\), for \\(n = 1,2,3,....\\)

    However, as successful as his theory was on the four visible wavelengths and on why the atom did not simply collapse, it turned out to be quite wrong in almost every other aspect of the atom.

    "},{"location":"GP/HA/HA/#physical-meaning-of-the-assumption","title":"Physical meaning of the assumption","text":"

    The de Broglie wavelength \\(\u03bb\\) of a free particle with momentum p is \\(\u03bb = h/p = h/mv\\).For an electron in a hydrogen atom whose orbital radius \\(r\\), the above equation leads to \\(\u03bb/r = h/rmv = h/L\\). Therefore, we obtain \\(2\u03c0r/\u03bb = L/\\bar{h}\\).

    \\(L=n\\bar{h}\\) means that the length of the orbit is an integer multiple of \\(\u03bb\\). Namely, the phase of the electron wave function returns to the initial value by moving for one cycle of the orbit.

    "},{"location":"GP/HA/HA/#analysis-based-on-bohrs-model","title":"Analysis based on Bohr\u2019s model","text":"
    • Bohr to quantize the electron orbit \\(L=rmv=n\\bar{h} \\Rightarrow v=\\frac{n\\bar{h}}{mr}\\)
    • Combining with the Newtonian result \\(\\frac{e^2}{4\\pi\\epsilon_0r^2}=m\\frac{v^2}{r}\\) we find \\(r_n =n^2a_B\\). where the characteristic length \\(a_B=\\frac{\\bar{h}^2}{me^2/(4\\pi\\epsilon_0)}=0.529 A\u030a\\)

    In the Bohr model of the hydrogen atom, the electron\u2019s orbital radius r is quantized and the smallest possible orbital radius (for \\(n = 1\\)) is \\(a_B\\), which is called the Bohr radius.

    • Can you obtain the length scale, alternatively, from dimension analysis?sIn order that the attraction between electron and nucleus does not simply collapse them together in the Bohr model, the electron should not get any closer to the nucleus than orbital radius aB by taking

    • The energy of the hydrogen atom, according to the Bohr model, is then \\(E_n=\\frac{1}{2}mv^2-\\frac{1}{4\\pi\\epsilon_0}\\frac{e^2}{r}=-\\frac{E_R}{n^2}\\) where \\(E_R=\\frac{me^4/(4\\pi\\epsilon_0)^2}{2\\bar{h}^2}=13.6eV\\)

    • We still have, for each orbit \\(E=E_k+E_c=\\frac{E_c}{2}=-E_k\\)
    "},{"location":"GP/HA/HA/#the-hydrogen-spectrum","title":"The Hydrogen Spectrum","text":"

    The energy of a hydrogen atom (or, equivalently, of its electron) changes when the atom emits or absorbs light. Emission and absorption involve a quantum of light according to \\(\\bar{h}\u03c9_{nm} =E_R(\\frac{1}{n^2} \u2212\\frac{1}{m^2})\\) for integers \\(m > n\\).

    The wavelengths of the emitted or absorbed light are given by $ \\frac{1}{\\lambda}=\\frac{E_R}{hc}(\\frac{1}{n^2}-\\frac{1}{m^2})$

    • \\(1\\ \u00c5ngstr\u00f6m - 1\u00d710^{\u221210}m\\)
    "},{"location":"GP/HA/HA/#combinations-of-physical-constants","title":"Combinations of Physical Constants","text":""},{"location":"GP/HA/HA/#gs-energy-from-uncertainty-principleground-state","title":"GS Energy from Uncertainty Principle[Ground State]","text":"

    The ground-state energy is the lowest energy allowed by Heisenberg\u2019s uncertainty principle.

    • For a hydrogen atom, the size of the wave function, \\(\u2206r\\), is the uncertainty in position.
    • The uncertainty in momentum is, roughly speaking, \\(\u2206p \u223c \\bar{h}/\u2206r\\), by the uncertainty principle.
    • The energy of the electron can be estimated to be \\(E \u223c \\frac{(\\triangle p)^2}{2m}-\\frac{e^2}{4\\pi\\epsilon_0\\triangle r}=\\frac{\\bar{h}^2}{2m(\\triangle r)^2}-\\frac{e^2}{4\\pi\\epsilon_0\\triangle r}\\)\\((Mean(p)=0\\ Thus\\ use\\ \\triangle p\\ to\\ approximate\\ p)\\)

    To find the minimal energy, we solve for \\(\\triangle r\\) \\(\\Rightarrow\\frac{dE}{d(\\triangle r)}=0 \\Rightarrow \\triangle r = \\frac{\\bar{h}^2}{me^2/(4\\pi\\epsilon_0)}=a_B\\) and \\(E=-\\frac{me^4/(4\\pi\\epsilon_0)^2}{2\\bar{h}^2}=-E_R\\)

    The energy of the ground state (or any stationary state) is uniquely determined. \u300cThough the uncertainty of \\(t\\ \\&\\ x\\)\u300d

    This is because of the energy-time uncertainty principle, \\(\u2206t \u00b7 \u2206E \u2265 \\bar{h}/2\\).

    • In the extreme case of a stationary state, \\(\u2206t = \u221e\\), so we have \\(\u2206E = 0\\).

    Note, however, both kinetic energy and potential energy have uncertainties, due to the uncertainties of position and momentum.

    Hydrogen is a three-dimensional, finite electron trap, with walls that vary in depth with distance.

    "},{"location":"GP/HA/HA/#schroedingers-equation-for-the-h-atom","title":"Schroedinger's Equation for the H-atom","text":""},{"location":"GP/HA/HA/#derive","title":"Derive","text":""},{"location":"GP/HA/HA/#ground-state-wave-function","title":"Ground State Wave Function","text":"

    \\(\u03c8_{100}(\\vec{r})=R_{10}(r)=\\frac{1}{\\sqrt{\\pi}a_B^{3/2}}e^{\\frac{r}{a_B}}\\)

    Note that the hydrogen atom in its ground state has zero angular momentum (\\(l = 0\\) more details will be discussed in the next lecture), which is not predicted in the Bohr model.)

    The probability that the electron can be detected in any given (infinitesimal) volume element \\(dV\\) located at radius \\(r\\) from the center of the atom is \\(|\u03c8_{100}(\\vec{r})|^2dV.\\)

    • Define radial Probability density \\(P(r)\\) such that \\(P(r)dr=|\u03c8_{100}(\\vec{r})|^2dV\\ (dV=4\\pi r^2)\\)
    • \\(P(r)\\) takes a maximum at \\(r=a_B\\)
    • All we can ever know abount the location of the electron in the ground state of the hydrogen atom is the radial probability density
    • Dot Plot
    "},{"location":"GP/HA/HA/#excited-states-of-the-hydrogen-atom","title":"Excited States of the Hydrogen Atom","text":""},{"location":"GP/HA/HA/#bohrs-correspondence-principle","title":"Bohr\u2019s Correspondence Principle","text":""},{"location":"GP/Polar/Polarization/","title":"Polarization","text":""},{"location":"GP/Polar/Polarization/#preknowledge","title":"PreKnowledge","text":"
    • consider \\(cos(kx+wt)\\) and \\(cos(kx-wt)\\)
    • \\(cos(kx+wt)\\) propagate along -x axis
    • \\(cos(kx-wt)\\) propogate along +x axis
    • Linear Waves
    "},{"location":"GP/Polar/Polarization/#polarization","title":"Polarization","text":"

    To observe interference of the two waves

    • two beams must have (nearly) the same frequency \u03c9
    • interfering waves have comparable amplitude
    • the phase difference between sources must remains constant.

    In this lecture we consider the direction of \\(\\vec{E}\\)

    Light is a transverse electromagnetic wave. Thus far we have considered only light for which the orientation of the electric field is constant, although its magnitude and sign vary in time.

    In general, we can consider two such harmonic lightwaves of the same frequency, moving through the same region of space, in the same direction \\(\\hat{z}\\)

    \\(\\vec{E}_x(z,t)=\\hat{i}E_{0x}cos(kz\u2212\u03c9t)\\)

    \\(\\vec{E}_y(z,t)=\\hat{j}E_{0y}cos(kz\u2212\u03c9t+\\epsilon)\\)

    "},{"location":"GP/Polar/Polarization/#polarization-and-its-mathematical-description","title":"Polarization and Its Mathematical Description","text":""},{"location":"GP/Polar/Polarization/#linear-polarization","title":"Linear polarization","text":"

    If \\(\u03b5\\) is zero or an integral multiple of \\(\u00b12\u03c0\\), the resultant wave is \\(\\vec{E}=(\\hat{i}E_{0x}+\\hat{j}E_{0y})cos(kz-wt)\\)

    "},{"location":"GP/Polar/Polarization/#circular-polarization","title":"Circular polarization","text":"

    When both constituent waves have equal amplitudes and \\(\\epsilon=-\\pi/2+2m\\pi\\)(m is an integer) the resultant wave is \\(\\vec{E}=E_0(\\hat{i}cos(kz-wt)+\\hat{j}sin(kz-wt))\\)

    When both constituent waves have equal amplitudes and \\(\\epsilon=\\pi/2+2m\\pi\\)(m is an integer) the resultant wave is \\(\\vec{E}=E_0(\\hat{i}cos(kz-wt)-\\hat{j}sin(kz-wt))\\)

    The amplitude is unaffected, but \\(\\vec{E}\\) at a fixed z now rotates counterclockwise, and the wave is left-circularly polarized.

    A linearly polarized wave can be synthesized from two oppositely polarized circular waves of equal amplitude.

    "},{"location":"GP/Polar/Polarization/#a-math-description-of-polarization","title":"A Math Description of Polarization","text":"
    • Jones vector
    • Horizontal and vertical linearly polarized are thus given by

    \\(|H\u27e9=\\begin{pmatrix}1\\\\0\\end{pmatrix}\\\\|V\u27e9= \\begin{pmatrix}0\\\\1\\end{pmatrix}\\)

    • Linearly polarized at +45\u25e6 from the x-axis (diagonal) and at \u221245\u25e6 from the x-axis (anti-diagonal) are given by

    \\(|D\u27e9=\\frac{1}{\\sqrt{2}}(|H\u27e9+|V\u27e9)=\\frac{1}{\\sqrt{2}}\\begin{pmatrix}1\\\\1\\end{pmatrix}\\)

    \\(|A\u27e9=\\frac{1}{\\sqrt{2}}(|H\u27e9\u2212|V\u27e9)=\\frac{1}{\\sqrt{2}}\\begin{pmatrix}1\\\\-1\\end{pmatrix}\\)

    Note that we are only interested in polarization, so the vectors are normalized, or in one unit length

    • Right-circular light is given by

    \\(|R\u27e9=\\frac{1}{\\sqrt{2}}(|H\u27e9\u2212i|V\u27e9)=\\frac{1}{\\sqrt{2}}\\begin{pmatrix}1\\\\-i\\end{pmatrix}\\)

    • Left-circular light is given by

    \\(|L\u27e9=\\frac{1}{\\sqrt{2}}(|H\u27e9+i|V\u27e9)=\\frac{1}{\\sqrt{2}}\\begin{pmatrix}1\\\\i\\end{pmatrix}\\)

    "},{"location":"GP/Polar/Polarization/#orthogonal","title":"Orthogonal","text":"

    Note that in the lecture on interference, we discussed the addition in a two-dimensional real space \\(R_2\\). The space is also equivalent to a one-dimensional complex space \\(C_1\\), or a two-component real vector space.

    Now, with polarization, we have generalized the one-dimensional complex space \\(C_1\\) to a two-dimensional complex space \\(C2 = C1 \u2297 C1\\), or a two-component complex vector space (in Jones\u2019 vector representation). The additional \\(C_1\\) space is spanned by the two orthogonal, linearly polarized states \\(|H\u27e9\\) and \\(|V\u27e9\\).

    • Two vectors A\u20d7 and B\u20d7 are said to be orthogonal whenA\u20d7 \u00b7 B\u20d7 = 0.

    similarly, two complex vectors A\u20d7 and B\u20d7 are said to be orthogonal when \\(\u27e8A|B\u27e9 \u2261 \\vec{A}^{*} \u00b7 \\vec{B} = 0\\).

    • Any polarization state will have a corresponding orthogonal state.

    Notice that\\(\u27e8H|V\u27e9 = \u27e8D|A\u27e9 = \u27e8L|R\u27e9 = 0\\).

    As we have seen, any polarization state can be described by a linear combination of the vectors in either one of the orthogonal sets.

    These same ideas are of considerable importance in quantum mechanics, where one deals with orthonormal wave functions.

    "},{"location":"GP/Polar/Polarization/#monochromatic-light-and-natural-light","title":"Monochromatic Light and Natural Light","text":""},{"location":"GP/Polar/Polarization/#light-trains-and-monochromatic-light","title":"Light Trains and Monochromatic Light","text":"

    In reality, a non-laser source emits, to the best, quasimonochromatic light trains, whose frequency can be represented by a bell-shaped Gaussian function.

    \"\u51c6\u5355\u8272\"\uff08quasi-monochromatic\uff09\u662f\u6307\u5149\u6ce2\u5728\u9891\u7387\u4e0a\u7684\u5206\u5e03\u76f8\u5bf9\u72ed\u7a84\uff0c\u4f46\u5e76\u975e\u5b8c\u5168\u5355\u4e00\u9891\u7387\u7684\u5149\u3002\u51c6\u5355\u8272\u5149\u901a\u5e38\u5177\u6709\u4e00\u4e2a\u4e3b\u5bfc\u7684\u4e2d\u5fc3\u9891\u7387\uff0c\u800c\u5728\u8be5\u4e2d\u5fc3\u9891\u7387\u5468\u56f4\u6709\u4e00\u5b9a\u7684\u9891\u7387\u5bbd\u5ea6\u3002\u8fd9\u79cd\u5149\u7684\u9891\u8c31\u5f62\u72b6\u53ef\u80fd\u7c7b\u4f3c\u4e8e\u9ad8\u65af\u5206\u5e03\u6216\u5176\u4ed6\u8fd1\u4f3c\u5355\u5cf0\u7684\u5206\u5e03\u3002

    That is, the irradiance (hence its square root, the amplitude) versus frequency is found to be Gaussian with a width \\(\u2206\u03c9 = 2\u03c0\u2206\u03bd.\\)

    Quasimonochromatic light resembles a series of randomly phased finite wave trains.Such a disturbance is nearly sinusoidal,although the frequence dose vary slowly about some mean value.

    Moreover,the amplitude fluctuates as well,but this too is a comparatively slow variation.

    The average constittuent wavetrain exists roughly for the coherence time \\(\\triangle t_c=\\frac{1}{\\triangle v}\\)

    \u4e24\u5217\u6ce2\u80fd\u53d1\u751f\u5e72\u6d89\u7684\u6700\u5927\u5149\u7a0b\u5dee\u53eb\u76f8\u5e72\u957f\u5ea6\\(\\delta_M=\\frac{\\lambda^2}{\\triangle\\lambda}\\) \\(\\lambda\\)\u4e3a\u4e2d\u5fc3\u6ce2\u957f

    \u5149\u901a\u8fc7\u76f8\u5e72\u957f\u5ea6\u6240\u9700\u65f6\u95f4\u53eb\u76f8\u5e72\u65f6\u95f4

    \u76f8\u5e72\u65f6\u95f4\u7684\u5b9a\u4e49\u662f\u57fa\u4e8e\u5149\u7684\u6ce2\u52a8\u6027\u548c\u5e72\u6d89\u6027\u7684\u3002\u5f53\u4e24\u675f\u5149\u540c\u65f6\u7167\u5c04\u5728\u540c\u4e00\u70b9\uff0c\u5982\u679c\u5b83\u4eec\u7684\u76f8\u4f4d\u5173\u7cfb\u4fdd\u6301\u4e0d\u53d8\uff0c\u90a3\u4e48\u5b83\u4eec\u5c31\u4f1a\u53d1\u751f\u5e72\u6d89\u3002\u76f8\u5e72\u65f6\u95f4\u5c31\u662f\u63cf\u8ff0\u8fd9\u79cd\u76f8\u4f4d\u5173\u7cfb\u4fdd\u6301\u4e0d\u53d8\u7684\u65f6\u95f4\u3002\u5177\u4f53\u6765\u8bf4\uff0c\u5982\u679c\u5149\u7684\u7535\u78c1\u573a\u5728\u4e00\u4e2a\u76f8\u5e72\u65f6\u95f4\u5185\u7684\u5e73\u5747\u503c\u4e0d\u53d8\uff0c\u90a3\u4e48\u6211\u4eec\u5c31\u8bf4\u8fd9\u675f\u5149\u5728\u8fd9\u4e2a\u65f6\u95f4\u5185\u662f\u76f8\u5e72\u7684\u3002\u76f8\u5e72\u65f6\u95f4\u7684\u8ba1\u7b97\u516c\u5f0f\u4e3a\\(T_c=1/\u0394\u03bd\\)\uff0c\u5176\u4e2d\u0394\u03bd\u4e3a\u5149\u7684\u9891\u7387\u5bbd\u5ea6

    \u5149\u7684\u5355\u8272\u6027\u597d\uff0c\u76f8\u5e72\u957f\u5ea6\u548c\u76f8\u5e72\u65f6\u95f4\u5c31\u957f\uff0c\u65f6\u95f4\u76f8\u5e72\u6027\u4e5f\u5c31\u597d

    An idealized monochromatic plane wave must be depicted as an infinite wavetrain. If this disturbance is resolved into two orthogonal components perpendicular to the direction of propagation, they, in turn, must have the same frequency, be infinite in extent, and therefore be mutually coherent (i.e., \\(\u03b5 = constant\\)).

    \\(\\vec{E}_x(z,t)=\\hat{i}E_{0x}cos(kz\u2212\u03c9t)\\)

    \\(\\vec{E}_y(z,t)=\\hat{j}E_{0y}cos(kz\u2212\u03c9t+\\epsilon)\\)

    A perfectly monochromatic plane wave is always polarized.

    The most spectacular of all present-day sources is the laser. Under optimum conditions, with temperature variations and vibrations meticulously suppressed, a laser was actually operated at quite close to its theoretical limit of frequency constancy.

    For example, a short-term frequency stability of about 8 parts per \\(10^{14}\\) was attained with a He\u2013Ne continuous gas laser at \\(\u03bb0 = 1153 nm\\) [Jaseja et al., Phys. Rev. Lett. 10, 165 (1963)].

    That corresponds to a remarkably narrow bandwidth of about \\(\u2206\u03bd = 20 Hz\\).

    "},{"location":"GP/Polar/Polarization/#natural-light","title":"Natural Light","text":"

    Natural light is composed of a rapidly varying succession (~\\(10^{\u22128}\\) s) of the different polarization states. It is also known as unpolarized or randomly polarized light.

    We can mathematically represent natural light in terms of two arbitrary, incoherent, orthogonal, linearly polarized waves of equal amplitude (i.e., waves for which the relative phase difference varies rapidly and randomly).

    "},{"location":"GP/Polar/Polarization/#coherence","title":"Coherence","text":"

    Coherence is a measure of the correlation between the phases measured at different (temporal and spatial) points on a wave.

    Temporal coherence is a measure of the correlation of light wave\u2019s phase at different points along the direction of propagation \u2013 it tells us how monochromatic a source is. (Think about the description of quasimonochromatic light.)

    Spatial coherence is a measure of the correlation of light wave\u2019s phase at different points transverse to the direction of propagation \u2013 it tells us how uniform the phase of the wavefront is. (Think about Young\u2019s interference experiment.)

    The figure illustrates how to prepare a monochromatic wave that is both temporally and spatially coherent from incoherent natural light.

    In reality, light is generally neither completely polarized nor completely unpolarized.

    More often, the electric-field vector varies in a way that is neither totally regular nor totally irregular, and such an optical disturbance is partially polarized.

    One useful way of describing this behavior is to envision it as the result of the superposition of specific amounts of natural and polarized light.

    "},{"location":"GP/Polar/Polarization/#polarizing-sheets","title":"Polarizing Sheets","text":"

    Unpolarized visible light can be transformed into polarized light by sending it through a polarizing sheet,or a Polaroid sheet.

    • A polarizing sheet consists of certain long molecules embedded in plastic.
    • When light is then sent through the sheet,the electric field component parallel to the polarizing direction is passed(transmitted);the component perpendicular to it is absorbed.

    Electric field oscillations of unpolarized light can resolve into two components with equal intensity

    • Therefore, the intensity I of the polarized light emerging from a polarizing sheet is then half the intensity \\(I_0\\) of the original light \\(I=I_0/2\\)

    For polarized light,obly the component \\(E_y\\)=\\(Ecos\\theta\\) parallel to the polarizing direction of the sheet can be transmitted.Therefore,the intensity of the emerging wave is \\(I_0=I_0cos^2\\theta\\)

    • Initially unpolarized light is sent through two polarizing sheets P1 (polarizer) and P (analyzer). In general, some of the light transmitted by P1 will be transmitted by P2.
    • If their polarizing directions are parallel,all the light passed through P1 is transmitted by P2
    • If perpendicular, no light is passed by the second sheet
    "},{"location":"GP/Polar/Polarization/#quiz-23-1-polarizing-sheets","title":"Quiz 23-1: Polarizing Sheets","text":""},{"location":"GP/Polar/Polarization/#polarization-by-reflection","title":"Polarization by Reflection","text":"

    One of the most common sources of polarized light is the ubiquitous process of reflection from dielectric media.

    Consider a ray of unpolarized light incident on a glass surface. The field \\(\\vec{E}\\) of the incident light can be decomposed into two components of equal magnitude, one perpendicular and another parallel to the plane of incidence.

    In general, the reflected light is partially polarized.

    When the light is incident at a particular incident angle, called the Brewster angle \\(\u03b8_B\\) , the reflected light is fully polarized.

    One finds experimentally that at the incident angle \\(\u03b8_B\\), the reflected and refracted rays are perpendicular to each other: \\(\\theta_B+\\theta_r=\\frac{2}{\\pi}\\)

    According to Snell\u2019s law \\(n_i sin\u03b8_B = n_r sin\u03b8_r\\)

    we have \\(n_i sin\u03b8_B =n_r sin\u03b8_r =n_r sin(\\frac{\\pi}{2}\u2212\u03b8_B)=n_r cos\u03b8_B\\) or \\(\\theta_B=tan^{-1}\\frac{n_r}{n_i}\\)

    If the incident and reflected rays travel in air, we can approximate \\(n_i\\) as unity, so \\(n_r\\)=\\(tan\\theta_B\\)

    "},{"location":"GP/QW/QW/","title":"Quantum Wells","text":"

    On a stretched string, we can set up both traveling waves and standing waves.

    • A traveling wave, on a long string, can have any frequency.
    • A standing wave, set up on a string with a finite length, can have only discrete frequencies.

    In other words, confining the wave to a finite region of space leads to quantization of the motion \u2014 to the existence of discrete states for the wave, each state with a sharply defined frequency.

    This observation applies to waves of all kinds, including matter waves. For matter waves, however, it is more convenient to deal with the energy E of the associated particle than with the frequency f of the wave.

    Consider the matter wave associated with an electron moving in the positive x direction and subject to no net force \u2014 a so-called free particle. The energy of such an electron can have any reasonable value, just as a wave traveling along a stretched string of infinite length can have any reasonable frequency.

    Consider next the matter wave associated with an atomic electron, perhaps the valence (least tightly bound) electron.

    The electron \u2014 held within the atom by the attractive Coulomb force between it and the positively charged nucleus \u2014 is a bound particle. It can exist only in a set of discrete states, each having a discrete energy E. This sounds much like the discrete states and quantized frequencies that apply to a stretched string of finite length.

    For matter waves, then, as for all other kinds of waves, we may state a confinement principle: Confinement of a wave leads to quantization \u2014 that is, to the existence of discrete states with discrete energies.

    "},{"location":"GP/QW/QW/#one-dimensional-infinite-potential-well","title":"One-Dimensional Infinite Potential Well","text":"

    Consider a nonrelativistic electron confined to a one-dimensional electron trap (or a limited region of space).

    "},{"location":"GP/QW/QW/#standing-waves-in-a-1d-trap","title":"Standing Waves in a 1D Trap","text":"

    We examine by analogy with standing waves on a string of finite length, stretched along an x axis and confined between rigid supports.

    • Because the supports are rigid, the two ends of the string are nodes, or points at which the string is always at rest. The states, or discrete standing wave patterns in which the string can oscillate, are those for which the length L of the string is equal to an integer number of half-wavelengths

    • That is, the string can occupy only states for which \\(L=\\frac{n\\lambda}{2}\\)

    Each value of the integer n identifies a state of the oscillating string. For a given n, the transverse displacement of the string at any position x \\((0 \u2264 x \u2264 L)\\) along the string is given by \\(y_n(x)=Asin(\\frac{n\\pi}{L}x)\\)where A is the amplitude of the standing wave

    For the n state \\(\\lambda_n=\\frac{2L}{n}\\) Thus \\(sinkx=sin\\frac{2\\pi}{\\lambda_n}x=sin(\\frac{n\\pi}{L}x)\\)

    For the electron in the trap, we promote the transverse displacement to wave function \\(\u03c8_n(x)\\).

    "},{"location":"GP/QW/QW/#probability-of-detection","title":"Probability of Detection","text":"

    Classically, we expect to detect the electron anywhere in the infinite well with a constant probability density.

    Quantum mechanically, we find the probability density \\(p_n(x) = |\u03c8_n(x)|^2 = |A|^2 sin^2(\\frac{n\\pi}{L}x)\\) for given n

    If don't satisfy \\(L=\\frac{n\\lambda}{2}\\) no stable wave formation!

    The constant A (up to a phase) can be determined by the normalization condition

    \\(\\int_{-\u221e}^{+\u221e}|\u03c8_n(x)|^2dx =\\int_0^L|\u03c8_n(x)|^2dx = 1\\), so \\(A=\\sqrt{2/L}\\)

    "},{"location":"GP/QW/QW/#energies-of-the-trapped-electron","title":"Energies of the Trapped Electron","text":"

    The de Broglie wavelength \u03bb of the electron is defined as \\(\u03bb=\\frac{h}{p}=\\frac{h}{\\sqrt{2mk}}\\),where \\(K=\\frac{p^2}{2m}\\)is the kinetic enerrgy of the nonrelativistic electron

    For an electron moving within the central cylinder, where U = 0, the total (mechanical) energy E is equal to the kinetic energy K.

    • Therefore , total energy for an electron moving in the central cylinder is \\(E_n=(\\frac{h}{\\lambda})^2/2m=\\frac{h^2}{8mL^2}n^2 \u221d n^2\\) (\\(\\lambda_n=\\frac{2L}{n}\\))
    • Narrower well \\((smaller\\ L)\\) \\(\u21d2 E_n \u2197\\).

    • The positive integer n is the quantum number of the electron's quantum state in the trap

    • The quantum state with the lowest possible energy level \\(E_1\\) with quantum number n = 1 is called the ground state of the electron.

    • Why is \\(n = 0\\) not allowed?

    Choosing n = 0 would indeed yield a lower energy of zero. However, as we will see below, the corresponding probability density is \\(|\u03c8|^2 = 0\\), which we can interpret only to mean that there is no electron in the well

    so \\(n = 0\\) is not a possible quantum number.

    • It is an important conclusion of quantum physics that confined systems must always have a certain non-zero minimum energy called the zero-point energy.

    • Electrons can be excited or de-excided bynthe absorption or emission of a photon with energy \\(\\bar{h}w=\\frac{hc}{\\lambda}=\\triangle E=E_{High}-E_{Low}\\)

    "},{"location":"GP/QW/QW/#wave-functions-of-the-trapped-electron","title":"Wave Functions of the Trapped Electron","text":"

    If we solve time-independent Schroedinger\u2019s equation, as in the previous lecture, for an electron trapped in the 1D infinite well of width L, we could write the solutions as \\(\u03c8_n(x)=exp (i\\frac{n\\pi}{L}x)\\)or\\(\u03c8_n(x)=exp(-i\\frac{n\\pi}{L}x)\\).

    • However, the above traveling waves do not satisfy the boundary conditions \\(\u03c8_n(0) = \u03c8_n(L) = 0.\\)

    The appropriate solutions can only be certain linear combinations of the traveling wave functions, given by \\(\u03c8_n(x)=Asin(\\frac{n\\pi}{L}x)\\) The constant A is to be determined.

    • Note that the wave functions \\(\u03c8_n(x)\\) have the same form as the displacement functions \\(y_n(x)\\) for a standing wave on a string stretched between rigid supports.

    For sufficiently large \\(n\\), the probability of detection becomes more and more uniform across the well in the coarse-grained scale. This result is an instance of a general principle called the correspondence principle: At large enough quantum numbers, the predictions of quantum physics merge smoothly with those of classical physics.

    "},{"location":"GP/QW/QW/#an-electron-in-a-finite-well","title":"An Electron in a Finite Well","text":"

    We can picture an electron trapped in a one-dimensional well between infinite-potential walls as being a standing matter wave. The solutions must be zero at the infinite walls.

    For finite walls, however, the analogy between waves on a stretched string and matter waves fails. Matter wave nodes no longer exist at \\(x = 0\\) and at \\(x = L\\).

    wave function can penetrate the walls into classically forbidden regions.

    Constraints

    (1)\\(\u03a8(-\\infty)\\rightarrow0\\)

    (2)\\(\u03a8(+\\infty)\\rightarrow0\\)

    (3)\\(\u03a8(0-)=\u03a8(0+)\\)

    (4)\\(\u03a8(L-0)=\u03a8(L+0)\\)

    (5)\\(\u03a8'(-0) = \u03a8'(+0)\\)

    (6)\\(\u03a8'(L-0) = \u03a8'(L+0)\\)

    "},{"location":"GP/QW/QW/#energies-of-the-trapped-electron_1","title":"Energies of the Trapped Electron","text":"

    Thus, the corresponding energy E \u2248 \\((h/\u03bb)^2/(2m)\\) for an electron in any given state is less in the finite well than in the infinite well.\uff08From what is mentioned above\uff09

    An electrons with an energy greater than the well depth\\((E > U_0)\\) has too much energy to be trapped in the finite well.

    Thus, there is a continuum of energies beyond the top of potential well ; a high-energy electron is not confined,and its energy is not quantized

    "},{"location":"GP/QW/QW/#semiconductor-quantum-wells","title":"Semiconductor Quantum Wells","text":"

    Semiconductor similar to finite wells

    "},{"location":"GP/QW/QW/#schroedingers-equation-in-high-dimensions","title":"Schroedinger\u2019s Equation in High Dimensions","text":"

    This has the form \\(E = F(x) + G(y)\\), which can only be satisfied when \\(F(x) = E_1\\) and \\(G(y) = E \u2212 E_1\\), i.e., each function must separately be a constant.

    As a consequence, separation of variables breaks the multivariate partial differential equation into a set of independent ordinary differential equations \\((ODEs)\\).

    We can solve the \\(ODEs\\) for \\(X(x)\\) and \\(Y(y)\\). The wave function for the original equation is simply their product \\(X(x)Y(y)\\).

    [In which case \\(\u03a8(x,y)\\) can be written in the form of \\(\u03a8(x,y) = X(x)Y(y\\)), and in which case cannot be?]

    • Separation of variables was first used by L\u2019Hospital in 1750.

    It is especially useful in solving equations arising in mathematical physics, such as Laplace\u2019s equation, Helmholtz\u2019s equation, and Schroedinger\u2019s equation.

    • Success requires choice of an appropriate coordinate system and may not be attainable at all depending on the equation. In particular, it works when

    \\(U (x , y ) = Ux (x ) + Uy (y )\\),or, in a central potential in spherical coordinates,\\(U(r,\u03b8,\u03c6) = V(r).\\)

    "},{"location":"GP/QW/QW/#2d-3d-infinite-potential-wells","title":"2D & 3D Infinite Potential Wells","text":""},{"location":"GP/QW/QW/#dirac-delta-function-potential-well","title":"Dirac Delta Function Potential Well","text":""},{"location":"GP/com/com/","title":"Electromagnetic Integration","text":""},{"location":"GP/com/com/#faradays-law-of-induction","title":"Faraday\u2019s Law of Induction","text":"

    \\(\\Phi_B=\\int\\vec{B}\\cdot d\\vec{A}\\)

    \\(\\epsilon = -N\\frac{d\\Phi_B}{dt}\\)

    When you move the magnet toward or away from the loop, a magnetic force resists the motion, so Lenz\u2019s law requires your applied force to do positive work.

    At the same time, thermal energy is produced in the material of the loop because of the material\u2019s electrical resistance to the induced current.

    The energy you transfer to the closed loop-magnet system via your applied force ends up in this thermal energy. (For now, we neglect energy that is radiated away from the loop as electromagnetic waves during the induction.)

    \\(\\epsilon= N\\frac{d\\Phi_B}{dt}=BLv\\)

    \\(F=F_1=iLB=B^2L^2v/R\\)

    \\(P_1=Fv=B^2L^2v^2/R\\)

    \\(P_{thermal}=i^2R=(\\frac{BLv}{R})^2R=B^2L^2v^2/R\\)

    "},{"location":"GP/com/com/#a-reformulation-of-faradays-law","title":"A Reformulation of Faraday\u2019s Law","text":"

    We find that an induced emf can be defined without the need of a current or particle: An induced emf is the sum\u2014via integration\u2014of quantities \\(\\vec{E} \u00b7 d\\vec{s}\\) around a closed path, where \\(\\vec{E}\\) is the electric field induced by a changing magnetic flux and \\(d\\vec{s}\\) is a differential length vector along the path.

    • Rewrite Faraday's Law as \\(\\oint \\vec{E}\\cdot d\\vec{s}=-N\\frac{d\\Phi_B}{dt}=-\\frac{d}{dt}\\int\\vec{B}\\cdot d\\vec{A}\\)

    • We can convert it to differential form by applying the Stokes\u2019 theorem (or the fundamental theorem for curls)

    \\(\\oint\\vec{E}\\cdot d\\vec{s}=\\int_S(\\triangledown \\times \\vec{E})\\cdot d\\vec{A}\\)

    • Thus, we get : \\(\\triangledown \\times\\vec{E}=-\\frac{\\partial \\vec{B}}{\\partial t}\\)

    • Electric potential has no meaning for electric fields that are produced by induction

    "},{"location":"GP/com/com/#inductors-and-inductance","title":"Inductors and Inductance","text":""},{"location":"GP/com/com/#revisiting-solenoid","title":"Revisiting Solenoid","text":"

    \\(B=\\mu_0in\\)

    \\(\\Phi_B=BA=\\mu_0inA\\)

    \\(Inductance \\ L \\ =N\\Phi_B/i=\\mu_0n^2lA\\)

    • If the length \\(l\\) of a solenoid is very much longer than its radius, then, to a good approximation, its inductance is \\(L = \u03bc_0n^2lA = N^2(\u03bc_0A/l)\\)(By \\(nl=N\\))
    "},{"location":"GP/com/com/#rl-circuits","title":"RL Circuits","text":"
    • L is like a voltage source

    • \\(E_L = \u2212\\frac{d(N\u03a6_B)}{dt} = \u2212L\\frac{di }{dt}\\)

    \\(\\begin{align*}&\\epsilon= iR-(-L\\frac{di}{dt})\\\\ &\\dot{i}+\\frac{R}{L}i-\\frac{\\epsilon}{L}=0\\end{align*}\\)

    \\(i=\\frac{\\epsilon}{R}(1-e^{-t/\\tau_L}) \\ \\ \\ (\\tau_L=\\frac{L}{R})\\)

    "},{"location":"GP/com/com/#energy","title":"Energy","text":""},{"location":"GP/com/com/#energy-stored-in-a-magnetic-field","title":"Energy Stored in a Magnetic Field","text":"

    \\(\\epsilon i = Li\\frac{di}{dt} + i^2R.\\)

    \\(\\Rightarrow U_B=\\frac{1}{2}Li^2\\)

    "},{"location":"GP/com/com/#energy-density-of-a-magnetic-field","title":"Energy Density of a Magnetic Field","text":"
    • The energy stored per unit volume of the field is

    \\(\\mu_B=\\frac{U_B}{Ah}=\\frac{Li^2}{2Ah}=\\frac{L}{h}\\frac{i^2}{2A}=\\frac{i^2n^2\\mu_0}{2}=\\frac{B^2}{2\\mu_0}\\)

    resembles that in an electric file \\(\\mu_E=\\frac{1}{2}\\epsilon_0E^2\\)

    "},{"location":"GP/com/com/#mutual-inductance-of-two-parallel-coils","title":"Mutual Inductance of Two Parallel Coils","text":"

    \\(M_{21}=\\frac{N_2\\Phi_{21}}{i_1}\\\\M_{12}=\\frac{N_1\\Phi_{12}}{i_2}\\)

    \\(\\epsilon_{21}=-M_{21}\\frac{di_1}{dt}\\\\\\epsilon_{12}=-M_{12}\\frac{di_2}{dt}\\)

    \\(\\epsilon_1=\\epsilon_{1}+\\epsilon_{12}=-L_{1}\\frac{di_{1}}{dt}-M_{12}\\frac{di_2}{dt}\\)

    \\(\\epsilon_2=\\epsilon_{22}+\\epsilon_{21}=-L_{2}\\frac{di_{2}}{dt}-M_{21}\\frac{di_1}{dt}\\)

    \\(\\Rightarrow-\\begin{pmatrix}L_1&M_{12}\\\\M_{21}&L_2\\end{pmatrix}\\frac{d}{dt}\\begin{pmatrix}i_1\\\\i_2\\end{pmatrix}=\\begin{pmatrix}\\epsilon_1\\\\\\epsilon_2\\end{pmatrix}\\)

    "},{"location":"GP/com/com/#alternating-current-circuits","title":"Alternating-Current Circuits","text":""},{"location":"GP/com/com/#lc-oscillations","title":"LC Oscillations","text":"

    \\(L\\frac{di}{dt}+\\frac{q}{C}=0\\)

    \\(\\ddot{q}+\\frac{1}{LC}q=0\\)

    \\(\\Rightarrow q =Acos(w_0t+\\phi)=Qcos(\\frac{1}{\\sqrt{LC}}t+\\phi)\\)

    \\(\\Rightarrow Qcos\\phi=0 \\\\-w_0Qsin\\phi=0\\)

    "},{"location":"GP/com/com/#the-complex-formalism","title":"The Complex Formalism","text":""},{"location":"GP/com/com/#damped-oscillations-in-an-rlc-circuit","title":"Damped Oscillations in an RLC Circuit","text":"
    • With Resistance R

    \\(\\ddot{q}+\\frac{R}{L}\\dot{q}+\\frac{1}{LC}q=0\\)

    \\(\\Rightarrow q=Qe^{-\\frac{t}{\\tau}}cos(wt+\\phi) \\ where\\ \\tau=2L/R \\ and \\ w=\\sqrt{w_0^2-(1/\\tau)^2} \\ and \\ w_0=\\frac{1}{\\sqrt{LC}}\\)

    Note Use ODEs or the method of the below picture

    • When \\(1/\u03c4 < \u03c9_0\\), a real \\(\u03c9\\) can be found and the system still oscillates, but with decreasing amplitude as its energy is converted to heat. The circuit is said to be underdamped. Over time the system should come to rest at equilibrium.
    • When \\(1/\u03c4 > \u03c9_0\\), one can only find imaginary \u03c9, which means the frictional force is so great that the system cannot oscillate. The circuit is said to be overdamped.

    • In between, when \\(1/\u03c4 = \u03c9_0\\), the circuit is said to be critically damped. It is worth noting that the critical damping gives the fastest return of the system to its equilibrium position. In engineering design this is often a desirable property.

    "},{"location":"GP/com/com/#ac-circuits-and-forced-oscillations","title":"AC Circuits and Forced Oscillations","text":"
    • The oscillations in an RLC circuit will not damp out if an external emf device supplies enough energy to make up for the energy dissipated as thermal energy in the resistance R.
    • The energy is supplied via oscillating emfs and currents \u2014 the current is said to be an alternating current, or ac for short. These oscillating emfs and currents vary sinusoidally with time, reversing direction 100 times per second and thus having frequency f = 50 Hz.
    • When the external alternating emf is connected, the oscillations of charge, potential difference, and current are said to be driven oscillations or forced oscillations. These oscillations always occur at the driving angular frequency.
    "},{"location":"GP/com/com/#three-simple-circuits","title":"Three Simple Circuits","text":"
    • For L :

    \\(i(t)=\\tilde{i}e^{iwt}\\)

    \\(V(t)=L\\frac{di}{dt}=L(iw)e^{iwt}\\tilde{i}\\)

    \\(\\tilde{Z}=iwL\\)

    • For C:

    \\(Q(t)=\\tilde{Q}e^{iwt}\\)

    \\(\\tilde{V}(t)=\\tilde{Q}/C\\cdot e^{iwt}\\)

    \\(\\tilde{i}=\\frac{d\\tilde{Q}}{dt}=iw\\tilde{\\tilde{Q}e^{iwt}}\\)

    \\(\\tilde{Z}=\\frac{1}{iwC}=-\\frac{i}{wC}\\)

    "},{"location":"GP/com/com/#the-series-rlc-circuit","title":"The Series RLC Circuit","text":""},{"location":"GP/com/com/#resonance","title":"Resonance","text":"

    When \\(\u03c9_d\\) equals \\(\u03c9_0\\), the circuit is in resonance.

    • The circuit is equally capacitive and inductive \\((|Z_C | = |Z_L|)\\).
    • The current amplitude \\(I = E_m/R\\) is maximum.
    • Current and emf are in phase (\u03c6 = 0).

    "},{"location":"GP/com/com/#maxwells-equations-and-em-waves","title":"Maxwell\u2019s Equations and EM Waves","text":"
    • Applying Divergence to Faraday's Law ,we get:\\(\\triangledown\\cdot(\\triangledown \\times \\vec{E})=\\triangledown \\cdot(-\\frac{\\partial\\vec{B}}{\\partial t})=-\\frac{\\partial}{\\partial t}(\\triangledown\\cdot\\vec{B})=0 (Consistency)\\)

    • However,when applying Divergence to Ampere's Law,we get\\(\\triangledown\\cdot(\\triangledown \\times \\vec{B})=\\triangledown\\cdot(\\mu_0\\vec{J})=\\mu_0(\\triangledown\\cdot\\vec{J})\\)

    While \\(\\triangledown \\cdot \\vec{J} = -\\frac{\\partial\\rho}{\\partial t}=-\\frac{\\partial{(\\epsilon_0\\triangledown\\cdot E)}}{\\partial t} =-\\triangledown\\cdot(\\epsilon_0\\frac{\\partial\\vec{E}}{\\partial t}) \\ Which \\ is\\ not\\ necessarily\\ ZERO\\)

    • Maxwell pointed out that the extra divergence can be removed by fixing Ampere\u2019s law to be:

    \\(\\triangledown\\times\\vec{B}=\\mu_0\\vec{J}+\\mu_0\\vec{J_d}=\\mu_0\\vec{J}+\\mu_0\\epsilon_0\\frac{\\partial\\vec{E}}{\\partial t}\\)

    "},{"location":"GP/com/com/#apply","title":"Apply","text":"

    \\(E=\\frac{\\sigma}{\\epsilon_0}=\\frac{Q}{\\epsilon_0A}\\\\ \\frac{\\partial{E}}{\\partial t}=\\frac{J_d}{\\epsilon_0}=\\frac{I}{\\epsilon_0A}\\)

    • Choose surface 1 to integral : \\(E=0\\ I_{enc}=I\\)

    • Choose surface 2 to integral:

    \\(I_{enc}=0\\\\\\mu_0\\epsilon_0\\frac{\\partial{E}}{\\partial t}=\\mu_0I/A \\ \\iint \\mu_0\\epsilon_0\\frac{\\partial{E}}{\\partial t}\\cdot d\\vec{A}=\\mu_0I\\)

    "},{"location":"GP/com/com/#maxwells-equations","title":"Maxwell\u2019s Equations","text":""},{"location":"GP/com/com/#electromagnetic-waves","title":"Electromagnetic Waves","text":""},{"location":"GP/com/com/#derivation-of-the-wave-equation","title":"Derivation of the Wave Equation","text":"

    1.Decouple

    \\(\\triangledown\\times(\\triangledown\\times\\vec{E})=\\triangledown\\times(-\\frac{\\partial\\vec{B}}{\\partial t})=-\\frac{\\partial}{\\partial t}(\\triangledown\\times\\vec{B})=-\\mu_0\\epsilon_0\\frac{\\partial^2\\vec{E}}{\\partial t^2}\\)

    \\(\\triangledown\\times(\\triangledown\\times\\vec{B})=\\triangledown\\times(\\mu_0\\epsilon_0\\frac{\\partial\\vec{E}}{\\partial t})=\\mu_0\\epsilon_0\\frac{\\partial}{\\partial t}(\\triangledown\\times\\vec{E})=-\\mu_0\\epsilon_0\\frac{\\partial^2\\vec{B}}{\\partial t^2}\\)

    Another way to solution :

    \\(\\vec{A}\\times(\\vec{B}\\times\\vec{C})=\\vec{B}\\cdot(\\vec{A}\\cdot \\vec{C})-\\vec{C}\\cdot(\\vec{A}\\cdot \\vec{B})\\)

    \\(\\triangledown\\times(\\triangledown\\times\\vec{C})=\\triangledown\\cdot(\\triangledown\\cdot \\vec{C})-\\triangledown^2\\vec{C}\\)

    Thus:

    \\(\\triangledown^2\\vec{B}=\\mu_0\\epsilon_0\\frac{\\partial^2\\vec{B}}{\\partial t^2}\\\\ \\triangledown^2\\vec{E}=\\mu_0\\epsilon_0\\frac{\\partial^2\\vec{E}}{\\partial t^2}\\)

    \\(\\lambda=\\frac{2\\pi}{k}\\\\ v=\\lambda f=\\lambda/T \\\\w=\\frac{2\\pi}{T}\\)

    • For \\(\\triangledown\\cdot \\vec{E}=0\\\\\\triangledown\\cdot \\vec{B}=0\\)

    We have \\(E_m(x)=B_m(x)=0\\)

    • For \\(\\triangledown\\times\\vec{E}=-\\frac{\\partial{B}}{\\partial t}\\)

    \\(-k\\hat{x}\\times\\vec{E_m}=-w\\vec{B_m}\\)

    • Therefore \\(\\vec{B}=\\frac{1}{c}(\\hat{x}(unit\\ vector)\\times\\vec{E})\\)

    "},{"location":"GP/com/com/#energy-transport","title":"Energy Transport","text":"
    • For \\(\\vec{B}=\\frac{1}{c}(\\hat{x}(unit\\ vector)\\times\\vec{E})\\) We have \\(\\mu_E=\\frac{\\epsilon_0 E^2}{2}=\\frac{B^2}{2\\mu_0}=\\mu_B\\)
    • The rate of energy transport per unit area in a plane wave is the product of total energy density and the speed of the electromagnetic wave, i.e \\(S=(u_E +u_B)c.\\)
    • \\(I = S_{avg}= \\frac{\\epsilon_0 E_m^2}{2}c=\\frac{B_m^2}{2\\mu_0}c.\\)
    "},{"location":"GP/com/com/#variation-of-intensity-with-distance","title":"Variation of Intensity with Distance","text":"

    When spherical wavefronts spread from an isotropic point source S with power Ps, the energy of the waves is conserved.

    The intensity I at the sphere must decrease with r as \\(I=\\frac{P_S}{4\\pi r^2}\\)

    "},{"location":"GP/current/current/","title":"Current","text":""},{"location":"GP/current/current/#resistance-and-capacitance","title":"Resistance and Capacitance","text":"
    • \\(q=(nAL)e\\)
    • \\(i=\\frac{q}{\\triangle t}=nAe\\vec{v_d}\\)
    • \\(\\vec{J}=ne\\vec{v_d}\\)
    "},{"location":"GP/current/current/#resistance-and-resistivity","title":"Resistance and Resistivity","text":"

    The resistivity \u03c1 and conductivity \u03c3 of a material are related by \\(\u03c1 = 1/\u03c3 = E/J\\), where \\(E\\) is the magnitude of the applied electric field and \\(J\\) is the magnitude of the current density.

    • Resistance is a property of an object, while resistivity is a property of a material.
    • The \\(SI\\) unit for resistance is the ohm (\\(\u03a9\\)). The SI unit for resistivity is the ohm-meter (\\(\u03a9\\)\u00b7\\(m\\)).
    "},{"location":"GP/current/current/#ohms-law","title":"Ohm\u2019s Law","text":"
    • An electron of mass m and charge (\u2212e) experiences an acceleration in an electric field \\(\\vec{E}\\) :

    \\(\\vec{a}=-\\frac{e\\vec{E}}{m}\\)

    • After a typical collision, each electron will \u201close its memory\u201d of its previous drift velocity, starting fresh and moving off in a random direction.

    • In the average time \\(\u03c4\\) (or mean free time) between collisions, the electron will, on average, acquire a drift velocity

    \\(\\vec{v_d}=-\\frac{e\\vec{E}}{m}\\tau \\ \\ \\ Combining \\ with \\vec{J}=-ne\\vec{v_d} \\ We \\ get :\\)

    \\(-\\frac{\\vec{J}}{ne}=-\\frac{e\\vec{E}}{m}\\tau \\ \\ \\ which \\ implies \\vec{E}=\\rho\\vec{J} \\ \\ where\\ \\rho=\\frac{m}{ne^2\\tau}\\)

    • For metals under normal circumstances, both n and \u03c4 can be considered to be a constant. Thus, metals obey Ohm\u2019s law.

    • Thus,\\(V/I=E\\cdot d/J\\cdot S = \\rho d /S\\)

    "},{"location":"GP/current/current/#estimate-the-mean-free-timecopper","title":"estimate the mean free time(Copper)","text":"
    • The free electron density in \\(Cu\\) is \\(n = 8.47 \u00d7 10^{28} m^{\u22123}\\).
    • Cu has a resistivity \\(\u03c1 = 1.56 \u03bc\u03a9\u00b7cm\\).
    • The mean free time can be estimated by \\(\\rho=\\frac{m}{ne^2\\tau}\\)
    • In the classical picture, the mean velocity of an electron at room temperature can be estimated by \\((1/2)mv^2 = (3/2)k_BT.\\)
    "},{"location":"GP/current/current/#equation-of-continuity","title":"Equation of Continuity","text":"

    We have implicitly used the (local) conservation of charge here. Namely, if the total charge in some volume changes, the exactly same amount of charge must have passed in or out through the surface. Otherwise, charge accumulation occurs in the volume enclosed by the surface.

    • Formally, we have
    • \\(\\frac{d}{dt}\\int_V\\rho(\\vec{r},t)dV = \\int_V \\frac{\\partial{\\rho(\\vec{r},t)}}{\\partial{t}}dV=-\\oint_S\\vec{J}(\\vec{r},t)d\\vec{A}\\)

    • To be able to move the derivative under the integral sign this way requires that \\(\u2202\u03c1/\u2202t\\) be continuous.

    • With the divergence theorem, we can rewrite it in the derivative form (note V is arbitrary)\\(\\frac{\\partial \\rho}{\\partial t}=-\\triangledown\\cdot\\vec{J}\\)\uff08By Gauss's Law\uff09

    Such an equation of continuity plays an important role in hydrodynamics, hear flow, and diffusion theory, besides electromagnetic theory. It is simply a mathematical expression of a conservation law.

    "},{"location":"GP/current/current/#capacitor-and-capacitance","title":"Capacitor and Capacitance","text":"

    \\(C=\\frac{Q}{U}\\)

    "},{"location":"GP/current/current/#capacitance-of-a-parallel-plate-capacitor","title":"Capacitance of a Parallel-Plate Capacitor","text":""},{"location":"GP/current/current/#capacitance-of-a-cylindrical-capacitor","title":"Capacitance of a Cylindrical Capacitor","text":"
    • Apparently, the capacitance is proportional to the length of the cylindrical capacitor, just like the resistance of a cylindrical conductor (R = \u03c1L/A).
    "},{"location":"GP/current/current/#energy-stored-in-a-capacitor","title":"Energy stored in a capacitor","text":"

    \\(dW=V'dq'=(\\frac{q'}{C})dq'\\)

    \\(W=\\int_0^q(q'/C)dq'=\\frac{q^2}{2C}\\)

    \\(U=\\frac{q^2}{2C}=\\frac{CV^2}{2}\\)

    "},{"location":"GP/current/current/#dc-circuits","title":"DC Circuits","text":""},{"location":"GP/current/current/#rc-circuits","title":"RC circuits","text":""},{"location":"GP/current/current/#charging-switch-to-a","title":"Charging (switch to a )","text":"

    \\(\\frac{q}{C}\\frac{dq}{dt}+i^2R=i\\epsilon\\)

    \\(\\Rightarrow \\dot{q}+\\frac{q}{RC}=\\frac{\\epsilon}{R}\\)

    \\(\\Rightarrow q=C\\epsilon(1-e^{-t/RC})\\)

    • Note : Derivation see Appendix : ODEs

    • The equilibrium (final) charge on the then fully charged capacitor is equal to \\(q_0 = CE\\).

    \\(\\Rightarrow i = \\frac{dq}{dt}=(\\frac{\\epsilon}{R}e^{-t/RC})\\)

    \\(\\Rightarrow V_c = \\frac{q}{C}=\\epsilon(1-e^{-t/RC})\\)

    "},{"location":"GP/current/current/#dischargingswitch-to-b-from-a","title":"Discharging(switch to b from a)","text":"

    \\(\\dot{q}+\\frac{q}{RC}=0\\)

    \\(\\Rightarrow q=q_0e^{-t/RC}\\)

    \\(\\Rightarrow i = (\\frac{\\epsilon}{R})e^{-t/RC}\\)

    "},{"location":"GP/current/current/#energy-density","title":"Energy Density","text":"

    parallel-plate capacitor:

    \\(U=\\frac{1}{2}CV^2=\\frac{1}{2}\\epsilon_0E^2(Ad)\\)

    • The energy density u, i.e., the potential energy per unit volume between the plates, is thus uniform:\\(u=\\frac{1}{2}\\epsilon_0E^2\\)
    "},{"location":"GP/current/current/#capacitor-with-a-dielectric","title":"Capacitor with a Dielectric","text":""},{"location":"GP/current/current/#appendix","title":"Appendix","text":""},{"location":"GP/current/current/#odes","title":"ODEs","text":"
    • \\(\\dot{y}+p(x)y=q(x) \\Rightarrow y=e^{-\\int pdx}(C+\\int q\\cdot e^{\\int pdx}dx)\\)
    "},{"location":"GP/lec1-3/lec1/","title":"Coulomb's Law and the Electric Field","text":""},{"location":"GP/lec1-3/lec1/#coulombs-law","title":"Coulomb\u2018s Law","text":"

    \\(\\vec{F}=k\\frac{q_1q_2}{r^2}\\)

    \\(k = 8.99 * 10^{-12} N*m^2/C^2=\\frac{1}{4\\pi\\epsilon_0}\\\\\\)

    \\(\\epsilon_0=8.85*10^{-12}C^2/N*m^2\\)

    "},{"location":"GP/lec1-3/lec1/#diphole","title":"Diphole","text":"
    • The product \\(\\vec{q}d\\) is known as the electric dipole moment \\(\\vec{p}\\) of the dipole.
    • Derivation

    \u200b \\(\\begin{align*}E&=\\frac{q}{4\\pi\\epsilon_0(z-\\frac{d}{2})^2}- \\frac{q}{4\\pi\\epsilon_0(z+\\frac{d}{2})^2}\\\\ &=\\frac{q\\vec{d}}{2\\pi\\epsilon_0}*\\frac{z}{(z-\\frac{d}{2})^2(z+\\frac{d}{2})^2}\\\\ &=\\frac{\\vec{p}}{2\\pi\\epsilon_0z^3}*\\frac{1}{(1-\\frac{d}{2z})^2(1+\\frac{d}{2z})^2}\\\\ &=\\frac{1}{2\\pi\\epsilon_0}\\frac{p}{z^3} \\ \\ when (z>>d)\\end{align*}\\)

    "},{"location":"GP/lec1-3/lec1/#a-diphole-in-a-uniform-electric-filed","title":"A diphole in a uniform electric filed","text":"

    Note:\\(\\tau=p\\times E\\)

    "},{"location":"GP/lec1-3/lec1/#the-electric-field-due-to-a-ring-of-charge","title":"The Electric Field Due to a Ring of Charge","text":"
    • When \\(z>>R\\) \\(E=\\frac{qz}{4\\pi\\epsilon_0z^3(1+(\\frac{R}{z})^2)^{\\frac{3}{2}}}=\\frac{q}{4\\pi\\epsilon_0z^2}\\)
    "},{"location":"GP/lec1-3/lec1/#the-electric-field-due-to-a-charged-disk","title":"The Electric Field Due to a Charged Disk","text":"

    \\(\\begin{align*}dE_z &= \\int \\frac{\\sigma(2\u03c0rdr)}{4\\pi\\epsilon_0(z^2+r^2)}\\frac{z}{\\sqrt{z^2+r^2}}=\\frac{\\sigma z}{2\\epsilon_0}\\int_0^R\\frac{rdr}{(z^2+r^2)^\\frac{3}{2}}\\\\ &= \\frac{\\sigma}{2\\epsilon_0}(1-\\frac{z}{\\sqrt{z^2+R^2}})\\end{align*}\\)

    "},{"location":"GP/lec1-3/lec1/#gausss-law","title":"Gauss's Law","text":""},{"location":"GP/lec1-3/lec1/#electric-flux","title":"Electric Flux","text":"

    \\(\u2206\u03a6 = (E cos\u03b8)\u2206A=\\vec{E}\\cdot{\\vec{A}}\\)

    \\(\u03a6=\\int\\vec{E}\\cdot{d\\vec{A}}\\)

    "},{"location":"GP/lec1-3/lec1/#gausss-law_1","title":"Gauss's Law","text":"

    \\(\\epsilon_0 \\oint\\vec{E}\\cdot d\\vec{A}=q_{encore}\\)

    "},{"location":"GP/lec1-3/lec1/#applications","title":"Applications","text":""},{"location":"GP/lec1-3/lec1/#1spherical-symmetry","title":"1.Spherical Symmetry","text":"

    \\(4\\pi r^2\\cdot E = \\frac{q{(\\frac{r}{R})^3}}{\\epsilon_0}\\)

    \\(\\Rightarrow \\ \\vec{E}=\\frac{q}{4\\pi\\epsilon_0R^3}\\cdot \\vec{r}\\)

    "},{"location":"GP/lec1-3/lec1/#2planar-symmetry","title":"2.Planar Symmetry","text":""},{"location":"GP/lec1-3/lec1/#3cylindrical-symmetry","title":"3.Cylindrical Symmetry","text":"
    • \\(\u03b5_0 \u03a6 = \u03bbh\\)

    • \\(E=\\frac{\\lambda}{2\\pi r\\epsilon_0}\\)

    "},{"location":"GP/lec1-3/lec1/#the-electrostatic-potential","title":"The Electrostatic Potential","text":""},{"location":"GP/lec1-3/lec1/#potential-due-to-an-electric-diphole","title":"Potential due to an electric diphole","text":"
    • For points that are relatively far from the the two lines to P as being parallel and their length dif- dipole \\((r \u226b d)\\), we can approximate the leg of a right triangle with hypotenuse d .Thus

    \\(r_--r_+\\approx dcos\\theta\\)

    \\(r_-\\cdot r_+\\approx r^2\\)

    \\(V=\\frac{\\vec{p}\\cdot\\vec{r}}{4\\pi\\epsilon_0r^3}\\)

    "},{"location":"GP/lec1-3/lec1/#systems-of-charged-particles","title":"Systems of Charged Particles","text":"
    • The lesson here is this: If you are given an assembly of charged particles, you can find the potential energy of the assembly by finding the potential of every possible pair of the particles and then summing the results.
    "},{"location":"GP/lec1-3/lec1/#continuous-charge-distribution-rod","title":"Continuous Charge Distribution: Rod","text":"

    \\(\\begin{align*} V &= \\int dV = \\int _0^L \\frac{\\lambda dx}{4\\pi\\epsilon_0\\sqrt{x^2+d^2}}\\\\ &=\\int \\frac{\\lambda}{4\\pi\\epsilon_0}\\int_0^L\\frac{dx}{\\sqrt{x^2+d^2}}\\\\ &=\\frac{\\lambda}{4\\pi\\epsilon_0}ln\\frac{L+\\sqrt{L^2+d^2}}{d} \\end{align*}\\)

    "},{"location":"GP/lec1-3/lec1/#continuous-charge-distribution-disk","title":"Continuous Charge Distribution: Disk","text":"

    \\(\\begin{align*}V &= \\int_0^R \\frac{\\sigma(2\u03c0rdr)}{4\\pi\\epsilon_0\\sqrt{z^2+r^2}}\\\\ &= \\frac{\u03c3}{2\\epsilon_0}(\\sqrt{z^2+R^2}\u2212z)\\end{align*}\\)

    \\(\\Rightarrow Ez=-\\frac{dV}{dz}\\)

    "},{"location":"GP/lec1-3/lec1/#the-triangle-of-electrostatics","title":"The Triangle of Electrostatics","text":""},{"location":"GP/lec1-3/lec1/#preknowledge","title":"PreKnowledge","text":""},{"location":"GP/lec1-3/lec1/#gradient","title":"gradient","text":"

    \\(\u2207V=\\frac{\\partial{V}}{\\partial{x}}\\hat{x}+\\frac{\\partial{V}}{\\partial{y}}\\hat{y}+\\frac{\\partial{V}}{\\partial{z}}\\hat{z}\\)

    "},{"location":"GP/lec1-3/lec1/#curl","title":"curl","text":"

    \\(\u2207 \\times V = \\begin{bmatrix}\\hat{x}&\\hat{y}&\\hat{z}\\\\\\frac{\\partial{}}{\\partial{x}}&\\frac{\\partial{}}{\\partial{y}}&\\frac{\\partial{}}{\\partial{z}}\\\\ V_x&V_y&V_z\\end{bmatrix}\\)

    • The curl of a gradient is always \\(ZERO\\)
    "},{"location":"GP/lec1-3/lec1/#divergence","title":"divergence","text":"

    \\(\u2207 \\cdot V\\)

    \\(\\frac{\\partial E_x}{\\partial x}+\\frac{\\partial E_y}{\\partial y}+\\frac{\\partial E_z}{\\partial z}=\\triangledown \\cdot \\vec{E}\\)

    "},{"location":"GP/lec1-3/lec1/#e-leftrightarrow-rho","title":"\\(E \\Leftrightarrow \\ \\rho\\)","text":"
    • \\(\\oint\\vec{E}\\cdot d\\vec{l}=\\int\\int(\\triangledown\\times \\vec{E})dS = 0\\) \\(By \\ Stokes\\) -- independent of \\(PATHS\\)

    • Choose a Gaussian surface to enclose a small cube centered at \\(\\vec{r}\\) with side \\(\\triangledown x\\triangledown y\\triangledown z\\) such that \\(\\triangle V = \\triangle x \\triangle y \\triangle z\\)

    • In the small \\(\\triangledown V\\) ,We have :
      • \\(\\frac{\\rho(\\vec{r})}{\\epsilon_0}=lim_{\\triangle V \\rightarrow0}\\frac{q_{enc}}{\\triangle V\\epsilon_0}=lim_{\\triangle V \\rightarrow0}\\frac{1}{\\triangle V}\\oint \\vec{E}\\cdot d\\vec{S}\\)
      • \\(\\oint \\vec{E_x}\\cdot d\\vec{S}=\\vec{E}(x + \\frac{\u2206x}{2} ,y,z)\\hat{x}\u2206y\u2206z+\\vec{E}(x - \\frac{\u2206x}{2} ,y,z)(-\\hat{x})\u2206y\u2206z = \\frac{\\partial E_x}{\\partial x}\\triangledown V\\)
      • \\(\\frac{\\rho(\\vec{r})}{\\epsilon_0}=\\frac{\\partial E_x}{\\partial x}+\\frac{\\partial E_y}{\\partial y}+\\frac{\\partial E_z}{\\partial z}=\\triangledown \\cdot \\vec{E}\\)
    • According to Gauss\u2019 law, the only places at which the divergence of the electric field is not zero are those locations at which charge is present. So the divergence is a measure of the tendency of the field to flow away from a (charged) point.
    • \\(\\oiint\\vec{E}\\cdot d\\vec{A} = \\iiint(\\triangledown \\cdot \\vec{E})dV\\) \\(Gauss's\\ Law\\)

    "},{"location":"GP/lec1-3/lec1/#example","title":"Example","text":""},{"location":"GP/lec1-3/lec1/#the-electrical-properties-of-conductors","title":"The Electrical Properties of Conductors","text":""},{"location":"GP/lec1-3/lec1/#a-charged-isolated-conductor","title":"A Charged Isolated Conductor","text":"
    • Consider an isolated conductor with excess charge. In electrostatic equilibrium, the electric field \\(\\vec{E}\\) inside the isolated conductor must be zero. Otherwise, the field would exert forces on the conduction electrons, and thus generate perpetual current in an isolated conductor.
    • Gauss\u2019 law then tells us that the net charge inside the Gaussian surface must also be zero; the excess charge must lie on the actual surface of the conductor.

    For the same conductor with a cavity, is there excess charge on the cavity wall?

    • We draw a Gaussian surface surrounding the cavity, close to its surface but inside the conducting body.
    • Because \\(\\vec{E} = 0\\) inside the conductor,there can be no flux through this new Gaussian surface
    • No charge on the cavity wall
    • The cavity can be enlarged until it consumes the entire conductor, leaving only the charges. The electric field would not change at all; so the electric field is set up by the charges and not by the conductor.
    "},{"location":"GP/lec1-3/lec1/#electric-field-outside-spherical-conductors","title":"Electric Field Outside Spherical Conductors","text":"
    • Shell Therom https://en.m.wikipedia.org/wiki/Shell_theorem

    If we enclose the conductor in a concentric Gaussian sphere, Gauss\u2019 law tells us that the electric field outside the surface of the conductor looks as if all the excess charge on the shell were concentrated at its center.

    "},{"location":"GP/lec1-3/lec1/#electric-field-outside-isolated-conductors","title":"Electric Field Outside Isolated Conductors","text":"
    • the electric field just outside the surface of a conductor can be determined using Gauss\u2019 law.
    • The electric field \\(\\vec{E}\\) at and just outside the conductor\u2019s surface must also be perpendicular to that surface.
    "},{"location":"GP/lec1-3/lec1/#flat-surface","title":"Flat surface","text":""},{"location":"GP/lec1-3/lec1/#parallel-plates","title":"Parallel Plates","text":""},{"location":"GP/lec1-3/lec1/#charge-inside-a-spherical-metal-shell","title":"Charge Inside a Spherical Metal Shell","text":"
    • Therefore, a total charge Q must lie on the inner wall of the shell in order that the net enclosed charge be zero.
    • Because the shell is electrically neutral,a total charge -Q leave the inner wall and move to the outer wall.
    • They must spread out uniformly.(This would be true no matter where inside the shell the particle happened to be located)
    "},{"location":"GP/lec1-3/lec1/#quantify-charge-distributionthe-method-of-images","title":"Quantify Charge Distribution(The Method of Images)","text":""},{"location":"GP/lec1-3/lec1/#asimple-analysis","title":"A.Simple Analysis","text":"

    There is a charge +q outside a spherical metal shell at a distance\\(r+R\\) from its center,how to decide the image?

    • Note:at the center C,all charges on the spherical shell exerts \\(ZERO\\) potentials on the point so \\(V_c=\\frac{kq}{(R+r)^2}\\)
    "},{"location":"GP/lec1-3/lec1/#b-a-single-grounded-pallete-with-a-charge-q-at-a-distance-d","title":"B. A single grounded pallete with a charge q at a distance d","text":"
    • In this way \\(V(x,y,z)=\\frac{\\frac{q}{ 4\\pi\\epsilon_0}}{\\sqrt{x^2+y^2+(z-d)^2}}- \\frac{\\frac{q}{ 4\\pi\\epsilon_0}}{\\sqrt{x^2+y^2+(z+d)^2}}\\)

    • We assert this is the solution for the upper half region.

    • We can check that\\(V(x,y,z=0)=0\\),and\\(V \u21920\\)for\\(x^2 +y^2 +z^2 \u226bd2.\\)

    • At z = 0, \\(\\vec{E}\\) = \u2212\u2207V is perpendicular to the xy plane, just as it would need to be with the grounded plane.
    • The only charge in the region z > 0 is q at (0,0,d).

    • According to Gauss\u2019 law, the surface charge density \u03c3 induced on the conductor is:

    \\(E=-\\epsilon_0\\frac{\\partial V}{\\partial z}|_{z=0}=\\frac{-qd}{2\\pi\\epsilon_0(x^2+y^2+d^2)^\\frac{3}{2}}\\hat{z}\\)

    \\(\\sigma=\\epsilon_0\\cdot E =\\frac{-qd}{2\\pi(x^2+y^2+d^2)^\\frac{3}{2}}\\)

    • Bringing q from infinity needs ? W

    Derive as little circles

    \\(V=\\int_0^\\infty\\frac{qd\\cdot 2\\pi r dr}{2\\pi(r^2+d^2)^{3/2}}\\cdot\\frac{q}{4\\pi\\epsilon_0(r^2+d^2)^{1/2}}=\\frac{q^2d}{8\\pi\\epsilon_0}\\int_0^{\\infty}\\frac{d(r^2)}{r^2+d^2}=-\\frac{q^2}{8\\pi\\epsilon_od}\\)

    which is half of the energy for bringing two point charges to a distance 2d with no conductor.

    "},{"location":"GP/lec1-3/lec1/#positive-charge-q-and-a-conducting-sphere","title":"positive charge +Q and a conducting sphere","text":"

    Solve the electro-static potential function \\(V(x,y,z)\\) and the electrostatic field \\(E(x,y,z)\\) in space, with a positive charge \\(+Q\\) located at \\((\u2212D, 0, 0)\\)and a conducting sphere of radius R (not grounded) at origin \\((R<D)\\).

    Pre - knowledge :

    • the grounded case with a charge outside(pictures below)

    Image : \\(r'=\\frac{R^2}{D}\\) \\(q'=-qR/D\\)

    Derivation :

    \\(\\begin{align*}V(\\theta)&=\\frac{q'}{4\\pi\\epsilon_0}\\cdot\\frac{1}{\\sqrt{R^2+r'^2-2Rr'cos\\theta}}+\\frac{Q}{4\\pi\\epsilon_0}\\cdot\\frac{1}{\\sqrt{R^2+D^2-2RDcos\\theta}}=0\\end{align*}\\)

    \\(\\Rightarrow \\frac{1}{4\\pi\\epsilon_0}[\\frac{\\frac{q'}{\\sqrt{Rr'}}}{\\sqrt{R/r'+r'/R-2cos\\theta}}+\\frac{\\frac{Q}{\\sqrt{RD}}}{\\sqrt{R/D+D/R-2cos\\theta}}]=0\\)

    \\(\\begin{align*}\\Rightarrow &\\frac{q'}{\\sqrt{Rr'}}+\\frac{Q}{\\sqrt{RD}}=0\\\\ &\\frac{R}{r'}+\\frac{r'}{R}=\\frac{R}{D}+\\frac{D}{R}\\end{align*}\\)

    \\(\\Rightarrow R/r'=D/R \\Rightarrow r'=R^2/D \\Rightarrow q'=-\\frac{qR}{D}\\)

    • the grounded case with a charge inside(Actually it's bascially the same thing)

    * Also See https://galileoandeinstein.phys.virginia.edu/Elec_Mag/2022_Lectures/EM_08_Images.html

    "},{"location":"GP/lec1-3/lec1/#appendix","title":"Appendix \uff1a","text":""},{"location":"GP/lec1-3/lec1/#cross-product","title":"Cross product","text":"
    • \\(\\vec{A} \u00d7(\\vec{B} +\\vec{C})=\\vec{A} \u00d7\\vec{B} +\\vec{A} \u00d7\\vec{C}\\)
    "},{"location":"GP/lec1-3/lec1/#_1","title":"\u7acb\u4f53\u89d2","text":"

    \\(dA=r^2sin\\theta d\\theta d\\Phi\\)

    \\(Solid \\ Angle\\ d\\Omega = \\frac{dA}{r^2}=sin\\theta d\\theta d\\Phi\\)

    \\(dV=r^2sin\\theta d\\theta d\\Phi dr\\)

    "},{"location":"GP/light/inteference/","title":"interference & refraction","text":""},{"location":"GP/light/inteference/#interference","title":"Interference","text":""},{"location":"GP/light/inteference/#the-superposition-of-waves","title":"The Superposition of Waves","text":""},{"location":"GP/light/inteference/#wave-equation","title":"Wave Equation","text":"

    Recall that each field component of an electromagnetic wave$ (Ex, Ey, Ez, Bx, By, and Bz) $satisfies the scalar 3D differential wave equation

    \\(\\frac{1}{v^2}\\frac{\\partial^2{\\phi}}{\\partial t^2}=\\frac{\\partial^2{\\phi}}{\\partial x^2}+\\frac{\\partial^2{\\phi}}{\\partial y^2}+\\frac{\\partial^2{\\phi}}{\\partial z^2}\\)

    This equation is linear \\(\\vec{\\phi}(r,t)\\) and its derivatives appear only to the first power.

    Consequently, if \\(\\vec{\\phi}(r,t)\\) are solutions, any linear combination of them \\(\\vec{\\phi}(r,t)=\\sum_{i=1}^nC_i\\vec{\\phi}_i(r,t)\\) will be a solution as well.

    • Examples

    "},{"location":"GP/light/inteference/#trigonometry-formulas","title":"Trigonometry Formulas","text":"

    \\(cos(\u03b1 + \u03b2) = cos \u03b1 cos \u03b2 \u2212 sin \u03b1 sin \u03b2\\)

    \\(cos(\u03b1 \u2212 \u03b2) = cos \u03b1 cos \u03b2 + sin \u03b1 sin \u03b2\\)

    \\(cos \u03b1 + cos \u03b2 = 2 cos \\frac{(\u03b1 + \u03b2)}{2} cos\\frac{(\u03b1 - \u03b2)}{2}\\)

    \\(cos \u03b1 \u2212 cos \u03b2 = -2 sin \\frac{(\u03b1 + \u03b2)}{2} sin\\frac{(\u03b1 - \u03b2)}{2}\\)

    "},{"location":"GP/light/inteference/#the-algebraic-method-of-adding-waves","title":"The Algebraic Method of Adding Waves","text":"

    \\(E_1 = E_{01}cos(\u03b1_1 \u2212 \u03c9t)\\)

    \\(E_2 = E_{02}cos(\u03b1_2 \u2212 \u03c9t)\\)

    \\(\u03b1_i = kx_i + \u03c6_i\\) with \\(x_i\\) being the distance from the source \\(s_i\\) of the waveto the point of observation.

    The linear combination of the waves is \\(E \u2261 E_0 cos(\u03b1 \u2212 \u03c9t) = E_1 + E_2\\)

    We get :

    \\(E_0cos\u03b1=E_{01}cos\u03b1_1 +E_{02}cos\u03b1_2\\)

    \\(E_0sin\u03b1=E_{01}sin\u03b1_1 +E_{02}sin\u03b1_2\\)

    \\(\\Rightarrow \\vec{E_0}=\\vec{E_{01}}+\\vec{E_{02}}\\)

    \\(E_0^2=E_{01}^2+E_{02}^2+2E_{01}E_{02}cos(\\alpha_2-\\alpha_1)\\)

    The resultant intensity is not simply the sum of the component intensity

    there is an additional contribution \\(2E_{01}E_{02}cos(\u03b1_2 \u2212 \u03b1_1)\\), known as the interference term.

    The phase difference may arise from a difference in path length traversed by the two waves, as well as a difference in the initial phase angle \\(\u03b4 =\\alpha_2-\\alpha_1= \\frac{2\u03c0}{\\lambda}(x_2 \u2212x_1)+(\u03c6_2 \u2212\u03c6_1).\\)

    "},{"location":"GP/light/inteference/#the-complex-method","title":"The Complex Method","text":"

    It is often mathematically convenient to make use of the complex representation when dealing with the superposition of harmonic waves.

    We now redo the calculation of adding two waves.

    The wave function \\(E_1 =E_{01}cos(\u03b1_1 \u2212\u03c9t)=E_{01}cos(kx_1 \u2212\u03c9t+\u03c6_1)\\) can be written as \\(\\tilde{E}_1 = E_{01}e^{i(\u03b1_1\u2212\u03c9t)} = E_{01}e^{i\u03b1_1}e^{\u2212i\u03c9t}\\) if we are interested only in the real part.

    • erratum \\(E_0^2=(E_0e^{i\\alpha})(E_0e^{-i\\alpha})\\)
    "},{"location":"GP/light/inteference/#phasor-addition","title":"Phasor Addition","text":"

    Now we discuss a graphical technique that uses vector additions instead of trigonometric additions.

    We can map a wave, which has an amplitude and a phase, to a vector, known as a phasor, in a two-dimensional plane, such that

    "},{"location":"GP/light/inteference/#summary","title":"Summary","text":"
    • The three methods all deal with addition in a two-dimensional space.
    • The phasor addition adds vectors (with x component and y component) in a two-dimensional real space.
    • The complex method is an addition of complex numbers (with real part and imaginary part) in a complex plane.
    • The algebraic or trigonometric method is most complex. In fact, it is an addition of functions (linear combination of \\(cos \u03c9t\\) and \\(sin \u03c9t\\)) in a two-dimensional Hilbert space, spanned by cos \u03c9t and sin \u03c9t.
    "},{"location":"GP/light/inteference/#natural-light","title":"Natural Light","text":"
    • Now, one may think that light from two fine incandescent wires would interfere.
    • This does not occur, because the light is emitted by vast numbers of atoms in the wires, acting randomly and independently for extremely short times \u2014 of the order of nanoseconds. The light is said to be incoherent.
    • As a result, at any given point on the viewing screen, the interference between the waves from the two sources varies rapidly and randomly between fully constructive and fully destructive. The screen is seen as being uniformly illuminated (over the time scale of our observation).
    "},{"location":"GP/light/inteference/#conditions-for-interference","title":"Conditions for Interference","text":"
    • To observe the interference of the two waves describedabove, we need the following conditions.
    • Two beams must have (nearly) the same frequency \u03c9. Otherwise, the phase difference is time-dependent. During the detection interval, the interference pattern will be averaged away.
    • The clearest pattern (with maximum contrast) exists when interfering waves have (nearly) equal amplitude. Why?
    • Initial phase difference can exist between sources, as long as it remains constant; the two sources are said to be coherent.

    • Until the advant of laser, no two individual sources can maintain a constant relative phase long enough for an observable interference pattern.

    "},{"location":"GP/light/inteference/#huygens-principle","title":"Huygens\u2019 Principle","text":"

    Each point on a wavefront may be regarded as a source of waves expanding from that point.

    If waves strike a barrier with a small opening, the waves may be seen to expand from the opening. Notice the wavelength is larger than the opening in this case.

    "},{"location":"GP/light/inteference/#youngs-interference-experiment","title":"Young\u2019s Interference Experiment","text":"
    • The slit \\(S_0\\) in screen A creates a spatially coherent beam that could identically illuminate slits \\(S_1\\) and \\(S_2\\) in screen B.
    • NOTE\uff1aSpatial incoherence arises from the fact that a realistic source (like a lightbulb) contains widely spaced point sources that changes phase rapidly and randomly (due to the granular nature of the emission process).
    • Nowadays screen A is no longer needed, and plane waves from a laser can provide the spatial coherence the experiment needs.
    • Light waves produce fringes in a Young\u2019s double-slit interference experiment, but what exactly determines the locations of the fringes?

    In other words, the light leaving the slits is in phase.

    However, the electric field components of these waves at point P are not in phase and vary with time as

    \\(E_1 =E_0cos(kr_1 \u2212\u03c9t)=E_0cos(kL+\u03b2\u2212\u03c9t)\\)

    \\(E_2 =E_0cos(kr_2 \u2212\u03c9t)=E_0cos(kL\u2212\u03b2\u2212\u03c9t)\\)

    Where the phase difference \\([L = (r_1 + r_2)/2 = \\sqrt{D^2+y^2}]\\) \\([\u03b4_2 = 2\u03b2 = k\u2206L = \\frac{2\u03c0d}{\\lambda} sin\u03b8.]\\)

    • The total intensity is thus given by \\(I \u221d 2E_{0}^2[1 + cos(2\u03b2)] \\ or\\ I = I_{max }cos^2\u03b2.\\)

    Therefore, a bright fringe appears when \\(\u2206L = d sin \u03b8 = m\u03bb\\) where m is an integer.

    On the other hand, a dark fringe appears when \\(\u2206L=dsin\u03b8= (m+\\frac{1}{2}) \u03bb\\) where m is an integer.

    We can then find the angle \u03b8 to any fringe and thus use the values of m to label the fringes.

    • For \\(\\triangle \\theta\\) \\(d(sin\\theta_1-sin\\theta_2)=\\frac{\\lambda}{2} \\Rightarrow dcos(\\frac{\\theta_1+\\theta_2}{2})\\triangle \\theta=\\frac{\\lambda}{2}. \\Rightarrow \\triangle \\theta = \\frac{\\lambda}{2dcos\\theta}\\)
    "},{"location":"GP/light/inteference/#interference-from-thin-films","title":"Interference from Thin Films","text":"

    So, reflecting off higher index, ray \\(r_1\\) has an additionalreflection phase shift 0.5 wavelength. There is no such shift for \\(r_2\\)

    In addition, the light waves of rays \\(r_1\\) and \\(r_2\\) has a path difference \\(2L\\), which occurs in index \\(n_2\\).Notice that the wavelength in the medium is \\(\u03bb_2=\\frac{v_2}{f}=\\frac{c}{n_2}\\frac{1}{f}=\\frac{\\lambda}{n_2}\\)

    Therefore, rays are in phase if \\(2L=(m+\\frac{1}{2})\\frac{\\lambda}{n_2}\\) , for integer m.

    They produce an interference maximum and the nearby region on the film is bright to observers.

    Similarly, if they are exactly out of phase \\(2L=m\\frac{\\lambda}{n_2}\\) they produce an interference minimum and the nearby region is dark, even though it is illuminated.

    "},{"location":"GP/light/inteference/#negligible-film-thickness","title":"Negligible Film Thickness","text":"
    • See at the top BLACK AREA which is because that the film is just so thin
    "},{"location":"GP/light/inteference/#newtons-rings","title":"Newton\u2019s Rings","text":"

    Newton\u2019s rings are interference patterns formed by light incident on the thin film of air between a convex lens and a flat (or between two suitable lenses).

    "},{"location":"GP/light/light/","title":"Light","text":""},{"location":"GP/light/light/#light-as-electromagnetic-waves","title":"Light as Electromagnetic Waves","text":""},{"location":"GP/light/light/#plane-wave","title":"Plane Wave","text":""},{"location":"GP/light/light/#transmission-of-light-in-matter","title":"Transmission of Light in Matter","text":"
    • In dielectric materials, the electric field is altered by a factor \\(\u03b5_r\\) , the relative permittivity (also called the dielectric constant \\(\u03ba\\)).

    • In magnetic materials (therefore, not in glass or plastic), the magnetic field is altered by a factor \\(\u03bc_r\\) , the relative permeability.

    Therefore, a light wave propagating through any substantive medium travels at a speed \\(v=\\frac{c}{n}=\\frac{1}{\\sqrt{\\epsilon_r\\mu_r}}\\frac{1}{\\sqrt{\\epsilon_o\\mu_o}}\\) where the index of refraction \\(n=\\sqrt{\\epsilon_r\\mu_r}\\)

    • The dispersion relation becomes \\(w=vk=ck/n\\) hence\\(k=nk_0\\ where\\ k_0 \\ is\\ the\\ wave\\ number\\ in\\ vaccum\\)
    "},{"location":"GP/light/light/#reflection-and-refraction","title":"Reflection and Refraction","text":"
    • Law of reflection: A reflected ray lies in the plane of incidence and has an angle of reflection equal to the angle of incidence (both relative to the normal)
    • Law of refraction: A refracted ray lies in the plane of incidence and has an angle of refraction \\(\u03b8_2\\) that is related to the angle of incidence \\(\u03b8_1\\) by \\(n_2sin\\theta_2=n_1sin\\theta_1\\) (Snell\u2019s law.)
    "},{"location":"GP/light/light/#total-internal-reflection","title":"Total Internal Reflection","text":""},{"location":"GP/light/light/#fermats-principle","title":"Fermat\u2019s Principle","text":"
    • The actual path between two points taken by a beam of light is the one that is traversed in the least time.
    • For a homogeneous medium the principle reduces to the law of the rectilinearity of a ray of light (in accordance with the axiom of geometry that a straight line is the shortest distance between two points).

    \\(Derivation\\)

    • Reflection(simple ignore)
    • Refraction

    \\(t(x)=\\frac{\\bar{SO}}{v_i}+\\frac{\\bar{OP}}{v_t}=\\frac{\\sqrt{x^2+h^2}}{\\frac{c}{n_i}}+\\frac{\\sqrt{(a-x)^2+b^2}}{\\frac{c}{n_t}}\\)

    • To minimize \\(t(x)\\) with respect to variations in x, we set \\(dt/dx = 0\\)

    \\(\\frac{dt}{dx}=\\frac{n_i}{c}\\frac{x}{\\bar{SO}}-\\frac{n_t}{c}\\frac{a-x}{\\bar{OP}}=0\\)

    Thus \\(n_isin\\theta_i=n_tsin\\theta_t\\)

    "},{"location":"GP/light/light/#huygens-principle","title":"Huygens\u2019 Principle","text":"

    Huygens\u2019 principle is: All points on a wavefront serve as point sources of spherical secondary wavelets. After a time \\(t\\), the new position of the wavefront will be that of a surface tangent to these secondary wavelets.

    • Reflection

    Thus , We get Law of reflection.

    • Refraction

    \\(\\triangle t = \\frac{\\triangle l\\ tan\\theta_1}{v_1}\\)

    \\(R=v_2 \\cdot \\triangle t\\)

    \\(v_i=\\frac{c}{n_i}\\)

    \\(\\Rightarrow R=\\frac{n_1}{n_2}\\triangle l \\cdot tan\\theta_1\\)

    \\(sin\\theta_2=\\frac{R}{\\frac{\\triangle l}{cons\\theta_1}}\\)

    \\(\\Rightarrow n_1sin\\theta_1=n_2sin\\theta_2\\)

    Thus We get Law of refraction.

    "},{"location":"GP/light/light/#the-electromagnetic-approach","title":"The Electromagnetic Approach","text":"

    \\(\\vec{E}_i = \\vec{E}_{0i}cos(\\vec{k}_i \\cdot\\vec{r}\u2212\u03c9_it)\\)

    \\(\\vec{E}_r = \\vec{E}_{0r}cos(\\vec{k}_r \\cdot\\vec{r}\u2212\u03c9_rt+\\phi_r)\\)

    \\(\\vec{E}_t = \\vec{E}_{0t}cos(\\vec{k}_t \\cdot\\vec{r}\u2212\u03c9_tt+\\phi_t)\\)

    • Above the surface : \\(\\vec{E}=\\vec{E_i}+\\vec{E_r}\\)
    • Below the surface \\(\\vec{E}=\\vec{E_t}\\)
    • For simplicity, we consider the case that \\(\\vec{E_{0i}}\\)\\(\\vec{E_{0r}}\\ \\vec{E_{0t}}\\) are constant in time

    \\(Boundary\\ conditions\\)

    • Draw a narrow closed path C that runs parallel to the interface inside bot media. According to the Faraday's Induction Law,we have \\(\\oint\\vec{E}\\cdot d\\vec{s}=-\\frac{d\\Phi_B}{dt}\\)

    • The loop can be made so narrow such that there is no flux through C.
    • Define \\(\\hat{u}_n\\)to be the unit vector normal to the interface
    • The boundary condition leads to :\\((\\vec{E}_i+\\vec{E}_r-\\vec{E}_t)\\)perpendicular to \\(\\vec{l}\\) thus parallel to \\(\\vec{u_n}\\)

    \\(\\hat{u}_n \\times (\\vec{E}_i+\\vec{E}_r)-\\hat{u}_n \\times \\vec{E}_t=0\\) which is satisfied for all values of time and at any point on the interface.

    Thus, we have :

    \\(\\begin{align*}&\\hat{u}_n \\times \\vec{E}_{0i}cos(\\vec{k}_i \\cdot\\vec{r}\u2212\u03c9_it)+\\hat{u}_n \\times \\vec{E}_{0r}cos(\\vec{k}_r \\cdot\\vec{r}\u2212\u03c9_rt+\\phi_r)\\\\ &= \\hat{u}_n \\times \\vec{E}_{0t}cos(\\vec{k}_t \\cdot\\vec{r}\u2212\u03c9_tt+\\phi_t) \\end{align*}\\)

    • This can only be satisfied if \\(\u03c9_i = \u03c9_r = \u03c9_t\\), which means the charged particles within the media are undergoing forced oscillations at the frequency of the incident wave.
    • Furthermore, for any \\(\\vec{r}\\) terminating on the interface

    \\((\\vec{k_i}\\cdot \\vec{r})|_{y=b}=(\\vec{k_r}\\cdot \\vec{r}+\\phi_r)|_{y=b}=(\\vec{k_t}\\cdot \\vec{r}+\\phi_t)|_{y=b}\\)

    Thus,We have \\((\\vec{k_i}-\\vec{k_r})|_{y=b}=\\phi_r\\) or \\((\\vec{k}_i-\\vec{k_r})\\cdot(\\vec{r_1}-\\vec{r_2})=0\\) for any pair of \\(\\vec{r_1}\\) and \\(\\vec{r_2}\\) terminating on the interface.

    For $\\hat{u_n}\\cdot (\\vec{r_1}-\\vec{r_2})=0 $,we know \\((\\vec{k_i}-\\vec{k_r})\\) is parallel to \\(\\hat{u_n}\\) or \\(k_isin\\theta_i=k_rsin\\theta_r\\)\u300cREFLECTION LAW\u300d

    Since the incident and reflected waves are in the same medium, \\(k_i = k_r\\) , so, finally, \\(\u03b8_i = \u03b8_r\\) (the law of reflection).

    • Similarly \\((\\vec{k_i}-\\vec{k_t})\\) is also parallel to \\(\\hat{u_n}\\) we have:

    \\(\\vec{k_i}\\times\\hat{u_n}=\\vec{k_t}\\times\\hat{u_n}\\)

    Or. \\(n_i(\\hat{k_i}\\times\\hat{u_n})=n_t(\\hat{k_t}\\times\\hat{u_n})\\)\u300cREFRACTION LAW\u300d

    • Note that the law of reflection and the law of refraction only rely on the phase relationship that exists among the phases of \\(\\vec{E}_{0i}\\), \\(\\vec{E}_{0r}\\) and \\(\\vec{E}_{0t}\\) at the boundary.

    • There is still an interdependence shared by the amplitudes \\(\\vec{E}_{0i}\\), \\(\\vec{E}_{0r}\\) and \\(\\vec{E}_{0t}\\). The additional constraint can be used to calculate the amplitude of the reflected wave and the transmitted wave (the Fresnel equations). This will lead to the phenomenon of polarization by reflection (to be discussed in the lecture on polarization).

    "},{"location":"GP/light/light/#geometrical-optics","title":"Geometrical Optics","text":""},{"location":"GP/light/light/#spherical-mirrors","title":"Spherical Mirrors","text":"
    • Store surveillance mirrors are usually convex to take advantage of the increase in the field of view \u2014 more of the store can then be seen with a single mirror.
    • Makeup mirrors and shaving mirrors are concave \u2014 they produce a larger image of a face.
    • For mirrors of both types, the focal length f is related to the radius of curvature r of the mirror by \\(f=r/2\\) where r is positive for a concave mirror and negative for a convex mirror.
    "},{"location":"GP/light/light/#focal-points-of-spherical-mirrors","title":"Focal Points of Spherical Mirrors","text":"

    \\(Proof\\)

    "},{"location":"GP/light/light/#images-from-spherical-mirrors","title":"Images from Spherical Mirrors","text":"

    \\(\\frac{1}{p}+\\frac{1}{i}=\\frac{1}{f}\\)

    \\(Proof\\)

    • We assume small angles (but for clarity the rays are drawn with exaggerated angles).

    • Clearly, When \\(p>f\\) \\(i\\) is positive, indictaing a real image.

    When \\(p<f\\) \\(i\\) is negative,indicating an imaginary image.

    • \\(-\\frac{i}{p}\\) -- scaling factor

    When \\(i\\) > 0 : an upsidedown real image

    When \\(i\\) <0 : an erect imaginary image

    \\(Proof\\)

    "},{"location":"GP/light/light/#spherical-refraction","title":"Spherical Refraction","text":"

    \\(Proof\\)

    • Quite the same when convex(only \\(i\\) & \\(r_0\\) Are negative)

    Thus \\(f\\) for convex lens is positive , for concave lens is negative

    \\(Proof\\)

    It can also be applied for any number of lenses.

    The overall (or net) lateral magnification M of a system of lenses (or lenses and a mirror) is the product of the individual lateral magnifications as given by \\(m = \u2212i/p\\).

    "},{"location":"GP/light/light/#application","title":"Application","text":"

    The normal human eye can focus a sharp image of an object on the retina if the object is located beyond the near point (\u223c 25 cm from the eye).

    To see better, we want to generate an magnified image of an object at the near point, instead of putting the object there.

    • Explain eg \\(p2\\) : \\(\\frac{1}{p_2}+\\frac{1}{i_2}=\\frac{1}{f}\\) but \\(i_2<0\\),Thus if we want \\(|i_2|\\)to be large ,\\(p_2\\) has to be relatively large, but also \\(p_2\\)has to be smaller than \\(f_{ey}\\) , thus \\(p2 <\\approx f_{ey}\\).

    • This leaves the distance between the two lenses \\(f_{ob} + s + f_{ey}\\) the only parameter to tune. The longer the distance, the larger the magnification

    \\(M = m_1m_2 \\approx -\\frac{f_{ob}+s}{f_{ob}}\\frac{25}{f_{ey}}\\)

    • We can make \\(s \u226b fob\\), so \\(M \u2248 \u2212(s/f_{ob})(25 cm/f_{ey})\\) (s still limited by the practical sizes of microscope)

    "},{"location":"GP/light/df/diffraction/","title":"Diffraction & Interference","text":""},{"location":"GP/light/df/diffraction/#plane-wave","title":"plane wave","text":"

    A plane wave is a type of wave whose wavefronts are flat, or nearly flat. This means that the wave crests and troughs are aligned along parallel lines. Plane waves are an important concept in physics and are often used to describe various types of waves, including electromagnetic waves and sound waves.

    Key characteristics of a plane wave include:

    1. Constant Phase Front: In a plane wave, all points on a wavefront have the same phase. The phase of a wave is a measure of the position of a point in its cycle relative to a reference point.

    2. Parallel Propagation: The wavefronts of a plane wave propagate in parallel lines. This is in contrast to spherical waves, where the wavefronts are spheres centered around the source.

    3. Mathematical Representation: Mathematically, a one-dimensional plane wave can be represented as a function of the form:

    \\(Acos\u2061(kx\u2212\u03c9t+\u03d5)\\)

    where:

    • A is the amplitude of the wave,
    • k is the wave number (related to the wavelength),
    • x is the spatial coordinate,
    • \u03c9 is the angular frequency,
    • t is time, and
    • \u03d5 is the phase angle.
    1. Infinite Extent: In theoretical discussions, plane waves are often assumed to have infinite extent, meaning they continue indefinitely in space.

    Plane waves are useful in physics because they simplify the mathematical description of wave phenomena, making it easier to analyze and solve problems. They are often used as a starting point for understanding more complex wave behavior. In the context of electromagnetic waves, for example, plane waves are fundamental to the study of optics and electromagnetic field theory.

    "},{"location":"GP/light/df/diffraction/#single-slit-diffraction","title":"Single-Slit Diffraction","text":""},{"location":"GP/light/df/diffraction/#electric-field-and-intensity","title":"Electric Field and Intensity","text":"

    To find an expression for the intensity at an arbitrary point P on the viewing screen, corresponding to a particular small angle \u03b8, we need to divide the slit into N zones of equal widths \\(\u2206x = a/N\\) small enough that we can assume each zone acts as a source of Huygens wavelets.

    We then add the phasors for the wavelets, which form a geometric series(notice. \\(r_{i+1}\u2212r_i =\u2206xsin\u03b8\\)):

    \\(\\widetilde{E}_\\theta =\\frac{E_0}{N}e^{-iwt}e^{ikr+1}\\times [1+e^{ik(r_2-r_1)}+e^{ik(r_3-r_1)}+\u2026+e^{ik(r_N-r_1)}]\\)

    note \\(\\Phi\\)=\\(\\frac{asin\\theta}{\\lambda}\\times2\\pi\\)

    Summary

    • When \\(\\alpha=0 (\\theta=0)\\),the intensity reaches the maximum
    • When \\(\\alpha =n\\pi(n\\ne0)\\),which is \\(asin\\theta=n\\lambda\\) the intensity is ZERO
    • When a is approximately large \\(\\theta\\) is rather small ,meaning that there is no diffraction

    "},{"location":"GP/light/df/diffraction/#from-sum-to-integral","title":"From Sum to Integral","text":"

    \\(\\begin{align*}\\widetilde{E}_\\theta &=\\frac{E_0}{N}e^{-iwt}e^{ikr+1}\\times [1+e^{ik(r_2-r_1)}+e^{ik(r_3-r_1)}+\u2026+e^{ik(r_N-r_1)}]\\\\&=\\frac{E_0 \\triangle x}{a}e^{-iwt}[e^{ikr_1}+e^{ikr_2}+\u2026+e^{ikr_N}]\\end{align*}\\)

    \\(\\Rightarrow_{N\\to+\\infty} \\widetilde{E}_\\theta = \\frac{E_0}{a} e^{-iwt}\\int_0^ae^{ik\uff08sin\\theta x+r_1\uff09}dx\\) ~ \\(\\int_{-a/2}^{a/2}e^{ik_xx}dx\\) \\((k_x=ksin\\theta)\\)

    "},{"location":"GP/light/df/diffraction/#fourier-transform","title":"Fourier Transform","text":"

    Thus \\(\\widetilde{E}_{sq}(k_x)= E_0a\\frac{2sin(k_xa/2)}{k_x}=E_0a\\frac{sin\\alpha}{\\alpha}(\\alpha=k_xa/2=\\frac{sin\\theta a}{2})\\)

    The key message is that the field distribution in the Fraunhofer diffraction pattern is the Fourier transform of the field distribution across the aperture.

    "},{"location":"GP/light/df/diffraction/#diffraction-by-a-circular-aperture","title":"Diffraction by a Circular Aperture","text":"

    We are essentially collecting only a fraction of the incident wavefront and therefore cannot hope to form a perfect image. The image is related to the Fourier transform of a disk and is known as the Airy pattern.

    The analysis of such patterns shows that the first minimum for the diffraction pattern of a circular aperture of diameter a is located by \\(sin\\theta = 1.22\\frac{\\lambda}{a}\\) in contrast to \\(sin \u03b8 = \u03bb/a\\) in the slit case.

    "},{"location":"GP/light/df/diffraction/#resolvability","title":"Resolvability","text":"

    Two objects cannot be distinguished from a single point object, if their diffraction patterns (mainly their central maxima) overlap. Rayleigh\u2019s criterion for resolvability states that the two point objects are barely resolved if their angular separation is such that the central maximum of the diffraction pattern of one source is centered on the first minimum of the diffraction pattern of the other, i.e.\\(\u03b8_R = sin^{\u22121} \\frac{1.22\u03bb}{a} \u2248 1.22\\frac{\\lambda}{a}\\)

    • Quesiton\uff1f QUIZ
    "},{"location":"GP/light/df/diffraction/#grating-and-spectra","title":"Grating and Spectra","text":""},{"location":"GP/light/df/diffraction/#diffraction-by-a-double-slit","title":"Diffraction by a Double Slit","text":"

    Formally, with diffraction effects taken into account, the intensity of a double-slit interference pattern (shown later with the Fourier method) is

    \\(I(\\theta)=I_{max}(\\frac{sin\\alpha}{\\alpha})^2cos^2\\beta\\) where \\(\\beta = \\frac{\\delta_2}{2}=\\frac{\\pi}{\\lambda}dsin\\theta\\) \\(\\alpha = \\frac{\\pi}{\\lambda}asin\\theta\\)

    • The first minimum occurs where the phase difference between the two slits (N = 2) is \\(\u03b4_2 =(2\u03c0/\u03bb)dsin\u03b8=\u03c0.\\)
    • The first minimum of the envelope occurs where the phase difference between one edge and the center of a single slit is \\(\u03b1 = (2\u03c0/\u03bb)(a/2) sin \u03b8 = \u03c0.\\)
    • One can, therefore, determine (d/a) by counting fringes.
    • In both cases, the larger the length (d or a) is, the smaller the \\(\u03b8\\) (or \\(k_x =ksin\u03b8\\) ) is.
    "},{"location":"GP/light/df/diffraction/#derivation","title":"Derivation","text":"

    The interference pattern can be understood by a convolution theorem for the Fourier transformation: The transform\uff08Fourier\uff09 of the convolution of two functions \\((f*g)\\) is the product of their transforms.

    \\(Proof\\)

    \\((f*g)(x)=\\int dx\\int dx'f(x')g(x-x')e^{ikx}\\\\=\\int f(x')e^{ikx'}d x'\\int dx\\ g(x-x')e^{ik(x-x')}\\)

    Thus

    • The single-slit aperture function :\\(F[E_{sq}(x)]=\\widetilde{E}_{sq}(k_x)=\\int_{-a/2}^{a/2}E_0e^{ikx}dx= E_0a\\frac{2sin(k_xa/2)}{k_x}=E_0a\\frac{sin\\alpha}{\\alpha}(\\alpha=k_xa/2=\\frac{sin\\theta a}{2})\\)

    • Young\u2019s double-slit interference result\uff1a

    Young's double-slit interference result is related to the interference pattern formed by two narrow slits. The function h(x) describes the distribution of intensity along the screen where the interference pattern is observed. In this case, h(x) is represented as a sum of two delta functions:

    \u200b \\(h(x) = \u03b4(x + d/2) + \u03b4(x \u2212 d/2)\\)

    Here, d is the separation between the two slits, and \u03b4(x) is the Dirac delta function. The Dirac delta function is a mathematical concept often used in physics to model idealized distributions. It is not a traditional function but rather a distribution that satisfies certain properties. In this context, \u03b4(x) can be thought of as an infinitely tall and narrow spike located at x=0.

    \u200b \\(F[h(x)]=\\int_{-\\infty}^{+\\infty} h(x)e^{ik_xx}dx= e^{-ik_xd/2}+e^{ik_xd/2}=2cos(k_xd/2)\\)

    "},{"location":"GP/light/df/diffraction/#interference-vs-diffraction","title":"Interference vs Diffraction","text":"

    If we let \\(a\u21920\\), then \\(\u03b1\u21920\\) and\\(\\frac{sin\\alpha}{\\alpha}\u21921\\). Our result then reduces, as it must, to an equation describing the interference pattern for a pair of vanishingly narrow slits with slit separation d.

    Similarly, putting \\(d \u2192 0\\) is equivalent physically to causing the two slits to merge into a single slit of width a. Then we have \\(\u03b2\u21920\\) and \\(cos2\u03b2\u21921\\). Our result reduces,as it must,to an equation describing the diffraction pattern for a single slit of width a.

    If the combining waves originate from a small number of elementary coherent sources \u2014 as in a double-slit experiment with a \u226a \u03bb \u2014 we call the process interference.

    If the combining waves originate in a single wavefront \u2014 as in a single-slit experiment \u2014 we call the process diffraction.

    Note that both are superposition effects and usually both are present simultaneously.

    "},{"location":"GP/light/df/diffraction/#diffraction-gratings","title":"Diffraction Gratings","text":"

    In double-slit interference with a \u226a \u03bb \\(I(\u03b8) = I_{max}cos^2 [\\frac{\u03c0d}{\\lambda} sin\u03b8]\\)

    The bright fringes due to different wavelengths overlap too much to be distinguished.

    A useful tool in the study of light and of objects that emit and absorb light is the diffraction grating, which has a much greater number N of slits, often called rulings, perhaps as many as several thousand per millimeter.

    "},{"location":"GP/light/df/diffraction/#multiple-slits-with-monochromatic-light","title":"Multiple Slits with Monochromatic Light","text":"
    • When N=3

    Figure below shows the simplest case of multiple-slit interference, with three slits, or \ud835\udc41=3. The spacing between slits is d, and the path length difference between adjacent slits is \ud835\udc51sin\ud835\udf03, same as the case for the double slit. What is new is that the path length difference for the first and the third slits is 2\ud835\udc51sin\ud835\udf03. The condition for constructive interference is the same as for the double slit, that is \\(dsin\\theta=m\\lambda\\)

    When this condition is met, 2\ud835\udc51sin\ud835\udf03 is automatically a multiple of \ud835\udf06, so all three rays combine constructively, and the bright fringes that occur here are called principal maxima. But what happens when the path length difference between adjacent slits is only \ud835\udf06/2? We can think of the first and second rays as interfering destructively, but the third ray remains unaltered. Instead of obtaining a dark fringe, or a minimum, as we did for the double slit, we see a secondary maximum with intensity lower than the principal maxima.

    • In general

    In general, for N slits, these secondary maxima occur whenever an unpaired ray is present that does not go away due to destructive interference. This occurs at (\ud835\udc41\u22122) evenly spaced positions between the principal maxima.

    The amplitude of the electromagnetic wave is correspondingly diminished to 1/\ud835\udc41 of the wave at the principal maxima, and the light intensity, being proportional to the square of the wave amplitude, is diminished to \\(\\frac{1}{N^2}\\) of the intensity compared to the principal maxima.

    As figure below shows, a dark fringe is located between every maximum (principal or secondary). As N grows larger and the number of bright and dark fringes increase, the widths of the maxima become narrower due to the closely located neighboring dark fringes. Because the total amount of light energy remains unaltered, narrower maxima require that each maximum reaches a correspondingly higher intensity.

    \\(Phase\\ difference\\)

    \\(\\delta_N=\\frac{2\\pi}{\\lambda}dsin\\theta\\)

    Consider the example below when N equals 4

    • With monochromatic (red) light incident on a diffraction grating (with a large number N), you would see on a viewing screen very narrow(and so are called lines) ,separated by relatively wide dark regions
    "},{"location":"GP/light/df/diffraction/#width-of-the-lines","title":"Width of the Lines","text":"

    A grating\u2019s ability to resolve (separate) lines of different wavelengths depends on the linewidth. The half-width of the central line \\(\u2206\u03b8_{hw}\\) is determined by the first minimum in intensity, at which the N rays from the N slits of the grating cancel one another.

    The first minimum occurs where the phase difference between the adjacent slits is (from the path length difference between the top and bottom rays)

    \\(\\delta_N=\\frac{2\\pi}{\\lambda}dsin\\triangle\\theta_{hw}=\\frac{2\\pi}{N}\\)

    Or \\(\\triangle\\theta_{hw}\\approx sin\\triangle\\theta_{hw}=\\frac{\\lambda}{Nd}\\)

    "},{"location":"GP/light/df/diffraction/#atomic-grating","title":"Atomic Grating","text":"

    A crystalline solid, which consists of a regular array of atoms, resembles a diffraction grating with separation d on the atomic scale (\u223c \\(10^{\u221210}\\) m).

    Waves can be diffracted as if they were reflected by a family of parallel planes, with angles measured relative to the planes (not to a normal as in optics).

    NOTE : The distance difference is now approximately \\(2dsin\\theta\\)

    Suppose we would like to use the visible light \\((\u03bb \u2243 5.5 \u00d7 10^{\u22127} m)\\) to study the diffraction. The first-order maximum (m = 1) would occur at \\(sin \u03b8 = \\frac{m\u03bb}{2d} = 2750 \u226b 1.\\)

    This means that we would not observe the first-order maxima. Therefore, we need waves with much shorter wavelength \\((\u03bb \u2248 d)\\), that is, X rays.

    "},{"location":"GP/light/df/diffraction/#x-ray-diffraction","title":"X-Ray Diffraction","text":"

    Wilhelm Roentgen discovered X rays in 1895. He realized that these rays could be used to pass through, e.g., his wife\u2019s hand and to create an image of internal bones.

    The invention of X rays helped revolutionize modern medicine, evolving into what we use today, called the digital X-ray.

    The maxima turns out to be in directions as if the x rays were reflected by a family of crystal planes that extend through the atoms within the crystal and that contain regular arrays of the atoms.

    Bragg\u2019s law states that the intensity maxima for X-ray diffraction is \\(2d sin\u03b8 = m\u03bb\\) where \\(m = 1,2,3,...\\) is the order number of an intensity maximum. A monochromatic X-ray beam can be used to determine the geometrical structure of a crystal.

    "},{"location":"GP/light/df/diffraction/#crystallography-miller-indices","title":"Crystallography: Miller Indices","text":"

    Miller Indices are a symbolic vector representation for the orientation of an atomic plane in a crystal lattice and are defined as the reciprocals of the fractional intercepts which the plane makes with the crystallographic axes.

    The method by which indices are determined is best shown by example. Recall, that there are three axes in crystallographic systems (except sometimes in the hexagonal system adopts a convention where there are four axes). Miller indices are represented by a set of 3 integer numbers.

    • Diffraction patterns are analyzed by a curve fitting procedure, with least-squares minimization between observed data and calculated pattern.

    (2,0,0) half of (1,0,0) Thus,\\(\\theta\\) is different

    "},{"location":"GP/light/df/diffraction/#applications","title":"Applications","text":"
    • The Discovery of the DNA Structure

    X-ray diffraction from fibrous DNA (by Rosalind Franklin and her student R. G. Gosling) tipped off Watson and Crick to double helix. Watson and Crick also knew from the work of Erwin Chargaff that adenine and thymine bases and guanine and cytosine bases were always present in approximately equal amounts.

    "},{"location":"GP/light/quantum%20light/quantum/","title":"The Quantum Nature of Light","text":""},{"location":"GP/light/quantum%20light/quantum/#the-photoelectric-effect","title":"The Photoelectric Effect","text":"

    Experiments show that if you direct a beam of light of short enough wavelength onto a clean metal surface, the light will eject the electrons from the surface.

    We adjust the potential difference V by moving the sliding contact so that the potential of collector C is slightly negative with respect to target T.

    At the stopping potential \\(V = V_{stop}\\), the reading of meter A has just dropped to zero, the most energetic ejected electrons are turned back just before reaching the collector.

    "},{"location":"GP/light/quantum%20light/quantum/#puzzle-1-for-classical-physics","title":"Puzzle 1 for Classical Physics","text":"

    Measurements show that for light of a given frequency, \\(K_{max}\\) does not depend on the intensity of the light source.

    However,in the classical theory, however, if we increase the amplitude of the wave and its oscillating electric field, the electron should get a more energetic \u201ckick\u201d.

    Why Strange?
    1. The incident light is a sinusoidally oscillating electromagnetic wave.

      An electron in the target should oscillate sinusoidally due to the oscillating electric force on it from the wave\u2019s electric field.

      If the amplitude of the electron\u2019s oscillation is great enough, the electron should break free of the target\u2019s surface \u2013 that is, be ejected from the target.

    "},{"location":"GP/light/quantum%20light/quantum/#puzzle-2-for-classical-physics","title":"Puzzle 2 for Classical Physics","text":"

    Experiments show that the photoelectric effect does not occur if the frequency is below a certain cutoff value \\(f_0\\) ,no matter how intense the incident light is.

    "},{"location":"GP/light/quantum%20light/quantum/#sum","title":"Sum","text":"

    In the classical theory, light is viewed as an electromagnetic wave.

    One expects that no matter how low the frequency, electrons can always be ejected by light if they are supplied with enough energy \u2014 that is, if one uses a light source that is bright enough.

    In experiments, however, electrons can escape only if the light frequency exceeds a certain value, and the escaping electron\u2019s kinetic energy is greater for a greater light frequency.

    Einstein proposed that electromagnetic radiation (or simply light) is quantized and exists in elementary amounts (quanta) that we now call photons. According to his proposal, the quantum of a light wave of frequency f has the energy \\(E = hf = \\bar{h}\u03c9\\), where \\(h = 2\u03c0\\bar{h} = 6.63 \u00d7 10^{\u221234} J\u00b7s\\) is the Planck constant, and \u03c9 is the angular frequency. The total energy of a light wave of frequency f must be an integer multiple of \\(hf\\) , with the smallest amount being \\(hf\\) ,the energy of a single photon.

    Einstein further proposed that when light is absorbed or emitted by an object (matter), the absorption or emission event occurs in the atoms of the object.

    In the absorption event, the energy \\(hf\\) of one photon is transferred from the light to the atom; the photon vanishes and the atom is said to absorb it.

    For an object consisting of many atoms, there can be many photon absorptions (such as with sunglasses) or photon emissions (such as with lamps).

    In classical physics, such events involve so much light that we had no need of quantum physics.

    "},{"location":"GP/light/quantum%20light/quantum/#photon-the-quantum-of-light","title":"Photon, the Quantum of Light","text":"

    Back to the Photoelectric Effect\uff0cthe electrons within the target are held by electric forces. To just escape from the target, an electron must pick up a certain minimum energy \\(W\\) , where \\(W\\) is a property of the target material called its work function.

    The energy that can be transferred from the incident light to an electron in the target is that of a single photon \\(hf\\) . According the conservation of energy, the kinetic energy K acquired by the electron satisfies. \\(hf = K + W\\) .

    In the most favorable circumstance, the electron can escape through the surface without losing any of this kinetic energy in the process. (i.e. \\(K_{max} = hf \u2212 W\\) ).

    Increasing the light intensity increases the number of photons in the light, not the photon energy, so the energy transferred to the kinetic energy of an electron is also unchanged. This solves puzzle #1.

    If the energy hf transferred to an electron by a photon exceeds the work function of the material (if \\(hf > W\\) ), the electron can escape the target. If the energy transferred does not exceed the work function (that is, if \\(hf < W\\) ), the electron cannot escape. This solves puzzle #2.

    "},{"location":"GP/light/quantum%20light/quantum/#photon-momentum-and-compton-scattering","title":"Photon Momentum and Compton Scattering","text":"

    A photon, or a light quantum, is a particle with energy \\(E = hf\\) . It has a velocity of the speed of light c, but no mass (m = 0). In 1916, Einstein extended his concept of photons by proposing that a quantum of light has linear momentum.

    According to the theory of relativity, \\(E^2 \u2212 c^2p^2 = m^2c^4 = 0\\) the magnitude of the photon momentum is. \\(p = \\frac{hf}{c} = \\frac{h}{\\lambda} = \\bar{h}k\\)

    "},{"location":"GP/light/quantum%20light/quantum/#compton-scattering","title":"Compton Scattering","text":"

    When a photon interacts with matter, energy and momentum are transferred, as if there were a collision between the photon and matter in the classical sense.

    To demonstrate, Arthur Compton measured the wavelengths and intensities of a beam of X rays that were scattered in various directions from a carbon target.

    Compton found that although there is only a single wavelength \\((\u03bb = 71.1 pm)\\) in the incident X-ray beam, the scattered X rays contain a range of wavelengths with two prominent intensity peaks.

    • One peak is centered about the incident wavelength \\(\u03bb\\).
    • The other is centered about a wavelength \\(\u03bb^\u2032\\) that is longer than \\(\u03bb\\) by an amount \\(\u2206\u03bb\\), the Compton shift.
    • The value of the Compton shift varies with the angle at which the scattered X rays are detected and is greater for a greater angle

    In classical physics, an electron in the carbon target undergoes forced oscillations in the sinusoidally oscillating electromagnetic wave. Hence, the electron should send out scattered waves at the same frequency.

    With quantum physics and relativity, the energy and momentum conservation becomes \u300cImportant\u300d

    \\(\\begin{align*} \\frac{hc}{\\lambda}+mc^2&=\\frac{hc}{\\lambda^{'}}+\\gamma mc^2 \\ (energy) \\\\ \\frac{h}{\\lambda}&=\\frac{h}{\\lambda'}cos\\phi+\\gamma mvcos\\theta\\ (momentun\\ in\\ x) \\\\ 0&=\\frac{h}{\\lambda'}sin\\phi-\\gamma mvcos\\theta\\ (momentun\\ in\\ y)\\end{align*}\\)

    where \\(\\gamma =\\sqrt{\\frac{1}{1-\\frac{v^2}{c^2}}}\\)

    The quantity \\(h/mc\\) is a constant called the Compton wavelength. Its value depends on the mass m of the particle from which the X rays scatter.

    • The Compton wavelength of a particle corresponds to the wavelength of a photon whose energy is the same as the rest mass energy of the particle.

    Strictly speaking, the particle can be a loosely boundelectron, or a carbon atom (with tightly bound electrons).

    • For an electron, the Compton wavelength is \\(\\frac{h}{mc}= \\frac{hc}{mc^2} =\\frac{12400eV\u00b7A\u030a}{511000eV}=2.426pm\\)

    • For a carbon atom, the Compton wavelength is \\(12 \u00d7 m_u /m_e \u2248 12 \u00d7 1836 \u2248 22, 000\\) times smaller and, hence, can be neglected. Therefore, there is a peak at the incident wavelength at any angle.

    "},{"location":"GP/light/quantum%20light/quantum/#appendix-ex","title":"Appendix ex","text":"
    • We can derive that \uff1a\\(tan\\theta=\\frac{sin\\phi}{\\frac{\\lambda}{\\lambda^{'}}-cos\\phi}\\) where \\(\\theta\\) is the scattering angle of the say, electrons.
    "},{"location":"GP/light/quantum%20light/quantum/#angular-momentum-of-photons-and-polarization","title":"Angular Momentum of Photons and Polarization","text":"

    According to the quantum-mechanical description, a photon also has an intrinsic spin angular momentum, which is either \\(\u2212\\bar{h}\\) or \\(+\\bar{h}\\), where the signs indicate right- or left-handedness, respectively.

    Whenever a charged particle emits or absorbs electromagnetic radiation, along with changes in its energy and linear momentum, it will undergo a change of \\(\u00b1\\bar{h}\\) in its angular momentum.

    The energy transferred to a target by an incident monochromatic electromagnetic wave can be envisaged as being transported in the form of a stream of identical photons.

    A beam of linearly polarized light will interact with matter as if it were composed, at that instant, of equal numbers of right- and left-handed photons. There is a subtle point. Strictly speaking, we cannot say that the beam is actually made up of precisely equal amounts of well-defined right- and left-handed photons; the photons are all identical.

    Rather, each individual photon exists in either spin state with equal likelihood.

    \\(|H\u27e9 =\\frac{|R\u27e9+|L\u27e9}{\\sqrt{2}} = \\frac{1}{\\sqrt{2}}[\\frac{1}{\\sqrt{2}}\\begin{pmatrix}1\\\\-i\\end{pmatrix} +\\frac{1}{\\sqrt{2}}\\begin{pmatrix}1\\\\i\\end{pmatrix}]\\)

    "},{"location":"GP/light/quantum%20light/quantum/#appendix-21a-quantum-key-distribution","title":"Appendix 21A: Quantum Key Distribution","text":"

    Goal: To send encrypted messages that cannot be understood by anyone but the designated recipient.

    Message is a whole number \\(m\\) (e.g., represented by the dots and dashes of Morse code as ones and zeros.)

    An encryption is a function \\(f : m \u2192 f (m)\\), agreed on between Alice (sender) and Bob (recipient) but unknown to Eve (a possible eavesdropper).

    Problem: If the same encryption is used many times, Eve can usually deduce the nature of the encryption and read the messages (by, e.g., frequency analysis).

    Classical solution: Let the encryption depend on a frequently changed key, which can be regarded as another whole number \\(k\\). The encrypted message is now \\(f (m, k)\\). New problem: Alice and Bob must frequently exchange messages to establish new keys, and these new messages too may be intercepted by Eve. Quantum solution: It is not possible to measure any quantity without changing an unknown state vector to one in which that quantity has some definite value.

    "},{"location":"GP/light/quantum%20light/quantum/#the-bb84-protocol-bennet-brassard-1984","title":"The BB84 Protocol (Bennet & Brassard, 1984)","text":"

    A protocol to establish a secured communication channel. More concretely, a scheme to enables us to detect the presence of an eavesdropper using polarized photons.

    • Alice sends the key to Bob as a sequence of linearly polarized photons with polarization vectors of the form \\(\\vec{e} = (cos \u03b6 , sin \u03b6 )\\), where \\(\u03b6\\) are various angles.
    • Alice represents ones and zeros by values of \u03b6 in either one of the two modes.
    • Finally, Alice and Bob communicate over a classical, possibly public channel to compare their choices of basis for each bit. The bits for which Alice and Bob have used different bases are discarded.

    What Can Eve Do?

    What Eve really wants is that Alice and Bob should establish a key that Eve knows, so that she can secretly read the messages sent from Alice to Bob.

    So Eve can intercept the photons sent by Alice, measure their polarizations, and then send substitute photons with these polarizations on to Bob.

    But Eve, like Bob, does not know the mode that Alice is using in choosing each photon polarization. So there is only a 50% chance that the substitute photon sent by Eve to Bob will have the same polarization that it had when it was sent by Alice.

    Can Alice and Bob Detect Eve?

    When Alice and Bob compare notes, they identity the photons that had been sent when Alice and Bob had by chance being used the same modes.

    Eve too may learn this information, but by then it is too late. There is only a 50% chance that Eve had used the same mode that Alice (and Bob) had used.\u300c\u6d4b\u4e0d\u51c6\u300d

    If Eve had used a different mode, there is still a 50% chance that Bob would have observed the same polarization that had been sent by Alice.

    Overall, Alice and Bob had 25% of the binary digits in the key that do not match; thus, they can detect Eve\u2019s intervention by comparing a part of the key.

    1. 25%\u7684\u4e0d\u5339\u914d\u6982\u7387\uff1a \u5f53Eve\u4f7f\u7528\u4e86\u4e0d\u540c\u7684\u6a21\u5f0f\u8fdb\u884c\u6d4b\u91cf\u65f6\uff0c\u670950%\u7684\u6982\u7387Bob\u4f1a\u89c2\u5bdf\u5230\u4e0eAlice\u53d1\u9001\u65f6\u76f8\u540c\u7684\u504f\u632f\u3002\u56e0\u6b64\uff0c\u603b\u4f53\u4e0a\uff0cAlice\u548cBob\u7684\u5bc6\u94a5\u4e2d\u670925%\u7684\u4e8c\u8fdb\u5236\u4f4d\u4e0d\u5339\u914d\uff0c\u56e0\u4e3a\u5728\u4e00\u534a\u7684\u60c5\u51b5\u4e0bEve\u53ef\u80fd\u622a\u83b7\u4e86\u76f8\u540c\u7684\u6a21\u5f0f\uff0c\u4f46\u53e6\u4e00\u534a\u7684\u60c5\u51b5\u4e0bBob\u89c2\u5bdf\u5230\u7684\u504f\u632f\u4e0eAlice\u53d1\u9001\u7684\u4e0d\u540c\u3002
    • Why do we call this scheme quantum key distribution?

    After all, polarization is a classical concept. Which part of the BB84 depends crucially on the quantum concept and can be defeated in the classical world?

    Quantum no-cloning theorem: It is impossible to create an identical copy of an arbitrary unknown quantum state. Where is it needed?

    • Take-home message: Eve will have success in preventing the construction of a key, but not in secretly learning a key that will be used by Alice and Bob.
    • \u6d4b\u91cf\u7684\u4e0d\u786e\u5b9a\u6027\u4f7f\u5f97Eve\u65e0\u6cd5\u83b7\u53d6\u5b8c\u6574\u7684\u5bc6\u94a5\u4fe1\u606f\uff0c\u800c\u4e14\u4efb\u4f55\u5979\u7684\u5e72\u6270\u90fd\u4f1a\u88abAlice\u548cBob\u5bdf\u89c9\u5230\u3002
    "},{"location":"GP/light/quantum%20light/quantum/#_1","title":"Quantum","text":""},{"location":"GP/mag/mag/","title":"The Magnetic Field","text":""},{"location":"GP/mag/mag/#the-magnetic-field","title":"The Magnetic Field","text":"
    • \\(\\vec{F}=q\\vec{v}\\times \\vec{B}\\)
    • Right-hand rule
    "},{"location":"GP/mag/mag/#circulating-charges","title":"Circulating Charges","text":"

    If the velocity of a charged particle has a component parallel to the uniform magnetic field, such that :

    \\(v_{||}=vcos\\phi\\)

    \\(v_{\u22a5}=vsin\\phi\\)

    • The perpendicular component \\(v_{\u22a5}\\) determines the radius of the helix \\(r=\\frac{mv_{\u22a5}}{|q|B}\\)
    • The parallel component \\(v_{||}\\)determines the pitch p of the helix ,that is,the distance between adjacent turns.
    "},{"location":"GP/mag/mag/#the-hall-effect","title":"The Hall Effect","text":""},{"location":"GP/mag/mag/#current-carrying-wire","title":"Current-Carrying Wire","text":"
    • If a wire is not straight or the field is not uniform, we can imagine the wire broken up into small straight segments and, in the differential limit, we can write \\(d\\vec{F}=id\\vec{L}\\times\\vec{B}\\)
    "},{"location":"GP/mag/mag/#torque-on-a-current-loop","title":"Torque on a Current Loop","text":""},{"location":"GP/mag/mag/#magnetic-field-of-a-current","title":"Magnetic Field of a Current","text":""},{"location":"GP/mag/mag/#biot-savart-law","title":"Biot-Savart-law","text":"

    \\(d\\vec{B}= \\frac{\\mu_0}{4\\pi}\\frac{id\\vec{s}\\times\\vec{r}}{r^3}\\)

    Where the constant \\(\\mu_0=4\\pi \\cdot 10^{-7(T\\cdot m/A)}\\)is called the permeability constant

    "},{"location":"GP/mag/mag/#example","title":"Example","text":""},{"location":"GP/mag/mag/#a-long-straight-wire","title":"A Long Straight Wire","text":"
    • Derivation

    \\(\\begin{align*}d\\vec{B}&=\\frac{\\mu_0}{4\\pi}\\frac{id\\vec{s}\\times\\vec{r}}{r^3}\\\\ &=\\frac{\\mu_0}{4\\pi}\\frac{id\\vec{s}\\times\\vec{R}}{r^3} \\\\B&=\\frac{\\mu_0i}{4\\pi R}\\int_{-\\infty}^{+\\infty}\\frac{R^2dS}{r^3} (sin\\theta=R/r \\ cos\\theta=-s/r \\ dr/ds=s/r)\\\\ &=\\frac{\\mu_0i}{4\\pi R}\\int_{0}^{\\pi}sin\\theta d\\theta \\ (cos\\theta d\\theta = d(sin\\theta)=-\\frac{R^2dr}{r^2ds}ds=-\\frac{R^2s}{r^2r}ds=cos\\theta \\frac{Rds}{r^2})\\\\ &= \\frac{\\mu_0 i}{2\\pi R}\\end{align*}\\)

    "},{"location":"GP/mag/mag/#force-between-two-parallel-wires","title":"Force Between Two Parallel Wires","text":""},{"location":"GP/mag/mag/#magnetic-field-circulation","title":"Magnetic Field Circulation","text":"

    \\(Circulation =\\oint \\vec{B}\\cdot d\\vec{s} = \\mu_0 i_{enc}\\) (Amperian Loop)

    • For a concentric Amperian loop inside the wire \\(i_{enc}=i\\frac{\\pi r^2}{\\pi R^2}\\) Thus, \\(B=\\frac{\\mu_0ir}{2\\pi R^2}\\)
    "},{"location":"GP/mag/mag/#a-sheet-of-moving-charge","title":"A Sheet of Moving Charge","text":""},{"location":"GP/mag/mag/#magnetic-field-of-a-solenoid","title":"Magnetic Field of a Solenoid","text":"

    In the limiting case of an ideal solenoid, which is infinitely long and consists of tightly packed (close-packed) turns of square wire, the field inside the coil is uniform and parallel to the solenoid axis. The magnetic field outside the solenoid is zero.

    The direction of the magnetic field along the solenoid axis is given by a curled-straight right-hand rule: Grasp the solenoid with your right hand so that your fingers follow the direction of the current in the windings; your extended right thumb then points in the direction of the axial magnetic field.

    • From Ampere's Law : \\(Bh=\\mu_0inh \\Rightarrow B=\\mu_0in\\)

    A solenoid thus provides a practical way to set up a known

    uniform magnetic field for experimentation, just as a parallel-plate capacitor provides a practical way to set up a known uniform electric field.

    "},{"location":"GP/mag/mag/#magnetic-field-of-a-toroid","title":"Magnetic Field of a Toroid","text":"

    In contrast to the situation for a solenoid, B is not constant over the cross section of a toroid.

    One can show, with Ampere\u2019s law, that B = 0 for points outside an ideal toroid (as if the toroid were made from an ideal solenoid).

    "},{"location":"GP/mag/mag/#the-curl-of-vecb","title":"The Curl of \\(\\vec{B}\\)","text":"
    • By Stokes's theorem : \\(\\oint\\vec{B}\\cdot d\\vec{s} = \\iint(\\triangledown \\times \\vec{B})\\cdot d\\vec{A}=\\mu_0i_{enc}=\\mu_0\\iint_S\\vec{J}\\cdot d\\vec{A}\\)
    • Thus \\(\\triangledown \\times \\vec{B}(\\vec{r}) = \\mu_0\\vec{J}(\\vec{r})\\)
    "},{"location":"GP/mag/mag/#the-divergence-of-vecb","title":"The Divergence of \\(\\vec{B}\\)","text":"

    For volume currents, the Biot-Savart law becomes

    \\(\\vec{B}(x,y,z)=\\frac{\\mu_0}{4\\pi}\\iiint\\frac{\\vec{J}(x',y',z')\\times \\vec{r}}{r^3}dx'dy'dz'\\)

    • The length element \\(id\\vec{s}\\) is replace by the volume element \\(JdV'= \\vec{J}(x',y',z')dx'dy'dz'\\) and \\(r =(x \u2212 x' ) \\hat{x} + ( y \u2212 y' )\\hat{y} + ( z \u2212 z') \\hat{z}\\)

    • Applying the divergence, we obtain:

    \\(\\triangledown \\cdot \\vec{B}=\\frac{\\mu_0}{4\\pi}\\int \\triangledown (\\frac{\\vec{J}\\times \\vec{r}}{r^3})dV'=-\\frac{\\mu_0}{4\\pi}\\int \\vec{J} (\\triangledown \\times \\frac{\\vec{r}}{r^3})dV'\\)

    • Note that \\(\\frac{\\vec{r}}{r^3}= \u2212\\triangledown(1/\\vec{r} )\\) is nothing but the electric field of a point charge (q = 4\u03c0\u03b50)
    • It does not twists around; it only spreads out. Its curl is zero (as known in electrostatics).

    • Thus \\(\\triangledown \\cdot \\vec{B} = 0\\)

    • Constructing a closed Gaussian surface,we have:

    \\(\\oint\\vec{B}\\cdot d\\vec{A}=\\int(\\triangledown\\cdot\\vec{B})dV=0\\)

    • The law asserts that the net magnetic flux \\(\\Phi _B\\) through any closed Gaussian surface is zero.

    • This is a formal way of saying that magnetic monopoles do not exist. The simplest magnetic structure that can exist is a magnetic dipole.

    "},{"location":"GP/mag/mag/#magnetic-properties-of-materials","title":"Magnetic Properties of Materials","text":""},{"location":"GP/mag/mag/#the-magnetic-dipole","title":"The Magnetic Dipole","text":"

    \\(\\vec{\\mu}=Ni\\vec{A}\\)

    \\(\\tau = \\vec{\\mu} \\times \\vec{B}=-\\mu Bsin\\theta=-\\frac{\\partial}{\\partial \\theta}(-\\mu Bcos\\theta)\\)

    \\(U_B=-\\vec{\\mu}\\cdot\\vec{B} = -\\mu Bcos\\theta\\)

    "},{"location":"GP/mag/mag/#magnetic-field-of-a-circular-arc-of-wire","title":"Magnetic Field of a Circular Arc of Wire","text":""},{"location":"GP/mag/mag/#at-the-center","title":"At the center","text":"
    • Thus , at the center of a single-loop coil, we have \\(B=\\frac{\\mu_0i}{2R}=\\frac{\\mu_0\\mu}{2\\pi R^3}\\)
    "},{"location":"GP/mag/mag/#at-axial-points-far-from-the-loopz-r","title":"at axial points far from the loop\\((z \u226b R)\\)","text":"

    Which means \\(B(z)=\\frac{\\mu_0}{2\\pi}\\frac{\\mu}{r^3}\\) Just like the electric dipole

    "},{"location":"GP/mag/mag/#magnetic-materials","title":"Magnetic Materials","text":""},{"location":"GP/mag/mag/#paramagnetism","title":"Paramagnetism","text":"

    Paramagnetism occurs in materials whose atoms have permanent magnetic dipole moments \\(\\vec{\\mu}\\)

    • Curie\u2019s law : \\(M=C\\frac{B_{ext}}{T}\\)
    • The law is actually an approximation that is valid only when the ratio \\(B_{ext}/T\\) is not too large.
    • With sufficient strong \\(\\vec{B}_{ext}\\) all dipoles in a sample of N atoms and a volume V line up with \\(\\vec{B}\\) hence M saturates at \\(M_{max}=N\\mu/V\\)

    Explain:

    "},{"location":"GP/mag/mag/#diamagnetism","title":"Diamagnetism","text":"

    Diamagnetism occurs in all materials, but the weak effect is only observable in materials having atomic dipole moments of zero.

    Such a material can be modeled by equal numbers of electrons orbiting counterclockwise or clockwise. An external magnetic field will either accelerate or decelerate these electrons, leading to a net magnetic dipole moment

    "},{"location":"GP/mag/mag/#ferromagnetism","title":"Ferromagnetism","text":"

    A ferromagnet has strong, permanent magnetism. What distinguishes ferromagnets from paramagnets is that there is a strong interaction between neighboring atoms.

    The interaction keeps the dipole moments of atoms aligned even when the magnetic field is removed.

    "},{"location":"GP/matter%20wave/matter/","title":"matter wave","text":""},{"location":"GP/matter%20wave/matter/#matter-waves","title":"Matter Waves","text":""},{"location":"GP/matter%20wave/matter/#two-versions-of-interference","title":"Two Versions of Interference","text":""},{"location":"GP/matter%20wave/matter/#standard-version-of-the-double-slit-experiment","title":"standard version of the double-slit experiment","text":"

    In the standard version of the double-slit experiment(Thomas Young, 1801), light shines on screen B, which contains two narrow parallel slits.

    The light waves emerging from the two slits spread out by diffraction and overlap on screen C where, by interference, they form a pattern of alternating intensity maxima and minima.

    • Let us place a tiny photon detector D at one point in the plane of screen C.
    • Let the detector be a photoelectric device that clicks when it absorbs a photon.
    • We would find that the detector produces a series of clicks, randomly spaced in time, each click signaling the transfer of energy from the light wave to the screen via a photon absorption.
    • If we moved the detector very slowly up or down as indicated by the black arrow, we would find that the click rate increases and decreases, passing through alternate maxima and minima that correspond exactly to the maxima and minima of the interference fringes.

    The point of this thought experiment is as follows.

    • We cannot predict when a photon will be detected at any particular point on screen C
    • photons are detected at individual points at random times.
    • We can, however, predict that the relative probability that a single photon will be detected at a particular point in a specified time interval is proportional to the light intensity at that point.

    We know that the intensity \\(I\\) of a light wave at any point is proportional to the square of \\(E_m\\). Thus, the probability(per unit time interval) that a photon will be detected in any small volume centered on a given point in a light wave is proportional to the square of the amplitude of the wave\u2019s electric field vector at that point.

    "},{"location":"GP/matter%20wave/matter/#single-photon-version","title":"single-photon version","text":"

    The light source is so extremely feeble that it emits only one photon at a time, at random intervals. Astonishingly, interference fringes still build up on screen C if the experiment runs long enough

    • If the photons move through the apparatus one at a time, through which of the two slits in screen B does a given photon pass?
    • How does a given photon even \u201cknow\u201d that there is another slit present so that interference is a possibility?
    • Can a single photon somehow pass through both slits and interfere with itself?

    Because an interference pattern eventually builds up on the screen, we can only speculate that each photon travels from source to screen as a wave that fills up the space between source and screen.

    We can predict the probability that an energy transfer will occur at any given point on the screen.

    • Transfers will tend to occur (and thus photons will tend to be absorbed) in the regions of the bright fringes in the interference pattern that builds up on the screen.
    • Transfers will tend not to occur (and thus photons will tend not to be absorbed) in the regions of the dark fringes in the pattern.

    Thus, we can say that the wave traveling from the source is a probability wave, which produces a pattern of \u201cprobability fringes\u201d on the screen.

    "},{"location":"GP/matter%20wave/matter/#light-as-a-probability-wave","title":"Light as a Probability wave","text":"

    We see that the double-slit experiments tell us that

    • light is generated in the source as photons
    • absorbed in the detector as photons
    • travels between source and detector as a probability wave.

    The probability density of detecting a photon at some point \\(P\\) in space depends on the irradiance \\(I \u221d E_0^2\\) at that point. Thus, the net \\(E_0\\) at \\(P\\) can be interpreted as the probability amplitude. (Probability amplitude is a quantity whose square gives the probability density.)

    To go further, one will need quantum electrodynamics (QED), the quantum theory of the interaction of light and matter.

    "},{"location":"GP/matter%20wave/matter/#extendtions-to-not-only-light","title":"Extendtions to not only light","text":""},{"location":"GP/matter%20wave/matter/#de-broglie-hypothesis","title":"De Broglie Hypothesis","text":"

    A beam of light is a wave, but it transfers energy and momentum to matter only at points, via photons. Electron is a particle with energy and momentum. Why can\u2019t we think of a beam of moving electron \u2014 or any other particle \u2014 as a matter wave?

    In 1924, Louis de Broglie proposed that one could assign a wavelength \\(\u03bb\\) to a particle with momentum of magnitude \\(p\\). Like that of photons, we define. \\(\u03bb = h/p\\), which is known as the de Broglie wavelength of the moving particle.

    "},{"location":"GP/matter%20wave/matter/#electron-diffraction","title":"Electron Diffraction","text":"

    Electron diffraction and neutron diffraction are used to study the atomic structures of solids and liquids, and electron diffraction is often used to study the atomic.

    "},{"location":"GP/matter%20wave/matter/#the-interference-of-electrons","title":"The Interference of Electrons","text":"

    In a more recent experiment, an interference pattern was built up when electrons were sent, one by one, through a double-slit apparatus. When an electron hit the viewing screen, it caused a flash of light whose position was recorded.

    • Similar interference has been demonstrated with protons, neutrons, and various atoms. It was further demonstrated with iodine molecules \\(I_2\\) in 1994 and with fullerenes (or buckyballs) \\(C_{60}\\) and \\(C_{70}\\) in 1999.

    Do particles interfere with each other?

    Perhaps they collide . . . .

    • Repeat at low intensity that at any given time there is only one particle in the inteference region.

    "},{"location":"GP/matter%20wave/matter/#matter-wave","title":"Matter Wave","text":"

    In Newtonian physics: a particle is only aware of the slit through which it goes, it has no idea how many other slits are open or closed or even exist. Therefore, when both slits are open, \\(P_{12} = P_1 + P_2\\).

    • Clearly, there is no fringes(Newtonian physics)

    Consider matter waves:The electrons arrive in lumps, like particles, and the probability of arrival of these lumps is distributed like the distribution of intensity of a wave.

    Introduce:

    • Add Amplitude \\(A\\)

    • Introduce the probability amplitude \\(\u03c8\\) which is a complex number.

    The probability of an event in an ideal experiment is then given by \\(|\u03c8|^2 = \u03c8^\u2217\\times\u03c8\\).

    When an event can occur in several alternative ways, the probability amplitude for the event is the sum of the probability amplitudes for each way considered separately

    • \\(\u03c8 = \u03c8_1 + \u03c8_2 + \u00b7 \u00b7 \u00b7\\).

    • The probability for the event is, then,\\(P=|\u03c8|^2 =|\u03c81|^2+|\u03c82|^2+2R(\u03c81^\u2217\u03c82)+\u00b7\u00b7\u00b7.\\)\uff08note:\u6a21\uff09

    • The interference term \\(2R(\u03c8_1^\u2217\u03c8_2)\\) is responsible for the rapid oscillations of \\(P\\) observed in the experiment.

    "},{"location":"GP/matter%20wave/matter/#the-which-way-experiment","title":"The Which-Way Experiment","text":"

    If an experiment is performed which is capable of determining whether one or another alternative is actually taken, the interference is lost.

    The experiment tells us that the probability of the event in the which-way experiment is the sum of the probabilities for each alternative, \\(P = |\u03c8|^2 = |\u03c8_1|^2 + |\u03c8_2|^2\\),just as what happens in the classical case.

    Thus an electron acts like it went through one particular slit if we see it doing that, and acts like it did not have a specific path (through a specific slit) when it is not seen.

    • Why seeing makes a difference?

    To see an electron with a resolution comparable to slit separation \\(d\\), (so we know which slit it took) requires light with \\(\u03bb < d\\), this is just standard wave theory.

    But, the light is made of photons each with momentum \\(p>\\frac{h}{d}\\). So, measuring the position of the electron has made us disturb its momentum.

    The amount of momentum transferred to the electron in the act of observation is indefinite.

    This is a manifestation of Heisenberg\u2019s uncertainty principle, which says you cannot measure the momentum and coordinate of a particle simultaneously to arbitrary accuracy.

    "},{"location":"GP/matter%20wave/matter/#heisenbergs-uncertainty-principle","title":"Heisenberg\u2019s Uncertainty Principle","text":"

    Heisenberg\u2019s uncertainty principle is not an effect caused by the measurement but a consequence of intrinsic wave nature of matter.

    The probabilistic nature of quantum physics places an important limitation on detecting a particle\u2019s position and momentum. That is, it is not possible to measure the position \\(\\vec{r}\\) and the momentum \\(\\vec{p}\\) of a particle simultaneously with unlimited precision.

    The uncertainties in the components of these quantities are given by (Werner Heisenberg, 1927)

    \\(\u2206x\u00b7\u2206p_x \u2265\\bar{h}\\)

    \\(\u2206y\u00b7\u2206p_y \u2265\\bar{h}\\)

    \\(\u2206z\u00b7\u2206p_z \u2265\\bar{h}\\)

    They are due to the fact that electrons and other particles are matter waves and that repeated measurements of their positions and momenta involve probabilities, not certainties.

    In the statistics of such measurements, we can view, say, \\(\u2206x\\) and \\(\u2206p_x\\) as the spread (actually, the standard deviations) in the measurements. Couldn\u2019t we very precisely measure \\(p_x\\) and then next very precisely measure x wherever the electron happens to show up?

    Doesn\u2019t that mean that we have measured both \\(p_x\\) and \\(x\\) simultaneously and very precisely?

    • No, the flaw is that although the first measurement can give us a precise value for \\(p_x\\) , the second measurement necessarily alters that value. Puzzled?

    • Consider an electron with a certain value of \\(k\\), which, by the de Broglie relationship, means a certain momentum \\(p_x = \\bar{h}k\\). Thus, \\(\u2206p_x = 0\\). By Heisenberg\u2019s uncertainty principle, that means that \\(\u2206x \u2192 \u221e\\).

    • What form does the electron wave function have? The naive guess could be \\(sinkx\\), or \\(coskx\\).

    But they have spatial variance that is inconsistent with our intuition.

    To represent the electron by a wave, we need a function, which is called wave function, with a wavelength \\(\u03bb = 2\u03c0/k\\), but its square should not show any variation in x\u300cNote: Definite Momentum\u300di.e. \\(\u03c8(x,t) = e^{i(kx\u2212\u03c9t)}\\).

    To calculate the square of the wave function \\(\u2223\u03c8\u2223^2\\), we obtain \\(\u2223\u03c8\u2223^2=e^{i(kx\u2212\u03c9t)}\u22c5e^{\u2212i(kx\u2212\u03c9t)}\\).

    we then have \\(\u2223\u03c8\u2223^2=1\\).

    This implies that at a given time t, the square of the wave function is a constant in the x direction, with no variation concerning x.

    Now, where is the electron? Why complex?

    • If we measure \\(p_x\\) now, we obtain \\(p_x = \\bar{h}k\\) without uncertainty

    but the particle exists anywhere with the same probability, so \\(\u2206x = \u221e\\). ?Question

    Heisenberg\u2019s uncertainty principle is not violated.

    • If we measure x then, we will find the electron somewhere at \\(x_0\\). Once we find it, it cannot be elsewhere. So the wave function suddenly collapses to \\(\u03c8(x) = \u03b4(x \u2212 x0)\\).

    Now, is the momentum still \\(p_x = \\bar{h}k\\)?

    The Fourier transform of the \u03b4-function tells us \\(\u03c8 \u0304(p) = F(\u03c8(x)) = constant\\).

    In this case, \\(\u2206x = 0\\) but \\(\u2206p = \u221e\\). Again, Heisenberg\u2019s uncertainty principle is not violated.

    "},{"location":"GP/matter%20wave/matter/#fourier-transform","title":"Fourier Transform","text":"

    https://www.youtube.com/watch?v=spUNpyF58BY&list=RDCMUCYO_jab_esuFRV4b17AJtAw&index=3

    https://youtube.com/watch?v=MBnnXbOM5S4

    "},{"location":"GP/sch/sch/","title":"Schroedinger's Equation","text":""},{"location":"GP/sch/sch/#motivation","title":"Motivation","text":"

    A classical wave \\(\u03c8(x, y, z, t)\\) satisfies the wave equation \\(\\frac{1}{v^2}\\frac{\\partial^2\u03c8}{\\partial^2t}=\\triangledown^2\u03c8\\) \\(v \\ is\\ speed\\)

    In the quantum theory, a microscopic particle is described by a probability amplitude \\(\u03c8(x, y, z, t)\\), and the probability of finding it is proportional to \\(P(x, y, z, t) = |\u03c8(x, y, z, t)|^2\\).

    • What is, then, the wave equation that governs the motion of the quantum particle?
    "},{"location":"GP/sch/sch/#schroedingers-equation","title":"Schroedinger\u2019s Equation","text":""},{"location":"GP/sch/sch/#classical-particle","title":"Classical Particle","text":"

    Find the equation that governs the quantum behavior of a free particle of mass \\(m\\) represented by a wave \\(\u03c8(x,t) = e^{i(kx\u2212\u03c9t)}\\).

    \\(E=\\frac{p^2}{2m}\\)

    According to the de Broglie\u2019s hypothesis

    \\(p=\\frac{h}{\\lambda}=\\bar{h}k=\u2212i\\bar{h}\\frac{1}{\u03c8(x,t)} \\frac{\u2202\u03c8(x,t)}{\\partial x}\\)

    d\\(p^2=\\bar{h}^2k^2=-\\bar{h}^2\\frac{1}{\u03c8(x,t)} \\frac{\u2202^2\u03c8(x,t)}{\\partial^2 x}\\)

    \\(E=hv=\\bar{h}w=\\frac{1}{\u03c8(x,t)} \\frac{\u2202\u03c8(x,t)}{\\partial t}\\)

    using wave function, the energy-momentum relation is

    In the presence of potential, e.g. a harmonic potential \\(U(x) = ax^2/2\\) , the classical relation is modified to \\(E=\\frac{p^2}{2m} +U(x)\\) where \\(E\\) is a constant of motion, but \\(p\\) is not. In other words, a plane wave is not a solution any more.

    In this expression, p is the momentum of the particle, m is the mass of the particle, \\(U(x)\\) is the potential energy associated with the position x, and E is the total energy of the system, which remains constant.

    In the conventional case where there is no potential energy in the system, momentum p would be a conserved quantity, implying the total momentum of the system remains constant. However, in the presence of potential energy, the interaction between kinetic and potential energy leads to a non-conservation of momentum. In such cases, simple waveforms like plane waves are no longer solutions, as the interaction between kinetic and potential energy requires a more complex description.

    Schroedinger's equation is both homogenous and linear!!!

    Linear Partial Differential Equation (PDE):

    A partial differential equation is termed linear if it is linear in terms of the unknown function and its partial derivatives. It can be expressed in the form:

    \\(L(u)=a_n(x,y)u_{xx}+a_{n\u22121}(x,y)u_x+\u2026+a_1(x,y)u_y+a_0(x,y)u+F(x,y)=0\\)

    Here, \\(u\\) is the unknown function, \\(u_x, u_y, u_{xx}\\), and so on represent the corresponding partial derivatives

    Crucially, all coefficients \\(a_n(x,y), a_{n\u22121}(x,y), \u2026\u2026, a_0(x,y)\\)as well as \\(F(x,y)\\), do not depend on the values of the unknown function \\(u\\) or its derivatives.

    Homogeneous Partial Differential Equation (PDE):

    A partial differential equation is considered homogeneous if all terms in the equation are homogeneous polynomials of the unknown function and its partial derivatives.

    NOTE\uff1ahomogeneous without \u201dconstant term\u201d

    "},{"location":"GP/sch/sch/#time-independent-schroedingers-equation","title":"time-independent Schroedinger\u2019s equation","text":"

    In most cases we discuss, the potential energy \\(U = U(x)\\) is independent of time.

    We can solve the stationary solution of the Schroedinger equation by an ansatz: \\(\u03c8(x, t) = \\Phi(x)e^{\\frac{-iEt}{\\bar{h}}}\\).

    Substituting the above ansatz of \\(\u03c8(x,t)\\), we obtain the following equation for \\(\u03c6(x)\\) \\(\\frac{\\partial^2\\phi(x)}{\\partial^2x}+\\frac{2m}{\\bar{h}^2}[E-U(x)]\\phi(x)=0\\)

    By solving this equation, we can obtain the stationary solution \u03c6\\((x)\\) under the time-independent external potential \\(U(x)\\).

    In free space, \\(U(x) = 0\\).

    • The general solution is \u03c6\\((x)=Ae^{ikx} +Be^{\u2212ikx}\\) where A and B are constants and k = \\(\\sqrt{2mE} /\\bar{h}\\).

    The general form of a second-order homogeneous linear ordinary differential equation (ODE) with constant coefficients is given by:

    \\(a\\frac{d^y}{dx^2}+b\\frac{dy}{dx}+cy=0\\)

    The general solution for such equations can be found by assuming the solution has the form \\(y=e^{rx}\\) where r is a constant to be determined. Substituting this form into the equation yields the characteristic equation:\\(ar^2+br+c=0\\)

    Solving this quadratic equation for rr determines the values for r, which in turn determine the form of the general solution. There are typically three cases:

    1. Two distinct real roots r1 and r2

    The general solution is: \\(y=C_1e^{r_1x}+C_2e^{r_2x}\\)

    1. One real root r repeated twice:

    The general solution is: \\(y=(C_1+C_2x)e^{rx}\\)

    1. Two complex conjugate roots r=\u03b1\u00b1\u03b2i:

    The general solution is: \\(y=e^{\u03b1x}(C_1cos\u2061(\u03b2x)+C_2sin\u2061(\u03b2x))\\)

    "},{"location":"GP/sch/sch/#the-complete-time-dependent-wave-function","title":"The complete time-dependent wave function","text":"

    \\(\u03c8(x,t)=Ae^{i(kx\u2212\u03c9t)} +Be^{\u2212i(kx+\u03c9t)}\\) where \\(w=\\frac{E}{\\bar{h}}\\)

    • The two terms correspond to right- and left-moving waves, respectively.

    Consider the right-moving wave \\(\u03c8(x,t) = Ae^{i(kx\u2212\u03c9t)}\\), the probability density is uniform:\\(|\u03c8(x, t)|^2 = \u03c8^\u2217(x, t)\u03c8(x, t) = |A|^2\\). That means that if we make a measurement to locate the particle, the location could turn out to be at any x value.

    "},{"location":"GP/sch/sch/#wave-packets","title":"Wave Packets","text":"

    What is the speed of a free quantum mechanical particle?

    \\(\u03c8(x,t)=Ae^{i(kx\u2212\\frac{\\bar{h}k^2}{2m}t)} +Be^{\u2212i(kx+\\frac{\\bar{h}k^2}{2m}t)}\\) where \\(w=\\frac{E}{\\bar{h}}\\) and \\(\\sqrt{2mE} /\\bar{h}\\)

    \\(\\Rightarrow v_{ph}=\\frac{\\bar{h}k}{2m}=\\sqrt{\\frac{E}{2m}}\\)

    On the other hand, the classical speed of a free particle with energy E is given by \\(v_{cl} = \\sqrt{\\frac{2E}{m}}= 2v_{ph}\\).

    Problem #1:

    The quantum mechanical wave function travels at half the speed of the particle it is supposed to represent!

    Problem #2:

    How to normalize the wave function of the free particle, say, represented by \\(Ae^{ikx}\\) ?

    \\(\\int_{-\\infty}^{+\\infty}|\u03c8(x)|^2dx=|A|^2\\int_{-\\infty}^{+\\infty}1dx=|A|^2\\infty\\)

    This wave function is not normalizable!

    In fact, the stationary (separable) solutions do not represent physically realizable states for a free particle; there is no such thing as a free particle with a definite energy.

    "},{"location":"GP/sch/sch/#the-realistic-solution-to-the-schroedinger-equation-for-a-free-particle","title":"the realistic solution to the Schroedinger equation for a free particle","text":"

    In quantum theory, a localized particle is modeled by a linear superposition of these stationary free-particle (or plane-wave) states.

    In general, we can construct a linear combination (integral over continuous \\(k\\))

    \\(\u03a8(x,t)=\\frac{1}{\\sqrt{2\\pi}}\\int_{-\\infty}^{+\\infty}\\)\u03c6\\((k)e^{i(kx\u2212\\frac{\\bar{h}k^2}{2m}t)}dk\\)

    This wave function can be normalized for appropriate \u03c6\\((k)\\), typically Gaussian. We call it a wave packet, which carries a range of k and, hence, a range of energies and speeds. In a general quantum problem, we are given \\(\u03a8(x, 0)\\) and needed to find \\(\u03a8(x, t)\\).

    The particle can be better localized (\u2206x can be decreased) if more plane-wave states of different wavelengths or momenta are added together in the right way (\u2206p is increased).

    According to Heisenberg, these uncertainties obey \\(\u2206x\u2206p \u2265 \\bar{h}/2\\).

    It turns out that the group velocity of the wave packet, not the phase velocity of the stationary states, matches the classical particle velocity.

    "},{"location":"GP/sch/sch/#some-exercises","title":"Some Exercises","text":""},{"location":"GP/sch/sch/#reflection-from-a-potential-step","title":"Reflection from a Potential Step","text":"

    Consider a beam of nonrelativistic electrons, each of total energy E, along an x axis through a narrow tube. They experience a negative electric potential step of height \\(V_b <0\\) at \\(x=0\\).(Note that the charge q of the electron is negative)

    "},{"location":"GP/sch/sch/#e-qv_b","title":"\\(E > qV_b\\).","text":"

    Classically, electrons should all pass through the boundary. Their total energy should be conserved, so their kinetic energy, hence speed, decreases when their potential energy increases.

    • What happens quantum mechanically?

    (at a given time?)

    • We can first set \\(D = 0\\), because there is no electron source off to the right, and there can be no electrons moving to the left in region 2.

    • We now consider boundary conditions at \\(x = 0\\):

    \\(A + B = C\\) (matching of values)

    \\(Ak \u2212 Bk = Ck_b\\) (matching of slopes) \u300cfirst derivation\u300d

    We should be able to solve \\(B/A\\) and \\(C/A\\), but not \\(A\\), \\(B\\), and \\(C\\).

    Note that the absolute values are not important for our purpose (it can be related to the beam intensities, though).

    • Indeed, to find the probability that electrons reflect from the step, we need to relate the probability density of the reflected wave \\(Be^{\u2212ikx}\\) to that of the incident wave \\(Ae^{ikx}\\). We thus define a reflection coefficient R:

    \\(R_{reflected}=\\frac{|A|^2}{|B|^2}=|\\frac{k-k_b}{k+k_b}|^2\\)

    \\(T_{transmition}=1-R=\\frac{4kR(k_b)}{|k+k_b|^2}\\)

    Quantum mechanically, electrons are reflected from the boundary, but only with a probability.

    What inspires us to define T in this way?

    Well, one can consider an alternative quantity \\(\\frac{|C|^2}{|A|^2}=\\frac{4k^2}{|k+k_b|^2}=\\frac{k}{R(k_b)}T=\\frac{k}{k_b}T for\\ real\\ k_b\\)(which means\\(E > qV_b\\). )

    Why coefficient?

    • Recall current density J = nqv. Not surprisingly, one finds

    \\(T = \\frac{|C|^2k_b}{|A|^2k} = \\frac{|C|^2q(\\bar{h}k_b/m)}{|A|^2q(\\bar{h}k/m)} =\\frac{n_1qv_1}{n_2qv_2}= \\frac{J_{transmitted}}{J_{incident}}\\).

    One can also write

    \\(R=\\frac{J_{reflected}}{J_{incident}}\\)

    Therefore, \\(T = 1 \u2212 R\\) is nothing but the conservation of current \\(J_{transmitted} = J_{incident} \u2212 J_{reflected}.\\)

    "},{"location":"GP/sch/sch/#e-qv_b_1","title":"\\(E < qV_b\\).","text":"
    • Just Reflection
    "},{"location":"GP/sch/sch/#tunneling-through-a-potential-barrier","title":"Tunneling through a Potential Barrier","text":"

    Now consider a potential energy barrier, which is a region of thickness L where the electric potential is \\(V_b(<0)\\) and the barrier height is \\(U_b=qV_b\\)

    • Consider \\(E < qV_b\\)

    Separate the space into three regions and solve Schroedinger's equation in each region \\((3\\times2-1=5\\ unknowns)\\)

    Apply boundary conditions at the two boundaries\\((2\\times2=4)\\)

    Calculate the tunneling coefficient.

    "},{"location":"GP/sch/sch/#general-results","title":"General Results","text":"
    • The oscillating curve to the left of the barrier (for x < 0) is a combination of the incident matter wave and the reflected matter wave (which has a smaller amplitude than the incident wave).

    The oscillations occur because these two waves, traveling in opposite directions, interfere with each other, setting up a standing wave pattern.

    • Within the barrier \\((for\\ 0 < x < L)\\) the probability density decreases exponentially with x. However, if L is small, the probability density is not quite zero at x = L..

    • To the right of the barrier (for x > L), the probability density plot describes a transmitted wave (through the barrier) with low but constant amplitude.

    We can assign a transmission coeffient T to the incident matter wave and the barrier. The transmission coefficient T is approximately \\(T\\approx e^{-2kL}\\) where \\(k=\\frac{\\sqrt{2m(qV_b-E)}}{\\bar{h}}\\) Try Derive (imaginary k' actually) \\(T\\) is sensitive to L,m and \\(U_b-E\\)

    "},{"location":"GP/sch/sch/#scanning-tunneling-microscope-stm","title":"Scanning Tunneling Microscope (STM)","text":"

    The size of details that can be seen in an optical microscope is limited by the wavelength of the light the microscope uses (about 300 nm for ultraviolet light). We use electron matter waves (tunneling through potential barriers) to create images on the atomic scale.

    The piezoelectric effect refers to the phenomenon where certain crystals exhibit charge separation when subjected to mechanical stress, resulting in the generation of voltage, or conversely, when an electric field is applied, causing the crystal to undergo mechanical deformation. This phenomenon is known as the piezoelectric effect, and the crystals that exhibit it are referred to as piezoelectric crystals.

    Specifically, the piezoelectric effect can be categorized into two main types:

    1. Direct Piezoelectric Effect: - When a piezoelectric crystal is subjected to external mechanical pressure, there is a redistribution of charges within the crystal, leading to charge separation on the crystal's surface and the generation of voltage. This effect finds widespread applications in devices such as piezoelectric sensors and transducers.
    2. Inverse Piezoelectric Effect: - The inverse piezoelectric effect occurs when a mechanical deformation is induced in a crystal by applying an electric field. In this case, the electric field can control the shape and size of the crystal, causing mechanical vibrations. This effect is utilized in applications like piezoelectric ceramics in drivers and Surface Acoustic Wave (SAW) devices.

    A fine metallic tip, mounted on quartz rods, is placed close to the surface to be examined. The space between the surface and the tip forms a potential energy barrier.

    • Quartz shows the piezoelectricity.

    • The position of the tip can be controlled by applying the electric field on the quartz. The horizontal location of the tip is controlled by the electric field in x- and y-directions. The vertical distance between the surface and the tip is controlled by the electric field in z-direction.

    • Transmission coefficient \\(T\\) ~ \\(e^{-2kL}\\) is sensitive to the barrier width.

    \\(\u2192\\) Tunneling current is sensitive to the distance between the surface and the tip.

    • The vertical position of the tip is adjusted to keep the tunneling current constant as the tip is scanned over the surface. Imaging of the atomic scale is possible.

    An STM not only can provide an image of a static surface, it can also be used to manipulate atoms and molecules on a surface.

    "},{"location":"GP/sch/sch/#s-matrix","title":"S-Matrix","text":"

    The expression \\(|r|^2+|t|^2=1\\) is a consequence of probability conservation in quantum mechanics. Let's break down the meaning of this expression in the context of quantum mechanics and scattering theory.

    In quantum mechanics, when a particle encounters a potential barrier or undergoes scattering, the probabilities of reflection\\(|r|^2\\) and transmission\\(t|^2\\)must add up to unity. Here's why:

    1. Probability Conservation: The total probability of finding the particle must be conserved. When a particle encounters a potential barrier, it can either be reflected back or transmitted through the barrier. The sum of the probabilities of these two outcomes must be equal to 1.

    Mathematically, this is expressed as \\(|r|^2+|t|^2=1\\)

    1. Normalization Condition: The probability amplitude is related to the wave function, and the square of the amplitude gives the probability density. For the wave function to represent a physically meaningful probability density, it must be normalized.

    The normalization condition for probability amplitudes requires that the sum of the probabilities over all possible outcomes is equal to 1.

    Mathematically, this normalization condition is expressed as \\(\u222b\u2223\u03a8(x)\u2223^2\u2009dx=1\\), where \\(\u03a8(x)\\) is the wave function.

    "},{"location":"GP/sch/sch/#example","title":"Example","text":"

    \\(Explain\\ for\\ the\\ below\\ Pic\\)

    • \\(t_1\\) and \\(t_2\\): These are the transmission coefficients at the first and second barriers, respectively. They represent the fraction of the wave that gets transmitted through the barriers.

    • \\(r_1\\) and \\(r_2\\): These are the reflection coefficients at the first and second barriers, respectively. They represent the fraction of the wave that gets reflected at the barriers.

    • \\(e^{i\u03b8}\\): This term introduces a phase shift (\u03b8) to the wave.

    The term is a complex exponential that represents a phase change in the wave. It's common in wave optics and quantum mechanics to introduce phase factors.

    Now, let's interpret the terms in the sum:

    1. The first term \\(t_1e^{i\u03b8}t_2\\) represents the wave being transmitted through the first barrier (\\(t_1\\)), undergoing a phase change (\\(e^{i\\theta}\\)), and then being transmitted through the second barrier \\((t_2)\\)

    2. The second term \\(t_1e^{i\\theta}r_2e^{i\\theta}r_1e^{i\\theta}t_2\\) represents a more complex scenario.

    The wave is transmitted through the first barrier (\\(t_1\\)), undergoes a phase change (\\(e^{i\\theta}\\)), gets partially reflected \\(r_2\\), undergoes another phase change\\(e^{i\\theta}\\), gets reflected again\\((r_1)\\), undergoes yet another phase change\\((e^{i\\theta})\\), and finally gets transmitted through the second barrier \\(t_2\\).

    • Question?

    \\(b_4b_4^\u2217=\\frac{t_{1}^2t_2^2}{1\u22122r_1r_2cos\u2061(2\u03b8)+r_1^2r_2^2}\\)

    "},{"location":"GP/sch/sch/#two-particle-system","title":"Two Particle System","text":"

    https://www.youtube.com/watch?v=M7VJa5eim5o

    https://phys.libretexts.org/Bookshelves/Quantum_Mechanics/Introductory_Quantum_Mechanics_(Fitzpatrick)/05%3A_Multi-Particle_Systems/5.03%3A_Two-Particle_Systems

    \\(i\\bar{h}\\frac{\\partial}{\\partial t}\u03c8(x_1,x_2,t)=[-\\frac{\\bar{h}^2}{2m_1}\\frac{\\partial^2}{\\partial x_1^2}-\\frac{\\bar{h}^2}{2m_2}\\frac{\\partial^2}{\\partial x_2^2}+V(x_1,x_2)]\u03c8(x_1,x_2,t)\\)

    "},{"location":"NA/Chap1/Chap1/","title":"Mathematical Preliminaries","text":""},{"location":"NA/Chap1/Chap1/#roundoff-errors-and-computer-arithmetic","title":"Roundoff Errors and Computer Arithmetic","text":"
    • Truncation Error: the error involved in using a truncated, or finite, summation to approximate the sum of an infinite series.

    • Roundoff Error: the error produced when performing real number calculations. It occurs because the arithmetic performed in a machine involves numbers with only a finite number of digits.

    If \\(p^*\\) is an approximation to p, the absolute error is | \\(p\\) \u2013 \\(p^*\\) |, and the relative error is | \\(p\\) \u2013 \\(p^*\\) | / | p |, provided that p \\(\\ne\\) 0.

    The number \\(p^*\\) is said to approximate \\(p\\) to t significant digits (or figures) if \\(t\\) is the largest nonnegative integer for which \\(\\frac{|p-p^*|}{|p|}<5\\times10^{-t}\\)

    To achieve \\(To\\ t\\ significant\\ digits\\) Both Chopping & Rounding has to approximate at \\(k = t\\)

    • How will roundoff error affect our results?

    Subtraction of nearly equal numbers will cause a cancellation of significant digits.

    "},{"location":"NA/Chap1/Chap1/#algorithms-and-convergence","title":"Algorithms and Convergence","text":"

    An algorithm that satisfies that small changes in the initial data produce correspondingly small changes in the final results is called stable; otherwise it is unstable.

    An algorithm is called conditionally stable if it is stable only for certain choices of initial data.

    Suppose that \\(E_0 > 0\\) denotes an initial error and \\(E_n\\) represents the magnitude of an error after n subsequent operations. If \\(E_n \\approx CnE_0\\), where C is a constant independent of n, then the growth of error is said to be linear. If \\(E_n \\approx C^n E_0\\), for some C > 1, then the growth of error is called exponential.

    "},{"location":"NA/Chap2/Chap2/","title":"Solutions of Equations in one variable","text":""},{"location":"NA/Chap2/Chap2/#the-bisection-method","title":"The Bisection Method","text":"
    Algorithm: Bisection\nTo find a solution to f (x) = 0 given the continuous function f on the interval [ a, b ], where f (a) and f (b) have opposite signs.\nInput: endpoints a, b; tolerance TOL; maximum number of iterations Nmax.\nOutput: approximate solution p or message of failure.\n\nStep 1  Set  i = 1;\n             FA = f (a) ;\nStep 2  While( i<=Nmax)  do  steps 3-6\n    Step 3  Set  p = a + ( b \u2013 a ) / 2 ; /* compute pi */\n               FP = f (p) ; \n    Step 4  If ( FP == 0 ) or ( b - a ) / 2 < TOL  then  Output (p); \n                 STOP; /* successful */\n    Step 5  Set  i ++;\n    Step 6  If  sign(FA) \u00b7 sign(FP) > 0 then set a = p ; FA = FP ;\n                           Else set b = p ; /* update ai, bi */  \nStep 7  Output (Method failed after Nmax iterations); /* unsuccessful */\n        STOP.\n

    Other Stopping Procedures

    \\(|p_N-p_{N-1}|<\\epsilon\\)

    \\(\\frac{|p_N-p_{N-1}|}{|p_N|}<\\epsilon\\)

    \\(|f(p_N)|<\\epsilon\\)

    "},{"location":"NA/Chap2/Chap2/#therom","title":"Therom","text":"

    Suppose that \\(f\\in C[a,b]\\) and \\(f(a)f(b)<0\\) The Bisection method generates a seqence \\(\\{p_n\\}_{n=1}^{\\infty}\\) approximating a zero p of f with \\(|p_n-p|\\le\\frac{b-a}{2^n}\\) when \\(n \\ge1\\)

    "},{"location":"NA/Chap2/Chap2/#fixed-point-iteration","title":"Fixed-Point Iteration","text":""},{"location":"NA/Chap2/Chap2/#theorem-fixed-point-theorem","title":"Theorem: (Fixed-Point Theorem)","text":"

    Let \\(g \\in C[a, b]\\) be such that \\(g(x) \\in [a, b]\\), for all x in \\([a, b]\\).

    • \\(g\\) has a fixed point in \\([a,b]\\)

    • Suppose, in addition, that \\(g\u2019\\) exists on \\((a, b)\\) and that a constant \\(0 < k < 1\\) exists with\\(|g\u2019(x)| \\le k\\) for all x in (a, b). Then:

    (1) The fixed point is unique \\(Proof \\ P57\\) (By Contradiction)

    (2)For any number \\(p_0\\) in [a, b], the sequence defined by \\(p_n = g( p_{n \u2013 1} )\\), \\(n \\ge 1\\), converges to the unique fixed point \\(p\\) in \\([a, b]\\). \\(Proof \\ P61-62\\)

    "},{"location":"NA/Chap2/Chap2/#corollary","title":"Corollary","text":"

    If \\(g\\) satisfies the hypotheses of the Fixed-Point Theorem, then bounds for the error involved in using \\(p_n\\) to approximate \\(p\\) are given by (for all n \\(\\ge\\) 1)

    \\(|p_n-p|\\le k^n max\\{p_0-a,b-p_0\\}\\)

    \\(|p_n-p|\\le\\frac{1}{1-k}|p_{n+1}-p_n|\\)

    \\(|p_n-p|\\le \\frac{k^n}{1-k}|p_1-p_0|\\)

    \\(Proof\\ P62\\)

    Algorithm: Fixed-Point Iteration\nFind a solution to p = g(p) given an initial approximation p0.\nInput: initial approximation p0; tolerance TOL; maximum number of iterations Nmax.\nOutput: approximate solution p or message of failure.\nStep 1  Set  i = 1;\nStep 2  While ( i <= Nmax)  do  steps 3-6\n        Step 3  Set  p = g(p0);  /* compute pi */\n        Step 4  If  | p - p0 | < TOL  then  Output (p);  /* successful */\n            STOP;\n        Step 5  Set  i ++;\n        Step 6  Set  p0 = p ;   /* update p0 */\nStep 7  Output (The method failed after Nmax iterations);  /* unsuccessful */\n                STOP.\n
    "},{"location":"NA/Chap2/Chap2/#newtons-problem","title":"Newton's Problem","text":"

    Linearize a nonlinear function using Taylor\u2019s expansion.

    "},{"location":"NA/Chap2/Chap2/#therom_1","title":"Therom","text":""},{"location":"NA/Chap2/Chap2/#secant-method","title":"Secant Method","text":""},{"location":"NA/Chap2/Chap2/#method-of-false-position","title":"Method of False Position","text":"

    P73 Just Modify to always bracket the root.

    "},{"location":"NA/Chap2/Chap2/#error-analysis-for-iterative-methods","title":"Error Analysis for Iterative Methods","text":""},{"location":"NA/Chap2/Chap2/#therom-27","title":"Therom 2.7","text":"

    Let \\(g \\in C[a,b]\\) be such that \\(g(x)\\in [a,b]\\) for all \\(x\\in [a,b]\\).Suppose, in addition,that is continuous on \\((a,b)\\) and a positive constant \\(k<1\\) exists with \\(|g'(x)|\\le k\\) for all \\(x\\in (a,b)\\)

    • If \\(g'(p)\\ne 0\\) then for any number \\(p_0\\) in \\([a,b]\\) ,the sequence \\(p_n=g(p_{n-1})\\) converges only linearly to the unique fixed point \\(p\\ in\\ [a,b]\\)

    \\(p_{n+1}-p=g(p_n)-g(p)=g'(\\epsilon_n)(p_n-p)\\)

    "},{"location":"NA/Chap2/Chap2/#therom_2","title":"Therom","text":"

    \\(f\\in C[a,b]\\) has a simple zero at \\(p\\) in \\((a,b)\\) if and only if \\(f(p)=0\\) but \\(f'(p)\\ne 0\\)

    \\(f\\in C^m[a,b]\\) has a zero of multiplicity m at \\(p\\) in \\((a,b)\\) if and only if \\(0=f(p)=f'(p)=\u2026\u2026=f^{m-1}(p)\\) but \\(f^m(p)\\ne 0\\)

    "},{"location":"NA/Chap2/Chap2/#accelarating-convergence","title":"Accelarating Convergence","text":"
    Algorithm: Steffensen\u2019s Acceleration\nFind a solution to x = g(x) given an initial approximation p0.\nInput: initial approximation p0; tolerance TOL; maximum number of iterations Nmax.\nOutput: approximate solution x or message of failure.\nStep 1  Set  i = 1;\nStep 2  While ( i <= Nmax)  do  steps 3-6\n    Step 3  Set  p1 = g(p0) ; \n          p2 = g(p1) ; \n          p = p0 -( p1 - p0 )2 / ( p2 -2 p1 + p0 ) ;\n    Step 4  If  | p - p0 | < TOL  then  Output (p);  /* successful */\n                    STOP;\n    Step 5  Set  i ++;\n    Step 6  Set  p0 = p ;   /* update p0 */\nStep 7  Output (The method failed after Nmax iterations);  /* unsuccessful */\n                STOP.\n
    "},{"location":"NA/Chap3/Chap3/","title":"Interpolation and Polynomial Approximation","text":""},{"location":"NA/Chap3/Chap3/#interpolation-and-the-lagrange-polynomial","title":"Interpolation and the Lagrange Polynomial","text":""},{"location":"NA/Chap3/Chap3/#therom-32","title":"Therom 3.2","text":"
    • Proof of Uniqueness
    "},{"location":"NA/Chap3/Chap3/#remainder","title":"Remainder","text":"

    \\(Specific\\ Proof\\ P112\\)

    "},{"location":"NA/Chap3/Chap3/#def","title":"Def","text":"

    Let \\(f\\) be a function defined at $x_0, x_1 \u2026\u2026 x_n $ and suppose that $m_0, m_1 \u2026\u2026 m_n $ are k distince integers . The Lagrange polynomial that agrees with \\(f(x)\\) at k points \\(x_{m1},x_{m2}\u2026\u2026 x_{m_k}\\) is denoted by \\(P_{m_1,m_2\u2026\u2026,m_n}(x)\\)

    "},{"location":"NA/Chap3/Chap3/#nevilles-method","title":"Neville\u2019s Method","text":""},{"location":"NA/Chap3/Chap3/#therom-35","title":"Therom 3.5","text":""},{"location":"NA/Chap3/Chap3/#peseudo-code","title":"Peseudo code","text":""},{"location":"NA/Chap3/Chap3/#divided-difference","title":"Divided Difference","text":""},{"location":"NA/Chap3/Chap3/#newtons-interpolation","title":"Newton\u2019s Interpolation","text":"

    \\(P_n(x)=f[x_0]+\\sum_{k=1}^nf[x_0,x_1,\u2026\u2026x_k](x-x_0)\u2026\u2026(x-x_{k-1})\\)

    • https://www.youtube.com/watch?v=S7QIU0i1qLE

    Newton's Forward Difference Interpolation and Newton's Backward Difference Interpolation are both methods for constructing polynomial interpolants, but they differ in terms of the direction in which they compute the differences.

    1. Newton's Forward Difference Interpolation: - Differences: Forward interpolation starts with the given data point closest to the beginning (usually the lowest x-value) and moves forward. - Formula: The forward difference formula is given by: \\(f[x_0]+f[x_0,x_1](x\u2212x_0)+f[x_0,x_1,x_2](x\u2212x_0)(x\u2212x_1)+\u2026\\)
    2. Newton's Backward Difference Interpolation: - Differences: Backward interpolation starts with the given data point closest to the end (usually the highest x-value) and moves backward. - Formula: The backward difference formula is given by: \\(f[x_n]+f[x_n,x_{n\u22121}](x\u2212x_n)+f[x_n,x_{n\u22121},x_{n\u22122}](x\u2212x_n)(x\u2212x_{n\u22121})+\u2026\\)

    In both cases, the differences \\(f[x_i,x_{i\u22121},\u2026,x_0]\\) are computed using the divided difference approach. The primary difference between the two methods lies in the direction in which these differences are calculated.

    Key Points:

    • Newton's Forward Difference Interpolation works from the initial data point towards the desired point.
    • Newton's Backward Difference Interpolation works from the final data point towards the desired point.
    • Both methods use divided differences to calculate the coefficients of the interpolation polynomial.
    • The choice between forward and backward interpolation may depend on the specific problem and the nature of the available data

    \\(Pseudocode\\ P124-125\\)

    • Refer to P126 - 128!
    "},{"location":"NA/Chap3/Chap3/#hermites-method","title":"Hermite's Method","text":"
    • Persuadocode
    "},{"location":"NA/Chap3/Chap3/#cubic-spline-interpolation","title":"Cubic Spline INterpolation","text":"

    How can we make a smooth interpolation without asking too much from \\(f\\) ?Headache \u2026

    "},{"location":"NA/Chap3/Chap3/#further","title":"Further","text":"

    Suppose \\(S_j(x)=a_j+b_j(x-x_j)+c_j(x-x_j)^2+d_j(x-x_j)^3\\)

    • \\(a_{j+1}=S_j(x_{j+1})S_j(x_{j+1})=a_j+b_j(x_{j+1}-x_j)+c_j(x_{j+1}-x_j)^2+d_j(x_{j+1-x_j})^3\\)

    For notation \\(h_j=x_{j+1}-x_j\\) \\(a_{j+1}=a_j+b_jh_j+c_jh_j^2+d_jh_j^3\\) \\((1)\\)

    • \\(S'_j(x_j)=b_j\\) Applying condition \uff08d\uff09

    \\(b_{j+1}=b_j+2c_jh_j+3d_jh_j^2\\) \\((2)\\)

    • \\(c_j=S''_j(x_j)/2\\) and applying condition (e).

    \\(c_{j+1}=c_j+3d_jh_j\\) \\((3)\\)

    \\(\\Rightarrow h_{j-1}c_{j-1}+2(h_{j-1}+h_j)c_j+h_jc_{j+1}=\\frac{3}{h_j}(a_{j+1}-a_j)-\\frac{3}{h_{j-1}}(a_{j+1}-a_j)\\)

    "},{"location":"NA/Chap3/Chap3/#natural-cubic-spline","title":"Natural Cubic Spline","text":""},{"location":"NA/Chap3/Chap3/#clamped-boundary","title":"Clamped Boundary","text":""},{"location":"NA/Chap4/Chap4/","title":"Numerical Differentiation and Integration","text":"

    Refer to the Book .\uff08This page LACKS many contents\uff09

    "},{"location":"NA/Chap4/Chap4/#numerical-differentiation","title":"Numerical Differentiation","text":""},{"location":"NA/Chap4/Chap4/#richardsons-extrapolation","title":"Richardson\u2019s Extrapolation","text":""},{"location":"NA/Chap4/Chap4/#elements-of-numerical-integration","title":"Elements of Numerical Integration","text":"

    Approximate \\(I=\\int_a^b f(x)dx\\)

    • Integrate the Lagrange interpolating polynomial of \\(f (x)\\) instead.
    "},{"location":"NA/Chap4/Chap4/#composite-numerical-integration","title":"Composite Numerical Integration","text":""},{"location":"NA/Chap4/Chap4/#composite-trapezoidal-rule","title":"Composite Trapezoidal Rule","text":""},{"location":"NA/Chap4/Chap4/#composite-simpsons-rule","title":"Composite Simpson\u2019s Rule","text":""},{"location":"NA/Chap4/Chap4/#romberg-integration","title":"Romberg Integration","text":""},{"location":"NA/Chap4/Chap4/#adaptive-quadrature-methods","title":"Adaptive Quadrature Methods","text":""},{"location":"NA/Chap4/Chap4/#gaussian-quadrature","title":"Gaussian Quadrature","text":"
    • Precision of degree 3(produces exact result for every polynomial of degree 3 or less)
    "},{"location":"NA/Chap5/Chap5/","title":"Chapter 5","text":""},{"location":"NA/Chap5/Chap5/#preknowledge","title":"Preknowledge","text":""},{"location":"NA/Chap5/Chap5/#eulers-method","title":"Euler's method\uff1a","text":"

    all step size, the accuracy of approximation increases.

    "},{"location":"NA/Chap5/Chap5/#error-analysis","title":"Error Analysis","text":"

    Refer to the BOOK

    "},{"location":"NA/Chap5/Chap5/#other-euler-methods","title":"Other Euler Methods","text":""},{"location":"NA/Chap5/Chap5/#implicit-euler-method","title":"Implicit Euler Method","text":"

    \\(y'(t_0)\\approx\\frac{t(t_0)-y(t_0-h)}{h}\\Rightarrow y(t_1)\\approx y(t_0)+hy'(t_1)=\\alpha+hf(t_1,y(t_1))\\)

    \\(w_0=\\alpha ; w_{i+1}=w_i+hf(t_{i+1},w_{i+1})(i=0,\u2026\u2026\uff0cn-1)\\)

    \\(\\tau_{i+1}=\\frac{y_{i+1}-w_{i+1}}{h}==\\frac{h}{2}y''(\\epsilon_i)=o(h)\\)

    "},{"location":"NA/Chap5/Chap5/#trapezoidal-method","title":"Trapezoidal Method","text":"

    \\(w_{i+1}=w_i+\\frac{h}{2}[f(t_i,w_i)+f(t_{i+1},w_{i+1})]\\)

    • Error \\(O(h^2)\\) but implict!! so has to be solved iteratively(LOW!)
    "},{"location":"NA/Chap5/Chap5/#double-step-method","title":"Double-step Method","text":"

    \\(y'(t_0)=\\frac{1}{2h}[y(t_0+h)-y(t_0-h)]-\\frac{h^2}{6}y^{(3)}(\\epsilon_1)\\)

    \\(\\Rightarrow y(t_2)\\approx y(t_0)+2hf(t_1,y(t_1))\\)

    \\(w_0=\\alpha\\\\ w_{i+1}=w_{i-1}+2hf(t_i,w_i)\\)

    • Two initial points are required to start moving forward .
    "},{"location":"NA/Chap5/Chap5/#modified-eulers-methodtrapezoidal-method","title":"modified Euler\u2019s method:Trapezoidal Method","text":"

    Modified Euler's method, also known as the Improved Euler method or Heun's method, is a numerical technique used for approximating solutions to ordinary differential equations (ODEs). It is an extension of the basic Euler's method and provides better accuracy by incorporating a simple correction.

    The standard Euler's method is a first-order numerical method that uses a linear approximation to update the solution from one time step to the next. However, it can have limited accuracy, especially for ODEs with rapidly changing behavior.

    The Modified Euler's method improves upon this by using a two-step process:

    1. Prediction Step:

    Use the current information to make a preliminary estimate of the solution at the next time step.

    Predicted Value \\((P)\\):\\(\\tilde{y}_{i+1}=y_{i}+h\u22c5f(t_i,y_i)\\)

    Here, \\(y_i\\) is the current approximation, h is the step size, and \\(f(t_i,y_i)\\)represents the derivative of yy with respect to \\(t\\) at the current point.

    1. Correction Step:

    Use the predicted value to compute a more accurate estimate by incorporating the derivative at the predicted point.

    Corrected Value \\((C)\\):\\(y_{i+1}=y_i+\\frac{h}{2}[f(t_i,y_i)+f(t_{i+1},\\tilde{y}_{i+1})]\\)

    In this step, \\(f(t_i,y_i)\\)represents the derivative at the initial point, and \\(f(t_{i+1},y_{i+1})\\) represents the derivative at the predicted point.

    Modified Euler's method has a local truncation error of \\(O(h^3)\\), which is an improvement over the \\(O(h^2)\\) local truncation error of the basic Euler method. This makes it more accurate for a wide range of ODEs, and it is still relatively simple to implement.

    "},{"location":"NA/Chap5/Chap5/#higher-order-taylor-methods","title":"Higher-order Taylor Methods","text":""},{"location":"NA/Chap5/Chap5/#runge-kutta-methods","title":"Runge-Kutta Methods","text":"

    Runge-Kutta methods are a family of iterative numerical techniques used for solving ordinary differential equations (ODEs) or systems of ODEs. These methods provide an approximation of the solution at discrete points in the domain by iteratively updating the solution from one point to the next.

    Single-Step Method:

    In a single-step method, the solution at the next time step \\((t_{i+1},w_{i+1})\\) is determined based on the information available at the current time step \\((t_{i},w_{i})\\). This implies that we calculate the next point of the solution through one iteration rather than computing the entire solution curve at once.

    We can improve the result by finding a better slope.

    Generalize the modified Euler\u2019s method

    "},{"location":"NA/Chap5/Chap5/#multistep-methods","title":"Multistep Methods","text":"

    Use a linear combination of y and y at several mesh points to better approximate \\(y(t_{i+1})\\)

    \\(w_{i+1}=a_{m-1}w_i+a_{m-2}w_{i-1}+\u2026\u2026+h[b_mf_{i+1}+b_{m-1}f_i+\u2026\u2026+b_0f_{i+1-m}]\\)

    Newton's Forward Difference Interpolation and Newton's Backward Difference Interpolation are both methods for constructing polynomial interpolants, but they differ in terms of the direction in which they compute the differences.

    1. Newton's Forward Difference Interpolation: - Differences: Forward interpolation starts with the given data point closest to the beginning (usually the lowest x-value) and moves forward. - Formula: The forward difference formula is given by: \\(f[x_0]+f[x_0,x_1](x\u2212x_0)+f[x_0,x_1,x_2](x\u2212x_0)(x\u2212x_1)+\u2026\\)
    2. Newton's Backward Difference Interpolation: - Differences: Backward interpolation starts with the given data point closest to the end (usually the highest x-value) and moves backward. - Formula: The backward difference formula is given by: \\(f[x_n]+f[x_n,x_{n\u22121}](x\u2212x_n)+f[x_n,x_{n\u22121},x_{n\u22122}](x\u2212x_n)(x\u2212x_{n\u22121})+\u2026\\)

    In both cases, the differences \\(f[x_i,x_{i\u22121},\u2026,x_0]\\) are computed using the divided difference approach. The primary difference between the two methods lies in the direction in which these differences are calculated.

    Key Points:

    • Newton's Forward Difference Interpolation works from the initial data point towards the desired point.
    • Newton's Backward Difference Interpolation works from the final data point towards the desired point.
    • Both methods use divided differences to calculate the coefficients of the interpolation polynomial.
    • The choice between forward and backward interpolation may depend on the specific problem and the nature of the available data.
    "},{"location":"NA/Chap5/Chap5/#adams-bashforth-explicit-m-step-technique","title":"Adams-Bashforth explicit m-step technique","text":"

    Derive from integration

    • Adams-Bashforth explicit m-step technique

    1.Use the Newton backward-difference formula to interpolate f on \\((t_i,f_i),(t_{i-1},f_{i-1})\u2026\u2026(t_{i+1-m},f_{i+1-m})\\) and obtain \\(P_{m-1}(t)\\)

    2.Or Let \\(t=t_i+sh\\ s\\in[0,1]\\) we have

    \\(\\int_{t_{i}}^{t_{i+1}}f(t,y(t))dt=h\\int_0^1P_{m-1}(t_i+sh)ds+h\\int_0^1R_{m-1(t_i+sh)}ds\\)

    \\(\\Rightarrow w_{i+1}=w_i+h\\int_0^1P_{m-1}(t_i+sh)ds\\)

    3. The local truncation error for a multistep method is \\(\\tau_{i+1}(h)=y_{i+1}-(a_{m-1}y_i+\u2026\u2026+a_0y_{i+1-m})/h-[b_mf_{i+1}+\u2026\u2026+b_0f_{i+1-m}]\\) for each \\(i=m-1,m\u2026\u2026,n-1\\)

    Example

    derive the Adams-Bashforth two-step explicit method.

    Note \uff1a \\(h\\) is step length \\(h=\\triangle x/n\\)

    • Use the Newton forward-difference formula to interpolate f
    • Note: Include\\((t_{i+1},f_{i+1})\\) to interpolate So it is implicit

    "},{"location":"NA/Chap5/Chap5/#adams-predictor-corrector-system","title":"Adams predictor-corrector system","text":"
    • Step 1 Compute the first m initial values by Runge-Kutta method.

    • Step 2 Predict by Adams-Bashforth explicit method.

    • Step 3 Correct by Adams-Moulton implicit method.

    "},{"location":"NA/Chap5/Chap5/#example","title":"EXAMPLE","text":"

    Consider a simple first-order ordinary differential equation given by:

    \\(dy/dt=\u2212y\\)

    We will use the Adams predictor-corrector method to numerically solve this equation.

    "},{"location":"NA/Chap5/Chap5/#step-1-compute-the-first-m-initial-values-by-runge-kutta-method","title":"Step 1: Compute the First m Initial Values by Runge-Kutta Method","text":"

    First, we use the Runge-Kutta method to calculate the initial values. For the given equation, the Runge-Kutta scheme is:

    \\(k_1=\u2212y_n\\)

    \\(k_2=\u2212(y_n+0.5hk_1)\\)

    \\(y_{n+1}=y_n+hk_2\\)

    Here, \\(h\\) is the time step.

    "},{"location":"NA/Chap5/Chap5/#step-2-predict-by-adams-bashforth-explicit-method","title":"Step 2: Predict by Adams-Bashforth Explicit Method","text":"

    The Adams-Bashforth method for a second-order equation is:

    \\(y_{n+1}^{(p)}=y_n+h(\u2212y_n+\\frac{3}{2}y_{n\u22121})\\)

    "},{"location":"NA/Chap5/Chap5/#step-3-correct-by-adams-moulton-implicit-method","title":"Step 3: Correct by Adams-Moulton Implicit Method","text":"

    The Adams-Moulton method for a second-order equation is:

    \\[y_{n+1}=y_n+h(\u2212\\frac{1}{2}y_{n+1}+\\frac{3}{2}y_{n})\\]

    This equation needs to be solved iteratively as \\(y_{n+1}\\) appears on both sides of the equation.

    This is a simple example, and in practice, the Adams predictor-corrector method can be applied to higher-order differential equations. The specific steps and coefficients will vary based on the chosen order. In real-world applications, computational tools or programming languages may be used to perform these calculations.

    • All the formulae used in the three steps must have the same order of local truncation error.

    The most popularly used system is based on the 4th-order Adams-Bashforth method as predictor and one iteration of the Adams-Moulton method as corrector, with the starting values obtained from the 4th-order Runge-Kutta method.

    "},{"location":"NA/Chap5/Chap5/#derive-from-taylor-expansion","title":"Derive from Taylor expansion","text":"
    • derive a formula of order 4 with the form
    "},{"location":"NA/Chap5/Chap5/#higher-order-equations-and-systems-of-differential-equations","title":"Higher-Order Equations and Systems of Differential Equations","text":""},{"location":"NA/Chap5/Chap5/#stability","title":"Stability","text":""},{"location":"NA/Chap5/Chap5/#def","title":"Def","text":"
    • Def one : A one-step difference equation method with local trucation error \\(\\tau_i(h)\\) is said to be consistent with the differential equation it approximates if \\(lim_{h\\rightarrow 0}|\\tau_i(h)|=0\\)

    For multistep methods it is also required that for \\(i=1,2,\u2026\u2026m-1\\)

    \u200b \\(lim_{h\\rightarrow 0}|w_i-y_i|=0\\)

    • A one-step difference equation method is said to be convergent with respect to the differential equation it approximates if \\(lim_{h\\rightarrow 0}max_{1\\le i\\le n}|w_i-y_i|=0\\)

    • Apply a particular method to a simple test equation,y\u2018 =\u03bby, y(0) =\u03b1, where Re(\u03bb ) < 0.Assume that roundoff error is introduced only at the initial point. If this initial error will decrease for a certain step size h, then this

    method is said to be absolutely stable with respect to H =\u03bbh. The set of all such H forms the region of absolute stability.

    Method A is said to be more stable than method B if the region of

    absolute stability of A is larger than that of B.

    "},{"location":"NA/Chap5/Chap5/#def_1","title":"Def","text":""},{"location":"NA/Chap6/1/","title":"1","text":"

    \u8ba2\u5a5a\u5f3a\u5978\u6848\u6848\u4f8b\u5206\u6790\uff08\u521d\u7248\uff09

    \u5468\u79c0\u654f 3220103565

    "},{"location":"NA/Chap6/1/#_1","title":"\u4e00\u3001\u6848\u4ef6\u6982\u8ff0","text":"

    \u200b 2023\u5e741\u670830\u65e5\uff0c\u88ab\u544a\u4eba\u5e2d\u67d0\u67d0\u4e0e\u88ab\u5bb3\u4eba\u7ecf\u5a5a\u4ecb\u673a\u6784\u4ecb\u7ecd\u76f8\u8bc6\u540e\u5f00\u59cb\u8c08\u604b\u7231\u3002\u4ea4\u5f80\u671f\u95f4\uff0c\u53cc\u65b9\u53e3\u5934\u7ea6\u5b9a\u8ba2\u5a5a\u5f69\u793c18.8\u4e07\u5143\u30025\u67081\u65e5\uff0c\u5e2d\u67d0\u67d0\u5bb6\u4e3a\u4e8c\u4eba\u4e3e\u529e\u8ba2\u5a5a\u4eea\u5f0f\uff0c\u5f53\u65e5\u4ea4\u4ed8\u5f69\u793c10\u4e07\u5143\u548c7.2\u514b\u6212\u6307\u3002\u540c\u65f6\uff0c\u5e2d\u67d0\u67d0\u53ca\u5176\u7236\u6bcd\u4e66\u9762\u627f\u8bfa\uff0c\u7ed3\u5a5a\u4e00\u5e74\u540e\u5728\u623f\u5c4b\u4ea7\u6743\u8bc1\u4e0a\u6dfb\u52a0\u88ab\u5bb3\u4eba\u7684\u540d\u5b57\u30025\u67082\u65e5\u4e2d\u5348\uff0c\u88ab\u5bb3\u4eba\u4e00\u65b9\u6309\u7167\u5f53\u5730\u4e60\u4fd7\u5bb4\u8bf7\u5e2d\u67d0\u67d0\u3002\u996d\u540e\uff0c\u5e2d\u67d0\u67d0\u548c\u88ab\u5bb3\u4eba\u4e00\u540c\u524d\u5f80\u5e2d\u67d0\u67d0\u4f4d\u4e8e\u9633\u9ad8\u53bf\u67d0\u5c0f\u533a\u67d0\u697c14\u5c42\u7684\u623f\u5185\uff0c\u5e2d\u67d0\u67d0\u5411\u88ab\u5bb3\u4eba\u63d0\u51fa\u53d1\u751f\u6027\u5173\u7cfb\uff0c\u906d\u5230\u88ab\u5bb3\u4eba\u62d2\u7edd\uff0c\u88ab\u5bb3\u4eba\u79f0\u7b49\u7ed3\u5a5a\u540e\u518d\u8bf4\u3002\u4e4b\u540e\uff0c\u5e2d\u67d0\u67d0\u4e0d\u987e\u88ab\u5bb3\u4eba\u53cd\u6297\uff0c\u5f3a\u884c\u4e0e\u88ab\u5bb3\u4eba\u53d1\u751f\u4e86\u6027\u5173\u7cfb\u3002\u4e8b\u540e\uff0c\u88ab\u5bb3\u4eba\u60c5\u7eea\u6fc0\u52a8\uff0c\u5b9e\u65bd\u4e86\u70b9\u706b\u70e7\u5367\u5ba4\u67dc\u5b50\u548c\u5ba2\u5385\u7a97\u5e18\u7b49\u884c\u4e3a\uff0c\u8fd8\u9003\u51fa\u623f\u95f4\u901a\u8fc7\u6b65\u68af\u4e0b\u81f313\u5c42\u547c\u558a\u201c\u6551\u547d\u201d\uff0c\u540e\u88ab\u5e2d\u67d0\u67d0\u5f3a\u884c\u62d6\u62fd\u56de\u623f\u5185\u3002\u8fd9\u671f\u95f4\uff0c\u88ab\u544a\u4eba\u62ff\u8d70\u4e86\u88ab\u5bb3\u4eba\u624b\u673a\uff0c\u76f4\u5230\u56de\u5bb6\u9014\u4e2d\uff0c\u88ab\u5bb3\u4eba\u6bcd\u4eb2\u6253\u6765\u7535\u8bdd\uff0c\u88ab\u544a\u4eba\u624d\u5c06\u624b\u673a\u5f52\u8fd8\u88ab\u5bb3\u4eba\u3002\u5f53\u665a\uff0c\u88ab\u5bb3\u4eba\u5411\u516c\u5b89\u673a\u5173\u62a5\u8b66\u3002\u7ecf\u4fa6\u67e5\u4eba\u5458\u5bf9\u88ab\u5bb3\u4eba\u8eab\u4f53\u68c0\u67e5\uff0c\u88ab\u5bb3\u4eba\u5de6\u53f3\u5927\u81c2\u3001\u53f3\u624b\u8155\u5747\u6709\u6de4\u9752\uff1b\u5bf9\u73b0\u573a\u8fdb\u884c\u52d8\u67e5\uff0c\u53d1\u73b0\u5367\u5ba4\u7684\u7a97\u5e18\u88ab\u62c9\u4e0b\u6389\u843d\uff0c\u5ba2\u5385\u7684\u7a97\u5e18\u6709\u88ab\u70e7\u8fc7\u7684\u75d5\u8ff9\u3002\u4fa6\u67e5\u4eba\u5458\u4e5f\u8c03\u53d6\u4e86\u5c0f\u533a\u76d1\u63a7\u5f55\u50cf\uff0c\u8be5\u5f55\u50cf\u663e\u793a\u88ab\u5bb3\u4eba\u5728\u9003\u51fa\u623f\u95f4\u901a\u8fc7\u6b65\u68af\u4e0b\u81f313\u5c42\u540e\u53c8\u88ab\u5e2d\u67d0\u67d0\u5f3a\u884c\u62d6\u62fd\u56de\u6848\u53d1\u73b0\u573a14\u5c42\u623f\u5185\u3002

    "},{"location":"NA/Chap6/1/#_2","title":"\u4e8c\u3001\u300a\u5211\u6cd5\u300b\u4e2d\u201c\u5f3a\u5978\u7f6a\u201d\u5728\u672c\u6848\u7684\u9002\u7528","text":"

    \u200b \u5f3a\u5978\u7f6a\u662f\u6307\u8fdd\u80cc\u5987\u5973\u7684\u610f\u5fd7\uff0c\u4ee5\u66b4\u529b\u3001\u80c1\u8feb\u6216\u8005\u5176\u4ed6\u624b\u6bb5\u5f3a\u884c\u4e0e\u5987\u5973\u53d1\u751f\u6027\u5173\u7cfb\u7684\u884c\u4e3a\u3002\u300a\u4e2d\u534e\u4eba\u6c11\u5171\u548c\u56fd\u5211\u6cd5\u300b\u7b2c\u4e8c\u767e\u4e09\u5341\u516d\u6761\u89c4\u5b9a\uff0c\u4ee5\u66b4\u529b\u3001\u80c1\u8feb\u6216\u8005\u5176\u4ed6\u624b\u6bb5\u5f3a\u5978\u5987\u5973\u7684\uff0c\u5904\u4e09\u5e74\u4ee5\u4e0a\u5341\u5e74\u4ee5\u4e0b\u6709\u671f\u5f92\u5211\uff1b\u540c\u65f6\u8fd8\u89c4\u5b9a\u82e5\u5e72\u4ece\u91cd\u5904\u7f5a\u7684\u60c5\u5f62\u3002

    \u200b \u5f3a\u5978\u7f6a\u4fb5\u72af\u7684\u5ba2\u4f53\u662f\u5987\u5973\u6027\u7684\u4e0d\u53ef\u4fb5\u72af\u7684\u6743\u5229(\u53c8\u79f0\u8d1e\u64cd\u6743)\uff0c\u5373\u5987\u5973\u6309\u7167\u81ea\u5df1\u7684\u610f\u5fd7\u51b3\u5b9a\u6b63\u5f53\u6027\u884c\u4e3a\u7684\u6743\u5229\uff0c\u5176\u72af\u7f6a\u5bf9\u8c61\u662f\u5973\u6027\u3002\u5ba2\u89c2\u8981\u4ef6\u4e0a\uff0c\u5f3a\u5978\u7f6a\u5ba2\u89c2\u4e0a\u987b\u8fdd\u80cc\u5987\u5973\u610f\u5fd7\uff0c\u5e76\u4e14\u5fc5\u987b\u5177\u6709\u4f7f\u7528\u66b4\u529b\u3001\u80c1\u8feb\u6216\u8005\u5176\u4ed6\u624b\u6bb5\uff0c\u4f7f\u5987\u5973\u5904\u4e8e\u4e0d\u80fd\u53cd\u6297\u3001\u4e0d\u6562\u53cd\u6297\u3001\u4e0d\u77e5\u53cd\u6297\u72b6\u6001\u6216\u5229\u7528\u5987\u5973\u5904\u4e8e\u4e0d\u77e5\u3001\u65e0\u6cd5\u53cd\u6297\u7684\u72b6\u6001\u800c\u4e58\u673a\u5b9e\u884c\u5978\u6deb\u7684\u884c\u4e3a\u3002\u4e3b\u4f53\u8981\u4ef6\u4e0a\uff0c\u5f3a\u5978\u7f6a\u7684\u4e3b\u4f53\u662f\u7279\u6b8a\u4e3b\u4f53\uff0c\u5373\u5e74\u6ee1\u5341\u56db\u5468\u5c81\u5177\u6709\u5211\u4e8b\u8d23\u4efb\u80fd\u529b\u7684\u7537\u5b50\u3002\u4e3b\u89c2\u8981\u4ef6\u4e0a\uff0c\u672c\u7f6a\u5728\u4e3b\u89c2\u65b9\u9762\u8868\u73b0\u4e3a\u6545\u610f\uff0c\u5e76\u4e14\u5177\u6709\u5978\u6deb\u7684\u76ee\u7684\u3002\u662f\u6307\u72af\u7f6a\u5206\u5b50\u610f\u56fe\u4e0e\u88ab\u5bb3\u5987\u5973\u53d1\u751f\u6027\u4ea4\u7684\u884c\u4e3a\u3002

    \u200b \u672c\u6848\u4e2d\uff0c\u5ba2\u89c2\u65b9\u9762\u4e0a\uff0c\u88ab\u5bb3\u4eba\u5728\u72af\u7f6a\u884c\u4e3a\u524d\u66fe\u660e\u786e\u5411\u5e2d\u67d0\u67d0\u8868\u793a\u8fc7\u81ea\u5df1\u53cd\u5bf9\u5a5a\u524d\u6027\u884c\u4e3a\uff0c\u5728\u5e2d\u67d0\u67d0\u5411\u88ab\u5bb3\u4eba\u63d0\u51fa\u53d1\u751f\u6027\u5173\u7cfb\u65f6\uff0c\u88ab\u5bb3\u4eba\u8868\u793a\u4e86\u62d2\u7edd\uff0c\u79f0\u7b49\u7ed3\u5a5a\u540e\u518d\u8bf4\u3002\u72af\u7f6a\u8fc7\u7a0b\u4e2d\uff0c\u88ab\u5bb3\u4eba\u8fdb\u884c\u4e86\u53cd\u6297\u3002\u8fd9\u4e00\u7cfb\u5217\u7684\u884c\u4e3a\u90fd\u8868\u660e\u5e2d\u67d0\u67d0\u7684\u884c\u4e3a\u8fdd\u80cc\u4e86\u88ab\u5bb3\u4eba\u5bf9\u6027\u7684\u81ea\u7531\u652f\u914d\u6743\uff0c\u88ab\u5bb3\u4eba\u5de6\u53f3\u5927\u81c2\u3001\u53f3\u624b\u8155\u6de4\u9752\u7684\u60c5\u51b5\u4e5f\u8bf4\u660e\u4e86\u5e2d\u67d0\u67d0\u4e0d\u987e\u88ab\u5bb3\u4eba\u53cd\u6297\uff0c\u4f7f\u7528\u4e86\u66b4\u529b\u624b\u6bb5\u3002\u4e3b\u89c2\u65b9\u9762\u4e0a\uff0c\u88ab\u5bb3\u4eba\u60c5\u7eea\u6fc0\u52a8\uff0c\u5b9e\u65bd\u4e86\u70b9\u706b\u70e7\u5367\u5ba4\u67dc\u5b50\u548c\u5ba2\u5385\u7a97\u5e18\u7b49\u884c\u4e3a\uff0c\u8fd8\u9003\u51fa\u623f\u95f4\u901a\u8fc7\u6b65\u68af\u4e0b\u81f313\u5c42\u547c\u558a\u201c\u6551\u547d\u201d\uff0c\u4e14\u88ab\u5bb3\u4eba\u5728\u9003\u51fa\u623f\u95f4\u901a\u8fc7\u6b65\u68af\u4e0b\u81f313\u5c42\u540e\u53c8\u88ab\u5e2d\u67d0\u67d0\u5f3a\u884c\u62d6\u62fd\u56de\u6848\u53d1\u73b0\u573a14\u5c42\u623f\u5185\u90fd\u8bf4\u660e\u5e2d\u67d0\u67d0\u4e3b\u89c2\u610f\u56fe\u4e0a\u5b9e\u65bd\u5978\u6deb\u7684\u6545\u610f\u548c\u88ab\u5bb3\u4eba\u660e\u786e\u8868\u793a\u7684\u62d2\u7edd\u4e0e\u53cd\u5bf9\u3002

    "},{"location":"NA/Chap6/1/#_3","title":"\u4e09\u3001\u9700\u7279\u522b\u5173\u6ce8\u7684\u60c5\u5f62","text":"

    \u200b \u5728\u6b64\u6848\u4e2d\uff0c\u5b58\u5728\u4e24\u4e2a\u7279\u6b8a\u60c5\u51b5\u9700\u8981\u8fdb\u884c\u5206\u6790\u3002\u9996\u5148\uff0c\u72af\u7f6a\u4eba\u4e0e\u88ab\u5bb3\u4eba\u53cc\u65b9\u5904\u4e8e\u8ba2\u5a5a\u5173\u7cfb\u3002\u5176\u6b21\uff0c\u4e8b\u540e\u53cc\u65b9\u8fdb\u884c\u4e86\u534f\u5546\u3002\u5bf9\u4e8e\u8ba2\u5a5a\u540e\u5f3a\u884c\u53d1\u751f\u6027\u884c\u4e3a\u662f\u5426\u6784\u6210\u5f3a\u5978\u7f6a\u7684\u95ee\u9898\uff0c\u7b54\u6848\u80af\u5b9a\u662f\u80af\u5b9a\u7684\u3002\u5c3d\u7ba1\u8ba2\u5a5a\u662f\u4e00\u79cd\u4f20\u7edf\u4e60\u4fd7\uff0c\u4f46\u5728\u6cd5\u5f8b\u4e0a\uff0c\u8ba2\u5a5a\u5e76\u4e0d\u7b49\u540c\u4e8e\u5df2\u7ecf\u7ed3\u5a5a\u3002\u5373\u4fbf\u5728\u4e00\u4e9b\u5730\u533a\u5f3a\u8c03\u8ba2\u5a5a\u4eea\u5f0f\u7684\u91cd\u8981\u6027\uff0c\u8ba4\u4e3a\u8ba2\u5a5a\u7b49\u540c\u4e8e\u7ed3\u5a5a\uff0c\u6839\u636e\u73b0\u884c\u6cd5\u5f8b\u89c4\u5b9a\uff0c\u5408\u6cd5\u5a5a\u59fb\u5e94\u4ee5\u5a5a\u59fb\u767b\u8bb0\u673a\u5173\u6838\u53d1\u7684\u7ed3\u5a5a\u767b\u8bb0\u8bc1\u4e3a\u51c6\u3002\u8ba2\u5a5a\u5e76\u4e0d\u8d4b\u4e88\u53cc\u65b9\u592b\u59bb\u4e4b\u95f4\u7684\u6743\u5229\u548c\u4e49\u52a1\u3002\u9000\u4e00\u6b65\u8bb2\uff0c\u5373\u4f7f\u662f\u5408\u6cd5\u5a5a\u59fb\u671f\u95f4\uff0c\u5982\u679c\u8fdd\u80cc\u5987\u5973\u610f\u5fd7\u5f3a\u884c\u53d1\u751f\u6027\u884c\u4e3a\uff0c\u4ecd\u7136\u6784\u6210\u5f3a\u5978\u7f6a\u3002

    \u200b \u5176\u6b21\uff0c\u4e8b\u540e\u8fbe\u6210\u534f\u8bae\u4e0d\u5f71\u54cd\u5bf9\u6b64\u884c\u4e3a\u7684\u8ba4\u5b9a\u3002\u6839\u636e\u201c\u884c\u4e3a\u4e0e\u6545\u610f\u540c\u65f6\u5b58\u5728\u539f\u5219\u201d\uff0c\u5bf9\u4e8e\u72af\u7f6a\u7684\u8ba4\u5b9a\u662f\u4ee5\u884c\u4e3a\u4eba\u5728\u72af\u7f6a\u65f6\u7684\u4e3b\u89c2\u5fc3\u6001\u4e3a\u51c6\u3002\u5728\u672c\u6848\u4e2d\uff0c\u4e8b\u53d1\u65f6\u88ab\u5bb3\u4eba\u660e\u786e\u8868\u8fbe\u4e86\u4e0d\u613f\u53d1\u751f\u6027\u884c\u4e3a\u7684\u610f\u613f\uff0c\u5e2d\u67d0\u67d0\u7684\u884c\u4e3a\u8fdd\u80cc\u4e86\u88ab\u5bb3\u4eba\u7684\u610f\u5fd7\uff0c\u4ee5\u66b4\u529b\u624b\u6bb5\u5f3a\u884c\u4e0e\u88ab\u5bb3\u4eba\u53d1\u751f\u6027\u884c\u4e3a\uff0c\u7b26\u5408\u5f3a\u5978\u7f6a\u7684\u6784\u6210\u8981\u4ef6\u3002\u4e8b\u540e\u7684\u534f\u8bae\u4e0d\u6539\u53d8\u5f53\u65f6\u7684\u72af\u7f6a\u6027\u8d28\uff0c\u800c\u662f\u5c5e\u4e8e\u4e8b\u540e\u7684\u5904\u7406\uff0c\u4e0d\u80fd\u5426\u5b9a\u5e2d\u67d0\u67d0\u6784\u6210\u5f3a\u5978\u7f6a\u7684\u4e8b\u5b9e\u3002

    \u200b \u5728\u91cf\u5211\u65b9\u9762\uff0c\u6cd5\u9662\u5145\u5206\u8003\u8651\u5230\u53cc\u65b9\u786e\u7cfb\u604b\u7231\u5173\u7cfb\uff0c\u5e76\u5728\u88ab\u5bb3\u4eba\u62a5\u8b66\u540e\uff0c\u5e2d\u67d0\u67d0\u81ea\u613f\u524d\u5f80\u516c\u5b89\u673a\u5173\u63a5\u53d7\u8c03\u67e5\u3002\u57fa\u4e8e\u7f6a\u8d23\u5211\u76f8\u9002\u5e94\u7684\u539f\u5219\uff0c\u5bf9\u5e2d\u67d0\u67d0\u4e88\u4ee5\u4ece\u8f7b\u5904\u7f5a\u3002\u56e0\u6b64\uff0c\u6cd5\u9662\u5224\u5904\u5e2d\u67d0\u67d0\u6709\u671f\u5f92\u5211\u4e09\u5e74\uff0c\u4f53\u73b0\u4e86\u5bf9\u6848\u4ef6\u7684\u516c\u6b63\u548c\u5408\u7406\u5224\u51b3\u3002

    "},{"location":"NA/Chap6/1/#_4","title":"\u56db\u3001\u5b9e\u65bd\u8005\u4e3b\u89c2\u8ba4\u8bc6\u4e0e\u88ab\u5bb3\u8005\u7684\u771f\u5b9e\u610f\u56fe\u7684\u8003\u91cf","text":"

    \u200b \u672c\u6848\u6700\u503c\u5f97\u8ba8\u8bba\u7684\u5728\u4e8e\u72af\u7f6a\u4eba\u5e2d\u67d0\u67d0\u7684\u4e3b\u89c2\u8ba4\u8bc6\u548c\u88ab\u5bb3\u4eba\u201c\u8fdd\u80cc\u5987\u5973\u610f\u5fd7\u201d\u7684\u4f53\u73b0\u3002

    \u200b \u88ab\u5bb3\u4eba\u7684\u4e3b\u89c2\u65b9\u9762\u4e0a\uff0c\u56fd\u5185\u6709\u90e8\u5206\u5b66\u8005\u8ba4\u4e3a\u201c\u7f3a\u4e4f\u88ab\u5bb3\u4eba\u540c\u610f\u201d\u548c\u201c\u8fdd\u80cc\u5987\u5973\u610f\u5fd7\u201d\u4e24\u4e2a\u6982\u5ff5\u65e0\u5b9e\u8d28\u5dee\u522b,\u56e0\u6b64\u7ecf\u5e38\u4e92\u6362\u4f7f\u7528,\u4f46\u8fd9\u5b9e\u9645\u4e0a\u662f\u5bf9\u4e8c\u8005\u5173\u7cfb\u7684\u8bef\u8bfb\u3002\u4e0e\u201c\u8fdd\u80cc\u5987\u5973\u610f\u5fd7\u201d\u76f8\u6bd4,\u5c06\u201c\u7f3a\u4e4f\u88ab\u5bb3\u4eba\u540c\u610f\u201d\u4f5c\u4e3a\u5f3a\u5978\u7f6a\u7684\u6838\u5fc3\u7279\u5f81\u5177\u6709\u660e\u663e\u7684\u4f18\u52bf\u3002

    \u200b \u9996\u5148\uff0c\u5728\u6cd5\u5f8b\u4e0a\uff0c\"\u7f3a\u4e4f\u88ab\u5bb3\u4eba\u540c\u610f\"\u4f5c\u4e3a\u4e00\u79cd\u5ba2\u89c2\u72b6\u6001\u62e5\u6709\u660e\u786e\u7684\u5f62\u6001\u4f18\u52bf\u3002\u8fd9\u4e00\u72b6\u6001\u5177\u6709\u6e05\u6670\u7684\u5916\u5728\u8868\u73b0\uff0c\u5373\u672a\u7ecf\u88ab\u5bb3\u4eba\u540c\u610f\u7684\u6027\u884c\u4e3a\u3002\u76f8\u5bf9\u800c\u8a00\uff0c\u201c\u8fdd\u80cc\u5987\u5973\u610f\u5fd7\u201d\u5219\u5c5e\u4e8e\u4e3b\u89c2\u5fc3\u7406\uff0c\u9700\u8981\u7ecf\u8fc7\u6df1\u5165\u7684\u4e3b\u89c2\u8003\u5bdf\u624d\u80fd\u786e\u5b9a\u3002\u56e0\u6b64\uff0c\u4e00\u4e2a\u5728\u5ba2\u89c2\u4e0a\u672a\u7ecf\u88ab\u5bb3\u4eba\u540c\u610f\u7684\u6027\u884c\u4e3a\u4e0d\u80fd\u76f4\u63a5\u88ab\u8ba4\u5b9a\u4e3a\u8fdd\u80cc\u88ab\u5bb3\u4eba\u610f\u5fd7\u7684\u884c\u4e3a\u3002\u5373\u4f7f\u88ab\u5bb3\u4eba\u901a\u8fc7\u8a00\u8bed\u62d2\u7edd\u548c\u8f7b\u5fae\u62b5\u6297\uff0c\u4e5f\u4e0d\u8db3\u4ee5\u8bc1\u660e\u8fdd\u80cc\u4e86\u88ab\u5bb3\u4eba\u7684\u771f\u5b9e\u610f\u613f\u3002\u8fd9\u7a81\u663e\u4e86\"\u7f3a\u4e4f\u540c\u610f\"\u8fd9\u4e00\u5ba2\u89c2\u72b6\u6001\u5728\u6cd5\u5f8b\u4e0a\u7684\u5f62\u6001\u660e\u6670\u548c\u5177\u4f53\u53ef\u8fa8\u6027\u3002

    \u200b \u5176\u6b21\uff0c\u6cd5\u76ca\u7ed3\u5408\u6027\u7684\u4f18\u52bf\u3002\"\u7f3a\u4e4f\u88ab\u5bb3\u4eba\u540c\u610f\"\u4e0e\u8bbe\u7acb\u5f3a\u5978\u7f6a\u7684\u6cd5\u76ca\u7d27\u5bc6\u76f8\u8fde\u3002\u540c\u610f\u662f\u4e00\u79cd\u5bf9\u6027\u81ea\u4e3b\u6743\u7684\u6388\u6743\u884c\u4e3a\uff0c\u76f4\u63a5\u4e0e\u8bbe\u7acb\u5f3a\u5978\u7f6a\u7684\u6cd5\u76ca\u76f8\u8054\u7cfb\uff1b\u800c\u201c\u8fdd\u80cc\u5987\u5973\u610f\u5fd7\u201d\u5219\u65e0\u6cd5\u76f4\u63a5\u4e0e\u4fdd\u62a4\u6cd5\u76ca\u76f4\u63a5\u8054\u7cfb\u3002\u56e0\u4e3a\u610f\u5fd7\u662f\u4e00\u79cd\u601d\u60f3\u72b6\u6001\uff0c\u800c\u601d\u60f3\u72b6\u6001\u5fc5\u987b\u901a\u8fc7\u5916\u5728\u8868\u73b0\u624d\u80fd\u8f6c\u5316\u4e3a\u5bf9\u6743\u5229\u7684\u5904\u7f6e\u3002

    \u200b \u7b2c\u4e09\uff0c\u6784\u6210\u8981\u4ef6\u5730\u4f4d\u7684\u4f18\u52bf\u3002\u5728\u6211\u56fd\uff0c\u5927\u591a\u6570\u5b66\u8005\u5c06\u5f3a\u5978\u7f6a\u4e2d\u88ab\u5bb3\u4eba\u7684\u540c\u610f\u89c6\u4e3a\u4e00\u79cd\u8fdd\u6cd5\u963b\u5374\u4e8b\u7531\u6216\u6b63\u5f53\u5316\u4e8b\u7531\u3002\u8fd9\u4f53\u73b0\u4e86\u5728\u6cd5\u5b66\u754c\u5bf9\u4e8e\u6784\u6210\u8981\u4ef6\u5730\u4f4d\u7684\u8ba4\u540c\u548c\u5f3a\u8c03\uff0c\u8fdb\u4e00\u6b65\u5f3a\u8c03\u4e86\u540c\u610f\u4e0e\u5f3a\u5978\u7f6a\u6784\u6210\u4e4b\u95f4\u7684\u7d27\u5bc6\u5173\u7cfb\u3002

    \u200b \u672c\u6848\u4e2d\uff0c\u5982\u679c\u88ab\u5bb3\u4eba\u867d\u7136\u5185\u5fc3\u5e76\u4e0d\u540c\u610f\u8fdb\u884c\u6027\u884c\u4e3a\uff0c\u4f46\u53d7\u5230\u5bf9\u604b\u7231\u5173\u7cfb\u3001\u8ba2\u5a5a\u5173\u7cfb\u7b49\u793e\u4f1a\u5916\u5728\u89c4\u8bad\u56e0\u7d20\u7684\u5f71\u54cd\uff0c\u56e0\u800c\u88ab\u8feb\u4e0e\u5e2d\u67d0\u67d0\u8fdb\u884c\u4e86\u6027\u884c\u4e3a\uff0c\u90a3\u4e48\u5176\u5b9e\u5728\u8fd9\u79cd\u60c5\u5f62\u4e0b\u867d\u8868\u73b0\u4e3a\u5e76\u672a\u8fdd\u53cd\u5987\u5973\u610f\u5fd7\uff0c\u4f46\u5176\u5185\u5fc3\u5b58\u5728\u5fc3\u7406\u5f3a\u5236\u54e6\uff0c\u4ecd\u9700\u8981\u88ab\u5f3a\u5978\u7f6a\u6240\u89c4\u5236\u3002\u4f46\u4e8b\u5b9e\u4e0a\uff0c\u88ab\u5bb3\u4eba\u4ee5\u660e\u786e\u8868\u793a\u4e86\u4e0d\u540c\u610f\uff0c\u901a\u8fc7\u8a00\u8bed\u7684\u62d2\u7edd\u3001\u884c\u4e3a\u7684\u53cd\u6297\u3001\u4e8b\u540e\u7684\u62a5\u8b66\u7b49\uff0c\u8fbe\u5230\u4e86\u6bd4\u201c\u5426\u5b9a\u6027\u540c\u610f\u201d\u8981\u6c42\u66f4\u9ad8\u7684\u201c\u80af\u5b9a\u6027\u540c\u610f\u201d\u6a21\u5f0f\u7684\u8981\u6c42\uff0c\u8db3\u4ee5\u8bf4\u660e\u72af\u7f6a\u4eba\u884c\u4e3a\u8fdd\u80cc\u4e86\u5987\u5973\u610f\u5fd7\uff0c\u4fb5\u5bb3\u4e86\u88ab\u5bb3\u4eba\u5bf9\u6027\u7684\u81ea\u4e3b\u6743\u3002

    \u200b \u5176\u6b21\uff0c\u5728\u72af\u7f6a\u4eba\u5e2d\u67d0\u67d0\u7684\u72af\u7f6a\u4e3b\u89c2\u8ba4\u8bc6\u4e0a\uff0c\u5176\u662f\u5426\u5b58\u5728\u5bf9\u6027\u884c\u4e3a\u4e0e\u5973\u65b9\u88ab\u5bb3\u4eba\u7684\u5dee\u5f02\u6027\u8ba4\u8bc6\u4e5f\u662f\u9700\u8981\u6ce8\u610f\u7684\u3002

    \u200b \u6211\u56fd\u5c06\u5f3a\u5978\u7f6a\u7684\u5b9e\u884c\u72af\u9650\u5b9a\u4e3a\u7537\u6027,\u800c\u57fa\u4e8e\u6027\u522b\u7684\u4e0d\u540c,\u7537\u6027\u4e0e\u5973\u6027\u5bf9\u5f85\u6027\u7684\u8868\u8fbe\u5f80\u5f80\u5b58\u5728\u5dee\u5f02\u3002\u56e0\u6b64,\u6027\u884c\u4e3a\u53d1\u751f\u65f6\u8bef\u4f1a\u5bf9\u65b9\u7684\u771f\u5b9e\u610f\u56fe\u5e76\u4e0d\u7f55\u89c1\u3002\u8fd9\u79cd\u8bef\u4f1a\u7684\u5ba2\u89c2\u5b58\u5728,\u4e5f\u4f7f\u5f3a\u5978\u7f6a\u4e2d\u7684\u8ba4\u8bc6\u9519\u8bef\u95ee\u9898\u6210\u4e3a\u6211\u56fd\u53f8\u6cd5\u5b9e\u8df5\u4e2d\u7684\u7591\u96be\u95ee\u9898\u4e4b\u4e00\u3002

    \u200b \u5728\u4ee5\u201c\u8fdd\u80cc\u5987\u5973\u610f\u5fd7\u201d\u4e3a\u5f3a\u5978\u7f6a\u6838\u5fc3\u7279\u5f81\u7684\u89c2\u70b9\u4e0b\uff0c\u89e3\u51b3\u8fd9\u4e00\u96be\u9898\u6709\u4e24\u79cd\u4e3b\u8981\u65b9\u5f0f\uff1a\u5176\u4e00\uff0c\u662f\u4e0d\u627f\u8ba4\u5f3a\u5978\u7f6a\u4e2d\u5b58\u5728\u884c\u4e3a\u4eba\u8ba4\u8bc6\u9519\u8bef\u7684\u95ee\u9898\u3002\u6309\u7167\u8fd9\u79cd\u65b9\u5f0f\uff0c\u88ab\u544a\u4eba\u8fa9\u89e3\u7684\u8ba4\u8bc6\u9519\u8bef\u88ab\u8ba4\u4e3a\u4e0d\u9700\u8981\u5426\u5b9a\u3002\u7136\u800c\uff0c\u8fd9\u79cd\u65b9\u5f0f\u65e0\u6cd5\u89e3\u91ca\u72af\u7f6a\u5206\u5b50\u4e3b\u89c2\u7f6a\u8fc7\u7684\u57fa\u7840\u662f\u4ec0\u4e48\uff0c\u5b58\u5728\u5ba2\u89c2\u5f52\u7f6a\u4e4b\u5acc\u3002\u5728\u4e00\u4e9b\u6848\u4f8b\u4e2d\uff0c\u751a\u81f3\u5b58\u5728\u88ab\u544a\u4eba\u4e0e\u88ab\u5bb3\u4eba\u8fbe\u6210\u6027\u4ea4\u6613\u7684\u5408\u610f\uff0c\u5230\u8fbe\u5bbe\u9986\u540e\uff0c\u88ab\u544a\u4eba\u540c\u9189\u9152\u4f46\u672a\u5931\u53bb\u610f\u8bc6\u7684\u88ab\u5bb3\u4eba\u53d1\u751f\u4e86\u6027\u884c\u4e3a\uff0c\u5374\u88ab\u8ba4\u5b9a\u4e3a\u6210\u7acb\u5f3a\u5978\u7f6a\u7684\u60c5\u51b5\u3002\u5176\u4e8c\uff0c\u662f\u627f\u8ba4\u5f3a\u5978\u7f6a\u4e2d\u5b58\u5728\u884c\u4e3a\u4eba\u8ba4\u8bc6\u9519\u8bef\u7684\u95ee\u9898\u3002\u6839\u636e\u6211\u56fd\u5211\u6cd5\u5b66\u7406\u8bba\u901a\u8bf4\uff0c\u6b64\u65f6\u9700\u8981\u8003\u5bdf\u8ba4\u8bc6\u9519\u8bef\u7684\u6027\u8d28\u3002\u5728\u4ee5\u201c\u8fdd\u80cc\u5987\u5973\u610f\u5fd7\u201d\u4e3a\u6838\u5fc3\u7279\u5f81\u7684\u89c6\u89d2\u4e0b\uff0c\u884c\u4e3a\u4eba\u5bf9\u4e8e\u8fdd\u80cc\u5987\u5973\u610f\u5fd7\u7684\u8ba4\u8bc6\u9519\u8bef\u5c5e\u4e8e\u4e8b\u5b9e\u8ba4\u8bc6\u9519\u8bef\u3002\u9274\u4e8e\u5f3a\u5978\u7f6a\u65e0\u8fc7\u5931\u5f62\u6001\uff0c\u5bf9\u4e8e\u8fd9\u79cd\u8ba4\u8bc6\u9519\u8bef\u53ea\u80fd\u505a\u51fa\u65e0\u7f6a\u5904\u7406\u3002\u7136\u800c\uff0c\u8fd9\u5bf9\u4e8e\u88ab\u5bb3\u4eba\u800c\u8a00\u663e\u7136\u6709\u5931\u516c\u5e73\uff0c\u5e76\u4e14\u5bb9\u6613\u653e\u7eb5\u72af\u7f6a\u5206\u5b50\u3002\u8fd9\u4e00\u65b9\u5f0f\u5e26\u6765\u7684\u95ee\u9898\u662f\u5982\u4f55\u5728\u6cd5\u5f8b\u4f53\u7cfb\u4e2d\u5e73\u8861\u8ba4\u8bc6\u9519\u8bef\u7684\u4e8b\u5b9e\u548c\u5bf9\u88ab\u5bb3\u4eba\u6743\u76ca\u7684\u4fdd\u62a4\uff0c\u9700\u8981\u66f4\u4e3a\u6df1\u5165\u7684\u601d\u8003\u548c\u7ec6\u81f4\u7684\u6743\u8861\u3002

    \u200b \u5728\u672c\u6848\u4e2d\uff0c\u72af\u7f6a\u4eba\u4e0e\u88ab\u5bb3\u4eba\u4e4b\u95f4\u7684\u604b\u7231\u5173\u7cfb\u3001\u8ba2\u5a5a\u5173\u7cfb\u53ef\u80fd\u5bfc\u81f4\u72af\u7f6a\u4eba\u5bf9\u4e8e\u6027\u884c\u4e3a\u7684\u6027\u8d28\u4ea7\u751f\u4e86\u9519\u8bef\u8ba4\u8bc6\uff0c\u4f7f\u5176\u8bef\u4ee5\u4e3a\u4e0e\u88ab\u5bb3\u4eba\u7684\u6027\u884c\u4e3a\u5e76\u4e0d\u6784\u6210\u5f3a\u5978\u3002\u8fd9\u79cd\u8ba4\u8bc6\u9519\u8bef\u6d89\u53ca\u5230\u5bf9\u6027\u884c\u4e3a\u7684\u4e0d\u6b63\u786e\u7406\u89e3\uff0c\u53ef\u80fd\u5c06\u88ab\u5bb3\u4eba\u7684\u53cd\u6297\u89e3\u91ca\u4e3a\u5bf9\u6027\u884c\u4e3a\u7684\u8bef\u89e3\u3002\u7136\u800c\uff0c\u8fd9\u79cd\u9519\u8bef\u8ba4\u8bc6\u65e2\u662f\u5bf9\u5973\u6027\u7684\u6b67\u89c6\uff0c\u4e5f\u662f\u5bf9\u5f3a\u5978\u7f6a\u88ab\u5bb3\u4eba\u7684\u4e8c\u6b21\u4f24\u5bb3\u3002\u7136\u800c\uff0c\u82e5\u4ece\u201c\u7f3a\u4e4f\u88ab\u5bb3\u4eba\u540c\u610f\u201d\u7684\u6838\u5fc3\u7279\u5f81\u51fa\u53d1\u8fdb\u884c\u5ba1\u89c6\uff0c\u4f1a\u53d1\u73b0\u4e0a\u8ff0\u8ba4\u8bc6\u9519\u8bef\u5728\u6cd5\u5f8b\u4e0a\u5c06\u5f97\u5230\u5408\u7406\u89e3\u51b3\u3002\u88ab\u5bb3\u4eba\u7684\u540c\u610f\u662f\u4e00\u79cd\u6cd5\u5b9a\u7684\u6388\u6743\u884c\u4e3a\uff0c\u5177\u6709\u9c9c\u660e\u7684\u89c4\u8303\u5316\u5c5e\u6027\u3002\u6b63\u5982\u884c\u4e3a\u4eba\u4e0d\u80fd\u5728\u62ff\u8d70\u719f\u7761\u88ab\u5bb3\u4eba\u7684\u8d22\u7269\u540e\u5ba3\u79f0\u81ea\u5df1\u672a\u7ecf\u540c\u610f\u62ff\u8d70\u88ab\u5bb3\u4eba\u7684\u8d22\u7269\u662f\u4e8b\u5b9e\u8ba4\u8bc6\u9519\u8bef\u4e00\u6837\uff0c\u5bf9\u4e8e\u6027\u81ea\u4e3b\u6743\u7684\u9519\u8bef\u8ba4\u8bc6\u4e5f\u5e94\u88ab\u89c6\u4e3a\u6cd5\u5f8b\u8ba4\u8bc6\u9519\u8bef\uff0c\u4e0d\u80fd\u6210\u4e3a\u5408\u7406\u7684\u8fa9\u62a4\u7406\u7531\u3002\u65e0\u8bba\u72af\u7f6a\u4eba\u5e2d\u67d0\u67d0\u7684\u9519\u8bef\u8ba4\u8bc6\u6765\u6e90\u4e8e\u4f55\u79cd\u539f\u56e0\uff0c\u5728\u7f3a\u4e4f\u88ab\u5bb3\u4eba\u540c\u610f\u7684\u60c5\u51b5\u4e0b\u5f3a\u884c\u53d1\u751f\u6027\u5173\u7cfb\uff0c\u90fd\u5e94\u5f53\u53d7\u5230\u5f3a\u5978\u7f6a\u7684\u6cd5\u5f8b\u89c4\u5236\u3002\u5728\u6cd5\u5f8b\u7684\u6846\u67b6\u4e0b\uff0c\u5f3a\u5978\u7f6a\u5bf9\u4e8e\u7f3a\u4e4f\u540c\u610f\u7684\u6027\u884c\u4e3a\u5177\u6709\u660e\u786e\u7684\u89c4\u5236\u548c\u5236\u7ea6\uff0c\u4ee5\u4fdd\u62a4\u88ab\u5bb3\u4eba\u7684\u6027\u81ea\u4e3b\u6743\u3002

    "},{"location":"NA/Chap6/1/#_5","title":"\u4e94\u3001\u601d\u8003\u89d2\u5ea6\u5ef6\u4f38","text":""},{"location":"NA/Chap6/1/#_6","title":"\u793e\u4f1a\u6587\u5316\u548c\u6cd5\u5f8b\u4e4b\u95f4\u7684\u51b2\u7a81","text":"

    \u200b \u5728\u6848\u4ef6\u4e2d\u63d0\u5230\u4e86\u8ba2\u5a5a\u5173\u7cfb\uff0c\u8fd9\u7275\u6d89\u5230\u793e\u4f1a\u6587\u5316\u548c\u6cd5\u5f8b\u4e4b\u95f4\u7684\u51b2\u7a81\u3002\u5728\u67d0\u4e9b\u5730\u533a\uff0c\u8ba2\u5a5a\u53ef\u80fd\u88ab\u89c6\u4e3a\u4e00\u79cd\u6cd5\u5f8b\u4e0a\u7684\u627f\u8bfa\uff0c\u4f46\u6839\u636e\u73b0\u884c\u6cd5\u5f8b\u89c4\u5b9a\uff0c\u5408\u6cd5\u7684\u5a5a\u59fb\u5e94\u5f53\u4ee5\u7ed3\u5a5a\u767b\u8bb0\u4e3a\u51c6\u3002\u8fd9\u79cd\u6587\u5316\u548c\u6cd5\u5f8b\u7684\u5dee\u5f02\u53ef\u80fd\u5bfc\u81f4\u72af\u7f6a\u4eba\u5bf9\u884c\u4e3a\u7684\u9519\u8bef\u8ba4\u8bc6\u3002\u53ef\u4ee5\u8fdb\u4e00\u6b65\u5206\u6790\u793e\u4f1a\u6587\u5316\u5bf9\u6cd5\u5f8b\u8ba4\u77e5\u7684\u5f71\u54cd\uff0c\u4ee5\u53ca\u5982\u4f55\u5728\u6cd5\u5f8b\u5236\u5ea6\u4e2d\u89e3\u51b3\u8fd9\u79cd\u51b2\u7a81\u3002

    "},{"location":"NA/Chap6/1/#_7","title":"\u4e3b\u89c2\u8ba4\u8bc6\u4e0e\u6cd5\u5f8b\u6559\u80b2\u7684\u5173\u7cfb","text":"

    \u200b \u6848\u4ef6\u4e2d\u63d0\u5230\u72af\u7f6a\u4eba\u53ef\u80fd\u56e0\u4e3a\u604b\u7231\u5173\u7cfb\u548c\u8ba2\u5a5a\u5173\u7cfb\u800c\u4ea7\u751f\u9519\u8bef\u8ba4\u8bc6\u3002\u8fd9\u6d89\u53ca\u5230\u5bf9\u6027\u884c\u4e3a\u3001\u540c\u610f\u548c\u5f3a\u5978\u7f6a\u7684\u6cd5\u5f8b\u6559\u80b2\u3002\u53ef\u4ee5\u8003\u8651\u5206\u6790\u793e\u4f1a\u5bf9\u6027\u6559\u80b2\u7684\u666e\u53ca\u7a0b\u5ea6\uff0c\u4ee5\u53ca\u6cd5\u5f8b\u5bf9\u516c\u6c11\u7684\u6cd5\u5f8b\u6559\u80b2\u63aa\u65bd\u3002\u63d0\u9ad8\u516c\u4f17\u5bf9\u6027\u884c\u4e3a\u6cd5\u5f8b\u89c4\u5b9a\u7684\u8ba4\u77e5\u5ea6\uff0c\u6709\u52a9\u4e8e\u51cf\u5c11\u56e0\u4e3a\u8bef\u89e3\u800c\u5bfc\u81f4\u7684\u72af\u7f6a\u884c\u4e3a\u3002

    "},{"location":"NA/Chap6/1/#_8","title":"\u6cd5\u5f8b\u5bf9\u5f3a\u5978\u7f6a\u8ba4\u5b9a\u6807\u51c6\u7684\u8ba8\u8bba","text":"

    \u200b \u5728\u672c\u6848\u4e2d\uff0c\u5f3a\u5978\u7f6a\u7684\u8ba4\u5b9a\u56f4\u7ed5\u7740\u662f\u5426\u201c\u8fdd\u80cc\u5987\u5973\u610f\u5fd7\u201d\u5c55\u5f00\u3002\u53ef\u4ee5\u5bf9\u6cd5\u5f8b\u5bf9\u4e8e\u5f3a\u5978\u7f6a\u8ba4\u5b9a\u6807\u51c6\u7684\u5408\u7406\u6027\u8fdb\u884c\u8ba8\u8bba\u3002\u662f\u5426\u5e94\u8be5\u8fdb\u4e00\u6b65\u660e\u786e\u6cd5\u5f8b\u4e2d\u540c\u610f\u548c\u8fdd\u80cc\u610f\u613f\u7684\u6807\u51c6\uff0c\u4ee5\u53ca\u5982\u4f55\u786e\u4fdd\u6cd5\u5f8b\u5bf9\u4e8e\u88ab\u5bb3\u4eba\u6743\u76ca\u7684\u6700\u5927\u4fdd\u62a4\u3002

    "},{"location":"NA/Chap6/1/#_9","title":"\u5bf9\u88ab\u5bb3\u4eba\u7684\u652f\u6301\u548c\u4fdd\u62a4\u673a\u5236","text":"

    \u200b \u5728\u6848\u4ef6\u4e2d\uff0c\u88ab\u5bb3\u4eba\u7ecf\u5386\u4e86\u8eab\u4f53\u4e0a\u548c\u5fc3\u7406\u4e0a\u7684\u53cc\u91cd\u4f24\u5bb3\u3002\u53ef\u4ee5\u8fdb\u4e00\u6b65\u8ba8\u8bba\u793e\u4f1a\u5bf9\u4e8e\u5f3a\u5978\u7f6a\u53d7\u5bb3\u8005\u7684\u652f\u6301\u548c\u4fdd\u62a4\u673a\u5236\uff0c\u5305\u62ec\u5fc3\u7406\u54a8\u8be2\u3001\u6cd5\u5f8b\u63f4\u52a9\u7b49\u65b9\u9762\u7684\u63aa\u65bd\u3002\u5982\u4f55\u63d0\u9ad8\u793e\u4f1a\u5bf9\u4e8e\u6027\u72af\u7f6a\u53d7\u5bb3\u8005\u7684\u5173\u6ce8\u5ea6\uff0c\u4ee5\u53ca\u5b8c\u5584\u76f8\u5173\u4fdd\u62a4\u673a\u5236\u662f\u503c\u5f97\u6df1\u5165\u601d\u8003\u7684\u95ee\u9898\u3002

    \u200b \u8fd9\u4e9b\u8865\u5145\u5206\u6790\u53ef\u4ee5\u4ece\u4e0d\u540c\u7ef4\u5ea6\u62d3\u5c55\u5bf9\u6848\u4ef6\u7684\u7406\u89e3\uff0c\u6df1\u5165\u63a2\u8ba8\u6cd5\u5f8b\u3001\u6587\u5316\u3001\u6559\u80b2\u7b49\u65b9\u9762\u7684\u5173\u7cfb\uff0c\u4e3a\u6848\u4ef6\u7684\u5168\u9762\u5206\u6790\u63d0\u4f9b\u66f4\u591a\u89d2\u5ea6\u3002

    "},{"location":"NA/Chap6/Chap6/","title":"Direct Methods for Solving Linear Systems","text":""},{"location":"NA/Chap6/Chap6/#pivoting-strategies","title":"Pivoting Strategies","text":"
    • Small pivot element may cause trouble.
    • Partial Pivoting (or maximal column pivoting)

    Place the element in the pivot position that is largest relative to the entries in its row.

    • Step 1: define a scale factor \\(s_i\\) for each row as \\(s_i=max_{1\\le j\\le n}|a_{ij}|\\)

    • Step 2:Determine the smallest \\(p\\ge k\\) such that \\(\\frac{|a_{pk}^{(k)}|}{s_p}=max_{k\\le i\\le n}\\frac{|a_{ik}^{(k)}|}{s_i}\\) (If already at the kth row)

    "},{"location":"NA/Chap6/Chap6/#lu-factorization","title":"LU Factorization","text":"
    • With forward substituion and then backward substitution easily solve the equation.
    "},{"location":"NA/Chap6/Chap6/#special-types-of-matrices","title":"Special Types of Matrices","text":"
    • A strictly diagonally dominant matrix A is nonsingular. Moreover, Gaussian elimination can be performed without row or column interchanges, and the computations will be stable with respect to the growth of roundoff errors.

    • A matrix A is positive definite if it is symmetric and if \\(\\vec{x^t}A\\vec{x}\\) > 0 for every n-dimensional vector\\(\\vec{x}\\ne 0\\).

    • Also \\(A^{-1}\\) is positive definite as well and \\(a_{ii}>0\\)
    • \\(max|a_{ij}|\\le max|a_{kk}|;(a_{ij}^2)<a_{ii}a_{jj}\\)
    • Each of A\u2019s leading principal submatrices Ak has a positive determinant.
    "},{"location":"NA/Chap6/Chap6/#lu-factorization-of-a-positive-definite-a","title":"LU factorization of a positive definite A","text":""},{"location":"NA/Chap6/Chap6/#crount-reduction-for-tridiagonal-linear-system","title":"Crount Reduction For Tridiagonal Linear System","text":""},{"location":"NA/Chap7/Chap7/","title":"Chapter 7","text":""},{"location":"NA/Chap7/Chap7/#vector-norms","title":"Vector Norms","text":""},{"location":"NA/Chap7/Chap7/#properties","title":"Properties","text":"
    • \\(||\\vec{x}||\\ge 0\\) (\\(||\\vec{x}||=0 \\Leftrightarrow \\vec{x}=0\\))
    • \\(||\\alpha \\vec{x}||=|\\alpha|\u00b7||\\vec{x}||\\)
    • \\(||\\vec{x}+\\vec{y}||\\le ||\\vec{x}||+||\\vec{y}||\\)

    Matrix Norms

    "},{"location":"NA/Chap7/Chap7/#eigenvalues-and-eigenvectors","title":"Eigenvalues and Eigenvectors","text":""},{"location":"NA/Chap8/Chap8/","title":"Chapter 8","text":"

    a

    "},{"location":"PT/PT/","title":"Probability Theory","text":""},{"location":"PT/PT/#_1","title":"\u968f\u673a\u53d8\u91cf\u4e0e\u5206\u5e03\u51fd\u6570","text":""},{"location":"PT/PT/#_2","title":"\u968f\u673a\u53d8\u91cf","text":""},{"location":"PT/PT/#_3","title":"\u5206\u5e03\u51fd\u6570","text":"

    \\(F (x) = P (\u03be \u2a7d x), \u2212\u221e < x < +\u221e\\)

    • Properties

    (1) \\(a < b, F (a) \u2a7d F (b)\\)

    (2). \\(lim_{x\\rightarrow-\\infty} F(x)=0\\\\ lim_{x\\rightarrow +\\infty} F(x)=1\\)

    (3) \\(\u2203F(x\u22120)= lim_{h\u21920+}F(x\u2212h)\\) -- \u5904\u5904\u5de6\u6781\u9650\u5b58\u5728 \\(F(x+0)= lim_{h\u21920+} F(x+h)=F(x)\\) -- \u53f3\u8fde\u7eed

    \u6ce8\u610f\uff0c\u5982\u679c\u4fee\u6539\u5206\u5e03\u51fd\u6570\u5b9a\u4e49\u4e3a\\(F (x) = P (\u03be < x), \u2212\u221e < x < +\u221e\\)\u90a3\u4e48 (3) \u5e94\u8be5\u4fee\u6539\u4e3a\u5904\u5904\u53f3\u6781\u9650\u5b58\u5728\uff0c\u5de6\u8fde\u7eed\u3002

    "},{"location":"PT/PT/#_4","title":"\u5bc6\u5ea6\u51fd\u6570","text":"

    \u82e5\u968f\u673a\u53d8\u91cf\\(\\epsilon\\)\u53ef\u53d6\u67d0\u4e2a\u533a\u95f4\u4e2d\u7684\u4e00\u5207\u503c\uff0c\u5e76\u4e14\u5b58\u5728\u67d0\u4e2a\u975e\u8d1f\u7684\u53ef\u79ef\u51fd\u6570\\(p(x)\\) , \u4f7f\u5206\u5e03\u51fd\u6570\\(F(x)\\)\u6ee1\u8db3\\(F(x)=\\int_{-\\infty}^xp(y)dy\\) \u5219\u79f0\\(\\epsilon\\) \u4e3a\u8fde\u7eed\u6027\u968f\u673a\u53d8\u91cf\uff0c\u79f0p(x)\u4e3a\\(\\epsilon\\)\u7684\u6982\u7387\u5bc6\u5ea6\u51fd\u6570

    • \\(F'(x)=p(x)\\)
    • \\(P(a\\le\\epsilon \\le b)=F(b)-F(a)=\\int_a^b p(y)dy\\)
    • \\(p(x)\\ge 0\\)
    • \\(\\int_{-\\infty}^{+\\infty} p(x)=1\\)
    "},{"location":"PT/PT/#_5","title":"\u968f\u673a\u5411\u91cf","text":"

    1.\u5206\u5e03\u51fd\u6570

    2.\u5bc6\u5ea6\u51fd\u6570

    • Properties

    \uff081\uff09\u57fa\u672c\u540c\u968f\u673a\u53d8\u91cf\u7684\u60c5\u51b5

    \uff082\uff09\\(\\frac{\\partial^nF(x_1,x_2,\u2026\u2026,X_n)}{\\partial x_1\u2026\u2026\\partial x_n}=p(x_1,x_2,\u2026\u2026,x_n)\\)

    3.\u8fb9\u9645\u5bc6\u5ea6

    "},{"location":"PT/PT/#_6","title":"\u72ec\u7acb\u6027","text":"

    \u5bf9\u4e8e\u79bb\u6563\u578b\u968f\u673a\u53d8\u91cf\uff0c\u7528\u5206\u5e03\u51fd\u6570\u5b9a\u4e49\u7684\u968f\u673a\u53d8\u91cf\u7684\u72ec\u7acb\u6027\u6761\u4ef6\\(F(x,y) = F_\u03be(x)F_\u03b7(y)\\) \u53ef\u4ee5\u901a\u8fc7\u6570\u5b66\u5f52\u7eb3\u63a8\u51fa\u5176\u7279\u6709\u72ec\u7acb\u6027\u6761\u4ef6\\(p_{ij} = p_i\u00b7 p_j\\) \u540c\u7406\uff0c\u5f88\u65b9\u4fbf\u5730\u53ef\u4ee5\u7528\u540e\u8005\u53cd\u63a8\u51fa\u524d\u8005\u3002\u56e0\u6b64\u5728\u79bb\u6563\u578b\u968f\u673a\u53d8\u91cf\u4e2d\uff0c\u8fd9\u4e24\u79cd\u5b9a\u4e49\u662f\u7b49\u4ef7\u7684

    \u8bbe \\(p(x, y)\\)\u4e0e \\(p_\u03be (x), p_\u03b7 (y)\\) \u5206\u522b\u4e3a\u8fde\u7eed\u578b\u968f\u673a\u5411\u91cf \\((\u03be, \u03b7)\\)\u7684\u8054\u5408\u5bc6\u5ea6\u548c\u8fb9\u9645\u5bc6\u5ea6, \u5219 \\(\u03be, \u03b7\\)\u76f8\u4e92\u72ec\u7acb\u7684\u5145\u8981\u6761\u4ef6\u662f\\(p(x, y) = p_\u03be (x)p_\u03b7 (y)\\)

    "},{"location":"PT/PT/#_7","title":"\u6761\u4ef6\u5206\u5e03","text":"
    • \u79bb\u6563\u578b

    • \u8fde\u7eed\u578b

    \u6761\u4ef6\u5206\u5e03\u51fd\u6570 \\(P(\\eta \\le y | \\epsilon =x)=\\int_{-\\infty}^{y}\\frac{p(x,v)}{p_\\epsilon(x)}dv\\)

    \u6761\u4ef6\u5bc6\u5ea6\u51fd\u6570 \\(p_{\\eta | \\epsilon}(y|x)=\\frac{p(x,y)}{p_\\epsilon(x)}\\)

    • \u7ed9\u5b9a\u968f\u673a\u53d8\u91cf\u4e0b\u7684\u6761\u4ef6\u6982\u7387

    \\(P(A)=P(A,-\\infty<x<+\\infty)=\\int_{-\\infty}^{+\\infty} P(A|X=x)p_X(x)dx=\\int_{-\\infty}^{+\\infty}g(x)P_X(x)dx\\)

    BOOK p79 2.24

    "},{"location":"PT/PT/#_8","title":"\u968f\u673a\u53d8\u91cf\u7684\u51fd\u6570\u53ca\u5176\u5206\u5e03","text":"
    • \u79bb\u6563\u5377\u79ef
    • \u4e00\u7ef4\u8fde\u7eed\u578b\u968f\u673a\u53d8\u91cf\u51fd\u6570\u7684\u5206\u5e03

    Therom 1

    \u5047\u8bbef(x)\u4e25\u683c\u5355\u8c03\uff0c\u53cd\u51fd\u6570\u6709\u8fde\u7eed\u5bfc\u6570\uff0c\u5219\\(\\eta = f(\\epsilon)\\)\u4e5f\u662f\u8fde\u7eed\u6027\u968f\u673a\u53d8\u91cf\uff0c\u5176\u5bc6\u5ea6\u51fd\u6570\u4e3a

    \\(g(y)=\\left\\{\\begin{array}{**lr**}p(f^{-1}(y)|f^{-1}|(y))'| y\\in f(x)\u7684\u503c\u57df\\\\0\\ \\ \\ \\ \u5176\u4ed6\\end{array}\\right.\\)

    note \u5728\u4e0d\u91cd\u53e0\u7684\u533a\u95f4\u4e0a\u9010\u6bb5\u4e25\u683c\u5355\u8c03\uff0c\u5404\u6bb5\u7684\u53cd\u51fd\u6570\u90fd\u6709\u8fde\u7eed\u5012\u6570

    \\(g(y)=\\left\\{\\begin{array}{**lr**}\\sum p(h_i(y)|h'_i|(y)|) y\\in \u5404h_i(y)\u7684\u5b9a\u4e49\u57df\\\\0\\ \\ \\ \\ \u5176\u4ed6\\end{array}\\right.\\)

    Therom 2

    \u8bbe\\(\\epsilon\\) \u6709\u8fde\u7eed\u7684\u5206\u5e03\u51fd\u6570\\(F(x)\\),\u6c42\\(\\theta=F(\\epsilon)\\)\u7684\u5206\u5e03 \\(P_{\\theta}(y)=y\\) \u670d\u4ece[0,1]\u4e0a\u7684\u5747\u5300\u5206\u5e03

    Therom 3

    \u82e5 \\(\\theta\\) \u670d\u4ece[0,1]\u4e0a\u7684\u5747\u5300\u5206\u5e03,F(x)\u6ee1\u8db3\u5206\u5e03\u51fd\u6570\u7684\u4e09\u4e2a\u6027\u8d28\uff0c\\(\\epsilon=F^{-1}(\\theta)\\) \u5219 \\(P_{\\epsilon}(x)=F(x)\\)

    • \u968f\u673a\u5411\u91cf\u51fd\u6570\u7684\u5206\u5e03\u5f8b

    Therom 1\u5377\u79ef\u516c\u5f0f

    Therom 2 \u82e5\\((\\epsilon_1 \\epsilon_2)\\)\u662f\u8fde\u7eed\u6027\u968f\u673a\u5411\u91cf\uff0c\u5219\\(\\eta=\\frac{\\epsilon_1}{\\epsilon_2}\\)\u662f\u8fde\u7eed\u578b\u968f\u673a\u53d8\u91cf\uff0c\u5176\u5bc6\u5ea6\u51fd\u6570\u4e3a

    \\(p_{\\eta}(z)=\\int_{-\\infty}^{+\\infty}p(zx,x)|x|dx\\)

    \\(F_{\\eta}(y)=\\int_{-\\infty}^yp_{\\eta}(z)dz\\)

    \u6b21\u5e8f\u7edf\u8ba1\u8ba1\u91cf\u5206\u5e03

    • \u968f\u673a\u5411\u91cf\u7684\u53d8\u6362

    P89-93

    \u8bbe\u968f\u673a\u53d8\u91cfX\u548cY\u76f8\u4e92\u72ec\u7acb\uff0c\u5e76\u4e14Z\u4ec5\u662fX\u7684\u51fd\u6570\uff0cW\u4ec5\u662fY\u7684\u51fd\u6570\uff1bZ=g(X) W=h(Y) \u5176\u4e2dg\u548ch\u90fd\u662f\u6ce2\u96f7\u5c14\u53ef\u6d4b\u51fd\u6570\uff0c\u90a3\u4e48Z\u548cW\u4f9d\u65e7\u72ec\u7acb

    "},{"location":"PT/PT/#_9","title":"\u5e38\u89c1\u79bb\u6563\u578b\u968f\u673a\u53d8\u91cf\u5206\u5e03","text":"

    1.\u9000\u5316\u5206\u5e03 \\(P(\\epsilon = c)=1\\)

    2.\u4e24\u70b9\u5206\u5e03 \\(\\begin{bmatrix}x1&x2\\\\p&q\\end{bmatrix}\\) \\(p+q=1 p,q>0\\)

    3.\u5e15\u65af\u5361\u5206\u5e03 \\(P(\\epsilon=k)=\\begin{pmatrix}k-1\\\\r-1\\end{pmatrix}p^rq^{k-r}\\)

    4.\u4e8c\u9879\u5206\u5e03

    • \\(b(k,n,p)=b(n-k,n,1-p)\\)
    • \\(\\frac{b(k,n,p)}{b(k-1,n,p)}=1+\\frac{(n+1)p-k}{kq}\\)
    • \\((n+1)p\\)\u662f\u6574\u6570 \uff1a \\((n+1)p \\ (n+1)p-1\\) \u4e3a\u6700\u6709\u53ef\u80fd\u7684\u6210\u529f\u6b21\u6570
    • \\((n+1)p\\)\u662f\u4e0d\u6574\u6570\uff1a \\(k=[(n+1)p]\\) \u6700\u6709\u53ef\u80fd\u7684\u6210\u529f\u6b21\u6570 \\([x]\\)\u8868\u793a\\(x\\)\u6700\u5927\u6574\u6570\u90e8\u5206
    • \u9012\u63a8\u516c\u5f0f \\(P(\\epsilon=k+1)=\\frac{p(n-k)}{(k+1)q}P(\\epsilon=k)\\)
    • \\(n \\rightarrow +\\infty\\) \u300c\u6cca\u677e\u5b9a\u7406\u300d

    \u82e5\u5b58\u5728\u6b63\u5e38\u6570\\(\\lambda\\) \u5f53\\(n \\rightarrow+\\infty\\)\u65f6\uff0c\u6709\\(bp_n \\rightarrow +\\lambda\\) ,\u5219

    \\(lim_{n \\rightarrow+\\infty} b(k,n,p)=\\frac{\\lambda^k}{k!}e^{-\\lambda}\\)

    \u901a\u5e38\uff0cn\u4e0ep\u65e0\u5173\uff0c\u4f46\u662fn\u5f88\u5927\uff0cp\u5f88\u5c0f\uff0cnp\u4e0d\u662f\u5f88\u5927\u7684\u65f6\u5019\uff0c\u53ef\u8fd1\u4f3c\u5730\u53d6\\(\\lambda=np\\)

    • \u5fb7\u83ab\u4f5b-\u62c9\u666e\u62c9\u65af\u5b9a\u7406 \\(npq \\rightarrow +\\infty\\)

    \\(P(\\epsilon_n=j)\\approx \\frac{1}{\\sqrt{2\\pi npq}}e^{-x^2/2} \\ \\ x=\\frac{j-np}{\\sqrt{npq}}\\)

    4.\u6cca\u677e\u5206\u5e03

    \\(P(\\epsilon=k)=\\frac{\\lambda^k}{k!}e^{-\\lambda}\\)

    5.\u51e0\u4f55\u5206\u5e03\u300c\u65e0\u8bb0\u5fc6\u6027\u300d

    \\(P(\\epsilon=k)=pq^{k-1}\\)

    6.\u8d85\u51e0\u4f55\u5206\u5e03

    • \\(P(\\epsilon=k)=\\frac{ \\begin{pmatrix}M\\\\k\\end{pmatrix} \\begin{pmatrix}N-M\\\\n-k\\end{pmatrix}}{\\begin{pmatrix}N\\\\n\\end{pmatrix}}\\) \\(k=0,1,2,\u2026\u2026\uff0cmin(n,M)\\)
    • \\(N\\rightarrow +\\infty\\ \\frac{M}{N}\\rightarrow p\\), \u8d85\u51e0\u4f55\u5206\u5e03\u53ef\u4ee5\u7528\u4e8c\u9879\u5206\u5e03\u8fd1\u4f3c\u8ba1\u7b97

    \u300c\u4fee\u6b63\uff1aM+N-n \u6709\u5927\u5c0f\u5199\u9519\u8bef\u300d

    "},{"location":"PT/PT/#_10","title":"\u5e38\u89c1\u8fde\u7eed\u578b\u968f\u673a\u53d8\u91cf\u5206\u5e03","text":"

    1.\u5747\u5300\u5206\u5e03

    2.\u6b63\u6001\u5206\u5e03

    • BASIC \\(p(x)=\\frac{1}{\\sqrt{2\\pi}\\sigma}e^{-\\frac{(x-a)^2}{2\\sigma^2}}\\)

    \\(Proof\\)

    \\(\\begin{align*}(\\frac{1}{\\sqrt{2\\pi}\\sigma}\\int_{-\\infty}^{+\\infty} e^{-\\frac{(t-a)^2}{2\\sigma^2}}dt)^2 &= (\\frac{1}{\\sqrt{2\\pi}}\\int_{-\\infty}^{+\\infty} e^{-\\frac{t^2}{2}}dt)^2\\\\&=\\frac{1}{2\\pi}\\int_{-\\infty}^{+\\infty} \\int_{-\\infty}^{+\\infty} e^{\\frac{t^2+s^2}{2}}dtds\\\\ &=\\frac{1}{2\\pi} \\int_{0}^{2\\pi}d\\theta\\int_{0}^{+\\infty} re^{-\\frac{r^2}{2}}dr\\\\ &=1\\end{align*}\\)

    • \\(a=0\\ \\sigma=1\\) \u6807\u51c6\u6b63\u6001\u5206\u5e03 \\(\\Phi(x)=\\frac{1}{\\sqrt{2\\pi}}e^{-\\frac{x^2}{2}}\\)
    • \\(\\Phi(-x)=1-\\Phi(x)\\)

    2.2 n\u7ef4\u6b63\u6001\u5206\u5e03

    \u8bbe \\(B = (b_{ij} )\\) \u4e3a n \u7ef4\u6b63\u5b9a\u5bf9\u79f0\u77e9\u9635, \\(|B|\\) \u4e3a\u5176\u884c\u5217\u5f0f, \\(B^{\u22121}\\) \u4e3a\u5176\u9006,

    \u53c8\u8bbe \\(x = (x1, x2, \u00b7 \u00b7 \u00b7 , xn)^T\\) , \\(a = (a1, a2, \u00b7 \u00b7 \u00b7 , an)^T\\) , \u5219\u79f0

    \\(p(\\vec{x})=\\frac{1}{(2\\pi)^{n/2}|B|^{1/2}} exp(-\\frac{1}{2}(x-a)^TB^{-1}(x-a))\\) \u4e3an\u7ef4\u6b63\u6001\u5bc6\u5ea6\u51fd\u6570

    2.3 \u4e8c\u7ef4\u7684\u60c5\u51b5

    \\(B=\\begin{pmatrix}\\sigma_1^2 & r\\sigma_1\\sigma_2\\\\ r\\sigma_1\\sigma_2&\\sigma_2^2\\end{pmatrix}. B^{-1}=\\begin{pmatrix}\\sigma_2^2 & -r\\sigma_1\\sigma_2\\\\ -r\\sigma_1\\sigma_2&\\sigma_1^2\\end{pmatrix}\\)

    \\(p(x,y)=\\frac{1}{2\\pi\\sigma_1\\sigma_2\\sqrt{1-r^2}}exp(-\\frac{1}{2(1-r^2)}\\times[\\frac{(x-a)^2}{\\sigma_1^2} - \\frac{2r(x-a)(y-b)}{\\sigma_1\\sigma_2} + \\frac{(y-b)^2}{\\sigma_2^2}])\\)

    \u7b80\u8bb0\u4f5c \\((\\epsilon,\\eta)\\) ~ \\(N(a,b,\\sigma_1^2,\\sigma_2^2,r)\\)

    • \u4e8c\u5143\u6b63\u6001\u5206\u5e03\u7684\u8fb9\u9645\u51fd\u6570\u4ecd\u662f\u6b63\u6001\u5206\u5e03 \\(\\eta\\)~\\(N(b,\\sigma_2^2)\\) [\u53cd\u8fc7\u6765\u5219\u4e0d\u4e00\u5b9a]
    • \\(\\epsilon\\ \\ \\eta\\) \u72ec\u7acb \u7b49\u4ef7\u4e8e \\(r=0\\)

    2.4 \u6761\u4ef6\u5206\u5e03

    2.5 \u6b63\u6001\u5206\u5e03\u7684\u51fd\u6570

    • \\(\\epsilon\\) ~ \\(N(0,\\sigma^2) \\ \\eta = k\\epsilon+b\\ \\eta\\)~ \\(N(ka+b,k^2\\sigma^2)\\)
    • \\(\\epsilon\\)~ \\(N(a_1,\\sigma_1^2)\\) \\(\\eta\\)~\\(N(a_2,\\sigma_2^2)\\) \\(\\eta + \\epsilon\\)~\\(N(a_1+a_2,\\sigma_1^2+\\sigma_2^2)\\)

    • \\(\\epsilon\\) ~ \\(N(0,\\ 1) \\ \\eta = \\epsilon^2\\)

    • \u82e5\\((X,Y)\\)~\\(N(\\mu_1,\\mu_2,\\sigma_1^2,\\sigma_2^2,r)\\) \u5219 \\(C_1X+C_2Y\\)~\\(N(C_1\\mu_1+C_2\\mu_2,C_1^2\\sigma_1^2+C_2^2\\sigma_2^2+2C_1C_2r\\sigma_1\\sigma_2)\\)

    2.6 \u591a\u7ef4\u6b63\u6001\u5206\u5e03 P93

    \\(\\vec{\\eta}=C\\vec{\\epsilon}+a\\) \u5219 \\(\\vec{\\eta}\\) ~ \\(N(C\\vec{\\mu}+a,C\\Sigma C^T)\\)

    3.\u6307\u6570\u5206\u5e03

    \\(p(x)=\\left\\{\\begin{array}{**lr**}\\lambda e^{-\\lambda x}\\ x\\ge 0 \\\\0 \\ \\ \\ \\ \\ \\ \\ \\ \\ x < 0\\end{array}\\right.\\)

    \\(F(x)=\\left\\{\\begin{array}{**lr**}1-e^{-\\lambda x}\\ x\\ge 0 \\\\0 \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ x < 0\\end{array}\\right.\\)

    • \u65e0\u8bb0\u5fc6\u6027 \uff1a \\(P(\\epsilon > s+t | \\epsilon > s)=P(\\epsilon > t)\\)

    4.T\u5206\u5e03

    5.\u5a01\u5e03\u5c14\u5206\u5e03

    6.\u5e15\u7d2f\u6258\u5206\u5e03

    7.\\(\\beta\\)\u5206\u5e03

    8.\u67ef\u897f\u5206\u5e03

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/","title":"\u6570\u5b57\u7279\u5f81\u4e0e\u7279\u5f81\u51fd\u6570","text":""},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_1","title":"\u6570\u5b66\u671f\u671b","text":""},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_2","title":"\u79bb\u6563\u578b\u968f\u673a\u53d8\u91cf\u7684\u6570\u5b66\u671f\u671b","text":"

    \u8bbe\u7f6e\u79bb\u6563\u578b\u968f\u673a\u53d8\u91cf\\(\\epsilon\\) \u7684\u5206\u5e03\u5217\u4e3a

    \\(\\begin{bmatrix}x_1&x_2&\u2026\u2026&x_k&\u2026\u2026\\\\p_1&p_2&\u2026\u2026&p_k&\u2026\u2026\\end{bmatrix}\\)

    \u5982\u679c\u7ea7\u6570\\(\\sum_kx_kp_k\\)\u7edd\u5bf9\u6536\u655b\uff0c\u5219\u79f0\u6b64\u7ea7\u6570\u7684\u548c\u4e3a\\(\\epsilon\\) \u7684\u6570\u5b66\u671f\u671b\u6216\u5747\u503c\\((mean)\\)\uff0c\u8ba1\u4f5c\\(E\\epsilon=\\sum_kx_kp_k\\)

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_3","title":"\u8fde\u7eed\u578b\u968f\u673a\u53d8\u91cf\u7684\u6570\u5b66\u671f\u671b","text":"

    \u8bbe\\(\\epsilon\\)\u4e3a\u8fde\u7eed\u578b\u968f\u673a\u53d8\u91cf\uff0c\u6709\u5bc6\u5ea6\u51fd\u6570\\(p(x)\\)\u5f53\\(\\int_{-\\infty}^{+\\infty}|x|p(x)dx<\\infty\u65f6\\) \u79f0\\(E\\epsilon=\\int_{-\\infty}^{+\\infty}xp(x)dx\\)\u4e3a\\(\\epsilon\\)\u7684\u6570\u5b66\u671f\u671b

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_4","title":"\u4e00\u822c\u5b9a\u4e49","text":"

    \u8bbe\u968f\u673a\u53d8\u91cf\\(\\epsilon\\)\u6709\u5206\u5e03\u51fd\u6570\\(F(x)\\)\uff0c\u82e5\\(\\int_{-\\infty}^{+\\infty}|x|d F(x)<\\infty\\) \u79f0\\(E\\epsilon=\\int_{-\\infty}^{+\\infty}xd F(x)\\)\u4e3a\\(\\epsilon\\)\u7684\u6570\u5b66\u671f\u671b

    • \u65af\u63d0\u5c14\u5409\u65af(Stieltjes)\u79ef\u5206
    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_5","title":"\u968f\u673a\u53d8\u91cf\u51fd\u6570\u7684\u6570\u5b66\u671f\u671b","text":"
    • \u8bbe\\(\\epsilon\\ \\eta\\)\u4e3a\u968f\u673a\u53d8\u91cf\u5206\u5e03\u51fd\u6570\u5206\u522b\u4e3a\\(F_{\\epsilon}(x)\\ F_{\\eta}(x)\\) \uff1b\\(f(x)\\)\u662f\u4e00\u5143\u6ce2\u96f7\u5c14\u51fd\u6570\uff0c\u8ba1\\(\\eta=f(\\epsilon)\\) \u5219 \\(E_{\\eta}=\\int_{-\\infty}^{+\\infty}xdF_{\\eta}(x)=\\int_{-\\infty}^{+\\infty}f(x)dF_{\\epsilon}(x)\\)

    • (Stein \u5f15\u7406) \\(P119\\)

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_6","title":"\u6570\u5b66\u671f\u671b\u7684\u57fa\u672c\u6027\u8d28","text":""},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#1","title":"\u6027\u8d281","text":"

    \u82e5\\(a\\le \\epsilon \\le b\\)\u5219 \\(E\\epsilon\\) \u5b58\u5728\u4e14\\(a\\le E\\epsilon\\le b\\)

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#1_1","title":"\u6027\u8d281\u2018","text":"

    \u82e5\\(|\\epsilon| < \\eta\\) \u4e14\\(E\\eta\\) \u5b58\u5728 \u5219\\(E\\epsilon\\)\u5b58\u5728 \u4e14\\(|E\\epsilon|\\le E|\\epsilon|\\le E\\eta\\)

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#2","title":"\u6027\u8d282","text":"

    \\(E_{\\epsilon_1},E_{\\epsilon_2},E_{\\epsilon_3}\u2026\u2026 E_{\\epsilon_n}\\)\u5b58\u5728\uff0c\u5219\u5bf9\u4efb\u610f\u5e38\u6570\\(c_1,c_2,\u2026\u2026c_n\\)\u548cb \\(E(\\sum_{i=1}^nc_i\\epsilon_i+b)\\)\u5b58\u5728\uff0c\u4e14\\(E(\\sum_{i=1}^nc_i\\epsilon_i+b)=\\sum_{i=1}^nc_iE\\epsilon_i+b\\)

    \u7279\u522b\u5730\uff1a\\(E(\\sum_{i=1}^n\\epsilon_i)=\\sum_{i=1}^nE\\epsilon_i\\) \\(E(c\\epsilon)=cE\\epsilon\\)

    • Exercise :\\(p121\\)
    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#3","title":"\u6027\u8d283","text":"

    \u82e5\\(\\epsilon_1,\\epsilon_2\u2026\u2026\\epsilon_n\\)\u76f8\u4e92\u72ec\u7acb\uff0c\u5404\\(E_{\\epsilon_i}\\)\u5b58\u5728\uff0c\u5219\\(E(\\epsilon_1,\\epsilon_2\u2026\u2026,\\epsilon_n)=E\\epsilon_1E\\epsilon_2\u2026\u2026E\\epsilon_n\\)

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#4","title":"\u6027\u8d284(\u6709\u754c\u6536\u655b\u5b9a\u7406)","text":"

    \u5047\u8bbe\u5bf9\u4efb\u610f\\(\\omega\\in\\Omega\\) \u6709\\(\\lim_{n\\rightarrow\\infty}\\epsilon(\\omega)=\\epsilon(\\omega)\\)\u5e76\u4e14\uff0c\u5bf9\u4e00\u5207\u7684\\(n >=1\\) \\(|\\epsilon_n|\\le M\\) M\u4e3a\u5e38\u6570\uff0c\u5219\\(\\lim_{n\\rightarrow\\infty}E\\epsilon_n=E\\epsilon\\)

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_7","title":"\u6761\u4ef6\u671f\u671b","text":""},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_8","title":"\u6761\u4ef6\u671f\u671b","text":"

    \\(E(\\eta|\\epsilon=x)=\\int_{-\\infty}^{+\\infty}ydF_{\\eta|\\epsilon}(y|x)\\)

    \\(E(\\eta|\\epsilon=x)=\\int_{-\\infty}^{+\\infty}yp_{\\eta|\\epsilon}(y|x)dy\\)

    \\(E(\\eta|\\epsilon=x)=\\sum yp_{\\eta|\\epsilon}(y|x)dy\\)

    \u518d\u5bf9\\(E(\\eta|\\epsilon=x)\\)\u6c42\u671f\u671b\uff0c\u4f1a\u5f97\u5230\\(E[E(\\eta|\\epsilon=x)]=E\\eta\\)

    \u8fde\u7eed\u578b

    \u79bb\u6563\u578b

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_9","title":"\u5168\u671f\u671b\u516c\u5f0f","text":"

    \\(\\epsilon\\) \u662f\u79bb\u6563\u578b\u968f\u673a\u53d8\u91cf\u65f6\uff0c\u8ba1\\(p_i=P(\\epsilon=x_i) \\Rightarrow E\\eta=\\sum_i p_iE(\\eta|\\epsilon=x_i)=\\sum_iE(\\eta|\\epsilon=x_i)P(\\epsilon=x_i)\\)

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_10","title":"\u6761\u4ef6\u671f\u671b\u7684\u6027\u8d28","text":"
    • P125
    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_11","title":"\u65b9\u5dee\uff0c\u534f\u65b9\u5dee\u4e0e\u76f8\u5173\u7cfb\u6570","text":""},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_12","title":"\u65b9\u5dee","text":"

    \\(Var\\epsilon=E(\\epsilon-E\\epsilon)^2=E\\epsilon^2-(E\\epsilon)^2\\)

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#chebyshev","title":"Chebyshev \u4e0d\u7b49\u5f0f","text":"

    \\(P(|\u03be\u2212E\u03be|\u2265\u03b5)\u2264 Var\u03be\\)

    \\(P(|\u03be \u2212 E\u03be| \u2265 \u03b5) =\\int_{|x-E\u03be|>=\\epsilon}dF(x)\\le \\int_{|x-E\u03be|>=\\epsilon}\\frac{(x-E\u03be)^2}{\\epsilon^2}dF(x)\\\\ \\le \\frac{1}{\\epsilon^2}\\int_ {-\\infty}^{+\\infty}(x-E\u03be)^2dF(x) =\\frac{Var\u03be}{\\epsilon^2}\\)

    • \u6027\u8d281

    \\(Var\u03be=0 \\Leftrightarrow P(\u03be=c)=1\\) (c\u662f\u5e38\u6570)

    • \u6027\u8d282

    \\(Var(c\u03be+b)=c^2Var\u03be\\)

    • \u6027\u8d283

    \u82e5 \\(c \\ne E\u03be\\ \\ \\ var\u03be<E(\u03be-c)^2\\)

    \\(p130\\)\u6700\u4f73\u9884\u6d4b\u95ee\u9898

    • \u6027\u8d284

    \\(Var (\\sum\u03be_i )= \\sum Var\u03be_i +2\\sum_{1\\le i<j\\le n} E(\u03be_i \u2212E\u03be_i)(\u03be_j \u2212E\u03be_j)\\)

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_13","title":"\u534f\u65b9\u5dee","text":"

    \u8bbe\\(\\epsilon_i \\epsilon_j\\)\u7684\u8054\u5408\u5206\u5e03\u51fd\u6570\u4e3a\\(F_{ij}(x,y)\\)\u82e5\\(E|(\\epsilon_i-E\\epsilon_i)(\\epsilon_j-E\\epsilon_j)|<\\infty\\) \u79f0 \\(E(\\epsilon_i-E\\epsilon_i)(\\epsilon_j-E\\epsilon_j)=\\int_{-\\infty}^{+\\infty}\\int_{-\\infty}^{+\\infty}(x-E\\epsilon_i)(y-E\\epsilon_j)dF_{ij}(x,y)\\)\u4e3a\\(\\epsilon_i\\)\u548c\\(\\epsilon_j\\)\u7684\u534f\u65b9\u5dee\uff0c\u8ba1\u4f5c\\(Cov(\\epsilon_i\\ \\epsilon_j)\\)

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_14","title":"\u6027\u8d28","text":"
    • 1.\\(Cov(\\epsilon\\ \\eta)=Cov(\\eta\\ \\epsilon)=E\\epsilon\\eta-E\\epsilon E\\eta\\)
    • 2.a b are constant \\(Cov(a\\epsilon,b\\eta)=abCov(\\epsilon.\\eta)\\)
    • 3.\\(Cov(\\sum_{i=1}^n\\epsilon_i,\\eta)=\\sum_{i=1}^nCov(\\epsilon_i,\\eta)\\)
    • 4.\\(CBC^{T}\\)
    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_15","title":"\u76f8\u5173\u7cfb\u6570","text":"

    \u4ee4\\(\\epsilon^*=(\\epsilon-E\\epsilon)/\\sqrt{Var\\epsilon} \\\\ \\eta^*=(\\eta-E\\eta)/\\sqrt{Var\\eta}\\)

    \u79f0\\(r_{\\epsilon\\eta}=Cov(\\epsilon^*,\\eta^*)=\\frac{E(\\epsilon-E\\epsilon)(\\eta-E\\eta)}{\\sqrt{Var\\epsilon Var\\eta}}\\) \u4e3a\\(\\epsilon \\ \\eta\\)\u7684\u76f8\u5173\u7cfb\u6570 \\(E\\epsilon^* \\eta^*\\) instead of \\(Cov(\\epsilon^*,\\eta^*)\\)?

    • Cauchy-Schwar \u4e0d\u7b49\u5f0f \\(|E\\epsilon\\eta|^2\\le E\\epsilon^2 E\\eta^2\\) \u7b49\u5f0f\u6210\u7acb\u5f53\u4e14\u4ec5\u5f53\\(\\exist t_o \\ st. P(\\eta=t_0\\epsilon)=1\\) \\(Proof\\ P134\\)
    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_16","title":"\u6027\u8d28","text":"
    • \u5bf9\u76f8\u5173\u7cfb\u6570\\(r_{\\epsilon\\eta}\\)\u6709 \\(|r_{\\epsilon\\eta}|\\le 1\\)

    \\(r_{\\epsilon\\eta}=1\\)\u6210\u7acb\\(iff\\ P(\\frac{\\epsilon-E\\epsilon}{\\sqrt{Var\\epsilon}}=\\frac{\\eta-E\\eta}{\\sqrt{Var\\eta}})=1\\)

    \\(r_{\\epsilon\\eta}=-1\\)\u6210\u7acb\\(iff\\ P(\\frac{\\epsilon-E\\epsilon}{\\sqrt{Var\\epsilon}}=-\\frac{\\eta-E\\eta}{\\sqrt{Var\\eta}})=1\\)

    • All the below are equavilant

    \\((1) Cov(\\epsilon,\\eta)=0\\)

    \\((2) \\epsilon \\ \\eta\\)\u4e0d\u76f8\u5173

    \\((3) E\\epsilon\\eta=E\\epsilon E\\eta\\)

    \\((4)Var{\\epsilon+\\eta}=Var\\epsilon+Var\\eta\\)

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_17","title":"\u77e9","text":""},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_18","title":"\u7279\u5f81\u51fd\u6570","text":"

    \\(f(t)=Ee^{it\\epsilon}\\)

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#example","title":"Example","text":"
    • \\(P(\\epsilon=c)=1--f(t)=e^{ict}\\)
    • \\(B(n,p)-- f(t)=\\sum_{k=0}^nC_n^kp^kq^{n-k}e^{itk}=\\sum_{k=0}^nC_n^k(pe^{it})^kq^{n-k}=(pe^{it}+q)^n\\)
    • \\(Poisson P(\\lambda)--f(t)=\\sum_{k=0}^{\\infty}\\frac{\\lambda^k}{k!}e^{-\\lambda}e^{ikt}=\\sum_{k=0}^{\\infty}\\frac{(\\lambda e^{it})^k}{k!}e^{-\\lambda}=e^{\\lambda e^{it}}e^{-\\lambda}=e^{\\lambda(e^{it}-1)}\\)
    • \\(Uniform\\ U(a,b)--f(t)=\\int_a^b\\frac{1}{b-a}e^{itx}dx=\\frac{e^{itb}-e^{ita}}{i(b-a)t}\\)
    • \\(N(a,\\sigma^2)--f(t)=\\frac{1}{\\sqrt{2\\pi\\sigma}}\\int_{-\\infty}^{+\\infty}e^{itx-(x-a)^2/2\\sigma^2}dx=e^{ita-\\frac{\\sigma^2t^2}{2}}\\)
    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#properties","title":"Properties","text":"
    • \\(|f(t)|\\le f(0)=1\\\\f(-t)=\\bar{f(t)}\\)
    • \\(f(t)\\)\u5728\\((-\\infty,+\\infty)\\)\u4e0a\u4e00\u81f4\u8fde\u7eed
    • \\(f(t)\\)\u975e\u8d1f\u5b9a

    \\(f(t)\\)\u4e3a\u7279\u5f81\u51fd\u6570\\(\\Leftrightarrow f(t)\\)\u975e\u8d1f\u5b9a\uff0c\u8fde\u7eed\u4e14\\(f(0)=1\\) * \\(\\epsilon_1\u2026\u2026\\epsilon_n\\)\u76f8\u4e92\u72ec\u7acb\uff0c\u7279\u5f81\u51fd\u6570\u5206\u522b\u4e3a\\(f_1(t)\u2026\u2026f_n(t)\\) \u8bb0\\(\\eta=\\epsilon_1+\u2026\u2026+\\epsilon_n\\) \u5219\\(\\eta\\)\u7684\u7279\u5f81\u51fd\u6570\\(f_\\eta(t)=f_1(t)f_2(t)\u2026\u2026f_n(t)\\) * \u82e5\\(E\\epsilon^n\\)\u5b58\u5728\uff0c\u5219\\(f(t)\\)n\u6b21\u53ef\u5fae\uff0c\u8fdb\u800c \\(k\\le n\\)\u65f6\uff0c\\(f^{k}(t)=i^k\\int_{-\\infty}^{+\\infty}x^ke^{itx}dF(x),f^{(k)}(0)=i^kE\\epsilon^k\\)\u7279\u522b\u5730 \\(E\\epsilon^2\\)\u5b58\u5728\u65f6 \\(E\\epsilon=-if'(0),E\\epsilon^2=-f''(0),Var\\epsilon=-f''(0)+[f'(0)]^2\\)

    \u53cd\u8fc7\u6765\uff0c\u82e5n\u4e3a\u5076\u6570\uff0c\u4e14\\(f^{(n)}(0)\\)\u5b58\u5728\uff0c\u5219\\(E\\epsilon^n\\)\u5b58\u5728 * \\(\\eta=a\\epsilon+b, f_\\eta(t)=e^{ibt}f(at)\\)

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_19","title":"\u9006\u8f6c\u516c\u5f0f","text":"

    \u8bbe\u5206\u5e03\u51fd\u6570\\(F(x)\\)\u7684\u7279\u5f81\u51fd\u6570\u4e3a\\(f(t)\\) \u53e6x1\uff0cx2\u4e3a\\(F(x)\\)\u7684\u8fde\u7eed\u70b9\uff0c\u5219\\(F(x_2)-F(x_1)=lim_{T\\rightarrow \\infty}\\frac{e^{-itx_1}=e^{-itx^2}}{it}f(t)dt\\)

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_20","title":"\u552f\u4e00\u6027\u5b9a\u7406","text":"

    \u5206\u5e03\u51fd\u6570\u53ef\u7531\u7279\u5f81\u51fd\u6570\u552f\u4e00\u786e\u5b9a

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_21","title":"\u9006\u5085\u7acb\u53f6\u53d8\u6362","text":"

    \u8bbe\\(f(t)\\)\u662f\u7279\u5f81\u51fd\u6570\u4e14\\(\\int_{=\\infty}^{+\\infty}|f(t)|dt<\\infty\\)\u5219\u5206\u5e03\u51fd\u6570F(x)\u8fde\u7eed\uff0c\u6b64\u65f6 \\(F'(x)=\\frac{1}{2\\pi}\\int_{-\\infty}^{+\\infty}e^{-itx}f(t)dt\\) * \u82e5f(t)\u662f\u67d0\u968f\u673a\u53d8\u91cf\u7684\u7279\u5f81\u51fd\u6570\uff0c\u5219\\(\\bar{f(t)},|f(t)|^2\\)\u4e5f\u662f\u7279\u5f81\u51fd\u6570 \\(f(-t)=\\bar{f(t)}\\)\u662f\\(-\\epsilon\\)\u7684\u7279\u5f81\u51fd\u6570 \\(\\epsilon_1-\\epsilon_2\\)\uff08\u72ec\u7acb\u540c\u5206\u5e03\uff09\u7684\u7279\u5f81\u51fd\u6570\u4e3a\\(f(t)\\bar{f(t)}=|f(t)|^2\\)

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_22","title":"\u5206\u5e03\u51fd\u6570\u7684\u53ef\u52a0\u6027","text":""},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_23","title":"\u591a\u5143\u7279\u5f81\u51fd\u6570","text":"

    \u8bbe\u968f\u673a\u5411\u91cf\\(\\vec{\\epsilon}=(\\epsilon_1,\u2026\u2026,\\epsilon_n)'\\)\u7684\u5206\u5e03\u51fd\u6570\u4e3a\\(F(x_1\u2026\u2026,x_n)\\)\u79f0\\(f(t_1,\u2026\u2026t_n)=\\int_{-\\infty}^{+\\infty}\u2026\u2026\\int_{-\\infty}^{+\\infty}e^{i(t_1x_1+\u2026\u2026+t_nx_n)}dF(x_1\u2026\u2026\uff0cx_n)\\)\u4e3a\u4ed6\u7684\u7279\u5f81\u51fd\u6570 * \\(\\eta=a_1\\epsilon_1\u2026\u2026+a_n\\epsilon_n\\\\f_\\eta(t)=Ee^{it\\sum_{k=1}^na_k\\epsilon_k}=f(a_1t,\u2026\u2026a_nt)\\) \u5176\u4ed6\u8be6\u7ec6\u89c1P48

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_24","title":"\u591a\u5143\u6b63\u6001\u5206\u5e03","text":"

    P149-P154

    "},{"location":"PT/%E6%9E%81%E9%99%90%E5%AE%9A%E7%90%86/","title":"\u6781\u9650\u5b9a\u7406","text":""},{"location":"PT/%E6%9E%81%E9%99%90%E5%AE%9A%E7%90%86/#_1","title":"\u4f9d\u5206\u5e03\u6536\u655b\u4e0e\u4e2d\u5fc3\u6781\u9650\u5b9a\u7406","text":""},{"location":"assembly/%E4%B8%AD%E6%96%AD/","title":"\u4e2d\u65ad","text":""},{"location":"assembly/%E4%B8%AD%E6%96%AD/#int16","title":"int16","text":"
    • int 16h/ah=00h \u5c5e\u4e8ebios\u4e2d\u65ad

      int 16h ax=\u6240\u6572\u952e\u7684\u7f16\u7801

      again:  [\u5237\u65b0\u6e38\u620f\u7684\u753b\u9762]\nmov ah,1\nint 16h \u68c0\u67e5\u952e\u76d8\u7f13\u51b2\u533a\u662f\u5426\u4e3a\u7a7a\uff0c\u82e5\u4e3a\u7a7a\uff0c\u5219\u8fd4\u56dezf=1,\u5426\u5219\u8fd4\u56dezf=0  (ZF=1 jz\u8df3\u8f6c)\njz no_key\nhas_key:\n    mov ah,0\n    int 16h  \u4ece\u952e\u76d8\u7684\u7f13\u51b2\u533a\u8bfb\u53d6\u4e00\u4e2a\u952e\uff0c\u6839\u636e\u6240\u6572\u7684\u952e\u6267\u884c\u4e0d\u540c\u5206\u652f\nno_key:\n    jmp again\n

    \u4f8b\u5b50\uff1a

    data segment\nx dw 0\ny dw 0\ndata ends\ncode segment\nassume cs:code,ds:data\nmain:\n  mov ax,data\n  mov ds,ax\n  mov ah,0\n  mov al,3\n  mov ax,0B800h\n  mov es,ax\ndraw:\n  ;bx=(y*80+x)*2\n  mov ax,[y]\n  mov bp,80\n  mul bp \n;  dx(\u9ad816\u4f4d):ax\uff08\u4f4e16\u4f4d\uff09=ax*bp \n;  \u5176\u4e2ddx=0 mul\u7684\u4e58\u6570\u5bbd\u5ea616 \u5219\u88ab\u4e58\u6570\u4e3aax\n;  24x79\u603b\u4e4b\u4e0d\u8d85\u8fc716\u4f4d      \n  add ax,[x]\n  add ax,ax\n  mov bx,ax\n  mov es:[bx],1720h\n check_key:\n  mov ah,1\n  int 16h\n  jnz has_key\n  jmp check_key\n has_key:\n  mov ah,0\n  int 16h\n  cmp ax,4800h\n  je is_up\n  cmp ax,5000h\n  je is_down\n  cmp ax,4B00h\n  je is_left\n  cmp ax,4D00h\n  je is_right\n  jmp exit\nis_up:\n  cmp [y],0\n  je check_key\n  dec [y]\n  jmp draw\nis_down:\n  cmp [y],24\n  je check_key\n  inc [y]\n  jmp draw\nis_left:\n  cmp [x],0\n  je check_key\n  dec [x]\n  jmp draw\nis_right:\n  cmp [x],79\n  je check_key\n  inc [x]\n  jmp draw\nexit:\n  mov ah,4Ch\n  int 21h\ncode ends\nend main\n

    "},{"location":"assembly/%E4%B8%AD%E6%96%AD/#int-21h","title":"int 21h","text":"
    • int21h\u5bf9\u5e94\u7684\u51fd\u6570\u9996\u5730\u5740\u4fdd\u5b58\u57280:84h\u5904, \u8be5\u5730\u5740\u662f\u4e00\u4e2a\u8fdc\u6307\u9488\u3002
      0:84 78h\n0:85 56h\n0:86 34h\n0:87 12h\nxor ax,ax\nmov es,ax\nmov bx,84h\nlds si,es:[bx]\n;ds=1234h si=5678h\n
    • dword ptr 0:[84h]\u79f0\u4e3aint 21h\u7684\u4e2d\u65ad\u5411\u91cf(\u5176\u5b9e\u662f\u5b83\u7684\u51fd\u6570\u9996\u5730\u5740)
      • int n\u5bf9\u5e94\u7684\u4e2d\u65ad\u5411\u91cf\u7684\u5b58\u50a8\u4f4d\u7f6e\u4e00\u5b9a\u662f0:n*4
      • n\u7684\u53d6\u503c\u8303\u56f4\u662f[00, FF], \u6240\u4ee5256\u4e2a\u4e2d\u65ad\u5411\u91cf\u4f1a\u5360\u75280:0~0:3FF\u4e4b\u95f4\u5171400h\u4e2a\u5b57\u8282\u7684\u5185\u5b58\uff0c\u8fd9\u5757\u533a\u57df\u79f0\u4e3a \u4e2d\u65ad\u5411\u91cf\u8868\u3002

    \u663e\u7136, int 00h\u7684\u4e2d\u65ad\u5411\u91cf\u4fdd\u5b58\u5728dword ptr 0:[0];\nint 01h\u7684\u4e2d\u65ad\u5411\u91cf\u4fdd\u5b58\u5728dword ptr 0:[4];\nint 03h\u7684\u4e2d\u65ad\u5411\u91cf\u4fdd\u5b58\u5728dword ptr 0:[0Ch];\nint 08h\u7684\u4e2d\u65ad\u5411\u91cf\u4fdd\u5b58\u5728dword ptr 0:[20h];\nint 0FFh\u7684\u4e2d\u65ad\u5411\u91cf\u4fdd\u5b58\u5728dword ptr 0:[3FCh];\n
    * BIOS\u4f1a\u5b8c\u6210\u90e8\u5206\u4e2d\u65ad\u5411\u91cf\u7684\u586b\u5199, \u5982int 10h\u3001int 16h\u3001int 13h\u8fd9\u51e0\u4e2aBIOS\u4e2d\u65ad\u7684\u5411\u91cf\u5728DOS\u542f\u52a8\u524d\u5c31\u5df2\u7ecf\u586b\u597d\u4e86 * DOS\u542f\u52a8\u5b8c\u6210\u540e\uff0c\u4f1a\u586b\u5165int 21h\u7684\u4e2d\u65ad\u5411\u91cf\u3002

    1000:2000 mov ah, 2\n1000:2002 mov dl, 'A'\n1000:2004 int 21h\n1000:2006 mov ah,4Ch\n
    * \u4e0a\u9762\u8fd9\u6761int 21h\u6307\u4ee4\u6267\u884c\u65f6, cpu\u505a\u4e86\u4ee5\u4e0b4\u4ef6\u4e8b:
    IF=0\nTF=0  -\u9632\u6b62\u4e2d\u65ad\u91cc\u518d\u6b21\u4ea7\u751f\u4e2d\u65ad\npushf\npush cs\u53731000h\npush \u4e0b\u6761\u6307\u4ee4\u7684\u504f\u79fb\u5730\u5740\u53732006h\njmp dword ptr 0:[84h]; jmp 1234h:5678h\n\n\u4e0a\u9762\u8fd9\u6761jmp\u4f1a\u8df3\u8f6c\u5230int 21h\u7684\u4e2d\u65ad\u670d\u52a1\u51fd\u6570\u5185\u90e8:\n1234:5678  ...\n             ...\n1234:56FF  iret; \u4e2d\u65ad\u8fd4\u56de\niret\u5728\u6267\u884c\u65f6, cpu\u505a\u4e86\u4ee5\u4e0b3\u4ef6\u4e8b\u60c5:\npop ip\u5373ip=2006h\npop cs\u5373cs=1000h\npopf\n\n1000:2000 call 1234:5678; \u8fdc\u8c03\u7528\n;\u6b64\u65f6\u4f1apush 1000h \u518d push 2005h\n;\u6700\u540ejmp 1234:5678\n1000:2005 mov ah, 4Ch\n1000:2007 int 21h\n...\n1234:5678 ...\n            retf; \u6b64\u65f6\u6267\u884cpop ip\u518dpop cs\n

    \u4e2d\u65ad\u7a0b\u5e8f\u4f8b\u5b50

    code segment\nassume cs:code\nold_80h dw 0, 0\nmain:\n   xor ax, ax\n   mov es, ax\n   mov bx, 80h*4; mov bx, 200h\n   mov ax, es:[bx]\n   mov old_80h[0], ax\n   mov ax, es:[bx+2]\n   mov old_80h[2], ax\n\n   mov word ptr es:[bx], offset int_80h\n   mov es:[bx+2], cs\n\n   mov ah, 1\n   int 80h; AL=\u952e\u76d8\u8f93\u5165\u7684ASCII\u7801\nnext:\n   mov ah, 2\n   mov dl, al\n   int 80h\n\n   mov ax, old_80h[0]\n   mov es:[bx], ax\n   mov ax, old_80h[2]\n   mov es:[bx+2], ax\n\n   mov ah, 4Ch\n   int 21h\nint_80h: ; ISR(Interrupt Service Routine)\n         ; \u4e2d\u65ad\u670d\u52a1\u51fd\u6570\n   cmp ah, 1\n   je is_1\nis_2:\n   push es\n   push bx\n   push ax\n   mov bx, 0B800h\n   mov es, bx\n   mov byte ptr es:[160], dl\n   mov byte ptr es:[161], 17h\n   pop ax\n   pop bx\n   pop es\n   jmp done\nis_1:\n   int 21h\ndone:\n   iret\n   ;\u5982\u679c\u60f3\u63a5\u8fde\u6267\u884cold int80\uff1ajmp dword ptr cs:[old_80h]\n\ncode ends\nend main\n

    "},{"location":"assembly/%E5%87%BD%E6%95%B0/","title":"\u51fd\u6570","text":""},{"location":"assembly/%E5%87%BD%E6%95%B0/#_1","title":"\u6c47\u7f16\u8bed\u8a00\u4e2d\u7684\u4e09\u79cd\u53c2\u6570\u4f20\u9012\u65b9\u5f0f","text":""},{"location":"assembly/%E5%87%BD%E6%95%B0/#_2","title":"\u5bc4\u5b58\u5668\u4f20\u9012","text":"
    f:\n   add ax, ax; ax=2*ax\n   ret        ; \u8fd4\u56de\u65f6ax\u5c31\u662f\u51fd\u6570\u503c\nmain:\n   mov ax, 3; ax\u5c31\u662ff()\u7684\u53c2\u6570\n   call f\nnext:\n   mov ah, 4Ch\n   int 21h\n
    "},{"location":"assembly/%E5%87%BD%E6%95%B0/#_3","title":"\u53d8\u91cf\u4f20\u9012","text":"

    f:\n   mov ax, var\n   add ax, ax; ax\u5c31\u662f\u51fd\u6570\u503c\n   ret\nmain:\n   mov var, 3\n   ; var\u662f\u4e00\u4e2a16\u4f4d\u7684\u53d8\u91cf, \u7528\u4f5c\u53c2\u6570\uff0cvar\u5fc5\u987b\u662f\u5168\u5c40\u53d8\u91cf\n   call f\n
    * \u5728\u6c47\u7f16\u8bed\u8a00\u4e2d\uff0c\u7528\u00a0db\u3001dw\u7b49\u5173\u952e\u8bcd\u5b9a\u4e49\u7684\u53d8\u91cf\u5747\u4e3a\u5168\u5c40\u53d8\u91cf\u00a0\u3002\u5728\u5806\u6808\u4e2d\u5b9a\u4e49\u7684\u53d8\u91cf\u624d\u662f\u5c40\u90e8\u53d8\u91cf\u3002 * var\u4e0d\u80fd\u7528\u4e8e\u9012\u5f52\u51fd\u6570\u5185--\u6bcf\u4e00\u5c42\u53d8\u91cf\u5730\u5740\u5404\u4e0d\u76f8\u540c\uff0c\u5168\u5c40\u53d8\u91cf\u7684\u8bdd\u6c38\u8fdc\u662f\u540c\u4e00\u4e2a\u5730\u5740\uff0c\u6240\u4ee5\u4e0d\u80fd\u7528\u6765\u4f20\u9012\u9012\u5f52\u51fd\u6570\u7684\u53c2\u6570

    "},{"location":"assembly/%E5%87%BD%E6%95%B0/#_4","title":"\u5806\u6808\u4f20\u9012","text":"

    f:\n   push bp\n   mov bp, sp\n   mov ax, [bp+4]; \u4ece\u5806\u6808\u4e2d\u53d6\u5f97\u53c2\u6570\n   add ax, ax\n   pop bp\n   ret\nmain:\n   mov ax, 3\n   push ax; \u53c2\u6570\u538b\u5165\u5230\u5806\u6808\n   call f\n   add sp, 2\n
    * C\u8bed\u8a00\u51fd\u6570\u8c03\u7528y=f(2,3)\u6c42\u4e24\u6570\u4e4b\u548c\u8f6c\u5316\u6210\u6c47\u7f16\u8bed\u8a00 * \u8bbess=1000h sp=2000h
    f:\n   push bp;(4)\n   mov bp, sp\n   mov ax, [bp+4]\n   add ax, [bp+6]\n   pop bp; (5)\n   ret; (6)  pop ip\nmain:\n   mov ax, 3\n   push ax; (1)\n   mov ax, 2\n   push ax; (2)\n   call f; (3) \n   ;call\u4f1a\u628af\u6307\u4ee4\u7684\u4e0b\u4e00\u6761\u7684\u5730\u5740\uff08here\uff09\u538b\u5165\u5806\u6808 \u7136\u540e\u518djmpf\nhere:\n   add sp, 4;(7);\u5806\u6808\u6062\u590d\u5e73\u8861\n
    * \u4e0a\u8ff0\u7a0b\u5e8f\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u7684\u5806\u6808\u5e03\u5c40\u5982\u4e0b:stack frame
    ss:1FF8 old bp <- bp (4)\nss:1FFA here <- (3)(5)\nss:1FFC 02   <- (2)(6)\nss:1FFE 03   <- (1)\nss:2000 ??   <- (7)\n
    * printf\u51fd\u6570\u539f\u578b
    #include <stdio.h>\ndouble f(char *s, ...)\n{  double y=0;\n   char *p = (char *)&s; /* p = bp+4 */\n   p += sizeof(s); /* p = bp+6 */\n   while(*s != '\\0')\n   {\n      if(*s == 'i')\n      {\n         y += *(int *)p;\n         p += sizeof(int);\n      }\n      else if(*s == 'l')\n      {\n         y += *(long*)p;\n         p += sizeof(long);\n      }\n      else if(*s == 'd')\n      {\n         y += *(double *)p;\n         p += sizeof(double);\n      }\n      s++;\n   }\n   return y;\n}\nmain()\n{\n   double y;\n   y = f(\"ild\", 10, 20L, 3.14);\n   printf(\"y=%lf\\n\", y);\n}\n
    * call far ptr dest retf
    1000:2000 call 1234:5678  ;\u8de8\u6bb5\u8df3\u8fdc\ncpu\u4f1a\u505a\u4e00\u4e0b\u52a8\u4f5c\uff1a\n[1]push cs\n[2]push 2005h\n[3]jmp 1234:5678h\n;\u4e00\u5b9a\u5148\u538b\u5165\u6bb5\u5730\u5740\uff0c\u518d\u538b\u5165\u504f\u79fb\u5730\u5740  WHY?5.18\u6700\u540e\u4e00\u6bb5\n1000:2005 mov ah,4Ch\n1234:5678 ...\n1234:5688 retf\ncpu \u5728retf\u65f6\u4f1a\u505a\u4ee5\u4e0b\u52a8\u4f5c\n[1]pop ip;\n[2]pop cs;\n

    "},{"location":"assembly/%E5%87%BD%E6%95%B0/#3","title":"\u7528\u5806\u6808\u4f20\u9012\u53c2\u6570\u67093\u79cd\u65b9\u5f0f:","text":""},{"location":"assembly/%E5%87%BD%E6%95%B0/#__cdecl","title":"__cdecl","text":"
    • \u53c2\u6570\u4ece\u53f3\u5230\u5de6\u987a\u5e8f\u538b\u5165\u5806\u6808\uff0c\u7531\u8c03\u7528\u8005\u6e05\u7406\u5806\u6808\u662fC\u8bed\u8a00\u53c2\u6570\u4f20\u9012\u89c4\u8303\u3002

      __cdecl\u7684\u4f8b\u5b50:

      f:\npush bp; (4)\nmov bp, sp\nmov ax, [bp+4]; arg0\nadd ax, [bp+6]; arg1\npop bp; (5)\nret; (6)\nmain:\nmov ax, 20; arg1\npush ax; (1)\nmov ax, 10; arg0\npush ax; (2)\ncall f; (3)\nhere:\nadd sp, 4; (7)\n

    • __cdecl\u5806\u6808\u5e03\u5c40:
      ss:1FF8 old bp -> bp (4)\nss:1FFA here -> (3)(5)\nss:1FFC 10 -> (2)(6)\nss:1FFE 20 -> (1)\nss:2000    -> (7)\n
    "},{"location":"assembly/%E5%87%BD%E6%95%B0/#__pascal","title":"__pascal","text":"
    • \u53c2\u6570\u4ece\u5de6\u5230\u53f3\u987a\u5e8f\u538b\u5165\u5806\u6808\uff0c\u7531\u88ab\u8c03\u7528\u8005\u6e05\u7406\u5806\u6808\u662fPascal\u8bed\u8a00\u53c2\u6570\u4f20\u9012\u89c4\u8303\u3002

      __pascal\u7684\u4f8b\u5b50\uff1a

      f:\npush bp; (4)\nmov bp, sp\nmov ax, [bp+6]; arg0\nadd ax, [bp+4]; arg1\npop bp; (5)\nret 4; (6)\nmain: \nmov ax, 10\npush ax; (1) arg0\nmov ax, 20\npush ax; (2) arg1\ncall f; (3)\nhere: \n

    • __pascal\u7684\u5806\u6808\u5e03\u5c40:
      ss:1FF8 old bp<- bp (4)\nss:1FFA here <- (3)(5)\nss:1FFC 20 <- (2)\nss:1FFE 10 <- (1)\nss:2000    <-(6)\n

      ret 4: [1]pop ip [2]sp=sp+4

    "},{"location":"assembly/%E5%87%BD%E6%95%B0/#__stdcall","title":"__stdcall","text":"
    • \u53c2\u6570\u4ece\u53f3\u5230\u5de6\u987a\u5e8f\u538b\u5165\u5806\u6808\uff0c\u7531\u88ab\u8c03\u7528\u8005\u6e05\u7406\u5806\u6808\u662fWindows API\u51fd\u6570\u7684\u53c2\u6570\u4f20\u9012\u89c4\u8303\u3002

      __stdcall\u7684\u4f8b\u5b50\uff1a

      f:\npush bp; (4)\nmov bp, sp\nmov ax, [bp+4]; arg0\nadd ax, [bp+6]; arg1\npop bp; (5)\nret 4; (6)\nmain:\nmov ax, 20\npush ax; (1) arg1\nmov ax, 10\npush ax; (2) arg0\ncall f; (3)\nhere: \n

    __stdcall\u7684\u5806\u6808\u5e03\u5c40:

    ss:1FF8 old bp<- bp (4)\nss:1FFA here <- (3)(5)\nss:1FFC 10 <- (2)\nss:1FFE 20 <- (1)\nss:2000    <-(6)\n
    * 32\u4f4d__stdcall\u7684\u4f8b\u5b50:
    f:\npush ebp;(4)\nmov ebp, esp\nmov eax,[ebp+8];arg0\nadd eax,[ebp+0Ch];arg1\npop ebp;(5)\nret 8;(6)\nmain:\npush 20;(1) arg1\npush 10;(2) arg0\ncall f;(3)\nhere:\n
    * 32\u4f4d__stdcall\u7684\u5806\u6808\u5e03\u5c40:
    ss:1FF0 old ebp<- ebp (4)\nss:1FF4 here <- (3)(5)\nss:1FF8 10 <- (2)\nss:1FFC 20 <- (1)\nss:2000    <-(6)\n

    "},{"location":"assembly/%E5%87%BD%E6%95%B0/#_5","title":"\u52a8\u6001\u53d8\u91cf","text":"
    int f(int a, int b)\n{\n   int c; /* c\u662f\u5c40\u90e8\u52a8\u6001\u53d8\u91cf */\n   c = a+b;\n   return c;\n}\n

    \u4e0a\u8ff0C\u8bed\u8a00\u51fd\u6570\u53ef\u7ffb\u8bd1\u6210\u4ee5\u4e0b\u6c47\u7f16\u4ee3\u7801:

    f:\npush bp; (4)\nmov bp, sp\nsub sp, 2; (5) \u8fd9\u91cc\u6316\u7684\u5751\u5c31\u662f\u7ed9\u53d8\u91cfc\u7684\nmov ax, [bp+4]\nadd ax, [bp+6]\nmov [bp-2], ax\nmov ax, [bp-2]\nmov sp, bp; (6)\u6b64\u65f6\u53d8\u91cfc\u6b7b\u4ea1\npop bp; (7)\nret; (8)\nmain:\nmov ax, 20\npush ax; (1)\nmov ax, 10\npush ax; (2)\ncall f; (3)\nhere:\nadd sp, 4;(9)\u6b64\u65f6\u53c2\u6570a,b\u6b7b\u4ea1\n
    \u6267\u884c\u4e0a\u8ff0\u4ee3\u7801\u65f6, \u5806\u6808\u5e03\u5c40\u5982\u4e0b:
    ss:1FF6 [30] (5) \u53d8\u91cfc\nss:1FF8 old bp<- bp(4)(6)\nss:1FFA here <- (3)(7)\nss:1FFC 10 <- (2)(8)\nss:1FFE 20 <- (1)\nss:2000    <-(9)\n

    "},{"location":"assembly/%E5%87%BD%E6%95%B0/#cbp-bx-si-di","title":"C\u8bed\u8a00\u51fd\u6570\u4e2d\u9700\u8981\u4fdd\u62a4bp, bx, si, di","text":"
    • C\u8bed\u8a00\u7684\u51fd\u6570\u91cc\u9762\u9664\u4e86\u4e0d\u80fd\u7834\u574fbp\u5916\uff0c\u8fd8\u8981\u4fdd\u62a4bx,si,di\u7684\u503c:
      f:\npush bp\nmov bp, sp\nsub sp, n; \u5176\u4e2dn\u4e00\u4e2a\u5e38\u6570,\u7528\u6765\u4e3a\u52a8\u6001\u53d8\u91cf\u5206\u914d\u7a7a\u95f4\n           \u5148\u6316\u5751\u518dpush\npush bx\npush si\npush di\n...\npop di\npop si\npop bx\nmov sp, bp\npop bp\nret\n
    • \u5982\u679c\u6ca1\u6709push bp --- \u591a\u5c42\u8c03\u7528\u4f1a\u51fa\u95ee\u9898\uff1amain\u8c03\u7528f f\u8c03\u7528g \u8fd9\u65f6g->f->main\u56de\u4e0d\u53bb
    "},{"location":"assembly/%E5%87%BD%E6%95%B0/#_6","title":"\u9012\u5f52","text":"
    int f(int n)\n{\n   if(n==1)\n      return 1;\n   return n+f(n-1);\n}\n

    \u4e0a\u8ff0C\u8bed\u8a00\u9012\u5f52\u51fd\u6570\u53ef\u7ffb\u8bd1\u6210\u4ee5\u4e0b\u6c47\u7f16\u4ee3\u7801:

    f:\n    push bp;(3)(6)(9)\n    mov bp, sp\n    mov ax, [bp+4]\n    cmp ax, 1\n    je done\n    dec ax\n    push ax;(4)(7)\n    call f;(5)(8)\nthere:\n    add sp, 2;(12)(15)\n    add ax, [bp+4]\ndone:\n    pop bp;(10)(13)(16)\n    ret;(11)(14)(17)\nmain:\n    mov ax, 3\n    push ax;(1)\n    call f;(2)\n    here:\n    add sp, 2;(18)\n
    \u6267\u884c\u4e0a\u8ff0\u4ee3\u7801\u65f6\u7684\u5806\u6808\u5e03\u5c40\u5982\u4e0b:
    ss:1FEE oldbp<-bp(9)\nss:1FF0 there<-(8)(10)\nss:1FF2 1<-(7)(11)\nss:1FF4 oldbp<-bp(6)12\nss:1FF6 there<-(5)(13)\nss:1FF8 2<-(4)(14)\nss:1FFA oldbp<-bp(3)(15)\nss:1FFC here <-(2)(16)\nss:1FFE 3 <-(1)(17)\nss:2000   <-(18)\n

    "},{"location":"assembly/%E5%9F%BA%E7%A1%80%E6%8C%87%E4%BB%A4/","title":"\u57fa\u7840\u6307\u4ee4","text":""},{"location":"assembly/%E5%9F%BA%E7%A1%80%E6%8C%87%E4%BB%A4/#_1","title":"\u903b\u8f91\u8fd0\u7b97\u548c\u79fb\u4f4d\u6307\u4ee4","text":""},{"location":"assembly/%E5%9F%BA%E7%A1%80%E6%8C%87%E4%BB%A4/#andorxornottest","title":"\u903b\u8f91\u8fd0\u7b97\u6307\u4ee4\uff1aAND\uff0cOR\uff0cXOR\uff0cNOT\uff0cTEST","text":"
    • not:\u5355\u76ee\u8fd0\u7b97\u7b26 not ax =~ax
    • test:\u00a0\u4e22\u5f03\u8fd0\u7b97\u7ed3\u679c\u00a0\uff0c\u4fdd\u7559\u6807\u5fd7\u4f4d\u72b6\u6001\uff1b\u672c\u8d28\u4e0a\u662fand\u6307\u4ee4
      mov ax, 9234h\ntest ax, 8000h; ZF=0, AX=9234h\njnz msb_is_one; most significant bit\u6700\u9ad8\u4f4d\n;test\u548cand\u7684\u5173\u7cfb\u76f8\u5f53\u4e8ecmp\u548csub\u7684\u5173\u7cfb\u3002\n
    • \u5224\u65ad\u67d0\u4e2a\u5bc4\u5b58\u5668\u662f\u5426\u4e3a0\u7684\u51e0\u79cd\u65b9\u6cd5:
      test cl, cl\nor cl, cl\nand cl, cl\nor cl, 0\ncmp cl, 0\n
    "},{"location":"assembly/%E5%9F%BA%E7%A1%80%E6%8C%87%E4%BB%A4/#_2","title":"\u79fb\u4f4d\u6307\u4ee4","text":"
    • shl shr \u903b\u8f91\u5de6\u79fb\u3001\u903b\u8f91\u53f3\u79fb[\u9488\u5bf9\u975e\u7b26\u53f7\u6570]
    • sal sar \u7b97\u672f\u5de6\u79fb\u3001\u7b97\u672f\u53f3\u79fb[\u9488\u5bf9\u7b26\u53f7\u6570]
    • sal=shl \u5747\u53f3\u8fb9\u8865\u96f6
    • shr\u53f3\u79fb\u65f6\u5de6\u8fb9\u6c38\u8fdc\u8865\u96f6\uff0c\u00a0sar\u53f3\u79fb\u65f6\u5de6\u8fb9\u8865\u4e0a\u5143\u7d20\u7684\u6700\u9ad8\u4f4d\u00a0
      mov ah, 1011 0110B\nrol ah, 1;  AH=0110 1101, CF=1\n;sal: shift arithmetic left \u7b97\u672f\u5de6\u79fb\nmov ah,11111100B;AH=-4\nsar ah,2;AH=11111111 AH=-2\n
    • sar\u5bf9\u8d1f\u6570\u53f3\u79fb\u65f6\u5de6\u8fb9\u8981\u88651
    • rcl: rotate through carry left \u5e26\u8fdb\u4f4d\u5faa\u73af\u5de6\u79fb
    • rcr: rotate through carry right\u5e26\u8fdb\u4f4d\u5faa\u73af\u53f3\u79fb
      mov ah,0B6h\nclc       ;CF=0\nrcl ah,1  ;CF=\u539f\u6765\u6700\u9ad8\u4f4d\u7684\u503c ah\u6700\u5730\u4f4d\u4f1a\u53d8\u6210\u539fCF\u7684\u503c\n          ;ah=01101100 CF=1\n\nmov ah, 0B6h\nstc         ; CF=1\nrcl ah, 1   ; CF=1 AH=1011 0110 \u79fb\u4f4d\u524d\n            ; CF=1 AH=0110 1101 \u79fb\u4f4d\u540e\n\nmov ah, 0B6h\nstc         ; CF=1\nrcr ah, 1   ; AH=1011 0110  CF=1\u79fb\u4f4d\u524d\n            ; AH=1101 1011  CF=0\u79fb\u4f4d\u540e\n\nmov ah,0B6h\nstc\nrcl ah, 1;  CF=1 AH=0110 1101\n           ;dx   ax\n
    • shl, shr, rol, ror, rcl, rcr\u00a0\u6700\u540e\u79fb\u51fa\u53bb\u7684\u90a3\u4e00\u4f4d\u4e00\u5b9a\u5728CF\u4e2d\u3002\u00a0

    \u5047\u5b9a\u8981\u628aAX\u4e2d\u768416\u4f4d\u503c\u8f6c\u5316\u6210\u4e8c\u8fdb\u5236\u8f93\u51fa: * \u89e3\u6cd51:

    mov cx, 16\nnext:\n    shl ax, 1\n    jc is_1\n\nis_0:\n    mov dl, '0'\n    jmp output\n\nis_1:\n    mov dl, '1'\n\noutput:\npush ax\nmov ah, 2\nint 21h\npop ax\ndec cx\njnz next\n
    * \u89e3\u6cd52:
    mov cx, 16\nnext:\nshl ax, 1\nmov dl, '0'\nadc dl, 0\noutput:\npush ax\nmov ah, 2\nint 21h\npop ax\ndec cx\njnz next\n

    "},{"location":"assembly/%E5%9F%BA%E7%A1%80%E6%8C%87%E4%BB%A4/#_3","title":"\u5b57\u7b26\u4e32\u64cd\u4f5c\u6307\u4ee4","text":""},{"location":"assembly/%E5%9F%BA%E7%A1%80%E6%8C%87%E4%BB%A4/#movsbmovswmovsd","title":"\u5b57\u7b26\u4e32\u4f20\u9001\u6307\u4ee4\uff1aMOVSB\uff0cMOVSW\uff0cMOVSD","text":"
    • rep movsb : \u5176\u4e2drep\u8868\u793arepeat\uff0cs\u8868\u793astring\uff0cb\u8868\u793abyte

    • \u5728\u6267\u884c\u6b64\u6307\u4ee4\u524d\u8981\u505a\u4ee5\u4e0b\u51c6\u5907\u5de5\u4f5c\uff1a

    • \u2460ds:si->\u6e90\u5b57\u7b26\u4e32(si\u5c31\u662fsource index)
    • \u2461es:di->\u76ee\u6807\u5b57\u7b26\u4e32(di\u5c31\u662fdestination index)
    • \u2462cx=\u79fb\u52a8\u6b21\u6570
    • \u2463DF=0\u5373\u65b9\u5411\u6807\u5fd7\u8bbe\u6210\u6b63\u65b9\u5411(\u7528\u6307\u4ee4cld)
    • rep movsb\u6240\u505a\u7684\u64cd\u4f5c\u5982\u4e0b:

      again:\nif(cx == 0)\n   goto done;\nbyte ptr es:[di] = byte ptr ds:[si]\nif(df==0)\n{si++; di++;}\nelse\n{si--; di--;}\ncx--\ngoto again\ndone:\n

    • \u4f8b\u5b50: \u8981\u628a\u4ee5\u4e0b\u5de6\u4fa74\u4e2a\u5b57\u8282\u590d\u5236\u5230\u53f3\u4fa7

    1000:0000 'A'        2000:0000  'A'\n1000:0001 'B'        2000:0001  'B'\n1000:0002 'C'        2000:0002  'C'\n1000:0003 00         2000:0003  00\n
    mov ax, 1000h\nmov ds, ax\nmov si, 0      ; mov si, 3\nmov ax, 2000h\nmov es, ax\nmov di, 0      ; mov di, 3\nmov cx, 4\ncld             ; std\nrep movsb\n

    • rep movsw\u7684\u64cd\u4f5c\u8fc7\u7a0b:[word]
      again:\nif(cx == 0)\n   goto done;\nword ptr es:[di] = word ptr ds:[si]\nif(df==0)\n{si+=2; di+=2;}\nelse\n{si-=2; di-=2;}\ncx--\ngoto again\ndone:\n
    • rep movsd\u7684\u64cd\u4f5c\u8fc7\u7a0b:[dword]

      again:\nif(cx == 0)\n   goto done;\ndword ptr es:[di] = dword ptr ds:[si]\nif(df==0)\n{si+=4; di+=4;}\nelse\n{si-=4; di-=4;}\ncx--\ngoto again\ndone:\n

    • \u572832\u4f4d\u7cfb\u7edf\u4e0b, \u5047\u5b9ads:esi->\u6e90\u5185\u5b58\u5757, es:edi->\u76ee\u6807\u5757, DF=0, \u5219\u5f53\u8981\u590d\u5236\u7684\u5b57\u8282\u6570ecx\u4e0d\u662f4\u7684\u500d\u6570\u65f6\uff0c\u53ef\u4ee5\u505a\u5982\u4e0b\u5904\u7406:

      push ecx\nshr ecx, 2\nrep movsd\npop ecx\nand ecx, 3; \u76f8\u5f53\u4e8eecx = ecx % 4\nrep movsb\n

    "},{"location":"assembly/%E5%9F%BA%E7%A1%80%E6%8C%87%E4%BB%A4/#cmpsbcmpswcmpsd","title":"\u5b57\u7b26\u4e32\u6bd4\u8f83\u6307\u4ee4\uff1aCMPSB\uff0cCMPSW\uff0cCMPSD","text":"
    • cmpsb [jz je]

      • \u6bd4\u8f83byte ptr ds:[si]\u4e0ebyte ptr es:[di]
      • \u5f53DF=0\u65f6\uff0csi++\uff0cdi++
      • \u5f53DF=1\u65f6\uff0csi--\uff0cdi--
      • \u81ea\u52a8\u5bf9si di\u66f4\u65b0[\u4e3a\u4e0b\u4e00\u6b21\u79fb\u52a8\u51c6\u5907]
    • repe cmpsb

    • \u82e5\u672c\u6b21\u6bd4\u8f83\u76f8\u7b49\u5219\u7ee7\u7eed\u6bd4\u8f83\u4e0b\u4e00\u4e2a(repeat if equal)

    again:\nif(cx == 0) goto done;\ntemp=byte ptr ds:[si]-byte ptr es:[di]\nold_fl=FL\n\u5f53DF=0\u65f6\uff0csi++\uff0cdi++\n\u5f53DF=1\u65f6\uff0csi--\uff0cdi--\ncx--\nFL=old_fl\nif (ZF==1) goto again\ndone:\n
    * cx!=0 \u4e5f\u53ef\u80fd\u63d0\u524d\u7ed3\u675f\u5faa\u73af * repne cmpsb * \u82e5\u672c\u6b21\u6bd4\u8f83\u4e0d\u7b49\u5219\u7ee7\u7eed\u6bd4\u8f83\u4e0b\u4e00\u4e2a(repeat if not equal)
    again:\nif(cx == 0) goto done;\ntemp=byte ptr ds:[si]-byte ptr es:[di]\nold_fl=FL\n\u5f53DF=0\u65f6\uff0csi++\uff0cdi++\n\u5f53DF=1\u65f6\uff0csi--\uff0cdi--\ncx--\nFL=old_fl\nif (ZF==0) goto again\ndone:\n

    "},{"location":"assembly/%E5%9F%BA%E7%A1%80%E6%8C%87%E4%BB%A4/#scasbscasw-scasd","title":"\u5b57\u7b26\u4e32\u626b\u63cf\u6307\u4ee4\uff1ascasb\uff0cscasw, scasd","text":"
    • scasb:
      cmp al, es:[di]\ndi++; (\u5f53DF=1\u65f6\uff0c\u4e3adi--)\n
    • repne scasb:

      next:\n  if(cx == 0) goto done;\n  cmp al, es:[di]\n      di++; \u5f53DF=1\u65f6\uff0c\u4e3adi--\n      cx--\n  je done\n  goto next\ndone:\n

    • \u4f8b\u5b50: \u5047\u5b9a\u4ece\u5730\u57401000:2000\u5f00\u59cb\u5b58\u653e\u4e00\u4e2a\u5b57\u7b26\u4e32\uff0c\u8bf7\u8ba1\u7b97\u8be5\u5b57\u7b26\u4e32\u7684\u957f\u5ea6\u5e76\u5b58\u653e\u5230CX\u4e2d\u3002\u5047\u5b9a\u5b57\u7b26\u4e32\u4ee5ASCII\u78010\u7ed3\u675f\uff0c\u5b57\u7b26\u4e32\u957f\u5ea6\u4e0d\u5305\u62ec0\u3002

      mov ax, 1000h\nmov es, ax\nmov di, 2000h; ES:DI->\u76ee\u6807\u4e32\nmov cx, 0FFFFh; CX=\u6700\u591a\u627eFFFF\u6b21\nmov al, 0; AL=\u5f85\u627e\u7684\u5b57\u7b26\ncld       ; DF=0\uff0c\u8868\u793a\u6b63\u65b9\u5411\nrepne scasb; again:\nnot cx      ; \u76f8\u5f53\u4e8ecx=FFFF-cx\ndec cx\n;\u4e0a\u8ff0\u4e24\u6761\u6307\u4ee4\u4e5f\u53ef\u4ee5\u66ff\u6362\u6210\u4ee5\u4e0b\u4e24\u6761\u6307\u4ee4:\n;inc cx\n;not cx\n;not cx\u76f8\u5f53\u4e8ecx=FFFF-cx\u00a0\n

    • repe scasb
      • \u5047\u5b9a\u4ece\u5730\u57401000:0000\u8d77\u5b58\u653e\u4ee5\u4e0b\u5b57\u7b26\u4e32\"###ABC\"\uff0c\u73b0\u8981\u6c42\u8df3\u8fc7\u524d\u9762\u7684#\uff0c\u628a\u540e\u9762\u5269\u4f59\u7684\u5168\u90e8\u5b57\u7b26\u590d\u5236\u52302000:0000\u4e2d
      • \u5047\u5b9aes=1000h, di=0, cx=7, \u5219
    mov al, '#'\ncld\nrepe scasb\ndec di; ES:DI->\"ABC\"\ninc cx; CX=4\npush es\npop ds; DS=ES\npush di\npop si; SI=DI\nmov ax, 2000h\nmov es, ax\nmov di, 0\nrep movsb\n
    "},{"location":"assembly/%E5%9F%BA%E7%A1%80%E6%8C%87%E4%BB%A4/#_4","title":"\u5b57\u7b26\u4e32\u64cd\u4f5c\u6307\u4ee4","text":"
    • stosb:
      es:[di] = AL\ndi++; DF=1\u65f6\u4e3adi--\n
    • rep stosb: \u5faa\u73afCX\u6b21stosb
      again:\nif(cx == 0) goto done;\nes:[di] = al\ndi++; \u5f53DF=1\u65f6, \u4e3aDI--\ncx--\ngoto again;\ndone:\n
    memset(void *t,int value,int n);\ndouble x[100];\nmemset(&x,0,sizeof(x))\n
    • lodsb
      al=ds:[si]\nSI++;\u5f53DF=1\u65f6, \u4e3aSI--\n
    • Exercise:
    • \u8bbeds:si-> \"##AB#12#XY\"
    • es:di\u6307\u5411\u4e00\u4e2a\u7a7a\u7684\u6570\u7ec4,
    • CX=11
    • \u901a\u8fc7\u7f16\u7a0b\u8fc7\u6ee4#\u6700\u540e\u4f7f\u5f97es:di ->\"AB12XY\"
    cld\nagain:\n   lodsb ; AL=DS:[SI], SI++\n         ; mov al, ds:[si]\n         ; inc si\n   cmp al, '#'\n   je   next\n   stosb ; ES:[DI]=AL, DI++\n         ; mov es:[di], al\n         ; inc di\nnext:\n   dec cx\n   jnz again\n
    "},{"location":"assembly/%E5%9F%BA%E7%A1%80%E6%8C%87%E4%BB%A4/#c","title":"C\u8bed\u8a00\u5b57\u7b26\u4e32\u51fd\u6570\u8f6c\u6362","text":"
    strlen:\n    push bp\n    mov bp,sp\n    push di\n    push ds\n\n\n    mov di,[bp+4]\n    mov ax,data\n    mov ds,ax\n    mov es,ax\n    mov cx,0FFFFh\n    xor al,al\n    cld\n    repne scasb\n    inc cx\n    not cx\n    mov ax,cx\n\n    pop ds\n    pop di\n    mov sp,bp\n    pop bp\n    ret\n_memcpy:\n    push bp\n    mov bp,sp\n    push es\n    push ds\n    push si\n    push di\n    mov ax,data\n    mov es,ax\n    mov ds,ax\n    mov si,word ptr [bp+6]\n    mov di,word ptr [bp+4]\n    mov cx,word ptr [bp+8]\n    cld\n    rep movsb\n    pop di\n    pop si\n    pop ds\n    pop es\n    mov sp,bp\n    pop bp\n    ret\n_strncpy:\n    push bp\n    mov bp,sp\n    push es\n    push ds\n    push si\n    push di\n    mov si, word ptr [bp+6]\n    mov di,word ptr [bp+4]\n    push si\n    call _strlen\n    pop cx\n    cmp ax,[bp+8]\n    jl tricky_form\n    mov cx,word ptr [bp+8]\n    cld\n    rep movsb\n    tricky_form:\n    mov dx,[bp+8]\n    sub dx,ax\n    mov cx,ax\n    cld\n    rep movsb\n    mov cx,dx\n    mov ax,0\n    cld\n    rep stosb\n    pop di\n    pop si\n    pop ds\n    pop es\n    mov sp,bp\n    pop bp\n    ret\n_memset:\n    push bp\n    mov bp,sp\n    push es\n    push di\n    mov ax,data\n    mov es,ax\n    mov di,[bp+4]\n    mov ax,[bp+6]\n    mov cx,[bp+8]\n    cld\n    rep stosb\n    pop di\n    pop es\n    mov sp,bp\n    pop bp\n    ret\n\n_clrscr:\n    push es\n    push di\n    mov ax,0B800h\n    mov es,ax\n    mov di,0\n    mov ax,0000h\n    mov cx,2000\nagain:\n    mov es:[di],ax\n    add di,2\n    sub cx,1\n    jnz again\n    pop di\n    pop es\n    ret\n
    "},{"location":"assembly/%E5%9F%BA%E7%A1%80%E6%8C%87%E4%BB%A4/#_5","title":"\u63a7\u5236\u8f6c\u79fb\u6307\u4ee4","text":"
    • jmp\u76843\u79cd\u7c7b\u578b \u2460jmp short target ; \u77ed\u8df3 \u2461jmp near ptr target ; \u8fd1\u8df3 \u2462jmp far ptr target ; \u8fdc\u8df3
    • \u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u7f16\u8bd1\u5668\u4f1a\u81ea\u52a8\u5ea6\u91cf\u8df3\u8dc3\u7684\u8ddd\u79bb\uff0c\u56e0\u6b64\u6211\u4eec\u5728 \u5199\u6e90\u7a0b\u5e8f\u7684\u65f6\u5019\u4e0d\u9700\u8981\u52a0\u4e0ashort\u3001near ptr\u3001far ptr\u7b49\u7c7b\u578b\u4fee\u9970\u5373\u4e0a\u8ff0\u4e09\u79cd\u5199\u6cd5\u4e00\u5f8b\u53ef\u4ee5\u7b80\u5316\u4e3ajmp target\u3002
    • \u77ed\u8df3\u6307\u4ee4[only one byte]
    • \u683c\u5f0f jmp + \u504f\u79fb\u5730\u5740\u6216\u6807\u53f7
    • \u4ee5\u4e0b\u6761\u4ef6\u8df3\u8f6c\u6307\u4ee4\u4e5f\u90fd\u5c5e\u4e8e\u77ed\u8df3: jc jnc jo jno js jns jz jnz ja jb jae jbe jg jge jl jle jp jnp
    • \u77ed\u8df3\u6307\u4ee4\u7684\u673a\u5668\u7801
           \u5730\u5740            \u673a\u5668\u7801   \u6c47\u7f16\u6307\u4ee4  \n    1D3E:0090     ...\n    1D3E:00F0\n    1D3E:0100     EB06     jmp  0108h\n    1D3E:0102     B402     mov  ah\uff0c2\n    1D3E:0104     B241     mov  dl, 41h\n    1D3E:0106     CD21     int  21h\n    1D3E:0108     B44C     mov  ah\uff0c4Ch\n    1D3E:010A     CD21     int  21h\n
    • \u77ed\u8df3\u592a\u8fdc\u8df3\u4e0d\u8fc7\u53bb\u7684\u89e3\u51b3\u529e\u6cd5
      cmp ax, bx\n\uff08je  equal; jump out of range\uff09\njne not_equal\njmp equal; \u8fd1\u8df3\nnot_equal:\n...; \u5047\u5b9a\u8fd9\u91cc\u7701\u7565\u6307\u4ee4\u7684\u673a\u5668\u7801\u603b\u957f\u5ea6\u8d85\u8fc77Fh\u5b57\u8282\nequal:\n...\n
    • \u8fd1\u8df3\u6307\u4ee4[two bytes]
    • \u8fd1\u8df3\u6307\u4ee4\u76843\u79cd\u683c\u5f0f
      jmp \u504f\u79fb\u5730\u5740\u6216\u6807\u53f7        ; \u5982jmp 1000h\njmp 16\u4f4d\u5bc4\u5b58\u5668      ; \u5982jmp bx\njmp 16\u4f4d\u53d8\u91cf       ; \u5982jmp word ptr [addr]\n
    • \u8fdc\u8df3\u6307\u4ee4[\u8de8\u6bb5\u8df3\u8dc3]
    • \u8fdc\u8df3\u6307\u4ee4\u76842\u79cd\u683c\u5f0f
      • jmp \u6bb5\u5730\u5740:\u504f\u79fb\u5730\u5740
      • jmp dword ptr 32\u4f4d\u53d8\u91cf
    • \u8fdc\u8df3\u6307\u4ee4\u7684\u673a\u5668\u7801
      • jmp 1234h:5678h; \u673a\u5668\u7801\u4e3a0EAh,78h,56h,34h,12h
    • \u8fdc\u8df3\u6ca1\u6709\u7528\u25b3\uff0c\u800c\u662f\u76f4\u63a5\u5730\u5740.\u8fdc\u8df3\u5230\u67d0\u4e2a\u5e38\u6570\u5730\u5740\u65f6,\u5728\u6e90\u7a0b\u5e8f\u4e2d\u4e0d\u80fd\u76f4\u63a5\u7528jmp\u6307\u4ee4\uff0c\u800c\u5e94\u8be5\u6539\u7528\u673a\u5668\u78010EAh\u5b9a\u4e49\uff0c\u5982:
      db 0EAh\ndw 5678h\ndw 1234h\ndb 0EAh\ndd 0FFFF0000h\n;\u6216 dw 0000h\n;dw 0FFFFh\n;\u4e0a\u8ff03\u884c\u5b9a\u4e49\u5408\u5728\u4e00\u8d77\u8868\u793ajmp 1234h:5678h\n
    • jmp dword ptr 32\u4f4d\u53d8\u91cf\u7684\u7528\u6cd5
      mov word ptr ds:[bx],1234h\nmov word ptr ds:[bx+2],5678h\njmp dword ptr ds:[bx] ;jmp 5678h:1234h\n
      data segment\naddr dw 0000h, 0FFFFh \n;\u6216\u5199\u6210addr dd 0FFFF0000h\ndata ends\ncode segment\nassume cs:code, ds:data\nmain:\nmov ax, data\nmov ds, ax\njmp dword ptr [addr] \n;\u76f8\u5f53\u4e8ejmp FFFF:0000\ncode ends\nend main\n
    "},{"location":"assembly/%E5%9F%BA%E7%A1%80%E6%8C%87%E4%BB%A4/#loop","title":"\u5faa\u73af\u6307\u4ee4\uff1aLOOP","text":"
    • loop dest\u7684\u64cd\u4f5c\u8fc7\u7a0b:
      CX = CX - 1     ; \u5faa\u73af\u6b21\u6570\u51cf1\nif(CX != 0)     ; \u82e5CX\u4e0d\u7b49\u4e8e0\uff0c\u5219\n    goto  dest  ; \u8df3\u8f6c\u81f3dest\n
    • \u4f8b: \u6c421+2+3\u7684\u548c
      mov cx, 3\nnext:\nadd ax, cx; ax +3, +2, +1\nloop next; cx=2, 1, 0\n           ; dec cx\n           ; jnz next  \u5148-1\u518d\u5224\u65ad\n           ;--cx\u521d\u59cb\u503c=0\u65f6\u80fd\u8fbe\u5230\u6700\u5927\u5faa\u73af\u6b21\u6570 10000h\u6b21\n\nmov ax, 0\nmov cx, 0\njcxz done  \u8fd9\u6761\u6307\u4ee4\u53ef\u4ee5\u9632\u6b62cx\u4e3a0\u65f6\u8fdb\u5165\u5faa\u73af\nnext:\nadd ax, cx\nloop next; \u5faa\u73af10000h\u6b21\ndone:\n
    • jecxz \u8868\u793ajump if ecx is zero
    "},{"location":"assembly/%E5%9F%BA%E7%A1%80%E6%8C%87%E4%BB%A4/#call-ret","title":"call, ret\u6307\u4ee4","text":"
    \u8fd1\u8fd4\u56de\uff1aretn\uff0c\u5728\u591a\u6570\u60c5\u51b5\u4e0b\u53ef\u5199\u6210ret\n\u8fdc\u8c03\u7528\uff1acall far ptr dest\n\u8fdc\u8fd4\u56de\uff1aretf\n
    "},{"location":"assembly/%E5%9F%BA%E7%A1%80%E6%8C%87%E4%BB%A4/#movpushpopxchg","title":"\u901a\u7528\u6570\u636e\u4f20\u9001\u6307\u4ee4\uff1aMOV\uff0cPUSH\uff0cPOP\uff0cXCHG","text":"
    • mov byte ptr ds:[bx], byte ptr es:[di]
    • \u9519\u8bef\u539f\u56e0:\u4e24\u4e2a\u64cd\u4f5c\u6570\u4e0d\u80fd\u540c\u65f6\u4e3a\u5185\u5b58\u53d8\u91cf\u4ee5\u4e0b\u4e3a\u6b63\u786e\u5199\u6cd5:
    mov al, es:[di]\nmov ds:[bx], al\n
    eax=12345678h\nebx=89ABCDEFh\nss=1000h\nsp=2000h\n\u73b0\u6267\u884c\u4ee5\u4e0b\u6307\u4ee4:\npush eax;(1)\npush ebx;(2)\npop ebx;(3)\npop eax;(4)\n
    • exchange \u6307\u4ee4
      mov ax,1\nmov bx,2\nxchg ax,bx\nxchg ax,ds:[bx] \u53ef\u4ee5\u4ea4\u6362\u5bc4\u5b58\u5668\u548c\u53d8\u91cf \u4e0d\u5141\u8bb8\u5bf9\u4e24\u4e2a\u53d8\u91cf\u8fdb\u884c\u4ea4\u6362\n
    "},{"location":"assembly/%E5%A0%86%E6%A0%88/","title":"\u5806\u6808","text":""},{"location":"assembly/%E5%A0%86%E6%A0%88/#_1","title":"\u5806\u6808\u6bb5\u7684\u5b9a\u4e49","text":"

    stk segment stack    \u5806\u6808\u53ea\u80fd\u5b9a\u4e49\u4e00\u4e2a\ns db 200h dup ('S');\u4e5f\u53ef\u4ee5\u4e0d\u5b9a\u4e49\u6570\u7ec4\u540d\ndb 200h dup('S')\nstk ends\n
    * assume cs:code,ds:data,ss:stk * \\(mov\\ ah,s[1]\\) \u7f16\u8bd1\u540e\u53d8\u6210 \\(mov\\ ah,stk:[s+1]\\)\u518d\u8f6c\u5316\u6210$mov ah,ss:[1] $ * \u5982\u679c\u5f15\u7528\u6570\u7ec4s\u5fc5\u987b\u52a0\u4e0aassume ss\uff1astk

    "},{"location":"assembly/%E5%A0%86%E6%A0%88/#dos","title":"\u7a0b\u5e8f\u8f7d\u5165\u5185\u5b58\u540e\uff0c\u64cd\u4f5c\u7cfb\u7edfdos\u4f1a\u5bf9\u4e00\u4e0b\u5bc4\u5b58\u5668\u4f5c\u521d\u59cb\u5316\u8d4b\u503c\uff1a","text":"
    • cs=code \u5373\u4e0d\u7528\u624b\u5de5\u7ed9cs\u8d4b\u503c
    • ip=offset main
    • ss=stk
    • sp=200h
    • ds=es=psp\u6bb5\u5740\uff1bpsp\u7a0b\u5e8f\u6bb5\u524d\u7f00\uff08program segment prefix)

      psp\u662f\u4e00\u4e2a\u957f\u5ea6\u4e3a100h\u5b57\u8282\u7684\u5185\u5b58\u5757\uff0c\u4f4d\u4e8e\u5f53\u524d\u7a0b\u5e8f\u9996\u6bb5\u7684\u524d\u9762 psp\u7531\u64cd\u4f5c\u7cfb\u7edf\u5206\u914d\u7ed9\u5f53\u524d\u7a0b\u5e8f\uff0c\u91cc\u9762\u5b58\u653e\u4e86\u4e0e\u8be5exe\u76f8\u5173\u7684\u4e00\u4e9b\u4fe1\u606f\u5982\u547d\u4ee4\u884c\u53c2\u6570\u5373main\uff08\uff09\u7684\u53c2\u6570

      int main(int argc,char *argv[]){  }\nmain.exe  123  xyz\nargv[0]   [1]  [2] \n

    "},{"location":"assembly/%E5%A0%86%E6%A0%88/#sssp","title":"\u5982\u679c\u672a\u5b9a\u4e49\u5806\u6808\uff0c\u90a3\u4e48ss\u548csp\uff1f","text":"

    \u6e90\u7a0b\u5e8f\u4e2d\u6ca1\u6709\u5b9a\u4e49\u5806\u6808\u6bb5\u65f6 ss=\u9996\u6bb5\u7684\u6bb5\u5730\u5740=1000h sp=0 sp-2=FFFE\uff081000\uff1aFFFE\uff09\u2014\u2014\u8fbe\u5230\u6700\u5927\u5806\u6808 \u5c0f\u7aef \u5373push a[0] (1234h)\u5728\u5806\u6808\u91cc\u4ec0\u4e48\u6837\u5b50 34 12 * 9000\uff1aFFFF\u662f\u7528\u6237\u53ef\u7528\u7684last \u5982\u679cpush\u592a\u591a\u4e86 \u53ef\u80fd\u8fdb\u5165code\u6bb5\u672b\u5c3e\uff0c\u5806\u6808\u6ea2\u51fa

    "},{"location":"assembly/%E5%AF%84%E5%AD%98%E5%99%A8/","title":"\u5bc4\u5b58\u5668","text":""},{"location":"assembly/%E5%AF%84%E5%AD%98%E5%99%A8/#_1","title":"\u5bc4\u5b58\u5668\u8be6\u89e3","text":"
    • \u5982\u679c\u672a\u5b9a\u4e49\u5806\u6808\uff0c\u90a3\u4e48ss\u548csp\uff1f

      • \u6e90\u7a0b\u5e8f\u4e2d\u6ca1\u6709\u5b9a\u4e49\u5806\u6808\u6bb5\u65f6
      ss=\u9996\u6bb5\u7684\u6bb5\u5730\u5740=1000h \nsp=0 \nsp-2=FFFE\uff081000\uff1aFFFE\uff09\u2014\u2014\u8fbe\u5230\u6700\u5927\u5806\u6808 \n9000\uff1aFFFF\u662f\u7528\u6237\u53ef\u7528\u7684last \n\u5982\u679cpush\u592a\u591a\u4e86 \u53ef\u80fd\u8fdb\u5165code\u6bb5\u672b\u5c3e\uff0c\u5806\u6808\u6ea2\u51fa\n
    "},{"location":"assembly/%E5%AF%84%E5%AD%98%E5%99%A8/#fl16-9963","title":"FL\u517116\u4f4d, \u4f46\u53ea\u7528\u5176\u4e2d9\u4f4d\uff0c\u8fd99\u4f4d\u5305\u62ec6\u4e2a\u72b6\u6001\u6807\u5fd7\u548c3\u4e2a\u63a7\u5236\u6807\u5fd7\uff0c\u5982\u4e0b\u6240\u793a\uff1a","text":"

    11 10 9 8 7 6 4 2 0

    O DF IF TF SF ZF AF PF CF

    "},{"location":"assembly/%E5%AF%84%E5%AD%98%E5%99%A8/#cf-zf-sf-of-af-pf","title":"CF ZF SF OF AF PF: \u72b6\u6001\u6807\u5fd7","text":"
    • CF: \u8fdb\u4f4d\u6807\u5fd7(carry flag)

      mov ah, 0FFh ;\nadd ah, 1; ah=0, CF=1\u4ea7\u751f\u4e86\u8fdb\u4f4d \nadd ah, 2; ah=2, CF=0 \nsub ah, 3; ah=0FFh, CF=1\u4ea7\u751f\u4e86\u8fdb\u4f4d \n
      • \u79fb\u4f4d\u6307\u4ee4\u4e5f\u4f1a\u5f71\u54cdcf\u503c\uff0c\u6700\u540e\u4e00\u51fa\u53bb\u7684\u90a3\u4e00\u4f4d\u4f1a\u4fdd\u5b58\u5728cf\u5f53\u4e2d
      mov cl,2 shr ah,cl;\u53f3\u79fb\u4e24\u4f4d\uff0ccf=1 \n
      • \u4e0eCF\u76f8\u5173\u7684\u8df3\u8f6c\u6307\u4ee4:

        • jc\u2014\u2014\u6709\u8fdb\u4f4d\u5219\u8df3\u8f6c
        • jnc\u2014\u2014\u65e0\u8fdb\u4f4d\u5219\u8df3\u8f6c
        • adc\u2014\u2014\u5e26\u8fdb\u4f4d\u52a0
        • clc : cf=0
        • stc : cf=1
        • adc ax,bx;ax=ax+bx+cf
        data segment\nabc dw 32767\ndata ends\ncode segment\nassume cs:code,ds:data\nmain:\n    mov ax,data\n    mov ds,ax\n    mov ax,[abc]\n    mov cx,16\nagain:\n    shl ax,1\n    jc is_one\nis_zero:\n    mov dl,'0'\n    jmp out_put\nis_one:\n    mov dl,'1'\nout_put:\n    push ax\n    mov ah,2\n    int 21h\n    pop ax\n    sub cx,1\n    jnz again\nmov ah,4Ch\nint 21h\ncode ends\nend main\n
    • ZF: \u96f6\u6807\u5fd7(zero flag)

      sub ax, ax; AX=0, ZF=1 \nadd ax, 1; AX=1, ZF=0 \nadd ax, 0FFFFh; AX=0, ZF=1, CF=1\n
      • jz is_zero \u4f1a\u53d1\u751f\u8df3\u8f6c, \u56e0\u4e3a\u5f53\u524dZF==1
      • jnz\u6839\u636eZF==0\u4f5c\u51fa\u8df3\u8f6c
      • jz\u7b49\u4ef7je jnz\u7b49\u4ef7jne
      • cmp ax,ax ;ax-ax \u5dee\u503c\u6ca1\u6709\u4fdd\u7559\uff0c\u800c\u662f\u4fdd\u7559\u4e86zf \u5373\u5224\u65ad\u662f\u5426\u60f3\u7b49\u5c31\u662f\u5224\u65ad\u662f\u5426zf=1
    • SF: \u7b26\u53f7\u6807\u5fd7(sign flag)\u8fd0\u7b97\u7ed3\u679c\u7684\u6700\u9ad8\u4f4d

      mov ah, 7Fh add ah, 1; AH=80h=1000 0000B, SF=1\u2014\u2014\u8fd0\u7b97\u7ed3\u679c\u8d1f\u6570 \nsub ah, 1; AH=7Fh=0111 1111B, SF=0\u2014\u2014\u8fd0\u7b97\u7ed3\u679c\u6b63\u6570\n
      • jns \u2014positive;\u4f1a\u53d1\u751f\u8df3\u8f6c, \u56e0\u4e3aSF==0
      • js\u662f\u6839\u636eSF==1\u4f5c\u51fa\u8df3\u8f6c
    • OF: \u6ea2\u51fa\u6807\u5fd7(overflow flag)

      mov ah, 7Fh \nadd ah, 1 ;AH=80h, OF=1, ZF=0, CF=0, SF=1 \nmov ah, 80h add ah, 0FFh; AH=7Fh, OF=1, ZF=0, CF=1, SF=0 \nmov ah, 80h sub ah, 1; AH=7Fh, OF=1, ZF=0, CF=0, SF=0 \n
      • OF\u4e5f\u6709\u4e24\u6761\u76f8\u5173\u7684\u6307\u4ee4: jo, jno
      mov ab,81h ;ah=10000001B \nshl ah,1 ah=00000010B;0F=1,CF=1 \nonly one-bit shift\u4f1a\u5f71\u54cdOF\n
    • PF(Parity Flag)\u5947\u5076\u6807\u5fd7

      mov ah, 4 add ah, 1; AH=0000 0101B, PF=1\u8868\u793a\u6709\u5076\u6570\u4e2a1 \nmov ax, 0101h add ax, 0004h; AX=0105h=0000 0001 0000 0101B \n; PF=1\u53ea\u7edf\u8ba1\u4f4e8\u4f4d\u4e2d1\u7684\u4e2a\u6570 \u8981\u662f\u4f4e8\u4f4d\u4e2d1\u7684\u4e2a\u6570\u662f\u5947\u6570\u65f6\uff0cPF=0 \n
      • jp(\u5f53PF==1\u65f6\u5219\u8df3)
      • jnp(\u5f53PF==0\u65f6\u5219\u8df3)
      • jp\u4e5f\u53ef\u4ee5\u5199\u6210jpe(jump if parity even)
      • jnp\u4e5f\u53ef\u4ee5\u5199\u6210jpo(jump if parity odd)

      \u5047\u5b9a\u8981\u53d1\u9001\u5b57\u7b26\u2019C\u2019=0100 0011B, \u73b0\u5047\u5b9a\u4f4e7\u4f4d\u4e3a\u6570\u636e\u4f4d \u6700\u9ad8\u4f4d\u4e3a\u6821\u9a8c\u4f4d\u3002\u90a3\u4e48\u6821\u9a8c\u4f4d\u7684\u8ba1\u7b97\u65b9\u6cd5\u67092\u79cd:

      (1) \u5947\u6821\u9a8c: \u6570\u636e\u4f4d+\u6821\u9a8c\u4f4d\u5408\u8d77\u6765\uff0c1\u7684\u4e2a\u6570\u5fc5\u987b\u662f\u5947\u6570

      (2) \u5076\u6821\u9a8c: \u6570\u636e\u4f4d+\u6821\u9a8c\u4f4d\u5408\u8d77\u6765\uff0c1\u7684\u4e2a\u6570\u5fc5\u987b\u662f\u5076\u6570

      \u73b0\u5728\u6211\u4eec\u91c7\u7528\u5076\u6821\u9a8c\u6765\u53d1\u9001\u2019C\u2019,\u90a3\u4e48\u6821\u9a8c\u4f4d\u5fc5\u987b\u7b49\u4e8e1,\u5373\u5b9e\u9645\u8981\u53d1\u9001\u76848\u4f4d\u4e8c\u8fdb\u5236\u503c\u4e3a1100 0011B \u5bf9\u65b9\u63a5\u6536\u8fd98\u4f4d\u503c\u5e76\u4fdd\u5b58\u5728\u5bc4\u5b58\u5668AL\u4e2d, \u63a5\u4e0b\u53bb\u53ef\u4ee5\u6267\u884c\u5982\u4e0b\u4ee3\u7801\u6765\u9a8c\u8bc1AL\u4e2d\u7684\u503c\u662f\u5426\u6709\u9519:

      or al, al\njnp error; if(PF==0) goto error\n good:\n ...\n error:\n ...\n
    • AF(Auxiliary Flag) \u8f85\u52a9\u8fdb\u4f4d\u6807\u5fd7

      • \u4f4e4\u4f4d\u5411\u9ad84\u4f4d\u4ea7\u751f\u8fdb\u4f4d\u6216\u501f\u4f4d

        mov ah, 1Fh ; 0001 1111\nadd ah, 1 ; ah=20h, AF=1\n
      • AF\u8ddfBCD(Binary Coded Decimal)\u7801\u6709\u5173

    "},{"location":"assembly/%E5%AF%84%E5%AD%98%E5%99%A8/#df-tf-if","title":"DF TF IF: \u63a7\u5236\u6807\u5fd7","text":"
    • DF:direction flag

    • TF:trace/trap flag

    • IF:interrupt flag

    • DF(Direction Flag)\u65b9\u5411\u6807\u5fd7: \u63a7\u5236\u5b57\u7b26\u4e32\u7684\u64cd\u4f5c\u65b9\u5411

      • \u5f53DF=0\u65f6\u4e3a\u6b63\u65b9\u5411(\u4f4e\u5730\u5740\u5230\u9ad8\u5730\u5740)\uff0c\u5f53DF=1\u662f\u53cd\u65b9\u5411\u3002
      • \u82e5\u6e90\u6570\u636e\u9996\u5730\u5740>\u76ee\u6807\u6570\u636e\u9996\u5730\u5740\uff0c\u5219\u590d\u5236\u65f6\u8981\u6309\u6b63\u65b9\u5411(\u4ece\u4f4e\u5730\u5740\u5230\u9ad8\u5730\u5740)\uff1b
      • \u82e5\u6e90\u6570\u636e\u9996\u5730\u5740<\u76ee\u6807\u6570\u636e\u9996\u5730\u5740\uff0c\u5219\u590d\u5236\u65f6\u8981\u6309\u53cd\u65b9\u5411(\u4ece\u9ad8\u5730\u5740\u5230\u4f4e\u5730\u5740)\uff1b
      • strcpy(target, source); \u6c38\u8fdc\u6309\u6b63\u65b9\u5411\u590d\u5236
      • memcpy(target, source, n);\u6c38\u8fdc\u6309\u6b63\u65b9\u5411\u590d\u5236
      • memmove(target, source, n); \u80fd\u6b63\u786e\u5904\u7406\u90e8\u5206\u91cd\u53e0
      • \u67092\u6761\u6307\u4ee4\u53ef\u4ee5\u8bbe\u7f6eDF\u7684\u503c: cld\u4f7fDF=0, \u5b57\u7b26\u4e32\u590d\u5236\u6309\u6b63\u65b9\u5411 std\u4f7fDF=1, \u5b57\u7b26\u4e32\u590d\u5236\u6309\u53cd\u65b9\u5411
        data segment:\ns db \"ABC123xyz\",0\nt db 10 dup(0)\ndata ends\ncode segment:\nassume cs:code,ds:data\nmain:\n    mov ax,data\n    mov ds,ax\n    mov es,ax\n    mov si,offset s+9\n    mov di,offset t+9\n    mov cx,10\n    std\n    rep movsb ;memcpy(es:di,ds:si,cx)\ndone:\n    mov ah,4Ch\n    int 21h\ncode ends\nend main\n\n\u6ce8\uff1arep movsb\nagain:\n    cmp cx,0\n    je done\n    mov al,ds[si]\n    mov es:[di],al\n    inc si/dec si\n    inc di/dec di\n    dec cx\n    jmp again\n
    • IF\uff08Interrupt Flag\uff09\u4e2d\u65ad\u6807\u5fd7

      • \u5f53IF=1\u65f6,\u5141\u8bb8\u4e2d\u65ad;\u5426\u5219\u7981\u6b62\u4e2d\u65ad
      • cli\u6307\u4ee4\u4f7fIF=0\u8868\u793a\u5173/\u7981\u6b62\u786c\u4ef6\u4e2d\u65ad
      • sti\u6307\u4ee4\u4f7fIF=1\u8868\u793a\u5f00/\u5141\u8bb8\u786c\u4ef6\u4e2d\u65ad
      • int nh \u4fdd\u5b58\u57284xn
      mov ax, 0 \nmov bx, 1 \nadd ax, bx \n
      • \u6b64\u65f6\u82e5\u7528\u6237\u6572\u952e,\u5219CPU\u4f1a\u5728\u6b64\u5904\u63d2\u5165\u4e00\u6761int 9h\u6307\u4ee4\u5e76\u6267\u884c\u5b83
      • int 9h\u7684\u529f\u80fd\u662f\u8bfb\u952e\u76d8\u7f16\u7801\u5e76\u4fdd\u5b58\u5230\u952e\u76d8\u7f13\u51b2\u533a\u4e2d(\u9690\u85cf)\u786c\u4ef6\u4e2d\u65ad
      • \u53d1\u8d77\u8005\u662f\u4e8b\u4ef6\uff0c\u533a\u522b\u4e8e\u7a0b\u5e8f\u5458\u4e3b\u52a8\u7684\u8f6f\u4ef6\u4e2d\u65ad

      \u65f6\u949f\u6bcf\u96941/18\u5999\u4f1a\u4ea7\u751f\u4e00\u4e2a\u4e2d\u65ad\u8bf7\u6c42 \u82e5\u7a0b\u5e8f\u5df2\u8fd0\u884c\u4e861/18\u79d2,\u5219cpu\u4f1a\u5728\u6b64\u5904\u63d2\u5165\u4e00\u6761int 8h\u6307\u4ee4\u5e76\u6267\u884c\uff08count++\uff09

      • \u7528cli\u548csti\u628a\u4e00\u6bb5\u4ee3\u7801\u5305\u56f4\u8d77\u6765\u53ef\u4ee5\u8fbe\u5230\u8be5\u6bb5\u4ee3\u7801\u5728 \u6267\u884c\u8fc7\u7a0b\u4e2d\u4e0d\u4f1a\u88ab\u6253\u65ad\u7684\u6548\u679c:
        • cli clear interrupt\u7981\u6b62\u786c\u4ef6\u4e2d\u65ad
        • \u91cd\u8981\u4ee3\u7801
        • sti set interrupt\u5141\u8bb8\u786c\u4ef6\u4e2d\u65ad
    • TF\uff08Trace/Trap Flag\uff09\u8ddf\u8e2a/\u9677\u9631\u6807\u5fd7

      • \u5f53TF=1\u65f6,CPU\u4f1a\u8fdb\u5165\u5355\u6b65\u6a21\u5f0f(single-step mode)\u3002
      • \u5f53TF=1\u65f6,CPU\u5728\u6bcf\u6267\u884c\u5b8c\u4e00\u6761\u6307\u4ee4\u540e,\u4f1a\u81ea\u52a8\u5728\u8be5\u6761\u6307\u4ee4\u4e0e\u4e0b\u6761\u6307\u4ee4\u4e4b\u95f4\u63d2\u5165\u4e00\u6761int 1h\u6307\u4ee4\u5e76\u6267\u884c\u5b83\u3002
      • \u5229\u7528\u5355\u6b65\u6a21\u5f0f\u53ef\u4ee5\u5b9e\u73b0\u53cd\u8c03\u8bd5,\u6f14\u793a\u4ee3\u7801\u89c1\u4ee5\u4e0b\u94fe\u63a5: http://cc.zju.edu.cn/bhh/antidbg.zip

      • bp\u7684\u9690\u542b\u6bb5\u5730\u5740\u662fss\u300c\u7528\u4ee5\u4ee3\u66ffsp\uff0c\u53ef\u83b7\u5f97\u5806\u6808\u4e2d\u7684\u5185\u5bb9\u300f

      • anti-debug \u4f8b\u5b50\uff1a
    code segment\nassume cs:code,ds:data\nmain:\n    jmp begin\nold1h dw 0,0\nprev_addr dw offset first,code  \n[\u6bb5\u5730\u5740+\u504f\u79fb\u5730\u5740\uff1a2x16\u4f4d]\n[\u5982\uff1aA0 00:00 01 \u662f\u4e00\u4e2a\u5730\u5740]\nbegin:\n    push cs\n    pop ds\n    xor ax,ax\n    mov es,ax  ;es=0\n    mov bx,4   ;bx=4 es:[bx]->int1h \u7684\u4e2d\u65ad\u5411\u91cf(\u8be5\u51fd\u6570\u7684\u9996\u5730\u5740) \u5176\u4e2d\u524d16\u4f4d\u5b58\u653e\u504f\u79fb\u5730\u57400:[4]\uff0c\u540e16\u4f4d\u5b58\u653e\u6bb5\u5730\u57400:[6]\n    push es:[bx]\n    pop old1h[0]\n    push es:[bx+2]\n    pop old1h[2]\n    mov word ptr es:[bx],offset int1h\n    mov word ptr es:[bx+2],cs\n    pushf   [save old FL \u628aflag\u538b\u5165\u5806\u6808]\n    pushf   [\u4e3a\u4e86\u4e4b\u540e\u518d\u628aTF\u6539\u62100][and ax,0FEFFh]\n    pop ax  [\u4e0d\u53ef\u7528mov ax,fl \u5373fl\u548cip\u552f\u4e8c\u4e0d\u80fd\u88ab\u5f15\u7528\u7684\u5bc4\u5b58\u5668]\n    or ax,100h [\u5c06TF\u6539\u62101]\uff01TF=1\n    push ax\n    popf    [FL=AX]\nfirst:\n    nop  \n    \u5f53\u67d0\u6307\u4ee4\u6267\u884c\u524dTF=1 \u5219\u8be5\u6307\u4ee4\u6267\u884c\u4e4b\u540e\u624d\u4f1a\u81ea\u52a8\u6267\u884cint01h\u5355\u6b65\u4e2d\u65ad\nsingle\u2014\u2014step_begin:\n\n[first int 1h] \nint1h\u53d1\u751f\u7684\u65f6\u5019 cpu\u4f1a\u505a\u4ee5\u4e0b\u7684\u52a8\u4f5c\uff1a\npushf      \u5c06flag\u538b\u5165\u5806\u6808\npush cs    \u5c06\u4e0b\u4e00\u6761\u6307\u4ee4\u7684\u6bb5\u5730\u5740\u538b\u5165\u5806\u6808\npush offset back \u5c06\u4e0b\u4e00\u6761\u6307\u4ee4\u7684\u504f\u79fb\u5730\u5740\u538b\u5165\u5806\u6808 <- ss:sp\njmp dword ptr 0:[4]\u8fdb\u5165\u51fd\u6570int1h\n\nback:\n    xor ax,ax\n    mov cx,3\nnext\uff1a\n    add ax,cx  ;\u5df2\u89e3\u5bc6\n    nop\n    loop next\n    popf\n    nop\nsingle_step_end:\n    push old1h[0]\n    pop es:[bx]\n    push old1h[2]\n    pop es:[bx+2]\n    mov ah,4Ch\n    int 21h\nint1h:\n    push bp\n    mov bp,sp\n    push bx\n    push es\n    mov bx,cs:prev_addr[0]\n    mov es,cs:prev_addr[2]\n    inc byte ptr es:[bx]\n    mov bx,[bp+2]\n    mov es,[bp+4]\n    dec byte ptr es:[bx]\n    mov cs:prev_addr[0],bx\n    mov cs:prev_addr[2],es \n    pop es\n    pop bx\n    pop bp\n    iret[\u4e2d\u65ad\u8fd4\u56de cpu\u4f1a\u6267\u884cpop ip \uff0cpop cs\uff0cpopf]\ncode ends\nend main\n
    "},{"location":"assembly/%E6%98%BE%E5%8D%A1%E8%BE%93%E5%87%BA/","title":"\u663e\u5361\u8f93\u51fa","text":""},{"location":"assembly/%E6%98%BE%E5%8D%A1%E8%BE%93%E5%87%BA/#_1","title":"\u663e\u5361\u8f93\u51fa","text":"
    • 7\u2014white 4-red
    0000\u2014\u2014black\n0001-blue\n0010-green\n0100-red\n0011(BLue and green)\n
    • \u6700\u53f3\u8fb9\u4e00\u4f4d\u8868\u793a\u52a0\u5f3a\u8272
    • (x,y)\u5750\u6807\u5bf9\u5e94\u7684\u663e\u5361\u504f\u79fb\u5730\u5740=\uff08y*80+x\uff09\u00d72 \uff0880\u00d725\u7684\u5c4f\u5e55\u5c3a\u5bf8\uff09
    • \u6ce8\u660e\uff1a\u4e5f\u5c31\u662f\u8bf4\u663e\u5361\uff0c\u4e00\u884c160\u4e2a\u5b57\u8282\uff1a
    • \u4e00\u822c\u4e00\u4e2a\u663e\u793a\u4f7f\u7528\u4e24\u4e2a\u5b57\u8282
    • \u7b2c\u4e00\u4e2a\u50a8\u5b58\u8f93\u51fa\uff0c\u7b2c\u4e8c\u4e2a\u50a8\u5b58\u989c\u8272
    code segment\nassume cs:code\nmain:\n  mov ax,0B800h\n  mov ds,ax\n  mov di,0\n  mov al,'A'\n  mov ah,17h\n  mov cx,2000\nagain:\n  mov ds:[di],ax\n  mov bx,800h\n\nwait_wait:\n  mov dx,0\nwait_a_while:\n  sub dx,1\n  jnz wait_a_while\n  sub bx,1\n  jnz wait_a_while;1000h\u4e58\u4ee5800h\n\n  mov word ptr ds:[di],0020h ;00\u9ed1\u8272\n  add di,2\n  sub cx,1\n  jnz again\n\n  mov ah,1\n  int 21h   (\u7528\u6237\u6572\u952e\u76d8\u518d\u7ed3\u675f)\n  mov ah ,4Ch\n  int 21h\n\ncode ends\nend main\n
    "},{"location":"assembly/%E6%98%BE%E5%8D%A1%E8%BE%93%E5%87%BA/#_2","title":"\u5185\u5b58\u6620\u5c04","text":"
    • B800:0000
    • \u6587\u672c\u6a21\u5f0f\u4e0b\u7684\u663e\u5361\u5730\u5740 A000:0000\u662f\u56fe\u5f62\u6a21\u5f0f\u4e0b\u7684\u663e\u5361\u5730\u5740
    • dos\u53ca\u7528\u6237\u7a0b\u5e8f\u5360\u7528\u8fd9\u5757\u5185\u5b58\uff0c\u603b\u957f\u4e3a640KB

      1000:0000~1000:FFFF\n\u2026\u2026\n9000:0000~9000:FFFF\n

    • A000:0000~A000:FFFF

    • (x,y)\u5750\u6807\u5bf9\u5e94\u7684\u663e\u5361\u504f\u79fb\u5730\u5740=y*320+x
    • B000:0000~B000:7FFF
      mov ah,0  set video mode\nmov al,13h  13\u53f7 320*200\nint 10h\n
    • int10h \u5207\u6362\u5230320 * 200 * 256\u8272\u56fe\u5f62\u6a21\u5f0f\uff08\u4e5f\u53ef\u4ee5\u8f93\u51fa\u6587\u672c 40x25 \uff09\uff080\u884c0\u5217\uff09
    • al=12h \u5207\u6362\u5230640 * 480 16 \u8272\u56fe\u5f62\u6a21\u5f0f > 640 480 \u8de8\u6bb5\uff0c\u8fd9\u4e2a\u65f6\u5019\u4e0d\u662f\u7528\u4e00\u4e2a\u5b57\u8282\u63a7\u5236\u4e00\u4e2a\u70b9\uff0c\u800c\u662f\u4e00\u4e2abit\u63a7\u5236\u4e00\u4e2a\u70b9 \uff0c\u7528\u56db\u4e2a\u5e73\u9762\u53e0\u8d77\u6765\uff0c\u63a7\u523616\u79cd\u989c\u8272

      code segment\nassume cs:code\nmain:\n  jmp begin\ni dw 0\nbegin:\n  mov ah,00h\n  mov al,13h\n  int 10h\n  mov ax,0A000h\n  mov es,ax\n  mov di,(100-20)*320+(160-20)\n  mov [i],41  \u4e00\u517141\u884c\nnext_row:\n  ;push cx\n  push di\n  mov al,4 ;color=red\n  mov cx,41\nnext_dot:\n  mov es:[di],al\n  add di,1\n  sub cx,1\n  jnz next_dot\n  pop di\n  add di,320\n  sub [i],1\n  jnz next_row\n  mov ah,1\n  int 21h\n\n  mov ah,00h\n  mov al,03h;80*25\u7684\u6587\u672c\u6a21\u5f0f\n  int 10h\n  mov ah ,4Ch\n  int 21h\ncode ends\nend main\n
    • Applications

      \u7a0b\u5e8f \u753b\u6c49\u5b57\n\ndata segment:\nhz db 04h,08h,0Eh,0A0h,78h,80h,08h,90h,\u2026\u202610h,0Ch\ndata ends\ncode segment:\nassume cs:code,ds:data\nmain:\n    mov ax,data\n    mov ds,ax\n    mov ax,0A000h\n    mov es,ax\n    mov di,0\n    mov ax,0013h\n    int 10h\n    mov dx,16\n    mov si,0\nnext_row:\n    mov ah,hz[si]\n    mov al,hz[si+1]\n    add si,2\n    mov cx,16\ncheck_next_dot:\n    shl ax,1\n    jnc no_dot\nis_dot:\n    mov byte ptr es:[di],0Ch\nno_dot:\n    add di,1\n    sub cx,1\n    jnz check_next_dot\n    sub di,16\n    add di,320\n    sub dx,1\n    jnz next_row\n    mov ah,1\n    int 21h\n    mov ax,0003h\n    int 10h;\u56de\u523080*25\u6587\u672c\u6a21\u5f0f\n    mov ah,4Ch\n    int 21h\ncode ends\nend main\n

    • \u5185\u5b58\u6620\u5c04
    • A000:0000-A000\uff1aFFFF B000:0000-B700:FFFF B800:0000~B800:7FFF \u6620\u5c04\u5230\u663e\u5361\u5185\u5b58
    • C000:0000C000:FFFF \u2026\u2026 F000:0000F000:FFFF \u6620\u5c04\u5230ROM
    • \u6620\u5c04\u65f6\u5728\u7535\u8111\u6267\u884cROM\u4e2dPOST\u4ee3\u7801\u8fc7\u7a0b\u4e2d\u5b8c\u6210\u7684;ROM\u4e2d\u8fd8\u5305\u62ecBIOS\u4ee3\u7801
    • \u5982int10h\u4ee5\u53caint16h\u51fd\u6570\u96c6\u5c31\u5b9a\u4e49\u5728BIOS\u4e2d
    "},{"location":"assembly/%E7%AB%AF%E5%8F%A3/","title":"\u7aef\u53e3","text":""},{"location":"assembly/%E7%AB%AF%E5%8F%A3/#_1","title":"\u7aef\u53e3","text":"
    • CPU <\u2014> \u7aef\u53e3(port) <\u2014> I/O\u8bbe\u5907

    • \u7aef\u53e3\u7f16\u53f7\u5c31\u662f\u7aef\u53e3\u5730\u5740\u3002\u7aef\u53e3\u5730\u5740\u7684\u8303\u56f4\u662f\uff1a[0000h, 0FFFFh]\uff0c\u517165536\u4e2a\u7aef\u53e3

    • \u5bf9\u7aef\u53e3\u64cd\u4f5c\u4f7f\u7528\u6307\u4ee4in\u4e0eout\u5b9e\u73b0\u3002

    "},{"location":"assembly/%E7%AB%AF%E5%8F%A3/#_2","title":"\u952e\u76d8\u901a\u4fe1","text":"
    • \u901a\u8fc760h\u53f7\u7aef\u53e3\uff0cCPU\u4e0e\u952e\u76d8\u4e4b\u95f4\u53ef\u4ee5\u5efa\u7acb\u901a\u8baf\u3002
    • in al, 60h\u4ece\u7aef\u53e360h\u8bfb\u53d6\u4e00\u4e2a\u5b57\u8282\u5e76\u5b58\u653e\u5230AL\u4e2d
    "},{"location":"assembly/%E7%AB%AF%E5%8F%A3/#_3","title":"\u65f6\u949f","text":"
    • 70h\u53ca71h\u7aef\u53e3\u4e0ecmos\u5185\u90e8\u7684\u65f6\u949f\u6709\u5173\u3002
    • 70h\u00a0\u5730\u5740\u7aef\u53e3\u00a0 71h\u00a0\u6570\u636e\u7aef\u53e3
    • \u5176\u4e2dcmos\u4e2d\u7684\u5730\u57404\u30012\u30010\u4e2d\u5206\u522b\u4fdd\u5b58\u4e86\u5f53\u524d\u7684\u65f6\u3001\u5206\u3001\u79d2\uff0c\u5e76\u4e14\u683c\u5f0f\u5747\u4e3aBCD\u7801\u3002
    mov al,2\nout 70h,al \u544a\u8bc9cmos\u63a5\u4e0b\u6765\u8981\u53bb\u8bbf\u95ee\u5b83\u76842\u53f7\u5185\u5b58\u5355\u5143\nin al,71h  \u8bfb\u53d6cmos\u4e2d2\u53f7\u5355\u5143\u7684\u503c\uff08\u5206\u949f\uff09\nmov al, 4\nout 70h, al\nmov al, 23h\nout 71h, al; \u628acmos4\u53f7\u5355\u5143\u5373\u5c0f\u65f6\u7684\u503c\u6539\u621023\u70b9\n
    "},{"location":"note/basicII/","title":"Basic data Structures II","text":""},{"location":"note/basicII/#graphs","title":"Graphs","text":""},{"location":"note/basicII/#some-defs","title":"Some defs","text":"
    • Complete graphs

    \\(Undirected \\ V=n \\ \\ \\ \\ E=C_n^2=\\frac{n(n-1)}{2}\\)

    \\(Directed \\ V=n \\ \\ \\ \\ E=2*C_n^2=n(n-1)\\)

    • Adjacent

    \\(Undirected \\ : (v_i,v_j)\\ is \\ incident \\ on\\ v_i\\ and\\ v_j\\)

    \\(Directed \\ : v_i \\ is\\ adjacent\\ to \\ v_j \\ \\ \\ \\ \\ v_j \\ is\\ adjacent\\ from \\ v_i\\)

    • Subgraph

    • Simple Path

    • Connected

    \\(Undirected:\\) An undirected graph G is connected if every pair of distinct \\(v_i\\) and \\(v_j\\) are connected

    • A tree = a graph that is connected and acyclic.

    \\(Directed:\\)

    Strongly connected directed graph G = for every pair of \\(v_i\\) and \\(v_j\\) in V( G ), there exist directed paths from \\(v_i\\) to \\(v_j\\) and from \\(v_j\\) to \\(v_i\\).

    If the graph is connected without direction to the edges, then it is said to be weakly connected

    Strongly connected component : the maximal subgraph that is strongly connected

    • A DAG = a directed acyclic graph.
    • Degree: Number of edges incident to v.
    • For a directed G, we have in-degree and out-degree.

    • \\(r=v-e+2\\)

    "},{"location":"note/basicII/#representation-of-graphs","title":"Representation of Graphs","text":""},{"location":"note/basicII/#adjacency-matrix","title":"Adjacency Matrix","text":"

    \\(adj_- mat[i][j]=\\left\\{\\begin{array}{l} 1 \\ if (v_i,v_j) \\ or <v_i,v_j> \\in E(G)\\\\0\\ \\ otherwise \\end{array}\\right.\\)

    If G is undirected the matrix is symmetric,thus sorting only half of the matrix

    The trick is to store the matrix as a 1-D array: adj_mat [ $n(n+1)/2 $] = \\({ a_{11}, a_{21}, a_{22}, ..., a_{n1}, ..., a_{nn} }\\)

    The index for \\(a_{ij}\\) is \\(i( i - 1 )/2+j\\).

    \\(\\begin{align*}degree(i) &= \\sum_{j=0}^{n-1}adj_-mat[i][j] \\ (If\\ G\\ is\\ undirected)\\\\ & \\ \\ +\\sum_{j=0}^{n-1}adj_-mat[j][i]\\ (If\\ G\\ is\\ directed)\\end{align*}\\)

    "},{"location":"note/basicII/#adjacency-lists","title":"Adjacency Lists","text":"
    • Undirected

    Degree( \\(i\\) ) = number of nodes in graph[ \\(i\\) ] (if \\(G\\) is undirected).

    T of examine (whether complete) E(G) = O( n + e )

    • Directed

    A. Add inverse adjacency lists

    B.Multilists

    "},{"location":"note/basicII/#adjacency-multilist","title":"Adjacency Multilist","text":"
    • The space taken :\\((n+2e)\\) ptrs + \\(2e\\) ints and \u201cmark\u201d is not counted.
    • Sometimes we need to mark the edge after examine it,and then find the next edge.This representation makesit easy to do so.
    "},{"location":"note/basicII/#topological-sort","title":"Topological Sort","text":""},{"location":"note/basicII/#aov-network","title":"AOV Network","text":"

    Digraph G in which V( G ) represents activities ( e.g. the courses ) and E( G ) represents precedence relations

    • i is a predecessor of j \\(:\\) there is a path from i to j.
    • i is an immediate predecessor of j \\(:\\) \\(< i, j >\\in E( G )\\) then \\(j\\) is called a successor ( immediate successor ) of i.
    • Partial order \\(:\\) a precedence relation which is both transitive and irreflexive.

    If the precedence relation is reflexive, then there must be an i such that i is a predecessor of i.

    That is, i must be done before i is started. Therefore if a project is feasible, it must be irreflexive.

    • Feasible AOV network must be a dag (directed acyclic graph).
    "},{"location":"note/basicII/#topological-order","title":"topological order","text":"

    A topological order is a linear ordering of the vertices of a graph such that, for any two vertices, i, j, if i is a predecessor of j in the network then i precedes j in the linear ordering.

    • Test an AOV for feasibility, and generate a topological order if possible.

    • Method One \\(T=O(|V|^2)\\)

    void Topsort( Graph G )\n{   int  Counter;\n    Vertex  V, W;\n    for ( Counter = 0; Counter < NumVertex; Counter ++ ) {\n        V = FindNewVertexOfDegreeZero( );\n        if ( V == NotAVertex ) {\n        Error ( \u201cGraph has a cycle\u201d );   break;  }\n        TopNum[ V ] = Counter; /* or output V */\n        for ( each W adjacent to V )\n            Indegree[ W ] \u2013 \u2013 ;\n    }\n}\n
    • Method Two. \\(T = O( |V| + |E| )\\)
    void Topsort( Graph G )\n{   Queue  Q;\n    int  Counter = 0;\n    Vertex  V, W;\n    Q = CreateQueue( NumVertex );  MakeEmpty( Q );\n    for ( each vertex V )\n    if ( Indegree[ V ] == 0 )   Enqueue( V, Q );\n    while ( !IsEmpty( Q ) ) {\n    V = Dequeue( Q );\n    TopNum[ V ] = ++ Counter; /* assign next */\n    for ( each W adjacent to V )\n        if ( \u2013 \u2013 Indegree[ W ] == 0 )  Enqueue( W, Q );\n    }  /* end-while */\n    if ( Counter != NumVertex )\n    Error( \u201cGraph has a cycle\u201d );\n    DisposeQueue( Q ); /* free memory */\n}\n
    "},{"location":"note/basicII/#midterm-review","title":"Midterm Review","text":"

    Which of the following statements is TRUE about topological sorting? (5\u5206)

    • If a graph has a topological sequence, then its adjacency matrix must be triangular.
    • If the adjacency matrix is triangular, then the corresponding directed graph must have a unique topological sequence.
    • In a DAG, if for any pair of distinct vertices Vi and Vj, there is a path either from Vi to Vj or from Vj to Vi, then the DAG must have a unique topological sequence.
    • If Vi precedes Vj in a topological sequence, then there must be a path from Vi to Vj.

    3 is true

    "},{"location":"note/basicII/#shortest-path-problem","title":"Shortest Path Problem","text":""},{"location":"note/basicII/#1single-source-shortest-path-problem","title":"1.Single-Source Shortest Path Problem","text":"
    • Unweighted Shortest Path
    void unweighted(Table T){\n    int CurrDist;\n    Vertex V,W;\n     for(CurrDist=0;CurrDist<NumVertex;CurrDist++){\n      for(each vertex V){      \n        if(!T[V].Known&&T[V].Dust==CurrDist){\n          R[V].Known=true;\n          for(each W adjacent to V){\n            if(T[W].Dist==infinity){\n              T[W].Dist=CurrDist+1;\n                T[E].Path=V;\n            }\n          }\n        }\n      }\n    }\n}\n

    But the time complexity is \\(O(|V|^2)\\)

    • Note: If V is unknown yet has \\(Dist < Infinity\\),then Dist is either \\(CurrDist\\) or \\(CurrDist +1\\)(Remember Tree?)

    Improvement

    void unweighted (Table T){\n  Queue Q;\n  Vertex V,W;\n  Q=CreateQueue(NumVertex);MakeEmpty(Q);\n  Enqueue(S,Q);\n  while(!isEmpty(Q)){\n    V=Dequeue(Q);\n    T[V].known=true;//not really necessary\n    for(each W adjacent to V){\n      if(T[W].Dist==Infinity){\n        T[W].Dist=T[V].Dist+1;\n        T[W].Path=V;\n        ENqueue(W,Q)\n      }\n    }\n  }\n  DisposeQueue(Q);\n}\n
    • \\(T=O(|V|+|E|)\\)
    "},{"location":"note/basicII/#dijkstras-algorithmfor-weighted-shortest-paths","title":"Dijkstra's Algorithm(for weighted shortest paths)","text":"
    void Dijkstra(Table T){\n  //T is initialized by Figure 9.30 on p 303\n  Vertex V,W;\n  for(;;){\n    V=smallest unknown distance vertex;\n    if(V==NotAVertex){break;}\n    T[V].known=true;\n    for(each W adjacent to V){\n      if(!T[W].Known){\n        if(T[V].Dist+Cvw<T[W].Dist){\n          Decrease(T[W].Dist to T[V].Dist+Cvw);\n          T[W].Path=V\n        }\n      }\n    }\n  }\n}\n
    • Implementation 1

    \\(T = O( |V|^2 + |E| )\\)

    • Initialization: The initialization phase involves traversing all vertices, setting their distances to infinity, and setting the initial vertex's distance to 0. The time complexity of this step is O(V), where V is the number of vertices.

    • Main Loop: The number of iterations in the main loop depends on the number of vertices. In each iteration, the algorithm selects the smallest unknown distance vertex V and then traverses all vertices W adjacent to V. For each W, it checks if there is a shorter path through V to W, and if so, it updates the distance of W.

      The time complexity of this step is \\(O(V^2)\\), as, for each vertex V, all vertices adjacent to V are considered.

    • Finding the Minimum Distance Vertex: In the main loop, the algorithm needs to find the smallest unknown distance vertex V. The time complexity of this step is O(V^2), as it needs to check the distance of each vertex.

    In summary, the time complexity of the Dijkstra algorithm is \\(O(V^2)\\).

    • Implementation 2

    • V = smallest unknown distance vertex: Keep distances in a priority queue and call DeleteMin \u2013 \\(O(log|V|)\\)

    • Decrease( T[ W ].Dist to T[ V ].Dist + Cvw )

      • Method 1: DecreaseKey \u2013 \\(O(log|V|)\\)

      \\(T = O( |V|log|V|+|E|log|V|)=O(|E|log|V|)\\) ----Good if the graph is sparse

      • Method 2: insert \\(W\\) with updated Dist into the priority queue.

      Must keep doing DeleteMin until an unknown vertex emerges

      \\(T = O(|E| log|V| )\\) but requires \\(|E|\\) DeleteMin with \\(|E|\\) space

    "},{"location":"note/basicII/#graphs-with-negative-edge-costs","title":"Graphs with Negative Edge Costs","text":"
    • Why don\u2019t we simply add a constant to each edge and thus remove negative edges? --Path with different count of PATHS!
    void  WeightedNegative( Table T )\n{   Queue  Q;\n    Vertex  V, W;\n    Q = CreateQueue (NumVertex );  MakeEmpty( Q );\n    Enqueue( S, Q ); /* Enqueue the source vertex */\n    while (!IsEmpty(Q)){\n      V=Dequeue(Q);/* each vertex can dequeue at most |V| times */\n      for(each W adjacent to V){\n        if ( T[ V ].Dist + Cvw < T[ W ].Dist ){/* no longer once per edge */\n            T[ W ].Dist = T[ V ].Dist + Cvw;\n            T[ W ].Path = V;\n            if(W is not already in Q){Enqueue(W,Q)}\n        }/* end-if update */                                              \n      }\n    }/* end-while */\n    DisposeQueue( Q ); /* free memory */\n}\n
    "},{"location":"note/basicII/#acyclic-graphs","title":"Acyclic Graphs","text":"

    If the graph is acyclic, vertices may be selected in topological order since when a vertex is selected, its distance can no longer be lowered without any incoming edges from unknown nodes.

    \\(T=O(|E| + |V|)\\) and no priority queue is needed.

    Application: AOE ( Activity On Edge ) Networks \u2014\u2014 scheduling a project

    "},{"location":"note/basicII/#all-pairs-shortest-path-problem","title":"All-pairs Shortest path problem","text":""},{"location":"note/basicII/#network-flow-problem","title":"Network Flow Problem","text":""},{"location":"note/basicII/#ford-fulkerson-algorithm","title":"Ford-Fulkerson Algorithm","text":"
    • If the edge capabilities are rational numbers, this algorithm always terminate with a maximum flow.

    • The algorithm works for G with cycles as well.

    Analysis

    "},{"location":"note/basicII/#1an-augmenting-path-can-be-found-by-an-unweighted-shortest-path-algorithm","title":"1.An augmenting path can be found by an unweighted shortest path algorithm.","text":"

    \\(T = O( f\\cdot|E| )\\) where f is the maximum flow.

    "},{"location":"note/basicII/#2always-choose-the-augmenting-path-that-allows-the-largest-increase-in-flow","title":"2.always choose the augmenting path that allows the largest increase in flow.","text":"

    \\(\u300cmodify\\ Dijkstra\u2019s\\ algorithm\\ \u300d\\)

    \\(\\begin{align*}T&=T_{argmentation}*T_{find\\ a\\ path}\\\\ &=O(E)log(cap_{max})*O(|E|log|V|)\\\\ &= O( |E|^2log|V|).\\end{align*}\\) if capmax is a small integer

    "},{"location":"note/basicII/#3always-choose-the-augmenting-path-that-has-the-least-number-of-edges","title":"3.Always choose the augmenting path that has the least number of edges.","text":"

    Simple \\(BSF\\) Unweighted shortest path algorithm

    \\(\\begin{align*}T&=T_{argmentation}*T_{find\\ a\\ path}\\\\ &=O(E)*O(|E||V|)\\\\ &= O( |E|^2|V|).\\end{align*}\\)

    • If every v \\(\\notin\\) { s, t } has either a single incoming edge of capacity 1 or a single outgoing edge of capacity 1, then time bound is reduced to \\(O( |E| |V|^{1/2} )\\).
    • The min-cost flow problem is to find, among all maximum flows, the one flow of minimum cost provided that each edge has a cost per unit of flow.
    "},{"location":"note/basicII/#minimum-spanning-tree","title":"Minimum Spanning Tree","text":"
    • A spanning tree of a graph G is a tree which consists of \\(V( G )\\) and a subset of \\(E( G )\\)
    • The minimum spanning tree is a tree since it is acyclic -- the number of edges is |V| \u2013 1.
    • It is minimum for the total cost of edges is minimized.
    • It is spanning because it covers every vertex.
    • A minimum spanning tree exists iff G is connected.
    • Adding a non-tree edge to a spanning tree, we obtain a cycle.
    "},{"location":"note/basicII/#algorithm","title":"Algorithm","text":"

    (1) we must use only edges within the graph

    (2) we must use exactly |V| -1 edges

    (3) we may not use edges that would produce a cycle.

    "},{"location":"note/basicII/#1prims-algorithm-grow-a-tree","title":"1.Prim\u2019s Algorithm \u2013 grow a tree","text":""},{"location":"note/basicII/#2krukals-algorithm-grow-a-tree","title":"2.Krukal\u2019s Algorithm \u2013 grow a tree","text":"
    void Kruskal ( Graph G )\n{   T = { } ;\n    while  ( T contains less than |V| - 1 edges \n                   && E is not empty ) {\n        choose a least cost edge (v, w) from E ; /* Delete Min */\n        delete (v, w) from E ;\n        if  ( (v, w) does not create a cycle in T )     /Union Find/\n    add (v, w) to T ;*\n        else     \n    discard (v, w) ;\n    }\n    if  ( T contains fewer than |V| - 1 edges )\n        Error ( \u201cNo spanning tree\u201d ) ;\n}\n
    "},{"location":"note/basicII/#applications-of-depth-first-search","title":"Applications of Depth-First Search","text":"
    void DFS ( Vertex V )  /* this is only a template */\n{   visited[ V ] = true;  /* mark this vertex to avoid cycles */\n    for ( each W adjacent to V )\n        if ( !visited[ W ] )\n    DFS( W );\n} \n/* T = O( |E| + |V| ) as long as adjacency lists are used */\n
    "},{"location":"note/basicII/#biconnectivity","title":"Biconnectivity","text":"
    • v is an articulation point if G\u2019 = DeleteVertex( G, v ) has at least 2 connected components.
    • G is a biconnected graph if G is connected and has no articulation points.
    • A biconnected component is a maximal biconnected subgraph.
    "},{"location":"note/basicII/#find-the-biconected-components-of-a-connected-undirected-graph-g","title":"find the biconected components of a connected undirected graph G","text":""},{"location":"note/basicII/#directed-case","title":"Directed case","text":"

    Refert to https://www.baeldung.com/cs/scc-tarjans-algorithm

    A directed graph is strongly connected if there is a path between all pairs of vertices. A strongly connected component (SCC) of a directed graph is a maximal strongly connected subgraph.

    • DFS search produces a DFS tree/forest
    • Strongly Connected Components form subtrees of the DFS tree.
    • If we can find the head of such subtrees, we can print/store all the nodes in that subtree (including the head) and that will be one SCC.
    • There is no back edge from one SCC to another (There can be cross edges, but cross edges will not be used while processing the graph).

    • Case1 (Tree Edge): If node v is not visited already, then after the DFS of v is complete, a minimum of low[u] and low[v] will be updated to low[u]. low[u] = min(low[u], low[v])

    • Case 2 (Back Edge): When child v is already visited, then a minimum of low[u] and Disc[v] will be updated to low[u]. low[u] = min(low[u], disc[v]);
    "},{"location":"note/basicII/#euler-circuit","title":"Euler Circuit","text":"
    • \u6b27\u62c9\u56de\u8def\uff08Euler circuit\uff09\u4e3a\u5305\u542b\u6240\u6709\u8fb9\u7684\u7b80\u5355\u73af\uff0c\u6b27\u62c9\u8def\u5f84\uff08Euler path\uff09\u4e3a\u5305\u542b\u6240\u6709\u8fb9\u7684\u7b80\u5355\u8def\u5f84
    • \u65e0\u5411\u56fe
    • \u65e0\u5411\u56fe G \u6709\u6b27\u62c9\u56de\u8def\u5f53\u4e14\u4ec5\u5f53 G \u662f\u8fde\u901a\u7684\u4e14\u6bcf\u4e2a\u9876\u70b9\u7684\u5ea6\u6570\u90fd\u662f\u5076\u6570
    • \u65e0\u5411\u56fe G \u6709\u6b27\u62c9\u8def\u5f84\u5f53\u4e14\u4ec5\u5f53 G \u662f\u8fde\u901a\u7684\u4e14\u6709\u4e14\u4ec5\u6709\u4e24\u4e2a\u9876\u70b9\u7684\u5ea6\u6570\u662f\u5947\u6570
    • \u6709\u5411\u56fe
    • \u6709\u5411\u56fe G \u6709\u6b27\u62c9\u56de\u8def\u5f53\u4e14\u4ec5\u5f53 G \u662f\u5f31\u8fde\u901a\u7684\u4e14\u6bcf\u4e2a\u9876\u70b9\u7684\u51fa\u5ea6\u7b49\u4e8e\u5165\u5ea6
    • \u6709\u5411\u56fe G \u6709\u6b27\u62c9\u8def\u5f84\u5f53\u4e14\u4ec5\u5f53 G \u662f\u5f31\u8fde\u901a\u7684\u4e14\u6709\u4e14\u4ec5\u6709\u4e00\u4e2a\u9876\u70b9\u7684\u51fa\u5ea6\u6bd4\u5165\u5ea6\u5927 1\uff0c\u6709\u4e14\u4ec5\u6709\u4e00\u4e2a\u9876\u70b9\u7684\u5165\u5ea6\u6bd4\u51fa\u5ea6\u5927 1\uff0c\u5176\u4f59\u9876\u70b9\u7684\u51fa\u5ea6\u7b49\u4e8e\u5165\u5ea6
    "},{"location":"note/basicII/#dfs","title":"DFS","text":"
    • The path should be maintained as a linked list.
    • For each adjacency list, maintain a pointer to the last edge scanned.
    • T = \\(O( |E| + |V| )\\)
    #include <iostream>\n#include <cstring>\nusing namespace std;\nconst int maxn = 1005;  // \u5047\u8bbe\u6700\u5927\u8282\u70b9\u6570\u4e3a1005\nint G[maxn][maxn];      // \u90bb\u63a5\u77e9\u9635\u8868\u793a\u56fe\nint deg[maxn];          // \u8282\u70b9\u7684\u5ea6\nint ans[maxn];          // \u5b58\u50a8\u7ed3\u679c\u7684\u6570\u7ec4\nint ansi = 0;           // \u7ed3\u679c\u6570\u7ec4\u7684\u7d22\u5f15\nbool visited[maxn];     // \u6807\u8bb0\u8282\u70b9\u662f\u5426\u88ab\u8bbf\u95ee\u8fc7\nvoid dfs(int x) {\n    for (int y = 1; y <= maxn; ++y) {\n        if (G[x][y]) {\n            G[x][y] = G[y][x] = 0;\n            dfs(y);\n        }\n    }\n    ans[++ansi] = x;\n}\nint main() {\n    // ... \u8bfb\u53d6\u8f93\u5165\uff0c\u521d\u59cb\u5316 G \u548c deg\n    int cnt = 0, root = 0;\n    for (int i = 1; i <= maxn; ++i) {\n        if (deg[i] % 2) {\n            cnt++;\n            if (!root) root = i;\n        }\n    }\n    if (!root) {\n        for (int i = 1; i <= maxn; ++i) {\n            if (deg[i]) {\n                root = i; break;\n            }\n        }\n    }\n    if (cnt && cnt != 2) {\n        cout << \"No Solution\\n\";\n        return 0;\n    }\n    dfs(root);\n    // \u8f93\u51fa\u7ed3\u679c\n    for (int i = ansi; i > 0; --i) {\n        cout << ans[i] << ' ';}\n    cout << '\\n';\n    return 0;\n}\n
    "},{"location":"note/basicII/#hamilton-cycle","title":"Hamilton cycle","text":""},{"location":"note/hash/","title":"HASHING","text":""},{"location":"note/hash/#interpolation-search","title":"Interpolation Search","text":"

    Interpolation Search is a searching algorithm used to find a specific element in a sorted array. Similar to binary search, it employs a divide-and-conquer strategy, but it differs by estimating the probable position of the target value based on the distribution of the search key and array elements at each step.

    The algorithm proceeds as follows:

    1. Assume the array is sorted.

    2. Calculate the interpolation position using the formula:

    \\(position=low+\u230a\\frac{(high\u2212low)\u00d7(key\u2212arr[low])}{arr[high]\u2212arr[low]\u230b}\\)

    Here, \\(arr\\) is the array, and \\(low\\) and \\(high\\) are the array indices, while \\(key\\) is the element to be searched.

    1. If \\(arr[position]=key\\), the target element is found, and the position positionposition is returned.

    2. If \\(arr[position]<key\\), continue the search in the right half by updating \\(low=position+1\\)

    3. If \\(arr[position]>key\\), continue the search in the left half by updating \\(high=position\u22121\\)

    4. Repeat steps 2 to 5 until the target element is found or \\(low>high\\).

    Interpolation Search excels when dealing with uniformly distributed sorted arrays, as it efficiently estimates the target element's position, reducing the number of search iterations. However, its effectiveness relies on the assumption of a roughly uniform distribution of array elements. In cases of uneven data distribution, other search algorithms may outperform Interpolation Search. Binary search, for instance, could be more stable as it is less sensitive to the distribution of array elements.

    "},{"location":"note/hash/#hash-tables","title":"Hash Tables","text":"

    https://www.geeksforgeeks.org/hashing-data-structure/#introduction

    • Without overflow,\\(T_{search} = T_{insert} = T_{delete} = O( 1 )\\)
    "},{"location":"note/hash/#hash-functions","title":"Hash Functions","text":"

    For numbers\uff1a

    \uff081\uff09\u6c42\u4f59\u6cd5

    \uff082\uff09\u5e73\u65b9\u53d6\u4e2d

    \uff083\uff09\u6298\u53e0\u6cd5

    \uff084\uff09\u6570\u5b57\u5206\u6790\u6cd5

    • Eg. To Hash \"Strings\"

    \\(f(x)=(\\sum x[N-i-1]*32^i)\\%TableSize\\)

    Index Hash3( const char *x, int TableSize ) {\n    unsigned  int  HashVal = 0; \n/* 1*/  while( *x != '\\0' ) \n/* 2*/       HashVal = ( HashVal << 5 ) + *x++; \n/* 3*/  return HashVal % TableSize; \n} \n
    • If x is too long (e.g. street address), the early characters will be left-shifted out of place.
    "},{"location":"note/hash/#separate-chaining","title":"Separate Chaining","text":"
    struct  ListNode; \ntypedef  struct  ListNode  *Position; \nstruct  HashTbl; \ntypedef  struct  HashTbl  *HashTable; \nstruct  ListNode { \n    ElementType  Element; \n    Position  Next; \n}; \ntypedef  Position  List; \n/* List *TheList will be an array of lists, allocated later */ \n/* The lists use headers (for simplicity), */ \n/* though this wastes space */ \nstruct  HashTbl { \n    int  TableSize; \n    List  *TheLists; \n};\n
    "},{"location":"note/hash/#create-an-empty-table","title":"Create an empty table","text":"
    HashTable  InitializeTable( int TableSize ) \n{   HashTable  H; \n    int  i; \n    if ( TableSize < MinTableSize ) { \n        Error( \"Table size too small\" );  return NULL;  \n    } \n    H = malloc( sizeof( struct HashTbl ) );  /* Allocate table */\n    if ( H == NULL )    FatalError( \"Out of space!!!\" ); \n    H->TableSize = NextPrime( TableSize );  /* Better be prime */\n    H->TheLists = malloc( sizeof( List ) * H->TableSize );  /*Array of lists*/\n    if ( H->TheLists == NULL )   FatalError( \"Out of space!!!\" ); \n    for( i = 0; i < H->TableSize; i++ ) {   /* Allocate list headers */\n                H->TheLists[ i ] = malloc( sizeof( struct ListNode ) ); /* Slow! */\n                if ( H->TheLists[ i ] == NULL )  FatalError( \"Out of space!!!\" ); \n                else    H->TheLists[ i ]->Next = NULL;\n    } \n    return  H; \n} \n
    "},{"location":"note/hash/#find-a-key-from-a-hash-table","title":"Find a key from a hash table","text":"
    Position  Find ( ElementType Key, HashTable H ) \n{ \n    Position P; \n    List L; \n    L = H->TheLists[ Hash( Key, H->TableSize ) ]; \n\n    P = L->Next; \n    while( P != NULL && P->Element != Key )  /* Probably need strcmp */ \n    P = P->Next; \n    return P; \n} \n
    "},{"location":"note/hash/#insert-a-key-into-a-hash-table","title":"Insert a key into a hash table","text":"
    void  Insert ( ElementType Key, HashTable H ) \n{ \n    Position  Pos, NewCell; \n    List  L; \n    Pos = Find( Key, H ); \n    if ( Pos == NULL ) {   /* Key is not found, then insert */\n            NewCell = malloc( sizeof( struct ListNode ) ); \n            if ( NewCell == NULL )     FatalError( \"Out of space!!!\" ); \n            else { \n                L = H->TheLists[ Hash( Key, H->TableSize ) ]; \n                NewCell->Next = L->Next; \n                NewCell->Element = Key; /* Probably need strcpy! */ \n              L->Next = NewCell; \n                        } \n        } \n} \n
    "},{"location":"note/hash/#open-addressing","title":"Open Addressing","text":"

    Solve Collision

    Algorithm: insert key into an array of hash table\n{\n    index = hash(key);\n    initialize i = 0 ------ the counter of probing;\n    while ( collision at index ) {\n            index = ( hash(key) + f(i) ) % TableSize;\n            if ( table is full )    break;\n            else    i ++;\n    }\n    if ( table is full )  ERROR (\u201cNo space left\u201d);\n    else  insert key at index;\n}\n
    "},{"location":"note/hash/#linear-probing","title":"Linear Probing","text":"

    \\(f(i)=i\\)

    • Although p is small,the worst case can beLARGE.
    • Cause primary clustering: any key that hashes into the cluster will add to the cluster after several attempts to resolve the collision.
    "},{"location":"note/hash/#quadratic-probing","title":"Quadratic Probing","text":"

    \\(f(i)=i^2\\)

    • If the table size is a prime of the form 4k + 3, then the quadratic probing \\(f(i)=i^2\\) can probe the entire table.
    • Read Figures \\(7.15 - 7.16\\) for detailed representations and implementations of initialization.
    Position  Find ( ElementType Key, HashTable H ) \n{   Position  CurrentPos; \n    int  CollisionNum; \n    CollisionNum = 0; \n    CurrentPos = Hash( Key, H->TableSize ); \n    while( H->TheCells[ CurrentPos ].Info != Empty && \n    H->TheCells[ CurrentPos ].Element != Key ) { \n    CurrentPos += 2 * ++CollisionNum \uf02d 1; \n    if ( CurrentPos >= H->TableSize )  CurrentPos \uf02d = H->TableSize; \n    } \n    return CurrentPos; \n} \n
    • Insert
    void  Insert ( ElementType Key, HashTable H ) \n{ \n    Position  Pos; \n    Pos = Find( Key, H ); \n    if ( H->TheCells[ Pos ].Info != Legitimate ) { /* OK to insert here */ \n    H->TheCells[ Pos ].Info = Legitimate; \n    H->TheCells[ Pos ].Element = Key; /* Probably need strcpy */ \n    } \n} \n
    • Delete

    Insertion will be seriously slowed down if there are too many deletions intermixed with insertions.

    Although primary clustering is solved, secondary clustering occurs \u2013 that is, keys that hash to the same position will probe the same alternative cells.

    "},{"location":"note/hash/#double-hashing","title":"Double Hashing","text":"

    \\(f ( i ) = i * hash_2( x )\\) hash2( x ) is the 2nd hash function

    "},{"location":"note/hash/#rehashing","title":"Rehashing","text":""},{"location":"note/list/","title":"List","text":""},{"location":"note/list/#linked-list","title":"linked list","text":"

    // Reverse a linked list\nq=h;\np=NUll;\nwhile(q){\n    t = q->next;\n    q->next = p;\n    p=q;\n    q=t;\n}\nh = p;\n\nLNode *reverse( LNode *head ){\n    LNode *p0,*head1;\n    head1=NULL;\n    for(p0=head->next;p0;){\n       LNode *temp=p0->next;//important!!!\n       p0->next =head1;\n       head1=p0;\n       p0=temp;\n    }\n    return head1;\n}\n
    * multilist * sparse matrix representation

    "},{"location":"note/sort/","title":"Sort","text":""},{"location":"note/sort/#simple-sort","title":"Simple Sort","text":""},{"location":"note/sort/#algorithm","title":"Algorithm","text":""},{"location":"note/sort/#bubble-sort","title":"Bubble sort","text":"

    Basic

    void bubbleSort(int arr[], int n) {\n    for (int i = 0; i < n - 1; i++) {\n        for (int j = 0; j < n - i - 1; j++) {\n            if (arr[j] > arr[j + 1]) {\n                int temp = arr[j];\n                arr[j] = arr[j + 1];\n                arr[j + 1] = temp;\n            }\n        }\n    }\n}\n

    Improvement

    void bubbleSort_recursive(int a[],int begin,int end,int n){\n    if(end>begin){\n        int lastswap=-1;\n        for(int i=begin;i<end;i++){\n        if(a[i]>a[i+1]){\n          int m=a[i];\n          a[i]=a[i+1];\n          a[i+1]=m; \n          lastswap=i;\n        }\n    }\n    end=lastswap;\n    sort(a,begin,end,n);\n}\n\nvoid bubbleSort_iter (int a[], int n){\n    int lastswap, end;\n    for (int i=0;i<n-1;i++) {\n        lastswap = -1;\n        for (int j=0;j<end;j++) {\n            if (a[j] > a[j + 1]) {\n                exchange(&a[j], &a[j + 1]);\n                lastswap = j;\n            }\n        }\n        end = lastswap;\n    }\n}\n
    "},{"location":"note/sort/#selection-sort","title":"Selection sort","text":"
    void selectionSort(int arr[], int n) {\n    int i, j, min_idx;\n    // \u5916\u5c42\u5faa\u73af\u904d\u5386\u672a\u6392\u5e8f\u90e8\u5206\n    for (i = 0; i <n-1;i++) {\n        // \u5047\u8bbe\u5f53\u524d\u672a\u6392\u5e8f\u90e8\u5206\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\u4e3a\u6700\u5c0f\n        min_idx = i;\n        // \u5185\u5c42\u5faa\u73af\u5728\u672a\u6392\u5e8f\u90e8\u5206\u4e2d\u627e\u5230\u6700\u5c0f\u5143\u7d20\u7684\u7d22\u5f15\n        for (j=i+1;j<n;j++) {\n            if (arr[j] < arr[min_idx]) {\n                min_idx = j;\n            }\n        }\n        // \u5c06\u627e\u5230\u7684\u6700\u5c0f\u5143\u7d20\u4e0e\u672a\u6392\u5e8f\u90e8\u5206\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\u4ea4\u6362\u4f4d\u7f6e\n        swap(&arr[min_idx], &arr[i]);\n    }\n}\n
    "},{"location":"note/sort/#insertion-sort","title":"Insertion Sort","text":"
    void InsertionSort ( ElementType A[ ], int N ){\n  int j,P;\n  ElementType Tmp;\n  for(P=1;P<N;P++){\n    Tmp=A[p];\n    for(j=P;j>0&&A[j-1]>Tmp;j--){\n      A[j]=A[j-1];\n    }\n    A[j]=Tmp;\n  }\n}\n

    The worst case:Input \\(A[ \\ \\ ]\\) is in reverse order. \\(T( N ) = O( N^2 )\\)

    "},{"location":"note/sort/#analysis","title":"Analysis","text":"
    • A Lower Bound for Simple Sorting Algorithms
    • An inversion in an array of numbers is any ordered pair \\(( i, j )\\) having the property that \\(i < j\\) but \\(A[i] > A[j]\\).
    • Swapping two adjacent elements that are out of place removes exactly one inversion.
    • \\(T ( N, I )\\) = \\(O( I+N )\\) where \\(I\\) is the number of inversions in the original array.

    • The average number of inversions in an array of N distinct numbers is \\(N ( N +1 ) / 4\\).

    • Any algorithm that sorts by exchanging adjacent elements requires \\(\\Omega( N^2 )\\) time on average.
    "},{"location":"note/sort/#shell-sort","title":"Shell sort","text":"

    Original Shell Sequence: The original sequence suggested by Donald Shell was to use gaps of n/2, n/4, n/8, ..., 1. This is a simple and effective sequence, often called the \"original Shell sequence.\" It is easy to implement and works well in practice.

    for (int gap = n/2; gap > 0; gap /= 2) {\n    // Shell sort logic\n}\n

    Knuth's Sequence: Donald Knuth suggested a formula for computing gaps, which is 3^k - 1 for k = 0, 1, 2, .... This sequence often performs well in practice.

    for (int gap = 1; gap < n/3; gap = 3 * gap + 1) {\n    // Shell sort logic\n}\n

    Sedgewick's Sequence: Robert Sedgewick proposed a sequence that interleaves powers of 2 and 3: 1, 5, 19, 41, 109, 209, 505, .... It combines the simplicity of the original Shell sequence with the effectiveness of the Knuth sequence.

    int sedgewick[] = {1, 5, 19, 41, 109, 209, 505, ...};  // Extend as needed\nint sedgewickIndex = 0;\nfor (int gap = sedgewick[sedgewickIndex]; gap > 0; gap = sedgewick[++sedgewickIndex]) {\n    // Shell sort logic\n}\n
    the terms are either of the form \\(9\\times 4^i -9\\times 2^i + 1\\) or \\(4^i -3\\times 2^i + 1\\). \\(T_{avg} ( N ) = O ( N^{7/6} )\\) and \\(T_{worst} ( N ) = O ( N^{4/3} )\\).

    void shellSort(int arr[], int n) {\n    // ps:we can choose any ideal sequence suitable for given cases\n    for (int gap = n/2; gap > 0; gap /= 2) {\n        for (int i = gap; i < n; i++) {\n            int temp = arr[i];\n            int j;\n            for (j = i; j >= gap && arr[j - gap] > temp; j -= gap) {\n                arr[j] = arr[j - gap];\n            }\n            arr[j] = temp;\n        }\n    }\n}\n
    "},{"location":"note/sort/#worst-case-analysis","title":"Worst-Case Analysis:","text":"

    The worst-case running time of Shellsort, using Shell's increments, is \\(O(N^2)\\). * example : 1 9 2 10 3 11 4 12 5 13 6 14

    "},{"location":"note/sort/#hibbards-increment-sequence","title":"Hibbard's Increment Sequence:","text":"

    \\(h_k = 2^k -1\\) ---- consecutive increments have no common factors. The worst-case running time of Shellsort, using Hibbard's increments, is \\(O( N^{3/2})\\).

    "},{"location":"note/sort/#heap-sort","title":"Heap Sort","text":""},{"location":"note/sort/#algorithm-1","title":"Algorithm 1:","text":"

    Algorithm 1:\n{\n  BuildHeap( H ); //O(N)\n  for (int i=0; i<N; i++ ){\n        TmpH[ i ] = DeleteMin( H );O(logN)\n  }\n  for ( i=0; i<N; i++ ){\n        H[ i ] = TmpH[ i ];\n  }\n}\n
    \\(T ( N ) = O ( N log N )\\) but space needed is doubled.

    "},{"location":"note/sort/#algorithm-2","title":"Algorithm 2:","text":"

    Review

    void PercolateDown( int p, PriorityQueue H ){   \n    int temp=H->Elements[p];\n    int parent,son;\n    for(parent=p;parent*2<=H->Size;parent=son){\n        son=parent*2;\n        if(son<H->Size&&H->Elements[son]>H->Elements[son+1]){\n            son++;      \n        }\n        if(temp<=H->Elements[son])\n            break;      \n        else\n            H->Elements[parent]=H->Elements[son];\n    }\n    H->Elements[parent]=temp;\n}\n

    void Heapsort( ElementType A[ ], int N ) \n{   int i; \n    for ( i = N / 2; i >= 0; i - - ) /* BuildHeap */ \n        PercDown( A, i, N ); \n    for ( i = N - 1; i > 0; i - - ) { \n        Swap( &A[ 0 ], &A[ i ] ); /* DeleteMax */ \n        PercDown( A, 0, i ); \n    } \n}\n
    The average number of comparisons used to heapsort a random permutation of N distinct items is \\(2N log N - O( N log log N )\\).

    Although Heapsort gives the best average time, in practice it is slower than a version of Shellsort that uses Sedgewick's increment sequence.

    "},{"location":"note/sort/#mergesort","title":"Mergesort","text":"
    void Mergesort( ElementType A[ ], int N );\nvoid MSort( ElementType A[ ], ElementType TmpArray[ ],int Left,int Right);\nvoid Merge( ElementType A[ ], ElementType TmpArray[ ],int Lpos,int Rpos, int RightEnd);\nvoid Mergesort( ElementType A[ ], int N ) {\n    ElementType  *TmpArray;  /* need O(N) extra space */\n    TmpArray = malloc( N * sizeof( ElementType ) ); \n    if ( TmpArray != NULL ) { \n            MSort( A, TmpArray, 0, N - 1 ); \n            free( TmpArray ); \n    } \n    else  FatalError( \"No space for tmp array!!!\" ); \n}\nvoid MSort( ElementType A[ ], ElementType TmpArray[ ],int Left, int Right){\n    int  Center; \n    if ( Left < Right ) {  /* if there are elements to be sorted */\n        Center = ( Left + Right ) / 2; \n        MSort( A, TmpArray, Left, Center );     /* T( N / 2 ) */\n        MSort( A, TmpArray, Center + 1, Right );    /* T( N / 2 ) */\n        Merge( A, TmpArray, Left, Center + 1, Right );  /* O( N ) */\n    } \n} \n/* Lpos = start of left half, Rpos = start of right half */ \nvoid Merge( ElementType A[ ], ElementType TmpArray[ ], int Lpos, int Rpos, int RightEnd ) {\n    int  i, LeftEnd, NumElements, TmpPos; \n    LeftEnd = Rpos - 1; \n    TmpPos = Lpos; \n    NumElements = RightEnd - Lpos + 1; \n    while(Lpos<=LeftEnd && Rpos<=RightEnd){\n        if(A[Lpos]<=A[Rpos]){TmpArray[TmpPos++]=A[Lpos++];}\n        else{TmpArray[TmpPos++]=A[Rpos++];}\n        while(Lpos<=LeftEnd){TmpArray[ TmpPos++ ] = A[ Lpos++ ];}\n        while(Rpos<=RightEnd){TmpArray[ TmpPos++ ] = A[ Rpos++ ];}\n    }\n    for( i = 0; i < NumElements; i++, RightEnd - - ) \n         /* Copy TmpArray back */ \n        A[ RightEnd ] = TmpArray[ RightEnd ]; \n}\n/** version2 **/\nvoid Merge2( ElementType A[ ], ElementType TmpArray[ ], int Lpos, int Rpos, int RightEnd ) {\n    int  i, LeftEnd, NumElements, TmpPos; \n    LeftEnd = Rpos - 1; \n    TmpPos = Lpos; \n    NumElements = RightEnd - Lpos + 1; \n    for(int i=0;i<NumElements;i++){\n        if((Lpos<=LeftEnd)&&(Rpos>RightEnd||A[Lpos]<=A[Rpos])){TmpArray[i]=A[Lpos++];}\n        else{TmpArray[TmpPos++]=A[Rpos++];}\n    }\n\n}\n/** version3 **/\nvoid CopyArray(int B[],int iBegin,int iEnd,int A[]);\nvoid Merge (int A[],int ileft,int iright,int iend,int B[]);\nvoid BottomupMergeSort(int A[],int B[],int n){\n   for(int width=1;width<n;width=width*2){\n           for(int i=0;i<n;i=i+2*width){\n            Merge(A,i,min(i+width,n),min(i+2*width,n),B);\n           }\n           CopyArray(B,0,n,A);\n   }\n\n}\n// (iBegin,iEnd]\nvoid Merge (int A[],int ileft,int iright,int iend,int B[]){\n     int i=ileft,j=iright;\n\n    for(int k=ileft;k<iend;k++){\n\n         if(i<iright&&(j>=iend||A[i]<=A[j])){\n            B[k]=A[i++];\n         }\n         else{B[k]=A[j++];}\n    }\n}\n
    "},{"location":"note/sort/#complexity","title":"Complexity","text":"

    \\(T(n)=2T(n/2)+O(n)\\) \u2192 \\(O(nlogn)\\) Note: Mergesort requires linear extra memory, and copying an array is slow. It is hardly ever used for internal sorting, but is quite useful for external sorting.

    "},{"location":"note/sort/#quick-sort","title":"Quick Sort","text":""},{"location":"note/sort/#picking-the-pivot","title":"Picking the Pivot","text":"

    A Safe Maneuver: \\(Pivot = random\\ select\\ from\\ A[\\ \\ ]\\)

    Median-of-Three Partitioning : \\(Pivot\\ = median ( left, center, right )\\)

    1. Select the elements at the leftmost, center, and rightmost positions of the array.
    2. Calculate the median among these three elements, i.e., identify the element that is the middle value.
    3. Set the median as the pivot element.

    Eliminates the bad case for sorted input and actually reduces the running time by about 5%.

    "},{"location":"note/sort/#small-arrays","title":"Small Arrays","text":"

    Problem: Quicksort is slower than insertion sort for small N ( \\(\\le\\)20 ).

    Solution : Cutoff when N gets small ( e.g. N = 10 ) and use other efficient algorithms (such as insertion sort).

    "},{"location":"note/sort/#implementation","title":"Implementation","text":"
    • \u53cc\u6307\u9488
    void  Quicksort( ElementType A[ ], int N ) \n{ \n    Qsort( A, 0, N - 1 ); \n    /* A:   the array   */\n    /* 0:   Left index  */\n    /* N \u2013 1: Right index   */\n}\n\n/* Return median of Left, Center, and Right */ \n/* Order these and hide the pivot */ \nElementType Median3( ElementType A[ ], int Left, int Right ) \n{ \n    int  Center = ( Left + Right ) / 2; \n    if ( A[ Left ] > A[ Center ] ) \n        Swap( &A[ Left ], &A[ Center ] ); \n    if ( A[ Left ] > A[ Right ] ) \n        Swap( &A[ Left ], &A[ Right ] ); \n    if ( A[ Center ] > A[ Right ] ) \n        Swap( &A[ Center ], &A[ Right ] ); \n    /* Invariant: A[ Left ] <= A[ Center ] <= A[ Right ] */ \n    Swap( &A[ Center ], &A[ Right - 1 ] ); /* Hide pivot */ \n    /* only need to sort A[ Left + 1 ] \u2026 A[ Right \u2013 2 ] */\n    return  A[ Right - 1 ];  /* Return pivot */ \n}\n\nvoid  Qsort( ElementType A[ ], int Left, int Right ) \n{   int  i,  j; \n    ElementType  Pivot; \n    if( Left + Cutoff <= Right ){  /* if the sequence is not too short */\n        Pivot = Median3( A, Left, Right );  /* select pivot */\n        i = Left;     \n        j = Right \u2013 1;  /* why not set Left+1 and Right-2? */\n        for( ; ; ) { \n                    while ( A[ ++i ] < Pivot ) { }  /* scan from left */\n                    while ( A[ \u2013\u2013j ] > Pivot ) { }  /* scan from right */\n                    if ( i < j ) {Swap( &A[ i ], &A[ j ] ); } /* adjust partition */\n                    else {break; } /* partition done */\n        } \n        Swap( &A[ i ], &A[ Right - 1 ] ); /* restore pivot */ \n        Qsort( A, Left, i - 1 );      /* recursively sort left part */\n        Qsort( A, i + 1, Right );   /* recursively sort right part */\n    }  /* end if - the sequence is long */\n\n    else /* do an insertion sort on the short subarray */ \n    {InsertionSort( A + Left, Right - Left + 1 );}\n}\n
    "},{"location":"note/sort/#sorting-large-structures","title":"Sorting Large Structures","text":"

    Swapping large structures can be very much expensive. * Add a pointer field to the structure and swap pointers instead \u2013 indirect sorting. * Physically rearrange the structures at last if it is really necessary. In the worst case there are \\([N/2]\\)(down) cycles and requires \\([3N/2]\\) (down) record moves. \\(T = O( m N )\\) where m is the size of a structure

    "},{"location":"note/sort/#a-general-lower-bound-for-sorting","title":"A General Lower Bound for Sorting","text":"

    Any algorithm that sorts by comparisons only must have a worst case computing time of \\(\\Omega( N log N )\\).

    When sorting N distinct elements, there are \\(N!\\) (N factorial) different possible sorting outcomes. This arises from the numerous ways of arranging the elements, with \\(N\\) choices for the first element, \\(N-1\\) choices for the second, and so forth, yielding a total of \\(N!\\).

    In the context of decision trees representing the decision-making process of comparison-based sorting algorithms, the number of leaves in the tree is at least \\(N!\\). Each leaf node signifies a distinct sorting outcome.

    The relationship between the height of the decision tree \\((k)\\) and complete binary trees is emphasized. For a complete binary tree with \\(k\\) levels, it can have at most \\(2^{k-1}\\) leaves. Combining this with the earlier discussion, the inequality \\(N! \u2264 2^{k-1}\\) is established, where k is the height of the decision tree.

    Expressing the relationship between height and N! using logarithms, we find that \\(k \u2265 log(N!) + 1\\). * Logarithms are preferred due to their intuitive representation of exponential growth in tree height.

    These insights delineate theoretical limits for comparison-based sorting algorithms and underscore the significance of N log N as the theoretical lower bound for their time complexity.

    "},{"location":"note/sort/#bucket-sort-and-radix-sort","title":"Bucket Sort and Radix Sort","text":""},{"location":"note/sort/#bucket-sort","title":"Bucket Sort","text":"

    Algorithm\n{\n    initialize count[ ];\n    while (read in a student\u2019s record)\n        insert to list count[stdnt.grade];\n    for (i=0; i<M; i++) {\n        if (count[i])\n            output list count[i];\n    }\n}\nT(N,M)=O(M+N)\n
    * What if \\(M >> N\\) ?

    "},{"location":"note/sort/#radix-sort","title":"Radix Sort","text":""},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/","title":"Basic data Structures I","text":""},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#sparse-matrix","title":"SPARSE MATRIX","text":"

    Representing a sparse matrix by a 2D array leads to wastage of lots of memory as zeroes in the matrix are of no use in most of the cases. So, instead of storing zeroes with non-zero elements, we only store non-zero elements. This means storing non-zero elements with triples- (Row, Column, value).

    • Using Array
    #include <iostream>\nusing namespace std;\n\nint main()\n{\n    // Assume 4x5 sparse matrix\n    int sparseMatrix[4][5] =\n    {\n        {0 , 0 , 3 , 0 , 4 },\n        {0 , 0 , 5 , 7 , 0 },\n        {0 , 0 , 0 , 0 , 0 },\n        {0 , 2 , 6 , 0 , 0 }\n    };\n\n    int size = 0;\n    for (int i = 0; i < 4; i++)\n        for (int j = 0; j < 5; j++)\n            if (sparseMatrix[i][j] != 0)\n                size++;\n\n    // number of columns in compactMatrix (size) must be\n    // equal to number of non - zero elements in\n    // sparseMatrix\n    int compactMatrix[3][size];\n\n    // Making of new matrix\n    int k = 0;\n    for (int i = 0; i < 4; i++)\n        for (int j = 0; j < 5; j++)\n            if (sparseMatrix[i][j] != 0)\n            {\n                compactMatrix[0][k] = i;\n                compactMatrix[1][k] = j;\n                compactMatrix[2][k] = sparseMatrix[i][j];\n                k++;\n            } \n\n    for (int i=0; i<3; i++)\n    {\n        for (int j=0; j<size; j++)\n            cout <<\" \"<< compactMatrix[i][j];\n        cout <<\"\\n\";\n    }\n    return 0;\n}\n
    • Using Linked Lists
    #include<stdio.h>\n#include<stdlib.h>\n\n// Node to represent sparse matrix\nstruct Node\n{\n    int value;\n    int row_position;\n    int column_postion;\n    struct Node *next;\n};\n\n// Function to create new node\nvoid create_new_node(struct Node** start, int non_zero_element,int row_index, int column_index )\n{\n    struct Node *temp, *r;\n    temp = *start;\n    if (temp == NULL)\n    {\n        // Create new node dynamically\n        temp = (struct Node *) malloc (sizeof(struct Node));\n        temp->value = non_zero_element;\n        temp->row_position = row_index;\n        temp->column_postion = column_index;\n        temp->next = NULL;\n        *start = temp;\n    }\n    else\n    {\n        while (temp->next != NULL)\n            temp = temp->next;\n        // Create new node dynamically\n        r = (struct Node *) malloc (sizeof(struct Node));\n        r->value = non_zero_element;\n        r->row_position = row_index;\n        r->column_postion = column_index;\n        r->next = NULL;\n        temp->next = r;\n    }\n}\n// This function prints contents of linked list\n// starting from start\nvoid PrintList(struct Node* start)\n{\n    struct Node *temp, *r, *s;\n    temp = r = s = start;\n\n    printf(\"row_position: \");\n    while(temp != NULL){\n        printf(\"%d \", temp->row_position);\n        temp = temp->next;\n    }\n    printf(\"\\n\");\n    printf(\"column_postion: \");\n    while(r != NULL){\n        printf(\"%d \", r->column_postion);\n        r = r->next;\n    }\n    printf(\"\\n\");\n    printf(\"Value: \");\n    while(s != NULL){\n        printf(\"%d \", s->value);\n        s = s->next;\n    }\n    printf(\"\\n\");\n}\n// Driver of the program\nint main(){\n// Assume 4x5 sparse matrix\n    int sparseMatric[4][5] =\n    {\n        {0 , 0 , 3 , 0 , 4 },\n        {0 , 0 , 5 , 7 , 0 },\n        {0 , 0 , 0 , 0 , 0 },\n        {0 , 2 , 6 , 0 , 0 }\n    };\n    /* Start with the empty list */\n    struct Node* start = NULL;\n    for (int i = 0; i < 4; i++)\n        for (int j = 0; j < 5; j++)\n            // Pass only those values which are non - zero\n            if (sparseMatric[i][j] != 0)\n                create_new_node(&start, sparseMatric[i][j], i, j);\n    PrintList(start);\n    return 0;\n}\n
    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#stack","title":"STACK","text":""},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#1adt","title":"1.ADT","text":""},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#2implementations","title":"2.Implementations","text":"
    • Linked List
    • Array : The stack model must be well encapsulated.
    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#3applications","title":"3.Applications","text":"
    • Balancing Symbols
    • Pseudo Code
    Algorithm  {\n    Make an empty stack S;\n    while (read in a character c) {\n        if (c is an opening symbol)\n            Push(c, S);\n        else if (c is a closing symbol) {\n            if (S is empty)  { ERROR; exit; }\n            else  {  /* stack is okay */\n                if  (Top(S) doesn\u2019t match c)  { ERROR, exit; }\n                else  Pop(S);\n            }  /* end else-stack is okay */\n        }  /* end else-if-closing symbol */\n    } /* end while-loop */ \n    if (S is not empty)  ERROR;\n}\n
    #include <stdio.h>\n#include <stdbool.h>\n#include <string.h>\n\n#define STACKSIZE 30 \nchar stack[STACKSIZE]; // Global, but let's go with it\nint top = 0;\n\nvoid push(char x) {\n    if (top == STACKSIZE)\n        puts(\"Stack Full\");\n    else\n        stack[top++] = x;\n}\n\nbool popExpect(char c) { // compare expected char on top with passed char\n    return top && c == stack[--top];\n}\n\nbool chk(const char *str) {\n    char *cp, pairs[] = \"(){}[]\"; // three important pairs\n    bool isGood = true; // optimism\n\n    for (int i = 0; isGood && str[i]; i++)\n        // is this char one of the \"special\" ones?\n        if ((cp = strchr(pairs, str[i])) != NULL) {\n            int off = cp - pairs;\n            // because \"paired\" 0,2,4 are open, 1,3,5 are close\n            if (off % 2 == 0) // opening\n                push(cp[1]); // push the close that matches this open\n            else // special closing\n                isGood = popExpect(str[i]); // does this close match?\n        }\n\n    return isGood && top == 0;\n}\n\nint main() {\n    const char *s1 = \"(foobar)({}){bar}[[[(foo)]]]\"; // balanced\n    const char *s2 = \"(foobar)({}){ { bar}[[[(foo)]]]\"; // unbalanced open\n    const char *s3 = \"(foobar)({}){ ] bar}[[[(foo)]]]\"; // unbalanced close\n\n    puts(chk(s1) ? \"Balanced\" : \"Unbalanced\");\n    puts(chk(s2) ? \"Balanced\" : \"Unbalanced\");\n    puts(chk(s3) ? \"Balanced\" : \"Unbalanced\");\n\n    return 0;\n}\n
    • Calculation

    • Prefix

    • Infix\u300cConvert To Postfix\u300d

    #include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n// Function to return precedence of operators\nint prec(char c) {\n    if (c == '^')\n        return 3;\n    else if (c == '/' || c == '*')\n        return 2;\n    else if (c == '+' || c == '-')\n        return 1;\n    else\n        return -1;\n}\n\n// Function to return associativity of operators\nchar associativity(char c) {\n    if (c == '^')\n        return 'R';\n    return 'L'; // Default to left-associative\n}\n\n// Structure to represent stack\nstruct Stack {\n    int top;\n    unsigned capacity;\n    char* array;\n};\n\n// Function to initialize a stack\nstruct Stack* createStack(unsigned capacity) {\n    struct Stack* stack = (struct Stack*)malloc(sizeof(struct Stack));\n    stack->capacity = capacity;\n    stack->top = -1;\n    stack->array = (char*)malloc(stack->capacity * sizeof(char));\n    return stack;\n}\n\n// Function to check if the stack is full\nint isFull(struct Stack* stack) {\n    return stack->top == stack->capacity - 1;\n}\n\n// Function to check if the stack is empty\nint isEmpty(struct Stack* stack) {\n    return stack->top == -1;\n}\n\n// Function to push an element to the stack\nvoid push(struct Stack* stack, char item) {\n    if (isFull(stack)) {\n        printf(\"Stack Full\\n\");\n        return;\n    }\n    stack->array[++stack->top] = item;\n}\n\n// Function to pop an element from the stack\nchar pop(struct Stack* stack) {\n    if (isEmpty(stack)) {\n        return '$'; // Assuming '$' as an invalid character\n    }\n    return stack->array[stack->top--];\n}\n\n// The main function to convert infix expression\n// to postfix expression\nvoid infixToPostfix(char* exp) {\n    struct Stack* stack = createStack(strlen(exp));\n    char result[strlen(exp)];\n    int resultIndex = 0;\n\n    for (int i = 0; exp[i] != '\\0'; i++) {\n        char c = exp[i];\n\n        // If the scanned character is\n        // an operand, add it to the output string.\n        if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9'))\n            result[resultIndex++] = c;\n\n        // If the scanned character is an\n        // \u2018(\u2018, push it to the stack.\n        else if (c == '(')\n            push(stack, '(');\n\n        // If the scanned character is an \u2018)\u2019,\n        // pop and add to the output string from the stack\n        // until an \u2018(\u2018 is encountered.\n        else if (c == ')') {\n            while (stack->top != -1 && stack->array[stack->top] != '(') {\n                result[resultIndex++] = pop(stack);\n            }\n            pop(stack); // Pop '('\n        }\n\n        // If an operator is scanned\n        else {\n            while (!isEmpty(stack) && prec(exp[i]) < prec(stack->array[stack->top]) ||\n                !isEmpty(stack) && prec(exp[i]) == prec(stack->array[stack->top]) &&\n                associativity(exp[i]) == 'L') {\n                result[resultIndex++] = pop(stack);\n            }\n            push(stack, c);\n        }\n    }\n\n    // Pop all the remaining elements from the stack\n    while (!isEmpty(stack)) {\n        result[resultIndex++] = pop(stack);\n    }\n\n    result[resultIndex] = '\\0'; // Null-terminate the result string\n\n    printf(\"%s\\n\", result);\n}\n\n// Driver code\nint main() {\n    char exp[] = \"a+b*(c^d-e)^(f+g*h)-i\";\n    // Function call\n    infixToPostfix(exp);\n    return 0;\n}\n
    • Never pop a '(' from the stack except when processing a ')' .
    • Observe that when ' ( ' is not in the stack, its precedence is the highest; but when it is in the stack, its precedence is the lowest. Define in-stack precedence and incoming precedence for symbols, and each time use the corresponding precedence for comparison.
    • Note: a \u2013 b \u2013 c will be converted to a b \u2013 c \u2013. However, \\(2^{2^{3}}\\)must be converted to 2 2 3 ^ ^ , not 2 2 ^ 3 ^ since exponentiation associates right to left.

      • Observe that when ' ( ' is not in the stack, its precedence is the highest; but when it is in the stack, its precedence is the lowest. Define in-stack precedence and incoming precedence for symbols, and each time use the corresponding precedence for comparison.

      • Note: a \u2013 b \u2013 c will be converted to a b \u2013 c \u2013. However, \\(2^{2^{3}}\\)must be converted to 2 2 3 ^ ^ , not 2 2 ^ 3 ^ since exponentiation associates right to left.

    • Postfix \u300cEasier To Calculate\u300d

    ps:Tail Recursion! -- compliler will remove the recursion.

    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#the-queue-adt","title":"The Queue ADT","text":"
    • A queue is a First-In-First-Out (FIFO) list, that is, an ordered list in which insertions take place at one end and deletions take place at the opposite end.

    • Linked list implementation

    • Array Implementation

    struct  QueueRecord {\n    int     Capacity ;   /* max size of queue */\n    int     Front;          /* the front pointer */\n    int     Rear;           /* the rear pointer */\n    int     Size;  /* Optional - the current size of queue */\n    ElementType  *Array;    /* array for queue elements */\n } ; \n
    • A circular Queue
    • Rear[0] Font[1]
    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#tree","title":"TREE","text":""},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#basic-properties","title":"Basic Properties","text":"
    • N nodes and N-1 edges
    • node without any son is called \\(leaf\\)
    • \u4e00\u68f5\u6811\u7684\u5ea6\u662f\u8fd9\u68f5\u6811\u91cc\u6240\u6709\u8282\u70b9\u5ea6\u7684\u6700\u5927\u503c
    • \u4ece\u8282\u70b9 \\(n1\\) \u5230 \\(nk\\) \u7684\u8def\u5f84\u662f\u552f\u4e00\u7684\uff0c\u5176\u957f\u5ea6\u662f\u8def\u5f84\u4e0a\u8fb9\u7684\u6570\u91cf.
    • \u5bf9\u4e8e\u8282\u70b9 \\(ni\\)\uff0c\u5176\u6df1\u5ea6\u4e3a\u4ece\u6839\u5230 \\(ni\\) \u7684\u552f\u4e00\u8def\u5f84\u7684\u957f\u5ea6\\([Depth\\) \\(root = 0]\\)
    • \u5bf9\u4e8e\u8282\u70b9 \\(ni\\)\uff0c\u5176\u9ad8\u5ea6\u4e3a\u4ece \\(ni\\) \u5230\u4e00\u4e2a\u53f6\u8282\u70b9\u7684\u6700\u957f\u957f\u5ea6\\([Height\\) \\(leaf = 0]\\)
    • \u6839\u7684\u9ad8\u5ea6\u79f0\u4e3a\u8fd9\u68f5\u6811\u7684\u9ad8\u5ea6 / \u6df1\u5ea6
    • \u4e00\u4e2a\u8282\u70b9\u7684\u7956\u5148\uff08ancestors\uff09\u662f\u4ece\u6839\u5230\u8fd9\u4e2a\u8282\u70b9\u7684\u8def\u5f84\u4e0a\u7684\u6240\u6709\u8282\u70b9
    • \u4e00\u4e2a\u8282\u70b9\u7684\u540e\u88d4\uff08descendants\uff09\u662f\u8fd9\u4e2a\u8282\u70b9\u5b50\u6811\u4e2d\u7684\u6240\u6709\u8282\u70b9
    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#implementation","title":"Implementation","text":"
    • FirstChild-NextSibling \u8868\u793a\u6cd5

    • \u8bb0\u5f55\u7b2c\u4e00\u4e2a\u5b50\u8282\u70b9\u548c\u4e0b\u4e00\u4e2a\u5144\u5f1f\u8282\u70b9

    • \u56e0\u4e3a\u4e00\u68f5\u6811\u7684\u513f\u5b50\u987a\u5e8f\u4e0d\u5b9a\uff0c\u6240\u4ee5\u4e00\u68f5\u6811\u7684\u8868\u793a\u65b9\u5f0f\u4e0d\u552f\u4e00

      struct TreeNode {\n    ElementType Element;\n    PtrToNode FirstChild;\n    PtrToNode NextSibling;FirstChildFirfsads\n};\ntypedef struct TreeNode *PtrToNode;\n
    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#binary-tree","title":"Binary Tree","text":""},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#basic-properties_1","title":"Basic Properties","text":"
    • \u7b2c i \u5c42\u7684\u8282\u70b9\u6570\u6700\u591a\u4e3a \\(2^{i-1}\\)
    • \u6df1\u5ea6\u4e3a k \u7684\u4e8c\u53c9\u6811\u6700\u591a\u6709\\(2^{k}-1\\) \u4e2a\u8282\u70b9
    • \\(n0\\) \u8868\u793a\u53f6\u8282\u70b9\u6570\uff0c\\(n2\\) \u8868\u793a\u5ea6\u4e3a 2 \u7684\u8282\u70b9\u6570\uff0c\u5219 \\(n0 = n2 +1\\)
    • \u4e8c\u53c9\u6811\u53ef\u4ee5\u901a\u8fc7\u6570\u7ec4\u6765\u8868\u793a
    • \u6839\u4e3a tree[1]
    • \u8282\u70b9 tree[i] \u7684\u5de6\u513f\u5b50\u4e3a tree[2i]\uff0c\u53f3\u513f\u5b50\u4e3a tree[2i+1]
    • \u5b8c\u5168\u4e8c\u53c9\u6811\u7684\u6570\u7ec4\u4e2d\u5143\u7d20\u5168\u90e8\u5206\u5e03\u5728 1 ~ n \u4e2d
    • \u8868\u8fbe\u5f0f\u6811\uff08expression tree\uff09
    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#_1","title":"\u904d\u5386","text":"
    • Preorder\uff1aroot-left-right

    • Postorder\uff1aleft-right-root

    • inorder:left-root-right

    • level order:

    void levelorder(tree_ptr tree) {\n    enqueue(tree);\n    while (queue is not empty) {\n        visit(T = dequeue());\n        for (each child C of T) \n            enqueue(C);\n    }\n}\n
    //    \u4e8c\u53c9\u6811\u7684\u5b9e\u73b0\uff08C\u8bed\u8a00\uff09\n//    \u94fe\u8868\uff0c\u9012\u5f52\u5b9e\u73b0\ntypedef char Elementtype;    //    \u5b9a\u4e49\u6570\u636e\u7c7b\u578b\uff0c\u53ef\u6839\u636e\u9700\u8981\u81ea\u884c\u5b9a\u5236\ntypedef struct TreeNode * Node;    //    Node\u76f8\u5f53\u4e8estruct treeNode *\n//    \u5b9a\u4e49\u6570\u8282\u70b9\u7ed3\u6784\ntypedef struct TreeNode {\n    Elementtype Element;\n    Node left;    //    \u6811\u8282\u70b9\u7684\u5de6\u5b50\u8282\u70b9\n    Node right;    //    \u6811\u8282\u70b9\u7684\u53f3\u5b50\u8282\u70b9\n}TREE,*PTREE;\n\nvoid CreatTree(PTREE *);    //    \u6811\u7684\u5148\u5e8f\u521b\u5efa\u51fd\u6570\nvoid PreOrderTree(PTREE );    //    \u6811\u7684\u524d\u5e8f\u904d\u5386\u51fd\u6570\nvoid InOrderTree(PTREE );    //    \u6811\u7684\u4e2d\u5e8f\u904d\u5386\nvoid PostOrderTree(PTREE );    //    \u6811\u7684\u540e\u5e8f\u904d\u5386\nvoid LeafOfTree(PTREE );    //    \u6253\u5370\u6811\u7684\u53f6\u5b50\u8282\u70b9\u51fd\u6570\nint  Get_Leaf_Num(PTREE );    //    \u83b7\u53d6\u6811\u53f6\u5b50\u8282\u70b9\u4e2a\u6570\nint Get_Height(PTREE );    //    \u83b7\u53d6\u6811\u7684\u9ad8\u5ea6\n\nint main() {\n    PTREE Root;    \n    printf(\"\u8bf7\u5148\u5e8f\u8f93\u5165\u4e8c\u53c9\u6811\u7684\u8282\u70b9\u6570\u636e\uff1a \");\n    CreatTree(&Root);    \n    printf(\"\\n\u524d\u5e8f\u904d\u5386\u7ed3\u679c\u4e3a\uff1a\");\n    PreOrderTree(Root);    \n    printf(\"\\n\u4e2d\u5e8f\u904d\u5386\u7ed3\u679c\u4e3a\uff1a\");\n    InOrderTree(Root);\n    printf(\"\\n\u540e\u5e8f\u904d\u5386\u7ed3\u679c\u4e3a\uff1a\");\n    PostOrderTree(Root);\n    printf(\"\\n\u6253\u5370\u53f6\u5b50\u8282\u70b9\u4e3a\uff1a\");\n    LeafOfTree(Root);\n    printf(\"\\n\u53f6\u5b50\u8282\u70b9\u4e2a\u6570\u4e3a\uff1a%d\", Get_Leaf_Num(Root));\n    printf(\"\\n\u4e8c\u53c9\u6811\u7684\u9ad8\u5ea6\u4e3a\uff1a%d\", Get_Height(Root));\n    printf(\"\\n\");\n    return 0;\n}\n//    \u5b9a\u4e49\u6811\u5148\u5e8f\u521b\u5efa\u51fd\u6570\nvoid CreatTree(PTREE *ROOT){\n  char val = 0;\n  val = getchar();\n  if(wal=='*'){*ROOT=NULL;}\n  else{\n    (*Root)=(PTREE)malloc(sizeof(TREE));\n        if ((*Root) == NULL) {\n            printf(\"\u521b\u5efa\u8282\u70b9\u5931\u8d25\uff0c\u65e0\u6cd5\u5206\u914d\u53ef\u7528\u5185\u5b58...\");\n            exit(-1);\n        }\n            else{\n          (*Root)->Element =val;\n          CreatTree(&(*Root)->left);\n          CreatTree(&(*Root)->right); \n        }\n  }\n\n}\n\n//    \u6811\u7684\u524d\u5e8f\u904d\u5386\u51fd\u6570\u5b9a\u4e49\nvoid PreOrderTree(PTREE Root) {\n    if (Root == NULL)\n        return;\n    else {\n        putchar(Root->Element);\n        PreOrderTree(Root->left);\n        PreOrderTree(Root->right);\n    }\n}\n\n//    \u6811\u7684\u4e2d\u5e8f\u904d\u5386\u51fd\u6570\u5b9a\u4e49\nvoid InOrderTree(PTREE Root) {\n    if (Root == NULL)\n        return;\n    else {\n        InOrderTree(Root->left);\n        putchar(Root->Element);\n        InOrderTree(Root->right);\n    }\n}\n//    \u6811\u7684\u540e\u5e8f\u904d\u5386\u51fd\u6570\u5b9a\u4e49\nvoid PostOrderTree(PTREE Root) {\n    if (Root==NULL) \n        return ;\n    else{\n        PostOrderTree(Root->left);\n        PostOrderTree(Root->right);\n        putchar( Root->Element);\n    }\n}\n//\u6811\u7684\u540e\u5e8f\u904d\u5386\u7684\u5faa\u73af\u5f62\u5f0f\nIterative Program \nvoid iter_postorder\uff08tree_ptr_tree\uff09{\n  stack S = CreateStack(MAX_SIZE);\n  for(;;){\n\n  }\n}\n//    \u6253\u5370\u6811\u7684\u53f6\u5b50\u8282\u70b9\u51fd\u6570\u5b9a\u4e49\nvoid LeafOfTree(PTREE Tree) {\n    if (Tree == NULL)    \n        return ;\n    else {\n        if (Tree->left == NULL&&Tree->right == NULL)\n            putchar(Tree->Element);\n        else {\n            LeafOfTree(Tree->left);\n            LeafOfTree(Tree->right);\n        }\n    }  \n}\n//    \u83b7\u53d6\u6811\u7684\u53f6\u5b50\u8282\u70b9\u4e2a\u6570\u51fd\u6570\u5b9a\u4e49\nint Get_Leaf_Num(PTREE Tree) {\n    if (Tree == NULL)\n        return 0;\n    if (Tree->left == NULL&&Tree->right == NULL)\n        return 1;\n    //\u9012\u5f52\u6574\u4e2a\u6811\u7684\u53f6\u5b50\u8282\u70b9\u4e2a\u6570 = \u5de6\u5b50\u6811\u53f6\u5b50\u8282\u70b9\u7684\u4e2a\u6570 + \u53f3\u5b50\u6811\u53f6\u5b50\u8282\u70b9\u7684\u4e2a\u6570\n    return Get_Leaf_Num(Tree->left) + Get_Leaf_Num(Tree->right);\n}\n//    \u83b7\u53d6\u6811\u9ad8\u7684\u51fd\u6570\u5b9a\u4e49\nint Get_Height(PTREE Tree) {\n    int Height = 0;\n    if (Tree == NULL)\n        return 0;\n    //\u6811\u7684\u9ad8\u5ea6 = max(\u5de6\u5b50\u6811\u7684\u9ad8\u5ea6\uff0c\u53f3\u5b50\u6811\u7684\u9ad8\u5ea6) + 1\n    else\n    {\n        int L_Height = Get_Height(Tree->left);\n        int R_Height = Get_Height(Tree->right);\n        Height = L_Height >= R_Height ? L_Height + 1 : R_Height + 1;\n    }\n    return Height;\n}\n
    • inorder iterative
    #include <stdio.h>\n#include <stdlib.h>\n#include <stdbool.h>\n\n// \u5b9a\u4e49\u4e8c\u53c9\u6811\u7ed3\u70b9\nstruct TreeNode {\n    int val;\n    struct TreeNode* left;\n    struct TreeNode* right;\n};\n\n// \u521b\u5efa\u4e00\u4e2a\u4e8c\u53c9\u6811\u7ed3\u70b9\nstruct TreeNode* createNode(int val) {\n    struct TreeNode* newNode = (struct TreeNode*)malloc(sizeof(struct TreeNode));\n    newNode->val = val;\n    newNode->left = NULL;\n    newNode->right = NULL;\n    return newNode;\n}\n// \u7ed3\u6784\u4f53\u6a21\u62df\u6808\nstruct TreeNodeStack {\n    struct TreeNode* data;\n    struct TreeNodeStack* next;\n};\n\nstruct TreeNodeStack* createStackNode(struct TreeNode* node) {\n    struct TreeNodeStack* stackNode = (struct TreeNodeStack*)malloc(sizeof(struct TreeNodeStack));\n    stackNode->data = node;\n    stackNode->next = NULL;\n    return stackNode;\n}\n\nvoid push(struct TreeNodeStack** stack, struct TreeNode* node) {\n    struct TreeNodeStack* stackNode = createStackNode(node);\n    stackNode->next = *stack;\n    *stack = stackNode;\n}\n\nstruct TreeNode* pop(struct TreeNodeStack** stack) {\n    if (*stack == NULL) {\n        return NULL;\n    }\n    struct TreeNodeStack* temp = *stack;\n    *stack = (*stack)->next;\n    struct TreeNode* node = temp->data;\n    free(temp);\n    return node;\n}\n\nbool isEmpty(struct TreeNodeStack* stack) {\n    return stack == NULL;\n}\n\n// \u4e2d\u5e8f\u904d\u5386\u4e8c\u53c9\u6811\u5e76\u8fd4\u56de\u7ed3\u679c\u4f5c\u4e3a\u6570\u7ec4\nint* inorderTraversal(struct TreeNode* root, int* returnSize) {\n    struct TreeNodeStack* stack = NULL;\n    int* result = (int*)malloc(sizeof(int));\n    int resultSize = 0;\n    struct TreeNode* current = root;\n    while (current != NULL || !isEmpty(stack)) {\n        while (current != NULL) {\n            push(&stack, current);\n            current = current->left;\n        }\n        current = pop(&stack);\n        result = (int*)realloc(result, (resultSize + 1) * sizeof(int));\n        result[resultSize] = current->val;\n        resultSize++;\n        current = current->right;\n    }\n\n    *returnSize = resultSize;\n    return result;\n}\n\n// \u4e3b\u51fd\u6570\nint main() {\n    struct TreeNode* root = createNode(1);\n    root->right = createNode(2);\n    root->right->left = createNode(3);\n\n    printf(\"Inorder Traversal: \");\n    int resultSize;\n    int* result = inorderTraversal(root, &resultSize);\n    for (int i = 0; i < resultSize; i++) {\n        printf(\"%d \", result[i]);\n    }\n    free(result);\n    return 0;\n}\n
    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#tree_1","title":"\u521b\u5efaTREE","text":"
    • 1.Postorder & Inorder \u540e\u5e8f&\u4e2d\u5e8f
    BiTree* postInTree(int post[],int in[],int n)  {\n    if (n<=0)   return nullptr;\n    int i=0;\n    while (post[n-1]!=in[i])    i++;    //i\u4e5f\u6b63\u597d\u662f\u5de6\u5b50\u6811\u8282\u70b9\u6570\n    BiTree* nw=new BiTree;\n    nw->data=in[i];\n    nw->lc=postInTree(post,in,i);       //\u5efa\u5de6\u5b50\u6811\n    nw->rc=postInTree(post+i,in+i+1,n-i-1);     //\u5efa\u53f3\u5b50\u6811\n    return nw;\n}\n
    • 2.preorder & inorder \u524d\u5e8f&\u4e2d\u5e8f
    BiTree* preInTree2(int pre[],int in[],int n)  { //\u8fd9\u662f\u7b14\u8bb0\u4e0a\u7684\u6211\u7684\u65b9\u6cd5,n\u662f\u5f53\u524d\u4e8c\u53c9\u6811\u7684\u8282\u70b9\u6570\n    if (n<=0)   return nullptr;\n    int i=0;\n    while (in[i]!=pre[0])   i++;        //\u6b64\u65f6i\u6b63\u597d\u662f\u5de6\u5b50\u6811\u8282\u70b9\u6570\u3002\u5148\u5e8f\u904d\u5386\u7684\u9996\u5143\u7d20\u4e00\u5b9a\u662f\u6839\u8282\u70b9\n    BiTree* nw=new BiTree;\n    nw->data=in[i];\n    nw->lc=preInTree2(pre+1,in,i);      //\u5efa\u5de6\u5b50\u6811\uff0c\u5de6\u5b50\u6811\u8282\u70b9i\u4e2a\n    nw->rc=preInTree2(pre+i+1,in+i+1,n-i-1);        //\u5efa\u53f3\u5b50\u6811\uff0c\u53f3\u5b50\u6811\u8282\u70b9n-i-1\u4e2a\n    return nw;\n}\n
    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#application","title":"Application","text":"
    • Linux dir\u300cTypical Preoder Traversal\u300d
    static void  ListDir ( DirOrFile D, int Depth )\n{\n    if  ( D is a legitimate entry )   {\n        PrintName (D, Depth );\n        if ( D is a directory )\n            for (each child C of D )\n                ListDir ( C, Depth + 1 );\n    }\n}\n
    • Calculating the size of the directory\u300cTypical Postorder Traversal\u300d

    • \u7ebf\u7d22\u4e8c\u53c9\u6811 Threader Binary Tree Inorder

    Rule 1: If Tree->Left is null, replace it with a pointer to the inorder predecessor of Tree.

    Rule 2: If Tree->Right is null, replace it with a pointer to the inorder successor of Tree.

    Rule 3: There must not be any loose threads. Therefore a threaded binary tree must have a head node of which the left child points to the first node.

    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#binary-search-tree","title":"Binary Search Tree","text":"
    • Delete
    SearchTree Delete(ElementType X, SearchTree T) {\n    Position TmpCell;\n    if (T == NULL) Error(\"not found\");\n    else if (X < T->Element) T->Left = Delete(X, T->Left);\n    else if (x > T->Element) T->Right = Delete(X, T->Right);\n    else {\n        if (T->Left && T->Right) {\n            TmpCell = FindMin(T->Right);\n            T->Element = TmpCell->Element;\n            T->Right = Delete(T->Element, T->Right);\n        } else {\n            TmpCell = T;\n            if (T->Left == NULL) T = T->Right;\n            else if (T->Right == NULL) T = T->Left;\n            free(TmpCell);\n        }\n    }\n    return T;\n}\n
    • All binary trees: Equals n nodes pop sequence!!

    \\(C_{n}=\\sum_{i=1}^{n} C_{i}C{n-i-1}\\)

    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#complete-binary-tree","title":"\u5b8c\u5168\u4e8c\u53c9\u6811\uff08complete binary tree\uff09","text":""},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#basic-properties_2","title":"Basic Properties","text":"
    • \u6240\u6709\u53f6\u8282\u70b9\u90fd\u5728\u76f8\u90bb\u7684\u4e24\u5c42\u4e0a\u7684\u4e8c\u53c9\u6811

    • Basic Properties:

    • \u9664\u4e86\u6700\u540e\u4e00\u5c42\uff0c\u6bcf\u4e00\u5c42\u90fd\u662f\u6ee1\u7684

    • \u6700\u540e\u4e00\u5c42\u7684\u8282\u70b9\u90fd\u9760\u5de6\u6392\u5217

    • \\(2^{h}\\) ~ \\(2^{h+1}-1\\) nodes\\((0,1,2,3- height = 3)\\)

    • \\(h=O(log(n))\\)

    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#insert","title":"INSERT","text":"
    void Insert(ElementType X, MaxHeap H) {\n    if (IsFull(H)) {\n        Error(\"Full Heap\");\n        return;\n    }\n    int i = ++H->Size;\n    for (; H->Elements[i/2] < X; i /= 2) {\n        H->Elements[i] = H->Elements[i/2];\n    }\n    H->Elements[i] = X;\n}\n
    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#delete","title":"DELETE","text":"
    ElementType DeleteMax(MaxHeap H) {\n    if (IsEmpty(H)) {\n        Error(\"Empty Heap\");\n        return H->Elements[0];\n    }\n    int i, Child;\n    ElementType MaxElement, LastElement;\n    MaxElement = H->Elements[1];\n    LastElement = H->Elements[H->Size--];\n    for (i = 1; i * 2 <= H->size; i = Child) {\n        Child = i * 2;\n        if (Child != H->Size && H->Elements[Child + 1] > H->Elements[Child]) {\n            Child++;\n        }\n        if (LastElement < H->Elements[Child]) {\n            H->Elements[i] = H->Elements[Child];\n        } else {\n            break;\n        }\n    }\n    H->Elements[i] = LastElement;\n    return MaxElement;\n}\n

    Question: how to make it a natural stop without using \\(Child != H->size\\)

    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#buildheap-h","title":"BuildHeap ( H )","text":"

    For the perfect binary tree of height h containing \\(2^{h+1}-1\\) nodes, the sum of the heights of the nodes is \\(2^{h+1}-1 -(h + 1)\\).

    \\(T ( N ) = O ( N )\\)

    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#the-dynamic-equivalence-problem","title":"The Dynamic Equivalence Problem","text":"

    A dynamic graph generally refers to a graph that keeps on changing its configuration. Let\u2019s deep dive into it using an example:

    • Let\u2019s consider the edge information for the given graph as: {{1,2}, {2,3}, {4,5}, {6,7}, {5,6}, {3,7}}. Now if we start adding the edges one by one, in each step the structure of the graph will change. So, after each step, if we perform the same operation on the graph while updating the edges, the result might be different. In this case, the graph will be considered a dynamic graph.
    • For example, after adding the first 4 edges if we look at the graph, we will find that node 4 and node 1 belong to different components but after adding all 6 edges if we search for the same we will figure out that node 4 and node 1 belong to the same component.
    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#the-disjoint-set-adt","title":"THE DISJOINT SET ADT","text":"
    • UNION

    NOTE:UNION is the union of the head of one head to another(thus for a random element x,always find the \"head\" element Find(x) and modify s[Find(x)]

    void  SetUnion ( DisjSet S, \n                 SetType Rt1, \n                 SetType Rt2 )\n{    S [ Rt2 ] = Rt1 ;     }\n
    • Find
    SetType  Find ( ElementType X, DisjSet S )\n{   for ( ; S[X] > 0; X = S[X] )   ;\n    return  X ;\n}\n
    • Analysis for the Given problem
    Algorithm using union-find operations\n{  Initialize  Si = { i }  for  i = 1, ..., 12 ;\n   for  ( k = 1; k <= 9; k++ )  {  /* for each pair  i \u7b49\u4ef7j  \u5373\u5982\u679c\u7ed9\u51fa\u4e5d\u7ec4\u7b49\u4ef7\u5173\u7cfb*/\n      if  ( Find( i ) != Find( j ) )\n          SetUnion( Find( i ), Find( j ) );\n   }\n}\n
    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#smart-union-algorithms","title":"Smart Union Algorithms","text":"
    • \uff01\uff01\u5176\u5b9e\u53ef\u4ee5\u4e0d\u5f00\u65b0\u6570\u7ec4\uff0c\u53ea\u8bb0\u5f55\u5728\u6839\u7684\u6570\u636e\u4e2d
    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#union-by-rank","title":"Union by rank","text":"
    • Rank:

    The rank of a node generally refers to the distance (the number of nodes including the leaf node) between the furthest leaf node and the current node. Basically rank includes all the nodes beneath the current node.

    • Algorithm:
    • Initial configuration:
    • rank array: This array is initialized with zero.
    • parent array: The array is initialized with the value of nodes i.e. parent[i] =i.
    • The algorithm steps are as follows:
    • Firstly, the Union function requires two nodes(let\u2019s say u and v) as arguments. Then we will find the ultimate parent (using the findPar() function that is discussed later) of u and v. Let\u2019s consider the ultimate parent of u is pu and the ultimate parent of v is pv.
    • After that, we will find the rank of pu and pv.
    • Finally, we will connect the ultimate parent with a smaller rank to the other ultimate parent with a larger rank. But if the ranks are equal, we can connect any parent to the other parent and we will increase the rank by one for the parent node to whom we have connected the other one.
    void make_set(int v) {\n    parent[v] = v;\n    rank[v] = 0;\n}\nvoid union_sets(int a, int b) {\n    a = find_set(a);\n    b = find_set(b);\n    if (a != b) {\n        if (rank[a] < rank[b])\n            swap(a, b);\n        parent[b] = a;\n        if (rank[a] == rank[b])\n            rank[a]++;\n    }\n}\n
    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#union-by-size","title":"Union by size","text":"
    • Quite similar as Union by rank.
    void make_set(int v) {\n    parent[v] = v;\n    size[v] = 1;\n}\nvoid union_sets(int a, int b) {\n    a = find_set(a);\n    b = find_set(b);\n    if (a != b) {\n        if (size[a] < size[b])\n            swap(a, b);\n        parent[b] = a;\n        size[a] += size[b];\n    }\n}\n
    • Let T be a tree created by union-by-size with N nodes, then \\((Height(T) \\le \\lfloor log_2N \\rfloor + 1)\\)

    • Proof: By induction. (Each element can have its set name changed at most. \\(log_2N\\)

    times.\uff09\u300cUnion by size\u300d

    First , all note are at depth 0 at the very beginning

    Every time,we do Union:the node was set on a new tree whose size is at least twice its size

    So a node from either set can only incrase the depth by \\(1\\)

    For n nodes ,every node can have its set name changed at most \\(log_2N\\) times.

    Thus,Time complexity for Find is \\(O (l o g N )\\)

    • Here is a proof by induction on the tree height k. \u300cUnion By Size\u300d

    The base case K=0 is easy, since a tree of height 0 always has just 1 node

    Suppose the claim is true for h=k. Now consider a union-by-height tree of height k+1.

    There must have been a union that brought two trees together and increased the height of one of them from k to k+1.

    Let those two trees (at the time of that union) be T1 and T2. We know that both T1 and T2 were of height k before the union.

    • If one of them were of height less than k, then union-by-height would have changed the root of that shorter one to make it point to the root of the taller one, and the height of the unioned tree would still be k.
    • Now we can apply the induction hypothesis: the trees T1 and T2 each have at least \\(2^k\\) nodes. Thus, the unioned tree has at least \\(2^k + 2^k = 2^{k+1}\\)nodes.

    • Time complexity of \\(N\\) Union and \\(M\\) Find operations is now. \\(O( N + M log_2N)\\)

    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#note","title":"Note:","text":"

    We can set \\(S [ Root ] = \u2013 size\\), thus we don't need the array size[ ]

    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#path-compression","title":"Path Compression","text":"

    Basically, connecting each node in a particular path to its ultimate parent refers to path compression. Let\u2019s understand it using the following illustration

    1. Base case: If the node and the parent of the node become the same, it will return the node.
    2. We will call the findPar() function for a node until it hits the base case and while backtracking we will update the parent of the current node with the returned value.
    SetType  Find ( ElementType  X, DisjSet  S )\n{\n    if ( S[ X ] <= 0 )    return  X;\n    else  return  S[ X ] = Find( S[ X ], S );//IMPORTANT\uff01\uff01\uff01\n}\n//The simple implementation does what was intended: first find the representative of the set (root vertex), and then in the process of stack unwinding the visited nodes are attached directly to the representative.\nSetType  Find ( ElementType  X, DisjSet  S )\n{   ElementType  root,  trail,  lead;\n    for ( root = X; S[ root ] > 0; root = S[ root ] )\n        ;  /* find the root */\n    for ( trail = X; trail != root; trail = lead ) {\n       lead = S[ trail ] ;   \n       S[ trail ] = root ;   \n    }  /* collapsing */\n    return  root ;\n}\n

    NOTE

    • Though using the path compression technique it seems like the rank of the node is also changing, we cannot be sure about it. So, we will not make any changes to the rank array while applying path compression.
    • Just take \u201cheight\u201d as an estimated rank.
    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#worst-case-for-union-by-rank-and-path-compression","title":"Worst Case for Union-by-Rank and Path Compression","text":"
    #include <stdio.h>\n#include <stdlib.h>\nstruct DisjointSet {\n    int *rank, *parent, *size;\n    int n;\n};\nstruct DisjointSet* createDisjointSet(int n) {\n    struct DisjointSet* ds = (struct DisjointSet*)malloc(sizeof(struct DisjointSet));\n    ds->n = n;\n    ds->rank = (int*)malloc((n + 1) * sizeof(int));\n    ds->parent = (int*)malloc((n + 1) * sizeof(int));\n    ds->size = (int*)malloc((n + 1) * sizeof(int));\n    for (int i = 0; i <= n; i++) {\n        ds->rank[i] = 0;\n        ds->parent[i] = i;\n        ds->size[i] = 1;\n    }\n    return ds;\n}\nint findUPar(struct DisjointSet* ds, int node) {\n    if (node == ds->parent[node])\n        return node;\n    ds->parent[node] = findUPar(ds, ds->parent[node]);//PATH COMPRESSION\n    return ds->parent[node];\n}\nvoid unionByRank(struct DisjointSet* ds, int u, int v) {\n    int ulp_u = findUPar(ds, u);\n    int ulp_v = findUPar(ds, v);\n    if (ulp_u == ulp_v)\n        return;\n    if (ds->rank[ulp_u] < ds->rank[ulp_v]) {\n        ds->parent[ulp_u] = ulp_v;\n    } else if (ds->rank[ulp_v] < ds->rank[ulp_u]) {\n        ds->parent[ulp_v] = ulp_u;\n    } else {\n        ds->parent[ulp_v] = ulp_u;\n        ds->rank[ulp_u]++;\n    }\n}\nvoid unionBySize(struct DisjointSet* ds, int u, int v) {\n    int ulp_u = findUPar(ds, u);\n    int ulp_v = findUPar(ds, v);\n    if (ulp_u == ulp_v)\n        return;\n    if (ds->size[ulp_u] < ds->size[ulp_v]) {\n        ds->parent[ulp_u] = ulp_v;\n        ds->size[ulp_v] += ds->size[ulp_u];\n    } else {\n        ds->parent[ulp_v] = ulp_u;\n        ds->size[ulp_u] += ds->size[ulp_v];\n    }\n}\nint main() {\n    struct DisjointSet* ds = createDisjointSet(7);\n    unionBySize(ds, 1, 2);\n    unionBySize(ds, 2, 3);\n    unionBySize(ds, 4, 5);\n    unionBySize(ds, 6, 7);\n    unionBySize(ds, 5, 6);\n    if (findUPar(ds, 3) == findUPar(ds, 7)) {\n        printf(\"Same\\n\");\n    } else {\n        printf(\"Not same\\n\");\n    }\n    unionBySize(ds, 3, 7);\n    if (findUPar(ds, 3) == findUPar(ds, 7)) {\n        printf(\"Same\\n\");\n    } else {\n        printf(\"Not same\\n\");\n    }\n    free(ds->rank);\n    free(ds->parent);\n    free(ds->size);\n    free(ds);\n    return 0;\n}\n
    "},{"location":"note/%E6%9C%80%E5%A4%A7%E5%AD%90%E5%88%97%E5%92%8C/","title":"Maximum Subsequence Sum Problem","text":"
    • O(\\(N^3\\)) \u300c\u57fa\u672c\u601d\u8def\uff0c\u9010\u4e2a\u5217\u4e3e\uff0c\u7565\u300d

    • O(\\(N^2\\)) \u300c\u4f18\u5316\u4e00\u4e0b\u5217\u4e3e\uff0c\u7565\u300d

    • divide & conquer O(N logN)

    static int\nMaxSubSum(const int A[],int left,int right){\n    int MaxLeftSum, MaxRightSum;\n    int MaxLeftBorderSum, MaxRightBorderSum; \n    int LeftBorderSum, RightBorderSum;\n    int Center, i;\n\n    if( left == right ){\n        if(A[left]>0){\n            return A[left];\n        }\n        else{\n            return 0;\n        }\n    }\n    Center = ( Left +Right ) / 2;\n    MaxLeftSum = MaxSubSum( A, Left, Center ) \n    MaxRightSum = MaxSubSum( A, Center + 1, Right );\n\n    MaxLeftBorderSum = 0; LeftBorderSum = 0;\n\n    for(i=Cente+1;i>=left;i--){\n        LeftBorderSum += A[i];\n        if(leftBorderSum>MaxleftBorderSum){\n            MaxleftBorderSum = LeftBorderSum;\n        }\n    }\n\n    MaxRightBorderSum = 0; \n    RightBorderSum = 0;\n    for(i=Center;i<=Right;i++){\n        RightBorderSum += A[i];\n        if(RightBorderSum > MaxRightBorderSum){\n            MaxRightBOrderSum = RightBorderSum\n        }\n    }\n    return Max(MaxLeftSum,MaxRightSum,MaxLeftBorderSum+MaxRightBorderSum);\n\n}\nint MaxsubsequenceSum( const int A[],intN) {\n    return MaxSubSum( A, 0, N - 1 );\n    }\n

    • \u52a8\u6001\u89c4\u5212 O(N)
    int MaxSubsequenceSum( const int  A[ ],  int  N ) \n{ \n    int  ThisSum, MaxSum, j; \n    ThisSum = MaxSum = 0; \n    for ( j = 0; j < N; j++ ){ \n        ThisSum += A[ j ]; \n        if( ThisSum > MaxSum ){\n            MaxSum = ThisSum; \n        }\n        else if( ThisSum < 0 ){\n            ThisSum = 0;\n        }\n    } \n    return MaxSum; \n} \n
    • If counts negative paths
    int maxSubArray(int* nums, int numsSize) {\n    int pre = 0, maxAns = nums[0];\n    for (int i = 0; i < numsSize; i++) {\n        pre = fmax(pre + nums[i], nums[i]);\n        maxAns = fmax(maxAns, pre);\n    }\n    return maxAns;\n}\n
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/","title":"Chapter 1 Digital Systems and Information","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#breif-intro","title":"Breif Intro","text":"
    • \u505a\u5b58\u50a8\u7684\u65f6\u5019\uff0c\u8bbf\u95ee\u9700\u8981\u5b57\u5bf9\u9f50\uff0c\u6309\u7167\u5b57\u53bb\u53d6
    • Cache \u5c40\u90e8\u6027\u539f\u7406
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#signal","title":"Signal","text":"

    The most commonly used two-valued information is an electrical signal - voltage or current typically two discrete values represented by the voltage range of values.

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#digital-systems","title":"Digital Systems","text":"

    Takes a set of discrete information inputs and discrete internal information (system state) and generates a set of discrete information outputs.

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#types-of-digital-systems","title":"Types of Digital Systems","text":"
    • Combinational Logic System:No state present , one input just decide one output(one to one , no state)

    • Sequential System

    State present

    State updated at discrete times -- Synchronous Sequential System [Periodic]

    State updated att any time -- Asychronous Sequential System

    State function : \\(f_{state}=Function(State,Input)\\)

    Output function : \\(f_{output}=Function(State)\\) or \\(f_{output}=Function(State,Input)\\)

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#organization-of-computer","title":"Organization of Computer","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#embedded-systems","title":"Embedded Systems","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#number-systems-codes","title":"Number Systems & Codes","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#covert","title":"Covert","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#decimal-to-binary","title":"Decimal To Binary","text":"
    • \u6574\u6570\u2014\u2014\u6743\u5c55\u5f00\u5f0f\u96642\uff0c\u4f59\u6570\u6784\u6210\u6700\u4f4e\u4f4d\u2014\u2014\u96642\u53d6\u4f59

    • \u5c0f\u6570\u2014\u2014\u6743\u5c55\u5f00\u5f0f\u4e582\uff0c\u6574\u6570\u6784\u6210\u6700\u9ad8\u4f4d\u2014\u2014\u4e582\u53d6\u6574

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#binary-numbers-and-binary-coding","title":"Binary Numbers and Binary Coding","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#non-numeric-binary-codes","title":"Non-numeric Binary Codes","text":"

    Given n binary digits (called bits), a binary code is a mapping from a set of represented elements to a subset of the \\(2^n\\) binary numbers.

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#number-of-elements-represented","title":"Number of Elements Represented","text":"
    • You can represent 4 elements in radix r = 2 with n = 2 digits: (00, 01, 10, 11).

    • You can represent 4 elements in radix \\(r=2\\) with \\(n=4\\) digits (0001,0010,0100,1000) \\(One\\ Hot\\ Code\\)

    • Other Examples

    • For \\(8\\ 4\\ -2\\ -1\\) \\(\\&\\) \\(Excess\\ 3\\) code -- \"Symmetric\"(complement) Same Probability for \\(0\\) and \\(1\\)
    • \\(Excess\\ 3\\) code -- (real binary value plus 3)
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#binary-coded-decimal-bcd","title":"Binary Coded Decimal (BCD)","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#arithmetic","title":"Arithmetic","text":"

    Add Six

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#ascii","title":"ASCII","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#parity-bit-error-detection-codes","title":"Parity Bit Error-Detection Codes","text":"

    Redundancy (e.g. extra information), in the form of extra bits, can be incorporated into binary code words to detect and correct errors.

    A simple form of redundancy is parity, an extra bit appended onto the code word to make the number of 1\u2019s odd or even.

    Parity can detect all single-bit errors and some multiple-bit errors.

    • A code word has even parity if the number of 1\u2019s in the code word is even.

    • A code word has odd parity if the number of 1\u2019s in the code word is odd.

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#gray-code","title":"Gray Code","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#optical-shaft-encoder","title":"Optical Shaft Encoder","text":"

    Suppose we want to know the angle shifted by the machine.

    If Use Binary Code-- \u5982\u679c\u4e09\u4e2a\u4f20\u611f\u5668\u4f4d\u7f6e\u4e0d\u7edf\u4e00\uff0c\u5728\u4ece000-111\u8fc7\u7a0b\u4e2d\u53ef\u80fd\u4f1a\u51fa\u73b0\uff1a000-100-110-111 -- \u4e2d\u95f4\u8fc7\u7a0b\u7578\u53d8

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/","title":"Chapter 2 Combinational Logic","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#binary-logic-and-gates","title":"Binary Logic and Gates","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#gate-delay","title":"Gate Delay","text":"
    • In actual physical gates, if one or more input changes causes the output to change, the output change does not occur instantaneously.
    • The delay between an input change(s) and the resulting output change is the gate delay denoted by \\(t_{G}\\)
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#t_pd-propagation-delay","title":"\\(t_{pd}\\) [Propagation Delay]","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#inertial-delay","title":"Inertial Delay","text":"
    • Rejection Time [\"Thin\" Pulse cannot take place in real-time circumstances]
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#nmos-and-pmos","title":"NMOS and PMOS","text":"
    • When an \\(NMOS\\) transistor receives a non-negligible voltage, the connection from the source to the drain acts as a wire. Electricity will flow from the source to the drain uninhibited. This is referred to as a closed circuit.

    On the other hand, when an nMOS transistor receives a voltage at around 0 volts, the connection from the source to the drain will be broken, which is referred to as an open circuit.

    • The p-type transistor works counter to the n-type transistor.

    Whereas the nMOS will form a closed circuit with the source when the voltage is non-negligible, the pMOS will form an open circuit with the source when the voltage is non-negligible.

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#tristate-gate","title":"Tristate gate","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#common-logic-gate-circuit","title":"Common logic gate circuit","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#nand-operation","title":"NAND operation","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#nor-operation","title":"NOR operation","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#and-or-invert-operation","title":"AND-OR-INVERT operation","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#exclusive-or","title":"Exclusive OR","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#exclusive-nor","title":"Exclusive NOR","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#basic-concepts-of-boolean-algebra","title":"Basic concepts of Boolean algebra","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#the-xor-identities","title":"The XOR identities","text":"
    • \\(X\\oplus0=X\\ X\\oplus1=\\bar{X}\\)
    • \\(X\\oplus X=0\\ X\\oplus\\bar{X}=1\\)
    • \\(X\\oplus\\bar{Y}=\\bar{X}\\oplus Y=\\overline{X\\oplus Y}\\)
    • \\(X\\oplus Y=Y\\oplus X=X\\bar{Y}+\\bar{X}Y\\)
    • \\(\\overline{X\\oplus Y}=XY+\\bar{X}\\bar{Y}\\)
    • \\((X\\oplus Y)\\oplus Z=X\\oplus(Y\\oplus Z)=X\\oplus Y\\oplus Z\\)
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#basic-properties-of-boolean-algebra","title":"Basic properties of Boolean algebra","text":"
    • \\((X+Y)(X+Z)=X+YZ\\)
    • \\(\\overline{X+Y}=\\bar{X}\u00b7\\bar{Y}\\)
    • \\(\\overline{X\u00b7Y}=\\bar{X}+\\bar{Y}\\)
    • \\(A(A+B)=A\\)
    • \\(A+AB=A\\)
    • \\(A(\\bar{A}+B)=AB\\)
    • \\(A+\\bar{A}B=A+B\\)
    • \\((A+B)(\\bar{A}+C)(B+C)=(A+B)(\\bar{A}+C)\\)
    • \\(AB+\\bar{A}C+BC=AB+\\bar{A}C\\)
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#complementing-and-duality-rules","title":"Complementing and Duality rules","text":"
    • For logic function F, interchange AND and OR operators ;complement each constant value and literal, then obtained the new function is the inverse function of the original function is referred to as: \\(\\bar{F}\\)

    Note the following two points:

    The holding operation priority unchanged, if necessary, add brackets indicate.

    Within converting, public non-operation remains unchanged for several variables

    • Duality rules: For logic function F ,AND \\(\\Leftrightarrow\\) OR 0 \\(\\Leftrightarrow\\) 1

    If F\u2018 is the F Duality, then F is also F\u2019 of Duality. F and F\u2018 is mutually Duality formula .

    If the two logical functions F and G are equal, then the Duality formula F' and G' are also equal.

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#substitution-rules","title":"Substitution rules","text":"

    Any logical equation that contains a variable A, and if all occurrences of A's position** are replaced with a logical function F, the equation still holds.

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#shannon-formula","title":"Shannon formula","text":"

    \u2013 Assuming: Function F contained variables \\(x\\)\u3001\\(\\bar{x}\\), at \"x AND F\" operation, variable \\(x\\) may be replaced by 1 , variable \\(\\bar{x}\\) can be replaced by 0.

    \u2013 At \"x AND F\" operation, \\(x\\) can be \"0\", \\(\\bar{x}\\) can be replaced with \"1\" .

    \\(xf(x,\\overline{x},y...)=xf(1,0,y\u2026)\\)

    \\(\\overline{x}f(x,\\overline{x},y...)=\\overline{x} f(0,1,y...)\\)

    Similarly

    \\(x+f(x,\\bar{x},y\u2026\u2026z)=x+f(0,1,y\u2026\u2026z)\\)

    \\(\\bar{x}+f(x,\\bar{x},y\u2026\u2026z)=\\bar{x}+f(1,0,y\u2026\u2026,z)\\)

    If the function F contains the both of the variables \\(x,\\bar{x}\\) may be follow:

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#simplification","title":"Simplification","text":"
    • Example
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#or-and-style-simplification","title":"OR-AND style simplification","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#standard-forms","title":"Standard Forms","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#canonical-forms","title":"Canonical Forms","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#miniterms","title":"Miniterms","text":"

    Minterms are AND terms with every variable present in either true or complemented form.

    Given that each binary variable may appear normal (e.g., x) or complemented (e.g., x ), there are \\(2^n\\) minterms for n variables. denoted as \\(m_i\\)

    • only one set of variables value make to 1 for any one minterm .
    • any two minterms multiplied equal to 0
    • Sum of all minterms equal to 1
    • Any one minterm is not contained in the original function F,it can be seen as inAnti-function \\(\\bar{F}\\) \u3002

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#maxterms","title":"Maxterms","text":"

    Maxterms are OR terms with every variable in true or complemented form.

    Given that each binary variable may appear normal (e.g., x) or complemented (e.g., x), there are \\(2^n\\) maxterms for n variables. denoted as \\(M_i\\)

    • only one set of variables value make to 0 for any one Maxterm
    • sum of any two Maxterms equal to \\(M_i+M_j=1 \\ i\\ne j\\)
    • Product of all Maxterms equal to 0
    • Any one Maxterm is not contained in the original function F,it can be seen as inAnti-function \\(\\bar{F}\\)

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#minterm-and-maxterm-relationship","title":"Minterm and Maxterm Relationship","text":"
    • \\(M_i\\) and \\(m_i\\) is complement \\(\\overline{M_i}=m_i\\)
    • \\(F=\\sum m_i = \\overline{\\Pi M_i}\\)
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#function-of-the-canonical-forms","title":"Function of the canonical forms","text":"
    • Sum of Minterms(SOM)
    • Product of Maxterms (POM)
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#standard-forms_1","title":"Standard Forms","text":"
    • Standard Sum-of-Products (SOP) : Equations are written as OR of AND terms
    • Standard Product-of-Sums (POS) : Equations are written as AND of OR terms

    For a logical function SOP or POS is the optimized\uff08\u4e24\u7ea7\u95e8\uff0c\u95e8\u7ea7\u6570\u6700\u5c0f\uff09

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#karnaugh-map-of-functio","title":"Karnaugh map of Functio","text":"

    \u7565.

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#multi-level-circuit-optimization","title":"Multi-level circuit optimization","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#cost","title":"COST","text":"
    • Literal Cost : Just Literal Appearances

    • Gate Input Cost \\(G\\) : Add AND OR term but exclude one-literal term

    AB+CD+E -- 7

    BD+ABC+ACD --11

    • \\(GN\\) Add inverters [For the same variable only count once]

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#other-gate-types","title":"Other Gate Types","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#primitive-gates","title":"Primitive Gates","text":"

    A gate that can be described using a single primitive operation type (AND or OR) plus an optional inversions.

    • BUFFER

    The same as a connection -- improve circuit voltage levels and increase the speed of circuit operation.(decrease propagation delay)

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#complex-gates","title":"Complex Gates","text":"

    Requires more than one primitive operation type for its description.

    • XOR Impletations

    • Odd Functions and Even Functions

    XOR -- Odd Functions

    Use inversions -- Even Functions

    • P -- Generate the Parity bit

    • E--Decide whether the translated inf is Error

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#high-resistance-output-tristate-gate","title":"High-Resistance output (tristate gate)","text":"

    Three-state logic adds a third logic value, Hi-Impedance (\\(Hi-Z\\)), giving three states: \\(0, 1, and\\ Hi-Z\\) on the outputs.

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#the-3-state-buffer","title":"The 3-State Buffer","text":"
    • Resolving 3-State Values on a Connection

    Connection of two 3-state buffer outputs, B1 and B0, to a wire, OUT:

    • Data Selection Function with 3-state buffers

    • Last Row of the table will never occur
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#transmission-3-state-gate","title":"Transmission 3-state gate","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/","title":"Chapter 3 Combinational Logic Design","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#design-procedure","title":"Design Procedure","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#design-example","title":"Design Example","text":"
    • BCD to Excess 3 --Refer to PPT
    • NOTE: The '1' comes from -- \\(\\bar{T_1}\\)

    We can neglect the inversion of input iterals ; but the intermediate varaible\u2019s inversions cannot be neglected

    • For the first -- 3\u7ea7 but high cost

    • For the latter-- 4\u7ea7 but low cost

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#technology-mapping","title":"Technology Mapping","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#decoder","title":"Decoder","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#3-to-8-line-decoder","title":"3-to-8 line decoder","text":"
    • Basic Form : \\((2^3)\\) 8-3-input AND gates.

    • Split to 2-to-4-line decoder and 1-to-2-line decoder. [Simplify]

    Another Example

    • Basic \\(128*7\\)

    • 3-to-8 & 4-to-16. -- \\(128*2 + 8*3+16*4\\)

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#decoder-with-enable","title":"Decoder with Enable","text":"
    • Or to interpret in this way : Use \\(A_1\\) and \\(A_0\\) to decide \\(EN\\) was allocated to which output (\\(D_0\\ D_1\\ D_2\\ D_3\\))
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#decoder-and-or-gate","title":"Decoder and OR gate","text":"

    Theoratically realize all logic functions \\((SOM)\\)

    • Example Refer to PPT
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#display-decoder","title":"Display Decoder","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#7-segment-displayer","title":"7-segment Displayer","text":"

    To decrease count of the pins

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#encoding","title":"Encoding","text":"
    • Example Decimal to BCD

    If two signals are high simultaneously ? -- Meaningless

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#priority-encoder","title":"Priority Encoder","text":"

    If more than one input value is \\(1\\), then the encoder just designed does not work.

    One encoder that can accept all possible combinations of input values and produce a meaningful result is a priority encoder

    • Among the \\(1s\\) that appear, it selects the most significant input position (or the least significant input position)containing a 1 and responds with the corresponding binary code for that position.

    To process \u4e2d\u65ad\u4e8b\u4ef6

    • Could use a K-map to get equations

    • Also can be read directly from table and manually optimized if careful

    \\(A_2=D_4\\)

    \\(A_1=\\bar{D_4}D_3+\\bar{D}_4\\bar{D}_3D_2=\\bar{D_4}F_1. F_1=(D_3+D_2)\\)

    \\(A_0=\\bar{D}_4D_3+\\bar{D_4}\\bar{D_3}\\bar{D_2}D_1=\\bar{D_4(D_3+\\bar{D_2}D_1)}\\)

    \\(V=D_4+F_1+D_1+D_0\\)

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#multiplexers","title":"Multiplexers","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#multiplexer-width-expansion","title":"Multiplexer Width Expansion","text":"
    • GN(22)

    • Three State can connect all output to one line. --GN=18 (a)

    • GN=14 (b)

    Disadvantages : Takes much time .

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#example","title":"Example","text":"
    • Gray to Binary Code
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#approach-1","title":"Approach 1","text":"

    Refer to \\(PPT\\)

    Note that the multiplexer with fixed inputs is identical to a ROM with 3-bit addresses and 2-bit data!

    • Full adder

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#approach-2","title":"Approach 2","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#arithmetic-functions","title":"Arithmetic Functions","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#half-adder","title":"Half-Adder","text":"

    The most COMMON:

    • \\(S=X\\oplus Y\\ C=XY\\)
    • \\(S=(X+Y)\\bar{C}\\ C=\\overline{(\\overline{XY})}\\)
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#full-adder","title":"Full-Adder","text":"

    \\(X\\oplus Y\\) only different from \\(X+Y\\) when \\(XY=1\\)

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#binary-adders","title":"Binary Adders","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#carry-lookhead","title":"Carry Lookhead","text":"
    • To get \\(C_n\\) not dependent on \\(C_{n-1}\\)

    \\(P_i=A_i\\oplus B_i\\ \\ \\ G_i=A_iB_i\\\\S_i=P_i\\oplus C_i\\ \\ \\ C_{i+1}=G_i+P_iC_i\\)

    Thus,we have

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#group-carry-lookahead-logic","title":"Group Carry Lookahead Logic","text":"

    Disadvantages :

    • Too many Fan-Outs(propagation delay increase)
    • High Cost

    So Simple copy the CLA to more bits is not practical.

    • \u4f7f\u7528\u7b2c\u4e8c\u5c42CLA \u51cf\u5c11\u4f20\u8f93\u5ef6\u8fdf

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#unsigned-subtraction","title":"Unsigned Subtraction","text":"
    • TOO Complicated!
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#complements","title":"Complements","text":"
    • 1's Complement
    • 2's Complement
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#subtraction-with-2s-complement","title":"Subtraction with 2\u2019s Complement","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#signed-integers","title":"Signed Integers","text":"
    • Signed-Magnitude
    • Signed-Complement
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#2s-complement-addersubtractor","title":"2\u2019s Complement Adder/Subtractor","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#overflow-detection","title":"Overflow Detection","text":"

    Overflow V = \\(C_n\\oplus C_{n-1}\\)

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#incrementing-decrementing","title":"Incrementing & Decrementing","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#incrementing","title":"Incrementing","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#multiplicationdivision-by-2n","title":"Multiplication/Division by \\(2^n\\)","text":"
    • Zero Fill
    • Filling usually is applied to the MSB end of the operand, but can also be done on the LSB end
    • Extension- increase in the number of bits at the MSB end of an operand by using a complement representation

    Copies the MSB of the operand into the new positions

    Positive operand example - 01110101 extended to 16 bits:0000000001110101

    Negative operand example - 11110101 extended to 16 bits:1111111111110101

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#arithmetic-logic-unitalu-implementation","title":"Arithmetic Logic Unit(ALU) implementation","text":"

    \\(Y_i=B_iS_0+\\bar{B_i}S_1\\)

    The Above Part -- (Basic ALU like above)

    The below Part -- AND OR XOR NOT (one bit)

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#combinational-shifter-parameters","title":"Combinational Shifter Parameters","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/","title":"Chapter 4 Sequential Logic","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#storage-elements-and-sequential-circuit-analysis","title":"Storage Elements and Sequential Circuit Analysis","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#types-of-sequential-circuits","title":"Types of Sequential Circuits","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#synchronous","title":"Synchronous","text":"
    • Behavior defined from knowledge of its signals at discrete instances of time
    • Storage elements observe inputs and can change state only in relation to a timing signal (clock pulses from a clock)
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#asynchronous","title":"Asynchronous","text":"
    • Behavior defined from knowledge of inputs an any instant of time and the order in continuous time in which inputs change

    • If clock just regarded as another input, all circuits are asynchronous!

    • Nevertheless, the synchronous abstraction makes complex designs tractable!

    Circuit Delay Model"},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#latches","title":"Latches","text":"
    • Long term maintaining a given stable state
    • There are two stable states, \"0\", \"1\"
    • Under certain conditions, can change state at anytime
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#basicnand-bars-barr-latch","title":"Basic(NAND) \\(\\bar{S}-\\bar{R}\\) Latch","text":"
    • So RS state 00 is forbidden!
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#basicnor-s-r-latch","title":"Basic(NOR) \\(S-R\\) Latch","text":"
    • So RS state 11 is forbidden!
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#clocked-s-r-latch","title":"Clocked S-R Latch","text":"
    • Adding two NAND gates to the basic S - R NAND latch gives the clocked S \u2013 R latch
    • Has a time sequence behavior similar to the basic S-R latch except that the S and R inputs are only observed when the line C is high.
    Details"},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#d-latch","title":"D Latch","text":"
    • Adding an inverter to the S-R Latch, gives the D Latch -- No indeterminate states
    Q D Q(t+1) Comment 0 0 0 No Change 0 1 1 Set Q 1 0 0 Clear Q 1 1 1 No Change"},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#the-latch-timing-problem","title":"The Latch Timing Problem","text":"
    • We CANNOT be sure what value will Y output when C=0
    • This is the Latch Timing Problem.
    • In one Clock Pulse, Y can change many times if the Input Changes.
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#flip-flops","title":"Flip-Flops","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#s-r-master-slave-flip-flop","title":"S-R Master-Slave Flip-Flop","text":"
    • The Problem of 1s Catching

    While \\(C=1\\) \\(S\\) \\(and/or\\) \\(R\\) are permited to change.

    • Suppose \\(Q\\) =\\(0\\) and \\(S\\) goes to \\(1\\) and then back to \\(0\\) with \\(R\\) remaining at \\(0\\)

    The master latch sets to \\(1\\)

    A \\(1\\) is transferred to the slave

    • Suppose \\(Q\\) = \\(0\\) and \\(S\\) goes to \\(1\\) and back to \\(0\\) and \\(R\\) goes to \\(1\\) and back to \\(0\\)

    The master latch sets and then resets

    A \\(0\\) is transferred to the slave

    • Personally main problem: The hold state when \\(S=R=0\\)
    Details"},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#edge-triggered-d-flip-flop","title":"Edge-Triggered D Flip-Flop","text":"
    • The delay of the S-R master-slave flip-flop can be avoided since the 1s-catching behavior is not present with D replacing S and R inputs
    • The change of the D flip-flop output is associated with the negative edge at the end of the pulse
    • It is called a negative-edge triggered flip-flop
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#flip-flop-timing-parameters","title":"Flip-Flop Timing Parameters","text":"
    • \\(t_s\\) -- Setup Time

    Master-slave - Equal to the width of the triggering pulse (Because of the 1's Catching the triggering pulse once arrives is forbidden to change)

    Edge-triggered - Equal to a time interval that is generally much less than the width of the the triggering pulse

    • \\(t_h\\) Hold Time -- often equal to zero

    • \\(t_w\\) Clock Pulse Width

    • \\(t_{px}\\)

    Same parameters as for gates except that measured from clock edge that triggers the output change to the output change.

    More Specifically

    • \u8fd9\u51e0\u4e2a\u65f6\u95f4\u70b9\u8d77\u70b9/\u7ec8\u70b9\u90fd\u662f\u89e6\u53d1\u8fb9\u7f18\uff1b
    • Propagation Time \u4e00\u5b9a\u957f\u4e8e Hold Time\uff0c\u56e0\u6b64\u5728\u8ba1\u7b97\u7535\u8def\u5ef6\u8fdf\u65f6\u53ea\u8003\u8651 Propagation Time\uff1b
    • Pulse-trigger \u548c Edge-trigger \u5728\u8868\u73b0\u4e0a\u7684\u533a\u522b\u5728\u4e8e Setup Time\uff0c\u524d\u8005\u9700\u8981\u8986\u76d6\u6574\u4e2a pulse(pos or neg)\uff1b

    Summary"},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#sequential-circuit-design","title":"Sequential Circuit Design","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#state-table","title":"State Table","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#state-diagrams","title":"State Diagrams","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#moore-models","title":"Moore Models","text":"

    Outputs are a function ONLY of states

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#mealy-models","title":"Mealy Models","text":"

    Outputs are a function of inputs AND states

    Details"},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#equivalent-state","title":"Equivalent State","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#circuit-and-system-level-timing","title":"Circuit and System Level Timing","text":"
    • \\(t_p\\) clock period --The interval between occurrences of a specific clock edge in a

    periodic clock

    • \\(t_{pd,COMB}\\) -- total delay of combinational logic along the path from flip-flop output to

    flip-flop input

    • \\(t_{slack}\\) -- extra time in the clock period in addition to the sum of the delays and

    setup time on a path : Must be greater than or equal to zero on all paths for correct operation

    • \\(t_{pd,FF}\\) -- Flip-Flop's delay

    • Timing Equations

    \\(t_p=t_{slack}+(t_{pd,FF}+t_{pd,COMB}+t_s)\\)

    \\(t_{stack}\\) must be greater than or equal to zero so \\(t_{p} \\ge max(t_{pd,FF}+t_{pd,COMB}+t_s)\\)

    from all paths from flip-flop output to flip-flop input

    • Can be calculated more precisely by using \\(t_{PHL}\\) and \\(t_{PLH}\\) values instead of \\(t_{pd}\\) values, but requires consideration of inversions on paths

    • Calculation[Refer to PPT]

    Example Recognize 1101 Milley Model Moore Model

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#state-assignment","title":"State Assignment","text":"
    • Each of the m states must be assigned a unique code
    • Minimum member of bits required is n such that \\(n\\ge[log_2m]\\)

    The task of state assignment involves determining the encoding length and finding an optimal (often challenging) or near-optimal state assignment scheme, leading to different expressions for output functions and activation functions, and consequently varying circuit complexities. The basic principles of state assignment are:

    1. Determine the length of the encoding.
    2. Seek an optimal (difficult to find) or near-optimal state assignment scheme.

    The fundamental principles of assignment are as follows:

    • Under the same input conditions, states with the same next states should preferably be assigned adjacent binary codes.
    • Under adjacent input conditions, the next states of the same current state should preferably be assigned adjacent binary codes.
    • Current states with identical outputs should preferably be assigned adjacent binary codes.
    • Minimize the occurrence of the most frequently appearing states in the state table, or assign logic 0 to initial states.

    Generally, the first principle is of greater importance and should be prioritized. Subsequently, consideration should be given to the frequency of occurrence of state pairs resulting from the first three principles, with a preference for assigning adjacent binary codes to state pairs with higher frequencies.

    • EXAMPLE -- Refer to the PPT

    • Design a sequential modulo 3 accumulator for 2-bit operands

    Details"},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#other-flip-flop-types","title":"Other Flip-Flop Types","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#j-k-flip-flop","title":"J-K Flip-Flop","text":"

    Same as S-R flip-flop with J analogous to S and K analogous to R

    • J=K=1 is allowed ; the flip-flop changes to opposite state
    • As a master-slave, has same \u201c1s catching\u201d behavior as S-R flip-flop
    • To avoid 1s catching behavior,one solution used is to use an edge-triggered D as the core of the flip-flop

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#t-flip-flop","title":"T Flip-flop","text":"

    Has a single input T

    • For T = 0, no change to state
    • For T = 1, changes to opposite state

    Same as a J-K flip-flop with J = K = T

    • As a master-slave, has same \u201c1s catching\u201d behavior as J-K flip-flop
    • Cannot be initialized to a known state using the T input

    • To avoid 1s catching behavior,one solution used is to use an edge-triggered D as the core of the flip-flop

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#basic-flip-flop-descriptors","title":"Basic Flip-Flop Descriptors","text":"
    • Characteristic Table
    • Excitation Table

    Eg.

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#flip-flop-behavior-example","title":"Flip-Flop Behavior Example","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/DHI/Digital%20Hardware%20Implementation/","title":"Chapter 5 Digital Hardware Implementation","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/DHI/Digital%20Hardware%20Implementation/#programmable-logic","title":"Programmable Logic","text":"
    1. Economies of Large-Scale Production: Large-scale production of integrated circuits reduces the cost per chip as production costs can be spread across a greater number of chips. Initial setup and tooling expenses incurred during the production process can be amortized over a larger quantity, resulting in lower costs per chip.
    2. Small-Scale Design Requirements: While large-scale production is generally more economical, some designs may require only a relatively small number of chips. This could be due to the customized nature of specific applications or limitations in market size.
    3. Need for ICs that can be Produced in Large Volumes and Handle Small-Scale Designs: This indicates a requirement for integrated circuits that can be both mass-produced efficiently and effectively accommodate multiple designs.
    4. Programmable Logic Devices: These are a specialized category of integrated circuits that can be programmed after manufacturing. They can be divided into two types: field-programmable logic devices (FPLDs), which can be programmed outside the manufacturing environment, and erasable/reprogrammable logic devices.
    5. Erasable and Reprogrammable Nature: Most programmable logic devices possess the ability to be erased and reprogrammed. This feature allows for updating devices, correcting errors, and reusing the device for different designs, showcasing a high level of reusability.
    6. Used for Prototyping and Laboratory Teaching: Programmable logic devices are well-suited for prototyping as they enable engineers to make adjustments and modifications after the initial design is completed. Additionally, they serve as ideal tools in laboratory settings for demonstrating various designs and concepts.
    7. Utilized in Prototype Verification for Design: Programmable logic devices are often employed to verify design prototypes, allowing for debugging and testing before the final manufacturing of regular integrated circuits. For instance, complete Intel Pentium designs were prototyped using specialized systems based on a large number of VLSI programmable devices.
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/DHI/Digital%20Hardware%20Implementation/#programming-technologies","title":"programming technologies","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/DHI/Digital%20Hardware%20Implementation/#permanent","title":"Permanent","text":"
    • Mask Programming
    • Fuse
    • Antiques
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/DHI/Digital%20Hardware%20Implementation/#not-permanent","title":"Not Permanent","text":"
    • Volatile - Programming lost if chip power lost

    SIngle-bit-storge element

    • Non-volatile

    \u200b Reasable

    \u200b Eletrically erasable

    \u200b Flash

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/DHI/Digital%20Hardware%20Implementation/#read-only-memoryrom","title":"Read Only Memory(ROM)","text":"
    • OR Gate Changable
    • \u4e5f\u53ef\u4ee5\u5c06\u8f93\u5165\u770b\u4f5c addr, \u8f93\u51fa\u770b\u4f5c data,\u6765\u4f5c\u50a8\u5b58\u529f\u80fd
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/DHI/Digital%20Hardware%20Implementation/#programmable-array-logicpal","title":"Programmable Array Logic(PAL)","text":"
    • AND Gate Changable

    \u53ef\u5c06\u9996\u6b21\u4e0e\u6216\u5f53\u4f5c\u8f93\u5165\u56de\u5230AND gates input \u53ef\u5b9e\u73b0\u591a\u53d8\u91cf\u4e0e\u6216.

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/DHI/Digital%20Hardware%20Implementation/#programmable-logic-array-pla","title":"Programmable Logic Array (PLA)","text":"
    • And Or gates all changable
    • \\(And\\) Gates limited

      \u9002\u5f53\u53d6\u53cd\uff0c\u5c06\u9700\u89816\u4e2a\u4e0e\u9879\u2192 \u9700\u89814\u4e2a\u4e0e\u9879

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/DHI/Digital%20Hardware%20Implementation/#complex-programmable-logic-device-cpld-or-field-programmable-gate-arrayfpga","title":"Complex Programmable Logic Device (CPLD) or Field-Programmable Gate Array(FPGA)","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/DHI/Digital%20Hardware%20Implementation/#look-up-tables","title":"Look up tables","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/","title":"Chapter 7 Memory Basics","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#memory-organization","title":"Memory Organization","text":"
    • Access is based on words as the access unit.
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#basic-memory-operations","title":"Basic Memory Operations","text":"
    • Read Memory
    Chip select Read/not Write memory operation 0 None 1 0 Write to selected word 1 1 Read from selected word
    • Write Memory
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#memory-opertion-timing","title":"Memory opertion timing","text":"

    65ns -- 'read speed'--is critical for the whole speed.

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#ram","title":"RAM","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#types-of-random-access-memory","title":"Types of Random Access Memory","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#static-ram-cell","title":"Static RAM -- Cell","text":"

    Information stored in Latches

    Select = 0 HOLD

    Select = 1 OUTPUT DATA. \u300cINPUT depends on \\(B\\) and \\(\\bar{B}\\)\u300d

    • Bit select = 0 : NO WRITING or READING -- Bit Slice Disabled

    • Word select : only one allowed to be ONE

    • Bit select = 1:

    Read/not Write B not B Word select Result 1 0 0 1 One piece of information stored in one selected latch output 0 Data not Data 1 The input information is stored in the one selected latch
    • \\(2^{n-1}\\) Word using 1-Bit RAM IC

    Chip Select : When CS=0 Data Output \u9ad8\u963b\u6001

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#cell-arrays-and-coincident-selection","title":"Cell Arrays and Coincident Selection","text":"
    • Uses two decoders, one for words and one for bits
    • Word select becomes Row select
    • Bit select becomes Column select

    16x1

    • Still one ONE chosen
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#ram-ics-with-1-bitword","title":"RAM ICs with > 1 Bit/Word","text":"

    8x2

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#making-larger-memories-word-extension","title":"Making Larger Memories: Word extension","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#making-wider-memories-bit-extension","title":"Making Wider Memories: Bit extension","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#dynamic-ram","title":"Dynamic RAM","text":"

    information stored as electrical charges

    • Read will affect the stored information(has to write again)

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#read-write","title":"Read & Write","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#types","title":"Types","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#synchronous-dram-sdram","title":"Synchronous DRAM (SDRAM)","text":"

    Transfers to and from the DRAM are synchronize with a clock

    Synchronous registers appear on:

    • Address input
    • Data input
    • Data output

    Column address counter

    • for addressing internal data to be transferred on each clock cycle
    • beginning with the column address counts up to column address + burst size \u2013 1

    Example: Memory data path width: 1 word = 4 bytes

    SDRAM burst time-- burst size=4

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#double-data-rate-sdram-ddr-sdram","title":"Double Data Rate SDRAM (DDR SDRAM)","text":"
    • Transfers data on both edges of the clock

    • Provides a transfer rate of 2 data words perclock cycle

    • Example: Same as for synchronous DRAM

    Read cycle time = 60 ns

    Memory Bandwidth: (2 x 32)/(60 x 10-9) = 1.066 Mbytes/sec

    • SRAM as Cache -- read more memory than expected makes CPU reads faster when asking for other data(CPU reads from SRAM)

    SPEED UP!

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#rambus-dram-rdram","title":"RAMBUS\u00ae DRAM (RDRAM)","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#dependence-on-power-supply","title":"Dependence on Power Supply","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#volatile","title":"Volatile","text":"

    Loses stored information when power turned off

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#non-volatile","title":"Non-volatile","text":"

    Retains information when power turned off

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/","title":"Registers and Register Transfers","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#registers","title":"Registers","text":"Example"},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#storage-and-load-enable","title":"Storage and Load Enable","text":"
    • Load = 0 : Store

    • Load = 1 : Load

    The Problem is : Clock Skew \u300cAnd Gate Delay\u300d

    \u52d8\u8bef Load = 0 \u65f6 \u8109\u51b2\u6d88\u5931\uff0c\u5bc4\u5b58\u5668\u65e0\u6cd5\u88ab\u8f7d\u5165

    Example

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#register-transfer","title":"Register Transfer","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#microoperations","title":"Microoperations","text":"

    Logical Groupings:

    • Transfer - move data from one register to another
    • Arithmetic - perform arithmetic on data in registers
    • Logic - manipulate data or use bitwise logical operations
    • Shift - shift data in registers

    \\(if\\ \\ (K_1=1)\\ then\\ \\ (R_2\u2190R_1)\\) \u8868\u793a\u4e3a \\(K_1 : R_2\u2190R_1\\)

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#register-transfer-structures","title":"Register Transfer structures","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#multiplexer-based-transfers","title":"Multiplexer-Based Transfers","text":"

    note : clocks are omitted for clarity

    \\(K_1 : R_0\u2190R_1\\)

    \\(K2\\bar{K1}: R_0\u2190R_2\\)

    • \\(R_0\\) 's Load : \\(K_1+K2\\bar{K1}=K_1+K_2\\)

    Detailed-logic

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#register-cell-design","title":"Register Cell Design","text":"
    • Example 1 Not encoded \u300cone hot code\u300d

    • Example 2 Encoded. \u300cBinary or Gray\u300d

    EG1: Example

    Register A (m-bits) Sepecification:

    Data input B

    Control input \\(C_x \\ C_y\\) with combinations\\((0,0)\\ (0,1)\\ (1,0)\\)

    Register Transfers:

    \\(C_x : A \\leftarrow A\\ or\\ B\\)

    \\(C_y\\) : \\(A \\leftarrow A\\ xor\\ B\\)

    Hold State : \\((0,0)\\)

    Multiplexer Approach

    Thus , we have :

    \\(Load = C_x + C_y\\)

    Cost : 6+3+2(or)+8(xor) = 19

    Sequential Circuit Design Approach

    • State table\u300cCost Less\u300d

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#bus-based-transfers","title":"Bus-Based Transfers","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#dedicated-mux-based-transfers","title":"Dedicated Mux-Based Transfers","text":"

    Similar to using a MUX, the MUX in this case is no longer dedicated logic for a specific register but is shared logic used by three registers.

    The MUX in the bus selects one input among all registers and outputs it to all registers. The bus controls which (or how many) registers receive this signal by manipulating the Load signal.

    Advantages:

    1. The circuit is more streamlined, resulting in lower costs, and this advantage becomes more apparent as the number of registers increases.
    2. Cost-effectiveness is improved with the shared logic, as opposed to dedicated logic for each register.

    Disadvantages:

    1. At any given moment, the bus can only transmit one piece of data, meaning there is only one data source.
    2. Only one data transfer is possible to other locations within the same clock cycle. For instance, performing a swap operation requires at least two buses to implement.\u300c\u65e0\u6cd5\u505a\u5e76\u884c\u4f20\u8f93\u300d
    3. Due to these characteristics, the requirements must be carefully evaluated, and the appropriate structure chosen for implementation.

    Gate Cost. (increase linearly)

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#three-state-bus","title":"Three-State Bus","text":"

    The 3-input MUX can be replaced by a 3-state node (bus) and 3-state buffers.

    • Cost is further reduced, but transfers are limited.
    • Characterize the simultaneous transfers possible with this structure.
    • Characterize the cost savings and compare.
    • The input and output can share the same line, requiring only n pins.

    Gate Cost Only 2n (suppose cost for three-state is 2)

    Example

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#shift-registers","title":"Shift Registers","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#_1","title":"\u4e32\u884c\u5b9e\u73b0","text":"

    \u5047\u8bbe\u73b0\u5728\u6211\u4eec\u6709 4 \u4e2a FF \u9996\u5c3e\u76f8\u8fde\uff0c\u73b0\u5728\u4e32\u884c\u8f93\u5165 1001 \u8fd9 4bits \u7684\u6570\u636e\uff08\u5f53\u7136\uff0c\u5b8c\u5168\u8f93\u5165\u9700\u8981 4 \u4e2a\u65f6\u949f\u5468\u671f\uff09\u3002

    \u5047\u8bbe\u7b2c 1 \u4e2a\u5468\u671f\u7ed3\u675f\u540e\uff0c1001 \u6700\u53f3\u4fa7\u7684 1 \u88ab\u5b58\u5728\u4e86\u7b2c\u4e00\u4e2a FF\uff0c\u5219\uff1a

    \u5468\u671f \u5f85\u8f93\u5165 FF1 FF2 FF3 FF4 SO 1 100 1 ? ? ? 1??? 2 10 0 1 ? ? 01?? 3 1 0 0 1 ? 001? 4 1 0 0 1 1001 5 ? 1 0 0 ?100 6 ? ? 1 0 ??10 7 ? ? ? 1 ???1
    • \u8fd9\u91cc\u7684 SO \u6307\u7684\u662f\u4ece\u5f53\u524d\u8f6e\u6b21\u5f00\u59cb\uff0c\u8bfb\u5165 4bits \u6570\u636e\u5f97\u5230\u7684\u4e32\u884c\u8f93\u51fa\u7ed3\u679c\uff0c\u8fd9\u91cc\u7684 4bits \u5f53\u7136\u662f\u5bf9\u5e94\u8f93\u5165\u7684 4bits\u3002

    • \u53ef\u4ee5\u53d1\u73b0\uff0c\u5728\u7b2c\u56db\u8f6e\u524d\u540e\u7684\u7ed3\u679c\u5206\u522b\u662f\u5de6\u79fb\u548c\u53f3\u79fb\u7684\u7ed3\u679c\uff0c\u5f53\u7136\uff0c\u5982\u679c\u662f\u8981\u8003\u8651\u5177\u6709\u5b9e\u9645\u8ba1\u7b97\u4ef7\u503c\u7684\u4f4d\u79fb\uff0c\u6211\u4eec\u5f53\u7136\u9700\u8981\u586b\u5145 ? \u7684\u503c\uff0c\u4e0d\u8fc7\u8fd9\u90fd\u662f\u5c0f\u4e8b\u60c5\u3002

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#parallel-load-shift-registersmux","title":"Parallel Load Shift Registers\u300cMux\u300d","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#shift-registers-with-additional-functions","title":"Shift Registers with Additional Functions","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#counters","title":"Counters","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#ripple-counter","title":"Ripple Counter","text":"Example
    • The operating frequency gradually reduces to half of the previous layer.
    • Also, there is an intermediate process, eg. the transition from 111 to 000 has to go through 010
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#synchronous-counter","title":"Synchronous Counter","text":"

    Internal details => Incrementer

    Internal Logic

    • \ufeff\ufeffXOR complements each bit
    • \ufeff\ufeffAND chain causes complement of a bit if all bits toward LSB from it equal 1

    Count Enable

    • Forces all outputs of AND chain to 0 to \"hold\" the state

    Carry Out

    • Added as part of incrementer

    • Connect to Count Enable of additional 4-bit counters to form larger counters

    \u4e3a\u4e86\u5b9e\u73b0\u9006\u5411\u8ba1\u6570\u5668\uff0c\u6211\u4eec\u5219\u9700\u8981\u5c06\u81ea\u589e\u5668\u6362\u4e3a\u81ea\u51cf\u5668\u3002\u505a\u6cd5\u53ea\u4e0d\u8fc7\u662f\u5c06\u5f02\u6216\u95e8\u7684\u63a7\u5236\u4fe1\u53f7\u53d6\u53cd

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#counter-with-parallel-load","title":"Counter with parallel load","text":"count Load Operation 0 0 Hold 0 1 Load Parallel data 1 x count"},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#design-example","title":"Design Example","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#synchronous-bcd","title":"Synchronous BCD","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#counting-modulo-n","title":"Counting Modulo N","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#serial-transforms-and-microoperations","title":"Serial Transforms and Microoperations","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/","title":"Registers and Register Transfers","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#registers","title":"Registers","text":"Example"},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#storage-and-load-enable","title":"Storage and Load Enable","text":"
    • Load = 0 : Store

    • Load = 1 : Load

    The Problem is : Clock Skew \u300cAnd Gate Delay\u300d

    \u52d8\u8bef Load = 0 \u65f6 \u8109\u51b2\u6d88\u5931\uff0c\u5bc4\u5b58\u5668\u65e0\u6cd5\u88ab\u8f7d\u5165

    Example

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#register-transfer","title":"Register Transfer","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#microoperations","title":"Microoperations","text":"

    Logical Groupings:

    • Transfer - move data from one register to another
    • Arithmetic - perform arithmetic on data in registers
    • Logic - manipulate data or use bitwise logical operations
    • Shift - shift data in registers

    \\(if\\ \\ (K_1=1)\\ then\\ \\ (R_2\u2190R_1)\\) \u8868\u793a\u4e3a \\(K_1 : R_2\u2190R_1\\)

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#register-transfer-structures","title":"Register Transfer structures","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#multiplexer-based-transfers","title":"Multiplexer-Based Transfers","text":"

    note : clocks are omitted for clarity

    \\(K_1 : R_0\u2190R_1\\)

    \\(K2\\bar{K1}: R_0\u2190R_2\\)

    • \\(R_0\\) 's Load : \\(K_1+K2\\bar{K1}=K_1+K_2\\)

    Detailed-logic

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#register-cell-design","title":"Register Cell Design","text":"
    • Example 1 Not encoded \u300cone hot code\u300d

    • Example 2 Encoded. \u300cBinary or Gray\u300d

    EG1: Example

    Register A (m-bits) Sepecification:

    Data input B

    Control input \\(C_x \\ C_y\\) with combinations\\((0,0)\\ (0,1)\\ (1,0)\\)

    Register Transfers:

    \\(C_x : A \\leftarrow A\\ or\\ B\\)

    \\(C_y\\) : \\(A \\leftarrow A\\ xor\\ B\\)

    Hold State : \\((0,0)\\)

    Multiplexer Approach

    Thus , we have :

    \\(Load = C_x + C_y\\)

    Cost : 6+3+2(or)+8(xor) = 19

    Sequential Circuit Design Approach

    • State table\u300cCost Less\u300d

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#bus-based-transfers","title":"Bus-Based Transfers","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#dedicated-mux-based-transfers","title":"Dedicated Mux-Based Transfers","text":"

    Similar to using a MUX, the MUX in this case is no longer dedicated logic for a specific register but is shared logic used by three registers.

    The MUX in the bus selects one input among all registers and outputs it to all registers. The bus controls which (or how many) registers receive this signal by manipulating the Load signal.

    Advantages:

    1. The circuit is more streamlined, resulting in lower costs, and this advantage becomes more apparent as the number of registers increases.
    2. Cost-effectiveness is improved with the shared logic, as opposed to dedicated logic for each register.

    Disadvantages:

    1. At any given moment, the bus can only transmit one piece of data, meaning there is only one data source.
    2. Only one data transfer is possible to other locations within the same clock cycle. For instance, performing a swap operation requires at least two buses to implement.\u300c\u65e0\u6cd5\u505a\u5e76\u884c\u4f20\u8f93\u300d
    3. Due to these characteristics, the requirements must be carefully evaluated, and the appropriate structure chosen for implementation.

    Gate Cost. (increase linearly)

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#three-state-bus","title":"Three-State Bus","text":"

    The 3-input MUX can be replaced by a 3-state node (bus) and 3-state buffers.

    • Cost is further reduced, but transfers are limited.
    • Characterize the simultaneous transfers possible with this structure.
    • Characterize the cost savings and compare.
    • The input and output can share the same line, requiring only n pins.

    Gate Cost Only 2n (suppose cost for three-state is 2)

    Example

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#shift-registers","title":"Shift Registers","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#_1","title":"\u4e32\u884c\u5b9e\u73b0","text":"

    \u5047\u8bbe\u73b0\u5728\u6211\u4eec\u6709 4 \u4e2a FF \u9996\u5c3e\u76f8\u8fde\uff0c\u73b0\u5728\u4e32\u884c\u8f93\u5165 1001 \u8fd9 4bits \u7684\u6570\u636e\uff08\u5f53\u7136\uff0c\u5b8c\u5168\u8f93\u5165\u9700\u8981 4 \u4e2a\u65f6\u949f\u5468\u671f\uff09\u3002

    \u5047\u8bbe\u7b2c 1 \u4e2a\u5468\u671f\u7ed3\u675f\u540e\uff0c1001 \u6700\u53f3\u4fa7\u7684 1 \u88ab\u5b58\u5728\u4e86\u7b2c\u4e00\u4e2a FF\uff0c\u5219\uff1a

    \u5468\u671f \u5f85\u8f93\u5165 FF1 FF2 FF3 FF4 SO 1 100 1 ? ? ? 1??? 2 10 0 1 ? ? 01?? 3 1 0 0 1 ? 001? 4 1 0 0 1 1001 5 ? 1 0 0 ?100 6 ? ? 1 0 ??10 7 ? ? ? 1 ???1
    • \u8fd9\u91cc\u7684 SO \u6307\u7684\u662f\u4ece\u5f53\u524d\u8f6e\u6b21\u5f00\u59cb\uff0c\u8bfb\u5165 4bits \u6570\u636e\u5f97\u5230\u7684\u4e32\u884c\u8f93\u51fa\u7ed3\u679c\uff0c\u8fd9\u91cc\u7684 4bits \u5f53\u7136\u662f\u5bf9\u5e94\u8f93\u5165\u7684 4bits\u3002

    • \u53ef\u4ee5\u53d1\u73b0\uff0c\u5728\u7b2c\u56db\u8f6e\u524d\u540e\u7684\u7ed3\u679c\u5206\u522b\u662f\u5de6\u79fb\u548c\u53f3\u79fb\u7684\u7ed3\u679c\uff0c\u5f53\u7136\uff0c\u5982\u679c\u662f\u8981\u8003\u8651\u5177\u6709\u5b9e\u9645\u8ba1\u7b97\u4ef7\u503c\u7684\u4f4d\u79fb\uff0c\u6211\u4eec\u5f53\u7136\u9700\u8981\u586b\u5145 ? \u7684\u503c\uff0c\u4e0d\u8fc7\u8fd9\u90fd\u662f\u5c0f\u4e8b\u60c5\u3002

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#parallel-load-shift-registersmux","title":"Parallel Load Shift Registers\u300cMux\u300d","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#shift-registers-with-additional-functions","title":"Shift Registers with Additional Functions","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#counters","title":"Counters","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#ripple-counter","title":"Ripple Counter","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#synchronous-counter","title":"Synchronous Counter","text":""}]} \ No newline at end of file +{"config":{"lang":["en"],"separator":"[\\s\\u200b\\u3000\\-\u3001\u3002\uff0c\uff0e\uff1f\uff01\uff1b]+","pipeline":["stemmer"]},"docs":[{"location":"","title":"Welcome to Lily's Notebook!","text":""},{"location":"#about-me","title":"About me","text":""},{"location":"#my-github","title":"My GitHub","text":""},{"location":"#my-gmail-and-my-zju-email","title":"My Gmail and My ZJU Email","text":""},{"location":"#_1","title":"Welcome to Lily's Notebook!","text":""},{"location":"invisible/","title":"Invisible","text":"

    \\(\\hspace{1cm}\\) \u4eca\u5929\u65e9\u4e0a\u8d77\u6765\uff0c\u5929\u7a7a\u7070\u9eef\u9eef\u7684\uff0c\u5f53\u7136\uff0c\u65f6\u65f6\u662f\u8fd9\u6837\uff0c\u4e5f\u6b63\u662f\u8fd9\u6837\uff0c\u624d\u65f6\u65f6\u662f\u5371\u9669\u7684\u3002

    \\(\\hspace{1cm}\\) \u6211\u68b3\u4e86\u4e00\u4e2a\u9a6c\u5c3e\u8fab\u3002

    \\(\\hspace{1cm}\\) \u6253\u5f00\u7535\u89c6\uff0c\u55e1\u55e1\u7684\u58f0\u97f3\u50cf\u662f\u4e00\u4e0b\u4ece\u8fdc\u65b9\u62bd\u5438\u8fdb\u6765\uff0c\u6a21\u7cca\u51fa\u4e00\u7247\u6e05\u6f88\u3002\u201c\u6839\u636e\u8fd1\u4e9b\u5e74\u6765\u79d1\u5b66\u5bb6\u7814\u7a76\u7edf\u8ba1\uff0c\u5168\u7403\u660e\u7ea4\u5269\u4f59\u91cf\u5927\u7ea6\u4e3a0.03\u6839/\u5e73\u65b9\u5343\u7c73\uff0c\u5168\u7403\u5404\u56fd\u5fd7\u613f\u8005\u4e5f\u90fd\u5728\u4e3a\u626b\u9664\u660e\u7ea4\u5949\u732e\u7740\u9c9c\u8840\u548c\u6c57\u6c34\uff0c\u636e\u4f30\u8ba1\uff0c\u4ee5\u76ee\u524d\u8fdb\u7a0b\u5168\u7403\u57fa\u672c\u4e0a\u53ef\u4ee5\u5728X\u5e74\u57fa\u672c\u5f7b\u5e95\u6e05\u9664\u660e\u7ea4\u3002\u7136\u800c\u4e13\u5bb6\u4ecd\u7136\u5efa\u8bae\u5e7f\u5927\u7fa4\u4f17\u5728\u6b63\u5e38\u751f\u6d3b\u4e4b\u4f59\u505a\u597d\u660e\u7ea4\u65e5\u5e38\u9632\u62a4\u3002\u4e0b\u9762\u64ad\u653e\u51e0\u4e2a\u660e\u7ea4\u9632\u62a4\u65e5\u5e38\u8d34\u58eb\uff1a1.\u65e5\u5e38\u5e94\u8be5\u4fdd\u6301\u653e\u677e\u5fc3\u6001\uff0c\u4e0d\u8981\u8fc7\u4e8e\u7126\u8651\u660e\u7ea4\u95ee\u9898\u2026\u2026\u201d

    \\(\\hspace{1cm}\\) \u8001\u751f\u5e38\u8c08\uff0c\u6211\u6362\u4e86\u53f0\u3002

    \\(\\hspace{1cm}\\) \u201c\u636e\u672c\u53f0\u8bb0\u8005\u62a5\u9053\uff0c\u672c\u5e02\u4e8e\u6628\u65e5\u53d1\u751f\u4e00\u8d77\u2018\u62a2\u53d1\u6848\u2019 \uff0c\u53d7\u5bb3\u4ebaX\u5148\u751f\u88ab\u952f\u65ad\u8fd120cm\u5934\u53d1\uff0c\u5e02\u503c\u4f30\u8ba1\u572820000\u5143\u5de6\u53f3\uff0c\u73b0\u6b63\u7d27\u6025\u8c03\u67e5\u6d89\u5acc\u4eba\u5458\uff0c\u8bf7\u5e7f\u5927\u5e02\u6c11\u6ce8\u610f\u597d\u81ea\u8eab\u5b89\u5168\u4fdd\u62a4\u2026\u2026\u201d

    \\(\\hspace{1cm}\\) \u6211\u4e0d\u7531\u5f97\u6478\u4e86\u6478\u81ea\u5df1\u7684\u5934\u53d1\uff1a\u6211\u5f88\u559c\u6b22\u6211\u7684\u5934\u53d1\uff0c\u9ed1\u9ed1\u7684\uff0c\u4eae\u4eae\u7684\uff0c\u67d4\u987a\u7684\uff0c\u5e02\u4ef7\u5e94\u8be5\u5f88\u9ad8\uff0c\u6240\u4ee5\u6211\u4e00\u76f4\u6ca1\u6709\u5f88\u52aa\u529b\u5de5\u4f5c\uff0c\u5b9e\u5728\u4e0d\u884c\u4e86\uff0c\u6211\u5c31\u53bb\u628a\u5934\u53d1\u5356\u4e86\uff0c\u6211\u4e5f\u4e0d\u6015\u6b7b\uff0c\u4f46\u6211\u70ed\u7231\u751f\u6d3b\u3002

    \\(\\hspace{1cm}\\) \u81f3\u4e8e\u4e3a\u4ec0\u4e48\u73b0\u5728\u5934\u53d1\uff0c\u6216\u8005\u8bf4\u9ad8\u8d28\u91cf\u5047\u53d1\uff0c\u7adf\u7136\u4ef7\u683c\u5982\u6b64\u9ad8\u6602\uff0c\u662f\u4ece\u660e\u7ea4\u7684\u53d1\u73b0\u5f00\u59cb\u7684\u3002\u5927\u6982\u5728\u5341\u51e0\u5e74\u524d\uff0c\u5728Stephen\u5c0f\u9547\uff0c\u9065\u8fdc\u7684\u5317\u6b27\uff0c\u5728\u90a3\u7247\u5b81\u9759\uff0c\u6f2b\u957f\u4e0e\u5bd2\u51b7\u4e4b\u95f4\uff0c\u7a81\u7136\u6709\u4e86\u70ed\u8840\u6cb8\u817e\uff1a\u4e00\u4e2a\u4e0b\u5348\uff0c\u9633\u5149\u80fd\u6620\u51fa\u7a7a\u4e2d\u7684\u9648\u7c92\uff1b\u8857\u4e0a\uff0c\u884c\u4eba\u4e09\u4e24\uff1b\u7a81\u7136\u5c31\u6709\u4e86\u4e00\u9053\u8840\u5149\u3002\u5f53\u65f6\u8def\u4eba\u5927\u6982\u90fd\u60ca\u5446\u4e86\uff0c\u51bb\u5728\u90a3\u7247\u5bd2\u51b7\u7684\u8840\u8272\u91cc\u3002\u662f\u4e00\u4e2a\u884c\u4eba\uff0c\u4e00\u4e2a\u8001\u7237\u7237\uff0c\u5a46\u5a11\u7740\u80cc\uff0c\u6162\u6162\u5730\u8d70\u7740\uff0c\u7136\u540e\u7a81\u7136\u62e6\u8170\u65ad\u4e86\uff0c\u5012\u4e0b\uff0c\u5929\u8fb9\u4e00\u7247\u7ea2\u3002\u5728\u4e00\u6bb5\u53ef\u6016\u7684\u9759\u6b62\u548c\u6c89\u9ed8\u4e4b\u540e\uff0c\u6709\u4eba\u4e0a\u524d\u67e5\u770b\uff0c\u53c8\u5012\u4e0b\u4e86\u3002

    \\(\\hspace{1cm}\\) \u5bc2\u9759\u4e4b\u58f0\u3002

    \\(\\hspace{1cm}\\) \u540e\u6765\u7684\u540e\u6765\uff0c\u7ec8\u4e8e\u6709\u4eba\u53d1\u73b0\uff0c\u5728\u90a3\u5929\u707f\u70c2\u7684\u9633\u5149\u4e0b\uff0c\u90a3\u91cc\u98d8\u7740\u4e00\u6bb5\u5c0f\u5c0f\u7684\u7ea4\u7ef4\u72b6\u7684\u7ec6\u4e1d\uff0c\u5f88\u7ec6\uff0c\u80fd\u53d1\u73b0\u53ea\u662f\u56e0\u4e3a\u5728\u9633\u5149\u4e0b\u90a3\u7ec6\u4e1d\u6709\u4e9b\u5fae\u7684\u95ea\u70c1\u53d1\u5149,\u6240\u4ee5\uff0c\u5c31\u53eb\u505a\u660e\u7ea4\uff0c\u591a\u7f8e\u4e3d\u7684\u540d\u5b57\uff0c\u7ea4\u7ec6\u800c\u8106\u5f31\u3002

    \\(\\hspace{1cm}\\) \u6ca1\u6709\u4eba\u77e5\u9053\u660e\u7ea4\u662f\u54ea\u91cc\u6765\u7684\uff0c\u6709\u4eba\u8bf4\u662f\u4e00\u6b21\u9ad8\u7ea7\u6b66\u5668\u7684\u6ee5\u7528\uff0c\u67d0\u79cd\u5316\u5b66\u7269\u8d28\uff1b\u4e5f\u6709\u4eba\u8bf4\u662f\u67d0\u4e2a\u6050\u6016\u7ec4\u7ec7\u5455\u5c3d\u5fc3\u8840\u5728\u5168\u7403\u5e03\u7f6e\u4e0b\u51e0\u5904\u4ee5\u5f15\u8d77\u6050\u614c\u3002\u4e0d\u7ba1\u600e\u4e48\u6837\uff0c\u6050\u614c\u662f\u6709\u7684\uff1a\u636e\u76ee\u524d\u6240\u77e5\uff0c\u660e\u7ea4\u5206\u5e03\u4e0d\u5e7f\uff0c\u4f46\u6740\u4f24\u529b\u6781\u5927\u3002\u53d1\u73b0\u660e\u7ea4\u540e\uff0c\u4e5f\u53ea\u80fd\u5efa\u7acb\u7981\u884c\u533a\uff0c\u800c\u505a\u4e0d\u5230\u5f7b\u5e95\u7684\u201c\u6e05\u695a\u201d\u2014\u2014\u4e0d\u8fc7\u7528\u4ec0\u4e48\u60f3\u8981\u6e05\u695a\u660e\u7ea4\uff0c\u660e\u7ea4\u603b\u80fd\u5207\u65ad\uff0c\u4eba\u6216\u8005\u91d1\u5c5e\u3002

    \\(\\hspace{1cm}\\) \u636e\u8bf4\u88ab\u660e\u7ea4\u5207\u65ad\u7684\u4e00\u77ac\u95f4\u5e76\u6ca1\u6709\u4ec0\u4e48\u5177\u4f53\u611f\u53d7\uff0c\u5176\u5b9e\u8fd9\u662f\u4e00\u79cd\u63a8\u65ad\uff0c\u56e0\u4e3a\u5f88\u591a\u884c\u8fdb\u5f88\u6162\u7684\u4eba\uff0c\u5c31\u50cf\u7b2c\u4e00\u4f8b\u53d7\u5bb3\u8005\u8001\u7237\u7237\uff0c\u90fd\u6b7b\u4e8e\u8eaf\u4f53\u7684\u5b8c\u5168\u5206\u9694\u3002

    \\(\\hspace{1cm}\\) \u603b\u4e4b\uff0c\u5728\u90a3\u4e4b\u540e\uff0c\u4eba\u4eec\u90fd\u6709\u4e9b\u4e0d\u6562\u51fa\u95e8\u4e86\uff0c\u5728\u8857\u4e0a\u8d70\u4e5f\u5f88\u6162\u3002

    \\(\\hspace{1cm}\\) \u51e0\u5e74\u524d\u6709\u4e00\u4e2a\u5e78\u8fd0\u7684\u5973\u5b69\u5b50\u9047\u5230\u660e\u7ea4\u5374\u6beb\u53d1\u672a\u635f\u2014\u2014\u786e\u5207\u7684\u8bf4\uff0c\u53ea\u635f\u6beb\u53d1\uff1a\u5973\u5b69\u8d70\u8def\u65f6\u5f88\u7231\u7529\u5934\u53d1\uff0c\u53d1\u95f4\u5411\u5de6\u6643\u65f6\u4e00\u4e0b\u88ab\u5207\u65ad\u4e86\u4e00\u622a\uff0c\u98d8\u98d8\u6d12\u6d12\u3002\u540e\u6765\uff0c\u7537\u5b50\u4e5f\u5f00\u59cb\u84c4\u957f\u53d1\uff0c\u4f20\u8bf4\u4e2d\u6f02\u6d6e\u5ea6\u8303\u56f4\u5f88\u5e7f\u7684\u9ad8\u8d28\u91cf\u5047\u53d1\u4e5f\u5f00\u59cb\u5728\u5e02\u573a\u4e0a\u5d1b\u8d77\u4e86\u3002

    \\(\\hspace{1cm}\\) \u6211\u4e5f\u559c\u6b22\u8d70\u8def\u7684\u65f6\u5019\u9ad8\u9ad8\u5730\u7529\u5934\u53d1\uff0c\u6211\u89c9\u5f97\u771f\u5f88\u7f8e\uff0c\u5973\u5b69\u5b50\u7684\u9752\u6625\u7684\u7f8e\uff0c\u4e0d\u8fc7\uff0c\u4e5f\u8bb8\u662f\u56e0\u4e3a\u6211\u5728\u5fc3\u91cc\u7684\u4e00\u89d2\u6697\u81ea\u745f\u7f29\u5427\u3002

    \\(\\hspace{1cm}\\) \u601d\u7eea\u53c8\u548c\u7535\u89c6\u7684\u58f0\u97f3\u76f8\u9047\u4e86\u3002

    \\(\\hspace{1cm}\\) \u201c\u4e0b\u9762\u672c\u53f0\u4e3a\u60a8\u5e26\u6765\u5fd7\u613f\u6e05\u626b\u660e\u7ea4\u73b0\u573a\uff0c\u8ba9\u6211\u4eec\u4e3a\u5728\u573a\u7684\u6bcf\u4e00\u4f4d\u82f1\u96c4\u9f13\u638c\u559d\u5f69\uff01\u201d\u955c\u5934\u8f6c\u6362\uff0c\u4eba\u7fa4\u7199\u6518\uff0c\u6211\u770b\u89c1\u4e86\u5e74\u8f7b\u7684\u7537\u5973\uff0c\u4e2d\u5e74\u7684\u76b1\u7eb9\uff0c\u82b1\u767d\u7684\u5934\u53d1\uff0c\u4e73\u7259\uff0c\u9152\u7a9d\uff0c\u8033\u6d1e\u2026\u2026\u6240\u6709\u7684\u4e00\u5207\u90fd\u5728\u70ed\u70c8\u7684\u6c14\u6c1b\u4e2d\u6a21\u7cca\u6b86\u5c3d\uff0c\u8fd8\u6709\u9065\u9065\u7684\u70ed\u8840\u97f3\u4e50\u5728\u7a7a\u6c14\u4e2d\u6643\u8361\u3002

    \\(\\hspace{1cm}\\) \u5927\u6982\u662f\u5ba3\u5e03\u4e86\u5f00\u59cb\uff0c\u4eba\u7fa4\u52a8\u8d77\u6765\u4e86\uff0c\u8dd1\u8d77\u6765\u4e86\uff0c\u5374\u4e00\u76f4\u662f\u62e5\u6324\u7684\u53c8\u6a21\u7cca\u8d77\u6765\u4e86\u3002\u6211\u77e5\u9053\u4ed6\u4eec\u4e3a\u4ec0\u4e48\u5954\u8dd1\uff0c\u56e0\u4e3a\u636e\u8bf4\u5feb\u901f\u901a\u8fc7\u660e\u7ea4\u800c\u6b7b\u4ea1\u6ca1\u6709\u4efb\u4f55\u75db\u82e6\u3002\u6211\u4e5f\u77e5\u9053\u4ed6\u4eec\u4e3a\u4ec0\u4e48\u62e5\u6324\uff0c\u56e0\u4e3a\u53ea\u6709\u62e5\u5728\u4e00\u8d77\uff0c\u624d\u80fd\u4fdd\u8bc1\u7ecf\u8fc7\u7684\u6bcf\u4e00\u5904\u5730\u65b9\u90fd\u6ca1\u6709\u660e\u7ea4\u9003\u8fc7\u3002

    \\(\\hspace{1cm}\\) \u6211\u5374\u4e0d\u77e5\u9053\u4e3a\u4ec0\u4e48\u662f\u4eba\u3002\u4e3a\u4ec0\u4e48\u4e0d\u662f\u8f66\u6216\u8005\u673a\u5668\u6216\u8005\u6280\u672f\u2026\u2026\u4e5f\u6709\u5f88\u591a\u8bf4\u6cd5\uff0c\u6709\u4eba\u8bf4\u660e\u7ea4\u5206\u5e03\u5b9e\u5728\u7a00\u5c11\u4e0d\u5fc5\u4e3a\u6b64\u6295\u5165\u592a\u591a\u7cbe\u529b\uff0c\u786e\u5b9e\uff0c\u6bcf\u5e74\u636e\u62a5\u9053\u5927\u6982\u53ea\u67092-3\u4f8b\u53d7\u5bb3\u8005\u3002\u4e5f\u6709\u4eba\u8bf4\u8fd9\u6837\u7684\u6d3b\u52a8\u4ece\u6765\u6ca1\u6709\u8fc7\u727a\u7272\uff0c\u8fd8\u53ef\u4ee5\u57f9\u517b\u7fa4\u4f17\u7684\u56e2\u7ed3\u5408\u4f5c\u80fd\u529b\uff0c\u8fd8\u6709\u4eba\u8bf4\u8fd9\u662f\u4e2a\u9634\u8c0b\u8bba\u3002

    \\(\\hspace{1cm}\\) \u8fd8\u662f\u4e0d\u7ba1\u600e\u6837\uff0c\u603b\u6709\u5730\u65b9\u5728\u62db\u52df\u5fd7\u613f\u8005\uff0c\u4e5f\u603b\u6709\u8fd9\u6837\u7684\u5e74\u8f7b\u7f8e\u4e3d\uff0c\u70ed\u8840\u6f8e\u6e43\u7684\u5fd7\u613f\u8005\u81ea\u544a\u594b\u52c7\u3002

    \\(\\hspace{1cm}\\) \u4e00\u9635\u6c89\u90c1\u7ffb\u6d8c\uff0c\u6211\u5173\u4e0a\u4e86\u7535\u89c6\u3002

    \\(\\hspace{1cm}\\) \u6211\u6700\u6700\u4eb2\u7231\u7684\u8bfb\u8005\uff0c\u6211\u591a\u4e48\u96be\u5e0c\u671b\u548c\u4f60\u4eec\u4e00\u6837\u628a\u8fd9\u5f53\u6210\u4e00\u4e2a\u8981\u7231\u62a4\u5934\u53d1\u7684\u5c0f\u6545\u4e8b\uff0c\u53ef\u662f\u6211\u4e0d\u884c\uff0c\u6211\u9762\u5bf9\u7684\u4e0d\u662f\u865a\u7a7a\uff0c\u662f\u771f\u5b9e\u3002

    \\(\\hspace{1cm}\\) \u6574\u7406\u4e86\u4e0b\u5934\u53d1\uff0c\u6211\u51fa\u4e86\u5bb6\u95e8\uff0c\u62ac\u5934\uff0c\u53ea\u770b\u89c1\u90a3\u6c89\u6c89\u7684\u5929\u5728\u884c\u8272\u5306\u5306\u4e2d\u9759\u9ed8\u4e0d\u8a00\u3002

    "},{"location":"%E5%A4%A7%E4%BE%A0/","title":"\u5927\u4fa0","text":"

    \\(\\hspace{1cm}\\)\u5f88\u5c0f\u7684\u65f6\u5019\uff0c\u6211\u5c31\u77e5\u9053\uff0c\u6211\u4ee5\u540e\u8981\u505a\u4e00\u4ee3\u5927\u4fa0\uff0c\u884c\u8d70\u7eff\u6797\uff0c\u6d6a\u8361\u6c5f\u6e56\uff0c\u4e00\u8eab\u5251\u6c14\uff0c\u4e00\u8def\u6f47\u6d12\u3002

    \\(\\hspace{1cm}\\)\u6c5f\u6e56\u4e0a\u7684\u4e8b\u60c5\u6211\u4eec\u5927\u591a\u90fd\u6709\u8033\u95fb\uff1a\u8981\u6709\u6b66\u529f\uff0c\u8981\u6709\u809d\u80c6\uff0c\u8981\u4e00\u8eab\u6e05\u98ce\u6717\u6717\uff0c\u6063\u610f\u5e73\u751f\uff0c\u4e0e\u4e16\u5043\u4ef0\u3002

    \\(\\hspace{1cm}\\)\u4e8e\u662f\u6211\u4e0d\u65ad\u5730\u52aa\u529b\u7740\uff1a\u8d70\u5c71\u8d70\u6c34\uff0c\u95ef\u8361\u5929\u5730\uff0c\u56db\u5904\u8bbf\u5e08\uff0c\u56db\u5904\u5b66\u827a\u3002\u6768\u8fc7\u5927\u4fa0\u90a3\u6bb5\u4e0e\u6df1\u5c71\u4e3a\u4f34\u7684\u5c81\u6708\uff0c\u6211\u4e5f\u66fe\u76f8\u4f3c\u4eb2\u5386\u3002\u6211\u4ee5\u4e3a\u6211\u5c1d\u5c3d\u4e86\u6210\u957f\u4e3a\u4e00\u4ee3\u5927\u4fa0\u8fc7\u7a0b\u4e2d\u5e94\u6709\u7684\uff0c\u6240\u6709\u7684\u54c0\u621a\u4e0e\u5e78\u798f\uff0c\u6211\u4e3a\u6211\u7684\u4e00\u5207\u52aa\u529b\u800c\u611f\u5230\u5feb\u4e50\u4e0e\u6210\u5c31\u3002

    \\(\\hspace{1cm}\\)\u6bcf\u6b21\u6e38\u5386\u56de\u5bb6\u65f6\uff0c\u5988\u5988\u5e38\u7528\u7565\u5e26\u5fe7\u4f24\u7684\u773c\u795e\u770b\u7740\u6211\uff0c\u6211\u77e5\u9053\uff0c\u5979\u662f\u592a\u62c5\u5fc3\u6211\uff0c\u5bb3\u6015\u6c5f\u6e56\u4e0a\u7684\u9ed1\u6697\u4f1a\u5c06\u6211\u541e\u6ca1\uff0c\u4e0d\u5269\u9aa8\u5934\uff1b\u6211\u4e5f\u77e5\u9053\uff0c\u5979\u4ecd\u662f\u65e5\u65e5\u591c\u591c\u76fc\u671b\u6211\u6210\u529f\uff0c\u5e26\u7740\u8346\u68d8\u7684\u5fc3\u548c\u96be\u8a00\u7684\u60c6\u6005\u3002\u603b\u5f97\u6765\u8bf4\uff0c\u5988\u5988\u662f\u5f88\u652f\u6301\u6211\u7684\uff0c\u5c31\u50cf\u7ae5\u5e74\u7684\u7761\u524d\u6545\u4e8b\u2014\u2014\u90a3\u4e9b\u6ee1\u662f\u4fa0\u8005\u98ce\u8303\u7684\u5feb\u610f\u6c5f\u6e56\u3002

    \\(\\hspace{1cm}\\)\u90a3\u5929\uff0c\u6211\u6210\u5e74\u4e86\uff0c\u88f9\u4e86\u4e00\u4e2a\u5c0f\u5305\u88b1\uff1a\u4e00\u4e2a\u5988\u5988\u7ee3\u7684\u8377\u5305\uff0c\u51e0\u4e24\u94f6\u94b1\uff0c\u968f\u8eab\u8863\u7269\u3002\u7136\u540e\u6211\u5c31\u4e0a\u8def\u4e86\u2014\u2014\u6211\u51b3\u5b9a\u8981\u5f00\u542f\u81ea\u5df1\u7684\u4eba\u751f\uff1a\u5927\u4fa0\u7684\u4eba\u751f\u3002

    \\(\\hspace{1cm}\\)\u7b2c\u4e00\u5929\uff0c\u6211\u6551\u4e86\u4e00\u4e2a\u843d\u96be\u7684\u5973\u5b50\u3002\u5979\u8877\u5fc3\u5730\u611f\u8c22\u6211\uff0c\u7136\u540e\u53c8\u5e26\u7740\u5fe7\u4f24\u5730\uff0c\u621a\u621a\u5730\u770b\u7740\u6211\uff0c\u55eb\u5685\u7740\uff1a\u53ef\u662f\u4f60\u5e2e\u4e0d\u4e86\u6211\u2014\u2014\u90a3\u5fe7\u4f24\u548c\u5988\u5988\u7684\u5fe7\u4f24\u6709\u4e9b\u76f8\u4f3c\u3002\u6211\u628a\u968f\u8eab\u7684\u94f6\u4e24\u90fd\u585e\u7ed9\u4e86\u5979\uff0c\u5979\u6ca1\u6709\u6536\uff0c\u8885\u5a1c\u7740\u8d70\u4e86\u3002

    \\(\\hspace{1cm}\\)\u4e00\u4e9b\u8ff7\u832b\uff0c\u4e00\u4e9b\u611f\u52a8\uff0c\u548c\u4e00\u4e9b\u5fe7\u6101\u3002

    \\(\\hspace{1cm}\\)\u6211\u6ca1\u6709\u6e38\u79fb\u3002\u6211\u8fd8\u662f\u884c\u8d70\u7740\uff0c\u53c8\u89c1\u4e86\u4e00\u4e9b\u4e8b\uff0c\u6551\u4e86\u4e00\u4e9b\u4eba\uff0c\u8fd8\u662f\u8d70\u8fc7\u5c71\u5c71\u6c34\u6c34\u3002\u4ed6\u4eec\u90fd\u53d8\u6210\u4e86\u6211\u3002

    \\(\\hspace{1cm}\\)\u90a3\u5929\u6211\u4e8c\u5341\u4e94\u5c81\uff0c\u6211\u7ec8\u4e8e\u6765\u5230\u4e86\u6211\u4ece\u5c0f\u68a6\u91cc\u7684\u6bbf\u5802\uff1a\u4fa0\u4e4b\u95e8\u3002\u6211\u77e5\u9053\u6211\u4e0d\u662f\u540d\u95e8\u6b63\u6d3e\uff0c\u4f46\u6211\u60f3\uff0c\u7ecf\u5386\u4e86\u8fd9\u8bb8\u591a\uff0c\u6211\u4e00\u5b9a\u4f1a\u88ab\u8ba4\u53ef\u2014\u2014\u6b66\u529f\u4e5f\u597d\uff0c\u809d\u80c6\u4e5f\u7f62\uff0c\u4e0d\u81f3\u4e8e\u540d\u5782\u9752\u53f2\uff0c\u81f3\u5c11\u8db3\u591f\u6177\u6168\u3002

    \\(\\hspace{1cm}\\)\u6211\u8fdb\u4e86\u95e8\uff0c\u81ea\u62a5\u5bb6\u95e8\uff0c\u5b88\u95e8\u4eba\u5f15\u6211\u5411\u524d\uff0c\u5230\u4e86\u4e00\u5f20\u53e4\u6734\u7684\u684c\u5b50\uff0c\u684c\u524d\u5750\u7740\u4e00\u4f4d\u5782\u5782\u8001\u8005\u3002\u6211\u8840\u8109\u55b7\u6d8c\u2014\u2014\u50cf\u662f\u68a6\u91cc\u3002

    \\(\\hspace{1cm}\\)\u201c\u8981\u6210\u4e3a\u5927\u4fa0\uff1f\u201d

    \\(\\hspace{1cm}\\)\u201c\u662f\u7684\uff0c\u662f\u7684\u3002\u201d

    \\(\\hspace{1cm}\\)\u201c\u591a\u5927\uff1f\u201d

    \\(\\hspace{1cm}\\)\u201c\u4e8c\u5341\u4e94\u4e86\u3002\u201d

    \\(\\hspace{1cm}\\)\u6cdb\u9ec4\u7684\u7eb8\u9875\uff0c\u76d6\u4e86\u4e2a\u9c9c\u7ea2\u7684\u5370\u7ae0\uff0c\u5199\u7740\u4e9b\u4ec0\u4e48\u4fa0\u4e4b\u5927\u8005\uff0c\u63a8\u5411\u6211\u3002

    \\(\\hspace{1cm}\\)\u201c\u8d44\u683c\u8bc1\uff0c\u5927\u4fa0\u3002\u201d

    \\(\\hspace{1cm}\\)\u4e8e\u662f\uff0c\u6211\u591a\u4e86\u4e00\u7eb8\u8584\u8584\u7684\u4e66\u9875\uff0c\u8d70\u51fa\u4e86\u5c71\u95e8\u3002

    \\(\\hspace{1cm}\\)\u6211\u7a81\u7136\u60f3\u8d77\u5f88\u591a\u5e74\u524d\uff0c\u5728\u5988\u5988\u8fd8\u5728\u4e3a\u6211\u8bb2\u7761\u524d\u6545\u4e8b\u7684\u65f6\u5019\uff1a\u6211\u5e74\u7eaa\u5c0f\uff0c\u603b\u662f\u542c\u5230\u4e00\u534a\u5c31\u660f\u660f\u5165\u7761\uff0c\u4f46\u5988\u5988\u603b\u4f1a\u8bb2\u5b8c\u5979\u7684\u6545\u4e8b\u3002

    \\(\\hspace{1cm}\\)\u6211\u60f3\u8d77\u591a\u5e74\u524d\u7684\u90a3\u4e2a\u591c\u665a\uff0c\u661f\u661f\u5929\u771f\u5730\u5728\u591c\u7a7a\u6d82\u9e26\uff0c\u5988\u5988\u770b\u7740\u6211\u7761\u773c\u60fa\u5fea\uff0c\u8f7b\u58f0\u5730\u8bb2\u7740\u6545\u4e8b\u7684\u7ed3\u5c3e\uff1a\u4ed6\u6700\u7ec8\u6ca1\u80fd\u6210\u4e3a\u5927\u4fa0\uff0c\u4f46\u4ed6\u52c7\u6562\uff0c\u575a\u5b9a\uff0c\u5766\u8361\u800c\u6f84\u6f88\uff0c\u4ed6\u770b\u8fc7\u5c71\u7684\u9ad8\u5927\uff0c\u770b\u8fc7\u6d77\u7684\u8fbd\u9614\uff0c\u4eba\u4eec\u8bf4\u4ed6\u4e00\u4e8b\u65e0\u6210\uff0c\u53ea\u662f\u6d6a\u8361\u6c5f\u6e56\uff0c\u4ed6\u4e0d\u540e\u6094\u3002

    "},{"location":"AI/net/","title":"Neural Networks and Deep Learning","text":""},{"location":"AI/net/#convolutional-neural-networkcnn","title":"Convolutional Neural Network(CNN)","text":"

    https://leovan.me/cn/2018/08/cnn/

    "},{"location":"AI/net/#recurrent-neural-network-rnn","title":"Recurrent Neural Network \uff08RNN\uff09","text":"

    \\(O_t=g(V\\cdot S_t)\\)

    \\(S_t=\\Phi(U\\cdot X_t+W\\cdot S_{t-1})\\) \\(\\Phi\\)\uff08\u6fc0\u6d3b\u51fd\u6570\uff09

    "},{"location":"AI/net/#back-propagation","title":"Back propagation","text":""},{"location":"AI/net/#intro","title":"Intro","text":"

    \\(Cost=H(W_{11},W_{12},\u2026\u2026,W_{mn})\\)

    \\(\\triangledown H=\\frac{\\partial H}{\\partial W_{11}}e_{11}+\\frac{\\partial H}{\\partial W_{12}}e_{12}+\u2026\u2026+\\frac{\\partial H}{\\partial W_{mn}}e_{mn}\\)

    https://zhuanlan.zhihu.com/p/115571464

    https://towardsdatascience.com/understanding-backpropagation-algorithm-7bb3aa2f95fd

    \u53cd\u5411\u4f20\u64ad\uff08Backpropagation\uff09\u662f\u4e00\u79cd\u7528\u4e8e\u8bad\u7ec3\u795e\u7ecf\u7f51\u7edc\u7684\u4f18\u5316\u7b97\u6cd5\uff0c\u901a\u8fc7\u8ba1\u7b97\u635f\u5931\u51fd\u6570\u5173\u4e8e\u7f51\u7edc\u53c2\u6570\u7684\u68af\u5ea6\uff0c\u5e76\u5229\u7528\u8fd9\u4e9b\u68af\u5ea6\u6765\u66f4\u65b0\u53c2\u6570\uff0c\u4ee5\u6700\u5c0f\u5316\u635f\u5931\u51fd\u6570\u3002

    1. \u524d\u5411\u4f20\u64ad\uff08Forward Propagation\uff09\uff1a \u5c06\u8f93\u5165\u6570\u636e\u901a\u8fc7\u795e\u7ecf\u7f51\u7edc\u8fdb\u884c\u6b63\u5411\u4f20\u64ad\uff0c\u8ba1\u7b97\u6bcf\u4e00\u5c42\u7684\u8f93\u51fa\u3002
    2. \u8ba1\u7b97\u635f\u5931\uff08Compute Loss\uff09\uff1a \u4f7f\u7528\u7f51\u7edc\u7684\u8f93\u51fa\u548c\u771f\u5b9e\u6807\u7b7e\u8ba1\u7b97\u635f\u5931\u51fd\u6570\uff0c\u8861\u91cf\u7f51\u7edc\u7684\u6027\u80fd\u597d\u574f\u3002
    3. \u53cd\u5411\u4f20\u64ad\u68af\u5ea6\uff08Backward Pass\uff09\uff1a \u4ece\u8f93\u51fa\u5c42\u5f00\u59cb\uff0c\u8ba1\u7b97\u635f\u5931\u51fd\u6570\u5173\u4e8e\u6bcf\u4e2a\u53c2\u6570\u7684\u68af\u5ea6\u3002\u8fd9\u662f\u901a\u8fc7\u4f7f\u7528\u94fe\u5f0f\u6cd5\u5219\u6765\u8ba1\u7b97\u7684\uff0c\u5c06\u68af\u5ea6\u4ece\u8f93\u51fa\u5c42\u5411\u8f93\u5165\u5c42\u4f20\u64ad\u3002
    4. \u53c2\u6570\u66f4\u65b0\uff08Update Parameters\uff09\uff1a \u4f7f\u7528\u68af\u5ea6\u4e0b\u964d\u6216\u5176\u4ed6\u4f18\u5316\u7b97\u6cd5\uff0c\u901a\u8fc7\u5c06\u68af\u5ea6\u4e58\u4ee5\u4e00\u4e2a\u5b66\u4e60\u7387\uff0c\u6765\u66f4\u65b0\u7f51\u7edc\u53c2\u6570\u3002\u5b66\u4e60\u7387\u63a7\u5236\u4e86\u6bcf\u6b21\u53c2\u6570\u66f4\u65b0\u7684\u6b65\u957f\uff0c\u4ee5\u907f\u514d\u8df3\u8fc7\u6700\u4f18\u89e3\u3002
    5. \u91cd\u590d\u8fed\u4ee3\uff08Repeat\uff09\uff1a \u91cd\u590d\u4ee5\u4e0a\u6b65\u9aa4\uff0c\u76f4\u5230\u635f\u5931\u51fd\u6570\u6536\u655b\u5230\u6ee1\u610f\u7684\u7a0b\u5ea6\u6216\u8fbe\u5230\u9884\u5b9a\u7684\u8bad\u7ec3\u6b21\u6570\u3002
    "},{"location":"AI/net/#_1","title":"\u68af\u5ea6\u7684\u8ba1\u7b97","text":"

    \u8ba1\u7b97\u635f\u5931\u51fd\u6570\u5bf9\u7f51\u7edc\u8f93\u51fa\u7684\u68af\u5ea6\uff08\u5373\u635f\u5931\u51fd\u6570\u5173\u4e8e\u8f93\u51fa\u7684\u5bfc\u6570\uff09\u3002

    • \u4f7f\u7528\u94fe\u5f0f\u6cd5\u5219\uff0c\u5c06\u68af\u5ea6\u4ece\u8f93\u51fa\u5c42\u4f20\u64ad\u5230\u8f93\u5165\u5c42\uff0c\u8ba1\u7b97\u6bcf\u4e00\u5c42\u7684\u68af\u5ea6\u3002
    • \u6839\u636e\u68af\u5ea6\u548c\u9009\u62e9\u7684\u4f18\u5316\u7b97\u6cd5\uff0c\u66f4\u65b0\u6bcf\u4e2a\u53c2\u6570\u3002

    \u8fd9\u4e2a\u8fc7\u7a0b\u662f\u901a\u8fc7\u53cd\u5411\u4f20\u64ad\u548c\u68af\u5ea6\u4e0b\u964d\u7b97\u6cd5\u7684\u7ed3\u5408\u6765\u5b9e\u73b0\u7684\uff0c\u4ee5\u6700\u5c0f\u5316\u635f\u5931\u51fd\u6570\u5e76\u4f18\u5316\u795e\u7ecf\u7f51\u7edc\u7684\u53c2\u6570\u3002

    "},{"location":"AI/net/#_2","title":"\u53c2\u6570\u66f4\u65b0","text":"

    \\(\u03b8_{new}=\u03b8_{old}\u2212\u03b1\u2207L(\u03b8_{old})\\)

    \u5176\u4e2d\uff1a

    • \\(\u03b8_{old}\\) \u662f\u5f53\u524d\u7684\u53c2\u6570\u503c\u3002
    • \\(\u2207L(\u03b8_{old}\\)\u662f\u635f\u5931\u51fd\u6570\u76f8\u5bf9\u4e8e\u53c2\u6570\u7684\u68af\u5ea6\u3002
    • \\(\u03b1\\) \u662f\u5b66\u4e60\u7387\uff0c\u662f\u4e00\u4e2a\u5c0f\u6b63\u6570\u3002

    \u8fd9\u4e2a\u66f4\u65b0\u89c4\u5219\u7684\u76f4\u89c2\u89e3\u91ca\u662f\uff0c\u6211\u4eec\u6cbf\u7740\u635f\u5931\u51fd\u6570\u4e0b\u964d\u6700\u5feb\u7684\u65b9\u5411\u66f4\u65b0\u53c2\u6570\u3002\u68af\u5ea6\u544a\u8bc9\u6211\u4eec\u635f\u5931\u51fd\u6570\u5728\u5f53\u524d\u70b9\u4e0a\u5347\u6700\u5feb\u7684\u65b9\u5411\uff0c\u6211\u4eec\u6cbf\u7740\u68af\u5ea6\u7684\u53cd\u65b9\u5411\u524d\u8fdb\uff0c\u4ee5\u964d\u4f4e\u635f\u5931\u3002

    \u5b66\u4e60\u7387\u7684\u9009\u62e9\u662f\u5173\u952e\u7684\u3002\u5982\u679c\u5b66\u4e60\u7387\u592a\u5c0f\uff0c\u6536\u655b\u901f\u5ea6\u4f1a\u5f88\u6162\uff0c\u800c\u5982\u679c\u5b66\u4e60\u7387\u592a\u5927\uff0c\u6211\u4eec\u53ef\u80fd\u4f1a\u8df3\u8fc7\u635f\u5931\u51fd\u6570\u7684\u6700\u5c0f\u503c\u3002\u56e0\u6b64\uff0c\u9009\u62e9\u4e00\u4e2a\u5408\u9002\u7684\u5b66\u4e60\u7387\u5bf9\u4e8e\u8bad\u7ec3\u795e\u7ecf\u7f51\u7edc\u81f3\u5173\u91cd\u8981\u3002

    \u901a\u5e38\uff0c\u5728\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\uff0c\u5b66\u4e60\u7387\u53ef\u80fd\u4f1a\u968f\u7740\u65f6\u95f4\u7684\u63a8\u79fb\u800c\u53d8\u5316\uff0c\u8fd9\u88ab\u79f0\u4e3a\u5b66\u4e60\u7387\u8c03\u5ea6\uff08learning rate scheduling\uff09\u3002\u4f8b\u5982\uff0c\u521d\u59cb\u65f6\u53ef\u4ee5\u4f7f\u7528\u8f83\u5927\u7684\u5b66\u4e60\u7387\u4ee5\u5feb\u901f\u6536\u655b\uff0c\u7136\u540e\u968f\u7740\u8bad\u7ec3\u7684\u8fdb\u884c\u9010\u6e10\u51cf\u5c0f\u5b66\u4e60\u7387\uff0c\u4ee5\u63d0\u9ad8\u6536\u655b\u7684\u7cbe\u5ea6\u3002

    \u603b\u7684\u6765\u8bf4\uff0c\u5b66\u4e60\u7387\u662f\u4e00\u4e2a\u5e73\u8861\u8bad\u7ec3\u901f\u5ea6\u548c\u6027\u80fd\u7684\u5173\u952e\u56e0\u7d20\u3002\u4e0d\u540c\u7684\u95ee\u9898\u53ef\u80fd\u9700\u8981\u4e0d\u540c\u7684\u5b66\u4e60\u7387\uff0c\u56e0\u6b64\u5b83\u901a\u5e38\u9700\u8981\u901a\u8fc7\u5b9e\u9a8c\u6765\u8c03\u6574\u3002

    "},{"location":"AI/net/#back-propagation-in-cnn","title":"Back propagation in CNN","text":"

    https://mmuratarat.github.io/2019-02-07/bptt-of-rnn

    "},{"location":"AI/net/#long-short-term-memory","title":"Long Short-Term Memory","text":"

    https://easyai.tech/ai-definition/rnn/

    https://blog.csdn.net/u012328159/article/details/87567358

    "},{"location":"AI/net/#attention","title":"Attention","text":"

    https://www.cnblogs.com/gczr/p/14693829.html

    https://zhuanlan.zhihu.com/p/379722366

    "},{"location":"AI/pca/","title":"\u6570\u636e\u7684\u5411\u91cf\u8868\u793a\u53ca\u964d\u7ef4\u95ee\u9898","text":"

    \u6ce8\u660e\uff1a\u6765\u6e90

    • \u57fa

    \u4e0b\u9762\u6211\u4eec\u7ee7\u7eed\u5728\u4e8c\u7ef4\u7a7a\u95f4\u5185\u8ba8\u8bba\u5411\u91cf\u3002\u4e0a\u6587\u8bf4\u8fc7\uff0c\u4e00\u4e2a\u4e8c\u7ef4\u5411\u91cf\u53ef\u4ee5\u5bf9\u5e94\u4e8c\u7ef4\u7b1b\u5361\u5c14\u76f4\u89d2\u5750\u6807\u7cfb\u4e2d\u4ece\u539f\u70b9\u51fa\u53d1\u7684\u4e00\u4e2a\u6709\u5411\u7ebf\u6bb5\u3002\u4f8b\u5982\u4e0b\u9762\u8fd9\u4e2a\u5411\u91cf\uff1a

    \u5728\u4ee3\u6570\u8868\u793a\u65b9\u9762\uff0c\u6211\u4eec\u7ecf\u5e38\u7528\u7ebf\u6bb5\u7ec8\u70b9\u7684\u70b9\u5750\u6807\u8868\u793a\u5411\u91cf\uff0c\u4f8b\u5982\u4e0a\u9762\u7684\u5411\u91cf\u53ef\u4ee5\u8868\u793a\u4e3a(3,2)\uff0c\u8fd9\u662f\u6211\u4eec\u518d\u719f\u6089\u4e0d\u8fc7\u7684\u5411\u91cf\u8868\u793a\u3002

    \u4e0d\u8fc7\u6211\u4eec\u5e38\u5e38\u5ffd\u7565\uff0c\u53ea\u6709\u4e00\u4e2a(3,2)\u672c\u8eab\u662f\u4e0d\u80fd\u591f\u7cbe\u786e\u8868\u793a\u4e00\u4e2a\u5411\u91cf\u7684\u3002\u6211\u4eec\u4ed4\u7ec6\u770b\u4e00\u4e0b\uff0c\u8fd9\u91cc\u76843\u5b9e\u9645\u8868\u793a\u7684\u662f\u5411\u91cf\u5728x\u8f74\u4e0a\u7684\u6295\u5f71\u503c\u662f3\uff0c\u5728y\u8f74\u4e0a\u7684\u6295\u5f71\u503c\u662f2\u3002\u4e5f\u5c31\u662f\u8bf4\u6211\u4eec\u5176\u5b9e\u9690\u5f0f\u5f15\u5165\u4e86\u4e00\u4e2a\u5b9a\u4e49\uff1a\u4ee5x\u8f74\u548cy\u8f74\u4e0a\u6b63\u65b9\u5411\u957f\u5ea6\u4e3a1\u7684\u5411\u91cf\u4e3a\u6807\u51c6\u3002\u90a3\u4e48\u4e00\u4e2a\u5411\u91cf(3,2)\u5b9e\u9645\u662f\u8bf4\u5728x\u8f74\u6295\u5f71\u4e3a3\u800cy\u8f74\u7684\u6295\u5f71\u4e3a2\u3002\u6ce8\u610f\u6295\u5f71\u662f\u4e00\u4e2a\u77e2\u91cf\uff0c\u6240\u4ee5\u53ef\u4ee5\u4e3a\u8d1f\u3002

    \u66f4\u6b63\u5f0f\u7684\u8bf4\uff0c\u5411\u91cf(x,y)\u5b9e\u9645\u4e0a\u8868\u793a\u7ebf\u6027\u7ec4\u5408\uff1a

    \\[x(1,0)^\\mathsf{T}+y(0,1)^\\mathsf{T}\\]

    \u4e0d\u96be\u8bc1\u660e\u6240\u6709\u4e8c\u7ef4\u5411\u91cf\u90fd\u53ef\u4ee5\u8868\u793a\u4e3a\u8fd9\u6837\u7684\u7ebf\u6027\u7ec4\u5408\u3002\u6b64\u5904(1,0)\u548c(0,1)\u53eb\u505a\u4e8c\u7ef4\u7a7a\u95f4\u4e2d\u7684\u4e00\u7ec4\u57fa\u3002

    \u6240\u4ee5\uff0c\u8981\u51c6\u786e\u63cf\u8ff0\u5411\u91cf\uff0c\u9996\u5148\u8981\u786e\u5b9a\u4e00\u7ec4\u57fa\uff0c\u7136\u540e\u7ed9\u51fa\u5728\u57fa\u6240\u5728\u7684\u5404\u4e2a\u76f4\u7ebf\u4e0a\u7684\u6295\u5f71\u503c\uff0c\u5c31\u53ef\u4ee5\u4e86\u3002\u53ea\u4e0d\u8fc7\u6211\u4eec\u7ecf\u5e38\u7701\u7565\u7b2c\u4e00\u6b65\uff0c\u800c\u9ed8\u8ba4\u4ee5(1,0)\u548c(0,1)\u4e3a\u57fa\u3002

    \u6211\u4eec\u4e4b\u6240\u4ee5\u9ed8\u8ba4\u9009\u62e9(1,0)\u548c(0,1)\u4e3a\u57fa\uff0c\u5f53\u7136\u662f\u6bd4\u8f83\u65b9\u4fbf\uff0c\u56e0\u4e3a\u5b83\u4eec\u5206\u522b\u662fx\u548cy\u8f74\u6b63\u65b9\u5411\u4e0a\u7684\u5355\u4f4d\u5411\u91cf\uff0c\u56e0\u6b64\u5c31\u4f7f\u5f97\u4e8c\u7ef4\u5e73\u9762\u4e0a\u70b9\u5750\u6807\u548c\u5411\u91cf\u4e00\u4e00\u5bf9\u5e94\uff0c\u975e\u5e38\u65b9\u4fbf\u3002\u4f46\u5b9e\u9645\u4e0a\u4efb\u4f55\u4e24\u4e2a\u7ebf\u6027\u65e0\u5173\u7684\u4e8c\u7ef4\u5411\u91cf\u90fd\u53ef\u4ee5\u6210\u4e3a\u4e00\u7ec4\u57fa\uff0c\u6240\u8c13\u7ebf\u6027\u65e0\u5173\u5728\u4e8c\u7ef4\u5e73\u9762\u5185\u53ef\u4ee5\u76f4\u89c2\u8ba4\u4e3a\u662f\u4e24\u4e2a\u4e0d\u5728\u4e00\u6761\u76f4\u7ebf\u4e0a\u7684\u5411\u91cf\u3002

    \u4f8b\u5982\uff0c(1,1)\u548c(-1,1)\u4e5f\u53ef\u4ee5\u6210\u4e3a\u4e00\u7ec4\u57fa\u3002\u4e00\u822c\u6765\u8bf4\uff0c\u6211\u4eec\u5e0c\u671b\u57fa\u7684\u6a21\u662f1\uff0c\u56e0\u4e3a\u4ece\u5185\u79ef\u7684\u610f\u4e49\u53ef\u4ee5\u770b\u5230\uff0c\u5982\u679c\u57fa\u7684\u6a21\u662f1\uff0c\u90a3\u4e48\u5c31\u53ef\u4ee5\u65b9\u4fbf\u7684\u7528\u5411\u91cf\u70b9\u4e58\u57fa\u800c\u76f4\u63a5\u83b7\u5f97\u5176\u5728\u65b0\u57fa\u4e0a\u7684\u5750\u6807\u4e86\uff01\u5b9e\u9645\u4e0a\uff0c\u5bf9\u5e94\u4efb\u4f55\u4e00\u4e2a\u5411\u91cf\u6211\u4eec\u603b\u53ef\u4ee5\u627e\u5230\u5176\u540c\u65b9\u5411\u4e0a\u6a21\u4e3a1\u7684\u5411\u91cf\uff0c\u53ea\u8981\u8ba9\u4e24\u4e2a\u5206\u91cf\u5206\u522b\u9664\u4ee5\u6a21\u5c31\u597d\u4e86\u3002\u4f8b\u5982\uff0c\u4e0a\u9762\u7684\u57fa\u53ef\u4ee5\u53d8\u4e3a\\((\\frac{1}{\\sqrt{2}},\\frac{1}{\\sqrt{2}})\\)\u548c\\((-\\frac{1}{\\sqrt{2}},\\frac{1}{\\sqrt{2}})\\)\u3002

    \u73b0\u5728\uff0c\u6211\u4eec\u60f3\u83b7\u5f97(3,2)\u5728\u65b0\u57fa\u4e0a\u7684\u5750\u6807\uff0c\u5373\u5728\u4e24\u4e2a\u65b9\u5411\u4e0a\u7684\u6295\u5f71\u77e2\u91cf\u503c\uff0c\u90a3\u4e48\u6839\u636e\u5185\u79ef\u7684\u51e0\u4f55\u610f\u4e49\uff0c\u6211\u4eec\u53ea\u8981\u5206\u522b\u8ba1\u7b97(3,2)\u548c\u4e24\u4e2a\u57fa\u7684\u5185\u79ef\uff0c\u4e0d\u96be\u5f97\u5230\u65b0\u7684\u5750\u6807\u4e3a\\((\\frac{5}{\\sqrt{2}},-\\frac{1}{\\sqrt{2}})\\)\u3002\u4e0b\u56fe\u7ed9\u51fa\u4e86\u65b0\u7684\u57fa\u4ee5\u53ca(3,2)\u5728\u65b0\u57fa\u4e0a\u5750\u6807\u503c\u7684\u793a\u610f\u56fe\uff1a

    \u53e6\u5916\u8fd9\u91cc\u8981\u6ce8\u610f\u7684\u662f\uff0c\u6211\u4eec\u5217\u4e3e\u7684\u4f8b\u5b50\u4e2d\u57fa\u662f\u6b63\u4ea4\u7684\uff08\u5373\u5185\u79ef\u4e3a0\uff0c\u6216\u76f4\u89c2\u8bf4\u76f8\u4e92\u5782\u76f4\uff09\uff0c\u4f46\u53ef\u4ee5\u6210\u4e3a\u4e00\u7ec4\u57fa\u7684\u552f\u4e00\u8981\u6c42\u5c31\u662f\u7ebf\u6027\u65e0\u5173\uff0c\u975e\u6b63\u4ea4\u7684\u57fa\u4e5f\u662f\u53ef\u4ee5\u7684\u3002\u4e0d\u8fc7\u56e0\u4e3a\u6b63\u4ea4\u57fa\u6709\u8f83\u597d\u7684\u6027\u8d28\uff0c\u6240\u4ee5\u4e00\u822c\u4f7f\u7528\u7684\u57fa\u90fd\u662f\u6b63\u4ea4\u7684\u3002

    • \u57fa\u53d8\u6362\u7684\u77e9\u9635\u8868\u793a

    \u4e0b\u9762\u6211\u4eec\u627e\u4e00\u79cd\u7b80\u4fbf\u7684\u65b9\u5f0f\u6765\u8868\u793a\u57fa\u53d8\u6362\u3002\u8fd8\u662f\u62ff\u4e0a\u9762\u7684\u4f8b\u5b50\uff0c\u60f3\u4e00\u4e0b\uff0c\u5c06(3,2)\u53d8\u6362\u4e3a\u65b0\u57fa\u4e0a\u7684\u5750\u6807\uff0c\u5c31\u662f\u7528(3,2)\u4e0e\u7b2c\u4e00\u4e2a\u57fa\u505a\u5185\u79ef\u8fd0\u7b97\uff0c\u4f5c\u4e3a\u7b2c\u4e00\u4e2a\u65b0\u7684\u5750\u6807\u5206\u91cf\uff0c\u7136\u540e\u7528(3,2)\u4e0e\u7b2c\u4e8c\u4e2a\u57fa\u505a\u5185\u79ef\u8fd0\u7b97\uff0c\u4f5c\u4e3a\u7b2c\u4e8c\u4e2a\u65b0\u5750\u6807\u7684\u5206\u91cf\u3002\u5b9e\u9645\u4e0a\uff0c\u6211\u4eec\u53ef\u4ee5\u7528\u77e9\u9635\u76f8\u4e58\u7684\u5f62\u5f0f\u7b80\u6d01\u7684\u8868\u793a\u8fd9\u4e2a\u53d8\u6362\uff1a

    \\[\\begin{pmatrix} 1/\\sqrt{2} & 1/\\sqrt{2} \\\\ -1/\\sqrt{2} & 1/\\sqrt{2} \\end{pmatrix} \\begin{pmatrix} 3 \\\\ 2 \\end{pmatrix} = \\begin{pmatrix} 5/\\sqrt{2} \\\\ -1/\\sqrt{2} \\end{pmatrix}\\]

    \u592a\u6f02\u4eae\u4e86\uff01\u5176\u4e2d\u77e9\u9635\u7684\u4e24\u884c\u5206\u522b\u4e3a\u4e24\u4e2a\u57fa\uff0c\u4e58\u4ee5\u539f\u5411\u91cf\uff0c\u5176\u7ed3\u679c\u521a\u597d\u4e3a\u65b0\u57fa\u7684\u5750\u6807\u3002\u53ef\u4ee5\u7a0d\u5fae\u63a8\u5e7f\u4e00\u4e0b\uff0c\u5982\u679c\u6211\u4eec\u6709m\u4e2a\u4e8c\u7ef4\u5411\u91cf\uff0c\u53ea\u8981\u5c06\u4e8c\u7ef4\u5411\u91cf\u6309\u5217\u6392\u6210\u4e00\u4e2a\u4e24\u884cm\u5217\u77e9\u9635\uff0c\u7136\u540e\u7528\u201c\u57fa\u77e9\u9635\u201d\u4e58\u4ee5\u8fd9\u4e2a\u77e9\u9635\uff0c\u5c31\u5f97\u5230\u4e86\u6240\u6709\u8fd9\u4e9b\u5411\u91cf\u5728\u65b0\u57fa\u4e0b\u7684\u503c\u3002\u4f8b\u5982(1,1)\uff0c(2,2)\uff0c(3,3)\uff0c\u60f3\u53d8\u6362\u5230\u521a\u624d\u90a3\u7ec4\u57fa\u4e0a\uff0c\u5219\u53ef\u4ee5\u8fd9\u6837\u8868\u793a\uff1a

    \\[\\begin{pmatrix} 1/\\sqrt{2} & 1/\\sqrt{2} \\\\ -1/\\sqrt{2} & 1/\\sqrt{2} \\end{pmatrix} \\begin{pmatrix} 1 & 2 & 3 \\\\ 1 & 2 & 3 \\end{pmatrix} = \\begin{pmatrix} 2/\\sqrt{2} & 4/\\sqrt{2} & 6/\\sqrt{2} \\\\ 0 & 0 & 0 \\end{pmatrix}\\]

    \u4e8e\u662f\u4e00\u7ec4\u5411\u91cf\u7684\u57fa\u53d8\u6362\u88ab\u5e72\u51c0\u7684\u8868\u793a\u4e3a\u77e9\u9635\u7684\u76f8\u4e58\u3002

    \u4e00\u822c\u7684\uff0c\u5982\u679c\u6211\u4eec\u6709M\u4e2aN\u7ef4\u5411\u91cf\uff0c\u60f3\u5c06\u5176\u53d8\u6362\u4e3a\u7531R\u4e2aN\u7ef4\u5411\u91cf\u8868\u793a\u7684\u65b0\u7a7a\u95f4\u4e2d\uff0c\u90a3\u4e48\u9996\u5148\u5c06R\u4e2a\u57fa\u6309\u884c\u7ec4\u6210\u77e9\u9635A\uff0c\u7136\u540e\u5c06\u5411\u91cf\u6309\u5217\u7ec4\u6210\u77e9\u9635B\uff0c\u90a3\u4e48\u4e24\u77e9\u9635\u7684\u4e58\u79efAB\u5c31\u662f\u53d8\u6362\u7ed3\u679c\uff0c\u5176\u4e2dAB\u7684\u7b2cm\u5217\u4e3aA\u4e2d\u7b2cm\u5217\u53d8\u6362\u540e\u7684\u7ed3\u679c\u3002

    \u6570\u5b66\u8868\u793a\u4e3a\uff1a

    \\[\\begin{pmatrix} p_1 \\\\ p_2 \\\\ \\vdots \\\\ p_R \\end{pmatrix} \\begin{pmatrix} a_1 & a_2 & \\cdots & a_M \\end{pmatrix} = \\begin{pmatrix} p_1a_1 & p_1a_2 & \\cdots & p_1a_M \\\\ p_2a_1 & p_2a_2 & \\cdots & p_2a_M \\\\ \\vdots & \\vdots & \\ddots & \\vdots \\\\ p_Ra_1 & p_Ra_2 & \\cdots & p_Ra_M \\end{pmatrix}\\]

    \u5176\u4e2d\\(p_i\\)\u662f\u4e00\u4e2a\u884c\u5411\u91cf\uff0c\u8868\u793a\u7b2ci\u4e2a\u57fa\uff0c\\(a_j\\)\u662f\u4e00\u4e2a\u5217\u5411\u91cf\uff0c\u8868\u793a\u7b2cj\u4e2a\u539f\u59cb\u6570\u636e\u8bb0\u5f55\u3002

    \u7279\u522b\u8981\u6ce8\u610f\u7684\u662f\uff0c\u8fd9\u91ccR\u53ef\u4ee5\u5c0f\u4e8eN\uff0c\u800cR\u51b3\u5b9a\u4e86\u53d8\u6362\u540e\u6570\u636e\u7684\u7ef4\u6570\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u4e00N\u7ef4\u6570\u636e\u53d8\u6362\u5230\u66f4\u4f4e\u7ef4\u5ea6\u7684\u7a7a\u95f4\u4e2d\u53bb\uff0c\u53d8\u6362\u540e\u7684\u7ef4\u5ea6\u53d6\u51b3\u4e8e\u57fa\u7684\u6570\u91cf\u3002\u56e0\u6b64\u8fd9\u79cd\u77e9\u9635\u76f8\u4e58\u7684\u8868\u793a\u4e5f\u53ef\u4ee5\u8868\u793a\u964d\u7ef4\u53d8\u6362\u3002

    \u6700\u540e\uff0c\u4e0a\u8ff0\u5206\u6790\u540c\u65f6\u7ed9\u77e9\u9635\u76f8\u4e58\u627e\u5230\u4e86\u4e00\u79cd\u7269\u7406\u89e3\u91ca\uff1a\u4e24\u4e2a\u77e9\u9635\u76f8\u4e58\u7684\u610f\u4e49\u662f\u5c06\u53f3\u8fb9\u77e9\u9635\u4e2d\u7684\u6bcf\u4e00\u5217\u5217\u5411\u91cf\u53d8\u6362\u5230\u5de6\u8fb9\u77e9\u9635\u4e2d\u6bcf\u4e00\u884c\u884c\u5411\u91cf\u4e3a\u57fa\u6240\u8868\u793a\u7684\u7a7a\u95f4\u4e2d\u53bb\u3002\u66f4\u62bd\u8c61\u7684\u8bf4\uff0c\u4e00\u4e2a\u77e9\u9635\u53ef\u4ee5\u8868\u793a\u4e00\u79cd\u7ebf\u6027\u53d8\u6362\u3002\u5f88\u591a\u540c\u5b66\u5728\u5b66\u7ebf\u6027\u4ee3\u6570\u65f6\u5bf9\u77e9\u9635\u76f8\u4e58\u7684\u65b9\u6cd5\u611f\u5230\u5947\u602a\uff0c\u4f46\u662f\u5982\u679c\u660e\u767d\u4e86\u77e9\u9635\u76f8\u4e58\u7684\u7269\u7406\u610f\u4e49\uff0c\u5176\u5408\u7406\u6027\u5c31\u4e00\u76ee\u4e86\u7136\u4e86\u3002

    "},{"location":"AI/pca/#_2","title":"\u534f\u65b9\u5dee\u77e9\u9635\u53ca\u4f18\u5316\u76ee\u6807","text":"

    \u4e0a\u9762\u6211\u4eec\u8ba8\u8bba\u4e86\u9009\u62e9\u4e0d\u540c\u7684\u57fa\u53ef\u4ee5\u5bf9\u540c\u6837\u4e00\u7ec4\u6570\u636e\u7ed9\u51fa\u4e0d\u540c\u7684\u8868\u793a\uff0c\u800c\u4e14\u5982\u679c\u57fa\u7684\u6570\u91cf\u5c11\u4e8e\u5411\u91cf\u672c\u8eab\u7684\u7ef4\u6570\uff0c\u5219\u53ef\u4ee5\u8fbe\u5230\u964d\u7ef4\u7684\u6548\u679c\u3002\u4f46\u662f\u6211\u4eec\u8fd8\u6ca1\u6709\u56de\u7b54\u4e00\u4e2a\u6700\u6700\u5173\u952e\u7684\u95ee\u9898\uff1a\u5982\u4f55\u9009\u62e9\u57fa\u624d\u662f\u6700\u4f18\u7684\u3002\u6216\u8005\u8bf4\uff0c\u5982\u679c\u6211\u4eec\u6709\u4e00\u7ec4N\u7ef4\u5411\u91cf\uff0c\u73b0\u5728\u8981\u5c06\u5176\u964d\u5230K\u7ef4\uff08K\u5c0f\u4e8eN\uff09\uff0c\u90a3\u4e48\u6211\u4eec\u5e94\u8be5\u5982\u4f55\u9009\u62e9K\u4e2a\u57fa\u624d\u80fd\u6700\u5927\u7a0b\u5ea6\u4fdd\u7559\u539f\u6709\u7684\u4fe1\u606f\uff1f

    \u8981\u5b8c\u5168\u6570\u5b66\u5316\u8fd9\u4e2a\u95ee\u9898\u975e\u5e38\u7e41\u6742\uff0c\u8fd9\u91cc\u6211\u4eec\u7528\u4e00\u79cd\u975e\u5f62\u5f0f\u5316\u7684\u76f4\u89c2\u65b9\u6cd5\u6765\u770b\u8fd9\u4e2a\u95ee\u9898\u3002

    \u4e3a\u4e86\u907f\u514d\u8fc7\u4e8e\u62bd\u8c61\u7684\u8ba8\u8bba\uff0c\u6211\u4eec\u4ecd\u4ee5\u4e00\u4e2a\u5177\u4f53\u7684\u4f8b\u5b50\u5c55\u5f00\u3002\u5047\u8bbe\u6211\u4eec\u7684\u6570\u636e\u7531\u4e94\u6761\u8bb0\u5f55\u7ec4\u6210\uff0c\u5c06\u5b83\u4eec\u8868\u793a\u6210\u77e9\u9635\u5f62\u5f0f\uff1a

    \\[\\begin{pmatrix} 1 & 1 & 2 & 4 & 2 \\\\ 1 & 3 & 3 & 4 & 4 \\end{pmatrix}\\]

    \u5176\u4e2d\u6bcf\u4e00\u5217\u4e3a\u4e00\u6761\u6570\u636e\u8bb0\u5f55\uff0c\u800c\u4e00\u884c\u4e3a\u4e00\u4e2a\u5b57\u6bb5\u3002\u4e3a\u4e86\u540e\u7eed\u5904\u7406\u65b9\u4fbf\uff0c\u6211\u4eec\u9996\u5148\u5c06\u6bcf\u4e2a\u5b57\u6bb5\u5185\u6240\u6709\u503c\u90fd\u51cf\u53bb\u5b57\u6bb5\u5747\u503c\uff0c\u5176\u7ed3\u679c\u662f\u5c06\u6bcf\u4e2a\u5b57\u6bb5\u90fd\u53d8\u4e3a\u5747\u503c\u4e3a0\uff08\u8fd9\u6837\u505a\u7684\u9053\u7406\u548c\u597d\u5904\u540e\u9762\u4f1a\u770b\u5230\uff09\u3002

    \u6211\u4eec\u770b\u4e0a\u9762\u7684\u6570\u636e\uff0c\u7b2c\u4e00\u4e2a\u5b57\u6bb5\u5747\u503c\u4e3a2\uff0c\u7b2c\u4e8c\u4e2a\u5b57\u6bb5\u5747\u503c\u4e3a3\uff0c\u6240\u4ee5\u53d8\u6362\u540e\uff1a

    \\[\\begin{pmatrix} -1 & -1 & 0 & 2 & 0 \\\\ -2 & 0 & 0 & 1 & 1 \\end{pmatrix}\\]

    \u6211\u4eec\u53ef\u4ee5\u770b\u4e0b\u4e94\u6761\u6570\u636e\u5728\u5e73\u9762\u76f4\u89d2\u5750\u6807\u7cfb\u5185\u7684\u6837\u5b50\uff1a

    \u73b0\u5728\u95ee\u9898\u6765\u4e86\uff1a\u5982\u679c\u6211\u4eec\u5fc5\u987b\u4f7f\u7528\u4e00\u7ef4\u6765\u8868\u793a\u8fd9\u4e9b\u6570\u636e\uff0c\u53c8\u5e0c\u671b\u5c3d\u91cf\u4fdd\u7559\u539f\u59cb\u7684\u4fe1\u606f\uff0c\u4f60\u8981\u5982\u4f55\u9009\u62e9\uff1f

    \u901a\u8fc7\u4e0a\u4e00\u8282\u5bf9\u57fa\u53d8\u6362\u7684\u8ba8\u8bba\u6211\u4eec\u77e5\u9053\uff0c\u8fd9\u4e2a\u95ee\u9898\u5b9e\u9645\u4e0a\u662f\u8981\u5728\u4e8c\u7ef4\u5e73\u9762\u4e2d\u9009\u62e9\u4e00\u4e2a\u65b9\u5411\uff0c\u5c06\u6240\u6709\u6570\u636e\u90fd\u6295\u5f71\u5230\u8fd9\u4e2a\u65b9\u5411\u6240\u5728\u76f4\u7ebf\u4e0a\uff0c\u7528\u6295\u5f71\u503c\u8868\u793a\u539f\u59cb\u8bb0\u5f55\u3002\u8fd9\u662f\u4e00\u4e2a\u5b9e\u9645\u7684\u4e8c\u7ef4\u964d\u5230\u4e00\u7ef4\u7684\u95ee\u9898\u3002

    \u90a3\u4e48\u5982\u4f55\u9009\u62e9\u8fd9\u4e2a\u65b9\u5411\uff08\u6216\u8005\u8bf4\u57fa\uff09\u624d\u80fd\u5c3d\u91cf\u4fdd\u7559\u6700\u591a\u7684\u539f\u59cb\u4fe1\u606f\u5462\uff1f\u4e00\u79cd\u76f4\u89c2\u7684\u770b\u6cd5\u662f\uff1a\u5e0c\u671b\u6295\u5f71\u540e\u7684\u6295\u5f71\u503c\u5c3d\u53ef\u80fd\u5206\u6563\u3002

    \u4ee5\u4e0a\u56fe\u4e3a\u4f8b\uff0c\u53ef\u4ee5\u770b\u51fa\u5982\u679c\u5411x\u8f74\u6295\u5f71\uff0c\u90a3\u4e48\u6700\u5de6\u8fb9\u7684\u4e24\u4e2a\u70b9\u4f1a\u91cd\u53e0\u5728\u4e00\u8d77\uff0c\u4e2d\u95f4\u7684\u4e24\u4e2a\u70b9\u4e5f\u4f1a\u91cd\u53e0\u5728\u4e00\u8d77\uff0c\u4e8e\u662f\u672c\u8eab\u56db\u4e2a\u5404\u4e0d\u76f8\u540c\u7684\u4e8c\u7ef4\u70b9\u6295\u5f71\u540e\u53ea\u5269\u4e0b\u4e24\u4e2a\u4e0d\u540c\u7684\u503c\u4e86\uff0c\u8fd9\u662f\u4e00\u79cd\u4e25\u91cd\u7684\u4fe1\u606f\u4e22\u5931\uff0c\u540c\u7406\uff0c\u5982\u679c\u5411y\u8f74\u6295\u5f71\u6700\u4e0a\u9762\u7684\u4e24\u4e2a\u70b9\u548c\u5206\u5e03\u5728x\u8f74\u4e0a\u7684\u4e24\u4e2a\u70b9\u4e5f\u4f1a\u91cd\u53e0\u3002\u6240\u4ee5\u770b\u6765x\u548cy\u8f74\u90fd\u4e0d\u662f\u6700\u597d\u7684\u6295\u5f71\u9009\u62e9\u3002\u6211\u4eec\u76f4\u89c2\u76ee\u6d4b\uff0c\u5982\u679c\u5411\u901a\u8fc7\u7b2c\u4e00\u8c61\u9650\u548c\u7b2c\u4e09\u8c61\u9650\u7684\u659c\u7ebf\u6295\u5f71\uff0c\u5219\u4e94\u4e2a\u70b9\u5728\u6295\u5f71\u540e\u8fd8\u662f\u53ef\u4ee5\u533a\u5206\u7684\u3002

    \u4e0b\u9762\uff0c\u6211\u4eec\u7528\u6570\u5b66\u65b9\u6cd5\u8868\u8ff0\u8fd9\u4e2a\u95ee\u9898\u3002

    "},{"location":"AI/pca/#_3","title":"\u65b9\u5dee","text":"

    \u4e0a\u6587\u8bf4\u5230\uff0c\u6211\u4eec\u5e0c\u671b\u6295\u5f71\u540e\u6295\u5f71\u503c\u5c3d\u53ef\u80fd\u5206\u6563\uff0c\u800c\u8fd9\u79cd\u5206\u6563\u7a0b\u5ea6\uff0c\u53ef\u4ee5\u7528\u6570\u5b66\u4e0a\u7684\u65b9\u5dee\u6765\u8868\u8ff0\u3002\u6b64\u5904\uff0c\u4e00\u4e2a\u5b57\u6bb5\u7684\u65b9\u5dee\u53ef\u4ee5\u770b\u505a\u662f\u6bcf\u4e2a\u5143\u7d20\u4e0e\u5b57\u6bb5\u5747\u503c\u7684\u5dee\u7684\u5e73\u65b9\u548c\u7684\u5747\u503c\uff0c\u5373\uff1a

    \\[Var(a)=\\frac{1}{m}\\sum_{i=1}^m{(a_i-\\mu)^2}\\]

    \u7531\u4e8e\u4e0a\u9762\u6211\u4eec\u5df2\u7ecf\u5c06\u6bcf\u4e2a\u5b57\u6bb5\u7684\u5747\u503c\u90fd\u5316\u4e3a0\u4e86\uff0c\u56e0\u6b64\u65b9\u5dee\u53ef\u4ee5\u76f4\u63a5\u7528\u6bcf\u4e2a\u5143\u7d20\u7684\u5e73\u65b9\u548c\u9664\u4ee5\u5143\u7d20\u4e2a\u6570\u8868\u793a\uff1a

    \\[Var(a)=\\frac{1}{m}\\sum_{i=1}^m{a_i^2}\\]

    \u4e8e\u662f\u4e0a\u9762\u7684\u95ee\u9898\u88ab\u5f62\u5f0f\u5316\u8868\u8ff0\u4e3a\uff1a\u5bfb\u627e\u4e00\u4e2a\u4e00\u7ef4\u57fa\uff0c\u4f7f\u5f97\u6240\u6709\u6570\u636e\u53d8\u6362\u4e3a\u8fd9\u4e2a\u57fa\u4e0a\u7684\u5750\u6807\u8868\u793a\u540e\uff0c\u65b9\u5dee\u503c\u6700\u5927\u3002

    "},{"location":"AI/pca/#_4","title":"\u534f\u65b9\u5dee","text":"

    \u5bf9\u4e8e\u4e0a\u9762\u4e8c\u7ef4\u964d\u6210\u4e00\u7ef4\u7684\u95ee\u9898\u6765\u8bf4\uff0c\u627e\u5230\u90a3\u4e2a\u4f7f\u5f97\u65b9\u5dee\u6700\u5927\u7684\u65b9\u5411\u5c31\u53ef\u4ee5\u4e86\u3002\u4e0d\u8fc7\u5bf9\u4e8e\u66f4\u9ad8\u7ef4\uff0c\u8fd8\u6709\u4e00\u4e2a\u95ee\u9898\u9700\u8981\u89e3\u51b3\u3002\u8003\u8651\u4e09\u7ef4\u964d\u5230\u4e8c\u7ef4\u95ee\u9898\u3002\u4e0e\u4e4b\u524d\u76f8\u540c\uff0c\u9996\u5148\u6211\u4eec\u5e0c\u671b\u627e\u5230\u4e00\u4e2a\u65b9\u5411\u4f7f\u5f97\u6295\u5f71\u540e\u65b9\u5dee\u6700\u5927\uff0c\u8fd9\u6837\u5c31\u5b8c\u6210\u4e86\u7b2c\u4e00\u4e2a\u65b9\u5411\u7684\u9009\u62e9\uff0c\u7ee7\u800c\u6211\u4eec\u9009\u62e9\u7b2c\u4e8c\u4e2a\u6295\u5f71\u65b9\u5411\u3002

    \u5982\u679c\u6211\u4eec\u8fd8\u662f\u5355\u7eaf\u53ea\u9009\u62e9\u65b9\u5dee\u6700\u5927\u7684\u65b9\u5411\uff0c\u5f88\u660e\u663e\uff0c\u8fd9\u4e2a\u65b9\u5411\u4e0e\u7b2c\u4e00\u4e2a\u65b9\u5411\u5e94\u8be5\u662f\u201c\u51e0\u4e4e\u91cd\u5408\u5728\u4e00\u8d77\u201d\uff0c\u663e\u7136\u8fd9\u6837\u7684\u7ef4\u5ea6\u662f\u6ca1\u6709\u7528\u7684\uff0c\u56e0\u6b64\uff0c\u5e94\u8be5\u6709\u5176\u4ed6\u7ea6\u675f\u6761\u4ef6\u3002\u4ece\u76f4\u89c2\u4e0a\u8bf4\uff0c\u8ba9\u4e24\u4e2a\u5b57\u6bb5\u5c3d\u53ef\u80fd\u8868\u793a\u66f4\u591a\u7684\u539f\u59cb\u4fe1\u606f\uff0c\u6211\u4eec\u662f\u4e0d\u5e0c\u671b\u5b83\u4eec\u4e4b\u95f4\u5b58\u5728\uff08\u7ebf\u6027\uff09\u76f8\u5173\u6027\u7684\uff0c\u56e0\u4e3a\u76f8\u5173\u6027\u610f\u5473\u7740\u4e24\u4e2a\u5b57\u6bb5\u4e0d\u662f\u5b8c\u5168\u72ec\u7acb\uff0c\u5fc5\u7136\u5b58\u5728\u91cd\u590d\u8868\u793a\u7684\u4fe1\u606f\u3002

    \u6570\u5b66\u4e0a\u53ef\u4ee5\u7528\u4e24\u4e2a\u5b57\u6bb5\u7684\u534f\u65b9\u5dee\u8868\u793a\u5176\u76f8\u5173\u6027\uff0c\u7531\u4e8e\u5df2\u7ecf\u8ba9\u6bcf\u4e2a\u5b57\u6bb5\u5747\u503c\u4e3a0\uff0c\u5219\uff1a

    \\[Cov(a,b)=\\frac{1}{m}\\sum_{i=1}^m{a_ib_i}\\]

    \u53ef\u4ee5\u770b\u5230\uff0c\u5728\u5b57\u6bb5\u5747\u503c\u4e3a0\u7684\u60c5\u51b5\u4e0b\uff0c\u4e24\u4e2a\u5b57\u6bb5\u7684\u534f\u65b9\u5dee\u7b80\u6d01\u7684\u8868\u793a\u4e3a\u5176\u5185\u79ef\u9664\u4ee5\u5143\u7d20\u6570m\u3002

    \u5f53\u534f\u65b9\u5dee\u4e3a0\u65f6\uff0c\u8868\u793a\u4e24\u4e2a\u5b57\u6bb5\u5b8c\u5168\u72ec\u7acb\u3002\u4e3a\u4e86\u8ba9\u534f\u65b9\u5dee\u4e3a0\uff0c\u6211\u4eec\u9009\u62e9\u7b2c\u4e8c\u4e2a\u57fa\u65f6\u53ea\u80fd\u5728\u4e0e\u7b2c\u4e00\u4e2a\u57fa\u6b63\u4ea4\u7684\u65b9\u5411\u4e0a\u9009\u62e9\u3002\u56e0\u6b64\u6700\u7ec8\u9009\u62e9\u7684\u4e24\u4e2a\u65b9\u5411\u4e00\u5b9a\u662f\u6b63\u4ea4\u7684\u3002

    \u81f3\u6b64\uff0c\u6211\u4eec\u5f97\u5230\u4e86\u964d\u7ef4\u95ee\u9898\u7684\u4f18\u5316\u76ee\u6807\uff1a\u5c06\u4e00\u7ec4N\u7ef4\u5411\u91cf\u964d\u4e3aK\u7ef4\uff08K\u5927\u4e8e0\uff0c\u5c0f\u4e8eN\uff09\uff0c\u5176\u76ee\u6807\u662f\u9009\u62e9K\u4e2a\u5355\u4f4d\uff08\u6a21\u4e3a1\uff09\u6b63\u4ea4\u57fa\uff0c\u4f7f\u5f97\u539f\u59cb\u6570\u636e\u53d8\u6362\u5230\u8fd9\u7ec4\u57fa\u4e0a\u540e\uff0c\u5404\u5b57\u6bb5\u4e24\u4e24\u95f4\u534f\u65b9\u5dee\u4e3a0\uff0c\u800c\u5b57\u6bb5\u7684\u65b9\u5dee\u5219\u5c3d\u53ef\u80fd\u5927\uff08\u5728\u6b63\u4ea4\u7684\u7ea6\u675f\u4e0b\uff0c\u53d6\u6700\u5927\u7684K\u4e2a\u65b9\u5dee\uff09\u3002

    "},{"location":"AI/pca/#_5","title":"\u534f\u65b9\u5dee\u77e9\u9635","text":"

    \u4e0a\u9762\u6211\u4eec\u5bfc\u51fa\u4e86\u4f18\u5316\u76ee\u6807\uff0c\u4f46\u662f\u8fd9\u4e2a\u76ee\u6807\u4f3c\u4e4e\u4e0d\u80fd\u76f4\u63a5\u4f5c\u4e3a\u64cd\u4f5c\u6307\u5357\uff08\u6216\u8005\u8bf4\u7b97\u6cd5\uff09\uff0c\u56e0\u4e3a\u5b83\u53ea\u8bf4\u8981\u4ec0\u4e48\uff0c\u4f46\u6839\u672c\u6ca1\u6709\u8bf4\u600e\u4e48\u505a\u3002\u6240\u4ee5\u6211\u4eec\u8981\u7ee7\u7eed\u5728\u6570\u5b66\u4e0a\u7814\u7a76\u8ba1\u7b97\u65b9\u6848\u3002

    \u6211\u4eec\u770b\u5230\uff0c\u6700\u7ec8\u8981\u8fbe\u5230\u7684\u76ee\u7684\u4e0e\u5b57\u6bb5\u5185\u65b9\u5dee\u53ca\u5b57\u6bb5\u95f4\u534f\u65b9\u5dee\u6709\u5bc6\u5207\u5173\u7cfb\u3002\u56e0\u6b64\u6211\u4eec\u5e0c\u671b\u80fd\u5c06\u4e24\u8005\u7edf\u4e00\u8868\u793a\uff0c\u4ed4\u7ec6\u89c2\u5bdf\u53d1\u73b0\uff0c\u4e24\u8005\u5747\u53ef\u4ee5\u8868\u793a\u4e3a\u5185\u79ef\u7684\u5f62\u5f0f\uff0c\u800c\u5185\u79ef\u53c8\u4e0e\u77e9\u9635\u76f8\u4e58\u5bc6\u5207\u76f8\u5173\u3002\u4e8e\u662f\u6211\u4eec\u6765\u4e86\u7075\u611f\uff1a

    \u5047\u8bbe\u6211\u4eec\u53ea\u6709a\u548cb\u4e24\u4e2a\u5b57\u6bb5\uff0c\u90a3\u4e48\u6211\u4eec\u5c06\u5b83\u4eec\u6309\u884c\u7ec4\u6210\u77e9\u9635X\uff1a

    \\[X=\\begin{pmatrix} a_1 & a_2 & \\cdots & a_m \\\\ b_1 & b_2 & \\cdots & b_m \\end{pmatrix}\\]

    \u7136\u540e\u6211\u4eec\u7528X\u4e58\u4ee5X\u7684\u8f6c\u7f6e\uff0c\u5e76\u4e58\u4e0a\u7cfb\u65701/m\uff1a

    \\[\\frac{1}{m}XX^\\mathsf{T}=\\begin{pmatrix} \\frac{1}{m}\\sum_{i=1}^m{a_i^2} & \\frac{1}{m}\\sum_{i=1}^m{a_ib_i} \\\\ \\frac{1}{m}\\sum_{i=1}^m{a_ib_i} & \\frac{1}{m}\\sum_{i=1}^m{b_i^2} \\end{pmatrix}\\]

    \u5947\u8ff9\u51fa\u73b0\u4e86\uff01\u8fd9\u4e2a\u77e9\u9635\u5bf9\u89d2\u7ebf\u4e0a\u7684\u4e24\u4e2a\u5143\u7d20\u5206\u522b\u662f\u4e24\u4e2a\u5b57\u6bb5\u7684\u65b9\u5dee\uff0c\u800c\u5176\u5b83\u5143\u7d20\u662fa\u548cb\u7684\u534f\u65b9\u5dee\u3002\u4e24\u8005\u88ab\u7edf\u4e00\u5230\u4e86\u4e00\u4e2a\u77e9\u9635\u7684\u3002

    \u6839\u636e\u77e9\u9635\u76f8\u4e58\u7684\u8fd0\u7b97\u6cd5\u5219\uff0c\u8fd9\u4e2a\u7ed3\u8bba\u5f88\u5bb9\u6613\u88ab\u63a8\u5e7f\u5230\u4e00\u822c\u60c5\u51b5\uff1a

    \u8bbe\u6211\u4eec\u6709m\u4e2an\u7ef4\u6570\u636e\u8bb0\u5f55\uff0c\u5c06\u5176\u6309\u5217\u6392\u6210n\u4e58m\u7684\u77e9\u9635X\uff0c\u8bbe\\(C=\\frac{1}{m}XX^\\mathsf{T}\\)\uff0c\u5219C\u662f\u4e00\u4e2a\u5bf9\u79f0\u77e9\u9635\uff0c\u5176\u5bf9\u89d2\u7ebf\u5206\u522b\u4e2a\u5404\u4e2a\u5b57\u6bb5\u7684\u65b9\u5dee\uff0c\u800c\u7b2ci\u884cj\u5217\u548cj\u884ci\u5217\u5143\u7d20\u76f8\u540c\uff0c\u8868\u793ai\u548cj\u4e24\u4e2a\u5b57\u6bb5\u7684\u534f\u65b9\u5dee\u3002

    "},{"location":"AI/pca/#_6","title":"\u534f\u65b9\u5dee\u77e9\u9635\u5bf9\u89d2\u5316","text":"

    \u6839\u636e\u4e0a\u8ff0\u63a8\u5bfc\uff0c\u6211\u4eec\u53d1\u73b0\u8981\u8fbe\u5230\u4f18\u5316\u76ee\u524d\uff0c\u7b49\u4ef7\u4e8e\u5c06\u534f\u65b9\u5dee\u77e9\u9635\u5bf9\u89d2\u5316\uff1a\u5373\u9664\u5bf9\u89d2\u7ebf\u5916\u7684\u5176\u5b83\u5143\u7d20\u5316\u4e3a0\uff0c\u5e76\u4e14\u5728\u5bf9\u89d2\u7ebf\u4e0a\u5c06\u5143\u7d20\u6309\u5927\u5c0f\u4ece\u4e0a\u5230\u4e0b\u6392\u5217\uff0c\u8fd9\u6837\u6211\u4eec\u5c31\u8fbe\u5230\u4e86\u4f18\u5316\u76ee\u7684\u3002\u8fd9\u6837\u8bf4\u53ef\u80fd\u8fd8\u4e0d\u662f\u5f88\u660e\u6670\uff0c\u6211\u4eec\u8fdb\u4e00\u6b65\u770b\u4e0b\u539f\u77e9\u9635\u4e0e\u57fa\u53d8\u6362\u540e\u77e9\u9635\u534f\u65b9\u5dee\u77e9\u9635\u7684\u5173\u7cfb\uff1a

    \u8bbe\u539f\u59cb\u6570\u636e\u77e9\u9635X\u5bf9\u5e94\u7684\u534f\u65b9\u5dee\u77e9\u9635\u4e3aC\uff0c\u800cP\u662f\u4e00\u7ec4\u57fa\u6309\u884c\u7ec4\u6210\u7684\u77e9\u9635\uff0c\u8bbeY=PX\uff0c\u5219Y\u4e3aX\u5bf9P\u505a\u57fa\u53d8\u6362\u540e\u7684\u6570\u636e\u3002\u8bbeY\u7684\u534f\u65b9\u5dee\u77e9\u9635\u4e3aD\uff0c\u6211\u4eec\u63a8\u5bfc\u4e00\u4e0bD\u4e0eC\u7684\u5173\u7cfb\uff1a

    \\[\\begin{array}{l l l} D & = & \\frac{1}{m}YY^\\mathsf{T} \\\\ & = & \\frac{1}{m}(PX)(PX)^\\mathsf{T} \\\\ & = & \\frac{1}{m}PXX^\\mathsf{T}P^\\mathsf{T} \\\\ & = & P(\\frac{1}{m}XX^\\mathsf{T})P^\\mathsf{T} \\\\ & = & PCP^\\mathsf{T} \\end{array}\\]

    \u73b0\u5728\u4e8b\u60c5\u5f88\u660e\u767d\u4e86\uff01\u6211\u4eec\u8981\u627e\u7684P\u4e0d\u662f\u522b\u7684\uff0c\u800c\u662f\u80fd\u8ba9\u539f\u59cb\u534f\u65b9\u5dee\u77e9\u9635\u5bf9\u89d2\u5316\u7684P\u3002\u6362\u53e5\u8bdd\u8bf4\uff0c\u4f18\u5316\u76ee\u6807\u53d8\u6210\u4e86\u5bfb\u627e\u4e00\u4e2a\u77e9\u9635P\uff0c\u6ee1\u8db3\\(PCP^\\mathsf{T}\\)\u662f\u4e00\u4e2a\u5bf9\u89d2\u77e9\u9635\uff0c\u5e76\u4e14\u5bf9\u89d2\u5143\u7d20\u6309\u4ece\u5927\u5230\u5c0f\u4f9d\u6b21\u6392\u5217\uff0c\u90a3\u4e48P\u7684\u524dK\u884c\u5c31\u662f\u8981\u5bfb\u627e\u7684\u57fa\uff0c\u7528P\u7684\u524dK\u884c\u7ec4\u6210\u7684\u77e9\u9635\u4e58\u4ee5X\u5c31\u4f7f\u5f97X\u4eceN\u7ef4\u964d\u5230\u4e86K\u7ef4\u5e76\u6ee1\u8db3\u4e0a\u8ff0\u4f18\u5316\u6761\u4ef6\u3002

    \u81f3\u6b64\uff0c\u6211\u4eec\u79bb\u201c\u53d1\u660e\u201dPCA\u8fd8\u6709\u4ec5\u4e00\u6b65\u4e4b\u9065\uff01

    \u73b0\u5728\u6240\u6709\u7126\u70b9\u90fd\u805a\u7126\u5728\u4e86\u534f\u65b9\u5dee\u77e9\u9635\u5bf9\u89d2\u5316\u95ee\u9898\u4e0a\uff0c\u6709\u65f6\uff0c\u6211\u4eec\u771f\u5e94\u8be5\u611f\u8c22\u6570\u5b66\u5bb6\u7684\u5148\u884c\uff0c\u56e0\u4e3a\u77e9\u9635\u5bf9\u89d2\u5316\u5728\u7ebf\u6027\u4ee3\u6570\u9886\u57df\u5df2\u7ecf\u5c5e\u4e8e\u88ab\u73a9\u70c2\u4e86\u7684\u4e1c\u897f\uff0c\u6240\u4ee5\u8fd9\u5728\u6570\u5b66\u4e0a\u6839\u672c\u4e0d\u662f\u95ee\u9898\u3002

    \u7531\u4e0a\u6587\u77e5\u9053\uff0c\u534f\u65b9\u5dee\u77e9\u9635C\u662f\u4e00\u4e2a\u662f\u5bf9\u79f0\u77e9\u9635\uff0c\u5728\u7ebf\u6027\u4ee3\u6570\u4e0a\uff0c\u5b9e\u5bf9\u79f0\u77e9\u9635\u6709\u4e00\u7cfb\u5217\u975e\u5e38\u597d\u7684\u6027\u8d28\uff1a

    1\uff09\u5b9e\u5bf9\u79f0\u77e9\u9635\u4e0d\u540c\u7279\u5f81\u503c\u5bf9\u5e94\u7684\u7279\u5f81\u5411\u91cf\u5fc5\u7136\u6b63\u4ea4\u3002

    2\uff09\u8bbe\u7279\u5f81\u5411\u91cf\\(\\lambda\\)\u91cd\u6570\u4e3ar\uff0c\u5219\u5fc5\u7136\u5b58\u5728r\u4e2a\u7ebf\u6027\u65e0\u5173\u7684\u7279\u5f81\u5411\u91cf\u5bf9\u5e94\u4e8e\\(\\lambda\\)\uff0c\u56e0\u6b64\u53ef\u4ee5\u5c06\u8fd9r\u4e2a\u7279\u5f81\u5411\u91cf\u5355\u4f4d\u6b63\u4ea4\u5316\u3002

    \u7531\u4e0a\u9762\u4e24\u6761\u53ef\u77e5\uff0c\u4e00\u4e2an\u884cn\u5217\u7684\u5b9e\u5bf9\u79f0\u77e9\u9635\u4e00\u5b9a\u53ef\u4ee5\u627e\u5230n\u4e2a\u5355\u4f4d\u6b63\u4ea4\u7279\u5f81\u5411\u91cf\uff0c\u8bbe\u8fd9n\u4e2a\u7279\u5f81\u5411\u91cf\u4e3a\\(e_1,e_2,\\cdots,e_n\\)\uff0c\u6211\u4eec\u5c06\u5176\u6309\u5217\u7ec4\u6210\u77e9\u9635\uff1a

    \\[E=\\begin{pmatrix} e_1 & e_2 & \\cdots & e_n \\end{pmatrix}\\]

    \u5219\u5bf9\u534f\u65b9\u5dee\u77e9\u9635C\u6709\u5982\u4e0b\u7ed3\u8bba\uff1a

    \\[E^\\mathsf{T}CE=\\Lambda=\\begin{pmatrix} \\lambda_1 & & & \\\\ & \\lambda_2 & & \\\\ & & \\ddots & \\\\ & & & \\lambda_n \\end{pmatrix}\\]

    \u5176\u4e2d\\(\\Lambda\\)\u4e3a\u5bf9\u89d2\u77e9\u9635\uff0c\u5176\u5bf9\u89d2\u5143\u7d20\u4e3a\u5404\u7279\u5f81\u5411\u91cf\u5bf9\u5e94\u7684\u7279\u5f81\u503c\uff08\u53ef\u80fd\u6709\u91cd\u590d\uff09\u3002

    \u4ee5\u4e0a\u7ed3\u8bba\u4e0d\u518d\u7ed9\u51fa\u4e25\u683c\u7684\u6570\u5b66\u8bc1\u660e\uff0c\u5bf9\u8bc1\u660e\u611f\u5174\u8da3\u7684\u670b\u53cb\u53ef\u4ee5\u53c2\u8003\u7ebf\u6027\u4ee3\u6570\u4e66\u7c4d\u5173\u4e8e\u201c\u5b9e\u5bf9\u79f0\u77e9\u9635\u5bf9\u89d2\u5316\u201d\u7684\u5185\u5bb9\u3002

    \u5230\u8fd9\u91cc\uff0c\u6211\u4eec\u53d1\u73b0\u6211\u4eec\u5df2\u7ecf\u627e\u5230\u4e86\u9700\u8981\u7684\u77e9\u9635P\uff1a

    \\[P=E^\\mathsf{T}\\]

    P\u662f\u534f\u65b9\u5dee\u77e9\u9635\u7684\u7279\u5f81\u5411\u91cf\u5355\u4f4d\u5316\u540e\u6309\u884c\u6392\u5217\u51fa\u7684\u77e9\u9635\uff0c\u5176\u4e2d\u6bcf\u4e00\u884c\u90fd\u662fC\u7684\u4e00\u4e2a\u7279\u5f81\u5411\u91cf\u3002\u5982\u679c\u8bbeP\u6309\u7167\\(\\Lambda\\)\u4e2d\u7279\u5f81\u503c\u7684\u4ece\u5927\u5230\u5c0f\uff0c\u5c06\u7279\u5f81\u5411\u91cf\u4ece\u4e0a\u5230\u4e0b\u6392\u5217\uff0c\u5219\u7528P\u7684\u524dK\u884c\u7ec4\u6210\u7684\u77e9\u9635\u4e58\u4ee5\u539f\u59cb\u6570\u636e\u77e9\u9635X\uff0c\u5c31\u5f97\u5230\u4e86\u6211\u4eec\u9700\u8981\u7684\u964d\u7ef4\u540e\u7684\u6570\u636e\u77e9\u9635Y\u3002

    \u81f3\u6b64\u6211\u4eec\u5b8c\u6210\u4e86\u6574\u4e2aPCA\u7684\u6570\u5b66\u539f\u7406\u8ba8\u8bba\u3002\u5728\u4e0b\u9762\u7684\u4e00\u8282\uff0c\u6211\u4eec\u5c06\u7ed9\u51faPCA\u7684\u4e00\u4e2a\u5b9e\u4f8b\u3002

    "},{"location":"AI/pca/#pca","title":"PCA\u7b97\u6cd5","text":"

    \u603b\u7ed3\u4e00\u4e0bPCA\u7684\u7b97\u6cd5\u6b65\u9aa4\uff1a

    \u8bbe\u6709m\u6761n\u7ef4\u6570\u636e\u3002

    1\uff09\u5c06\u539f\u59cb\u6570\u636e\u6309\u5217\u7ec4\u6210n\u884cm\u5217\u77e9\u9635X

    2\uff09\u5c06X\u7684\u6bcf\u4e00\u884c\uff08\u4ee3\u8868\u4e00\u4e2a\u5c5e\u6027\u5b57\u6bb5\uff09\u8fdb\u884c\u96f6\u5747\u503c\u5316\uff0c\u5373\u51cf\u53bb\u8fd9\u4e00\u884c\u7684\u5747\u503c

    3\uff09\u6c42\u51fa\u534f\u65b9\u5dee\u77e9\u9635\\(C=\\frac{1}{m}XX^\\mathsf{T}\\)

    4\uff09\u6c42\u51fa\u534f\u65b9\u5dee\u77e9\u9635\u7684\u7279\u5f81\u503c\u53ca\u5bf9\u5e94\u7684\u7279\u5f81\u5411\u91cf

    5\uff09\u5c06\u7279\u5f81\u5411\u91cf\u6309\u5bf9\u5e94\u7279\u5f81\u503c\u5927\u5c0f\u4ece\u4e0a\u5230\u4e0b\u6309\u884c\u6392\u5217\u6210\u77e9\u9635\uff0c\u53d6\u524dk\u884c\u7ec4\u6210\u77e9\u9635P

    6\uff09\\(Y=PX\\)\u5373\u4e3a\u964d\u7ef4\u5230k\u7ef4\u540e\u7684\u6570\u636e

    "},{"location":"AI/pca/#_7","title":"\u5b9e\u4f8b","text":"

    \u8fd9\u91cc\u4ee5\u4e0a\u6587\u63d0\u5230\u7684

    \\[\\begin{pmatrix} -1 & -1 & 0 & 2 & 0 \\\\ -2 & 0 & 0 & 1 & 1 \\end{pmatrix}\\]

    \u4e3a\u4f8b\uff0c\u6211\u4eec\u7528PCA\u65b9\u6cd5\u5c06\u8fd9\u7ec4\u4e8c\u7ef4\u6570\u636e\u5176\u964d\u5230\u4e00\u7ef4\u3002

    \u56e0\u4e3a\u8fd9\u4e2a\u77e9\u9635\u7684\u6bcf\u884c\u5df2\u7ecf\u662f\u96f6\u5747\u503c\uff0c\u8fd9\u91cc\u6211\u4eec\u76f4\u63a5\u6c42\u534f\u65b9\u5dee\u77e9\u9635\uff1a

    \\[C=\\frac{1}{5}\\begin{pmatrix} -1 & -1 & 0 & 2 & 0 \\\\ -2 & 0 & 0 & 1 & 1 \\end{pmatrix}\\begin{pmatrix} -1 & -2 \\\\ -1 & 0 \\\\ 0 & 0 \\\\ 2 & 1 \\\\ 0 & 1 \\end{pmatrix}=\\begin{pmatrix} \\frac{6}{5} & \\frac{4}{5} \\\\ \\frac{4}{5} & \\frac{6}{5} \\end{pmatrix}\\]

    \u7136\u540e\u6c42\u5176\u7279\u5f81\u503c\u548c\u7279\u5f81\u5411\u91cf\uff0c\u5177\u4f53\u6c42\u89e3\u65b9\u6cd5\u4e0d\u518d\u8be6\u8ff0\uff0c\u53ef\u4ee5\u53c2\u8003\u76f8\u5173\u8d44\u6599\u3002\u6c42\u89e3\u540e\u7279\u5f81\u503c\u4e3a\uff1a

    \\[\\lambda_1=2,\\lambda_2=2/5\\]

    \u5176\u5bf9\u5e94\u7684\u7279\u5f81\u5411\u91cf\u5206\u522b\u662f\uff1a

    \\[c_1\\begin{pmatrix} 1 \\\\ 1 \\end{pmatrix},c_2\\begin{pmatrix} -1 \\\\ 1 \\end{pmatrix}\\]

    \u5176\u4e2d\u5bf9\u5e94\u7684\u7279\u5f81\u5411\u91cf\u5206\u522b\u662f\u4e00\u4e2a\u901a\u89e3\uff0c\\(c_1\\)\u548c\\(c_2\\)\u53ef\u53d6\u4efb\u610f\u5b9e\u6570\u3002\u90a3\u4e48\u6807\u51c6\u5316\u540e\u7684\u7279\u5f81\u5411\u91cf\u4e3a\uff1a

    \\[\\begin{pmatrix} 1/\\sqrt{2} \\\\ 1/\\sqrt{2} \\end{pmatrix},\\begin{pmatrix} -1/\\sqrt{2} \\\\ 1/\\sqrt{2} \\end{pmatrix}\\]

    \u56e0\u6b64\u6211\u4eec\u7684\u77e9\u9635P\u662f\uff1a

    \\[P=\\begin{pmatrix} 1/\\sqrt{2} & 1/\\sqrt{2} \\\\ -1/\\sqrt{2} & 1/\\sqrt{2} \\end{pmatrix}\\]

    \u53ef\u4ee5\u9a8c\u8bc1\u534f\u65b9\u5dee\u77e9\u9635C\u7684\u5bf9\u89d2\u5316\uff1a

    \\[PCP^\\mathsf{T}=\\begin{pmatrix} 1/\\sqrt{2} & 1/\\sqrt{2} \\\\ -1/\\sqrt{2} & 1/\\sqrt{2} \\end{pmatrix}\\begin{pmatrix} 6/5 & 4/5 \\\\ 4/5 & 6/5 \\end{pmatrix}\\begin{pmatrix} 1/\\sqrt{2} & -1/\\sqrt{2} \\\\ 1/\\sqrt{2} & 1/\\sqrt{2} \\end{pmatrix}=\\begin{pmatrix} 2 & 0 \\\\ 0 & 2/5 \\end{pmatrix}\\]

    \u6700\u540e\u6211\u4eec\u7528P\u7684\u7b2c\u4e00\u884c\u4e58\u4ee5\u6570\u636e\u77e9\u9635\uff0c\u5c31\u5f97\u5230\u4e86\u964d\u7ef4\u540e\u7684\u8868\u793a\uff1a

    \\[Y=\\begin{pmatrix} 1/\\sqrt{2} & 1/\\sqrt{2} \\end{pmatrix}\\begin{pmatrix} -1 & -1 & 0 & 2 & 0 \\\\ -2 & 0 & 0 & 1 & 1 \\end{pmatrix}=\\begin{pmatrix} -3/\\sqrt{2} & -1/\\sqrt{2} & 0 & 3/\\sqrt{2} & -1/\\sqrt{2} \\end{pmatrix}\\]

    \u964d\u7ef4\u6295\u5f71\u7ed3\u679c\u5982\u4e0b\u56fe\uff1a

    "},{"location":"AI/pca/#_8","title":"\u8fdb\u4e00\u6b65\u8ba8\u8bba","text":"

    \u6839\u636e\u4e0a\u9762\u5bf9PCA\u7684\u6570\u5b66\u539f\u7406\u7684\u89e3\u91ca\uff0c\u6211\u4eec\u53ef\u4ee5\u4e86\u89e3\u5230\u4e00\u4e9bPCA\u7684\u80fd\u529b\u548c\u9650\u5236\u3002PCA\u672c\u8d28\u4e0a\u662f\u5c06\u65b9\u5dee\u6700\u5927\u7684\u65b9\u5411\u4f5c\u4e3a\u4e3b\u8981\u7279\u5f81\uff0c\u5e76\u4e14\u5728\u5404\u4e2a\u6b63\u4ea4\u65b9\u5411\u4e0a\u5c06\u6570\u636e\u201c\u79bb\u76f8\u5173\u201d\uff0c\u4e5f\u5c31\u662f\u8ba9\u5b83\u4eec\u5728\u4e0d\u540c\u6b63\u4ea4\u65b9\u5411\u4e0a\u6ca1\u6709\u76f8\u5173\u6027\u3002

    \u56e0\u6b64\uff0cPCA\u4e5f\u5b58\u5728\u4e00\u4e9b\u9650\u5236\uff0c\u4f8b\u5982\u5b83\u53ef\u4ee5\u5f88\u597d\u7684\u89e3\u9664\u7ebf\u6027\u76f8\u5173\uff0c\u4f46\u662f\u5bf9\u4e8e\u9ad8\u9636\u76f8\u5173\u6027\u5c31\u6ca1\u6709\u529e\u6cd5\u4e86\uff0c\u5bf9\u4e8e\u5b58\u5728\u9ad8\u9636\u76f8\u5173\u6027\u7684\u6570\u636e\uff0c\u53ef\u4ee5\u8003\u8651Kernel PCA\uff0c\u901a\u8fc7Kernel\u51fd\u6570\u5c06\u975e\u7ebf\u6027\u76f8\u5173\u8f6c\u4e3a\u7ebf\u6027\u76f8\u5173\uff0c\u5173\u4e8e\u8fd9\u70b9\u5c31\u4e0d\u5c55\u5f00\u8ba8\u8bba\u4e86\u3002\u53e6\u5916\uff0cPCA\u5047\u8bbe\u6570\u636e\u5404\u4e3b\u7279\u5f81\u662f\u5206\u5e03\u5728\u6b63\u4ea4\u65b9\u5411\u4e0a\uff0c\u5982\u679c\u5728\u975e\u6b63\u4ea4\u65b9\u5411\u4e0a\u5b58\u5728\u51e0\u4e2a\u65b9\u5dee\u8f83\u5927\u7684\u65b9\u5411\uff0cPCA\u7684\u6548\u679c\u5c31\u5927\u6253\u6298\u6263\u4e86\u3002

    \u6700\u540e\u9700\u8981\u8bf4\u660e\u7684\u662f\uff0cPCA\u662f\u4e00\u79cd\u65e0\u53c2\u6570\u6280\u672f\uff0c\u4e5f\u5c31\u662f\u8bf4\u9762\u5bf9\u540c\u6837\u7684\u6570\u636e\uff0c\u5982\u679c\u4e0d\u8003\u8651\u6e05\u6d17\uff0c\u8c01\u6765\u505a\u7ed3\u679c\u90fd\u4e00\u6837\uff0c\u6ca1\u6709\u4e3b\u89c2\u53c2\u6570\u7684\u4ecb\u5165\uff0c\u6240\u4ee5PCA\u4fbf\u4e8e\u901a\u7528\u5b9e\u73b0\uff0c\u4f46\u662f\u672c\u8eab\u65e0\u6cd5\u4e2a\u6027\u5316\u7684\u4f18\u5316\u3002

    \u5e0c\u671b\u8fd9\u7bc7\u6587\u7ae0\u80fd\u5e2e\u52a9\u670b\u53cb\u4eec\u4e86\u89e3PCA\u7684\u6570\u5b66\u7406\u8bba\u57fa\u7840\u548c\u5b9e\u73b0\u539f\u7406\uff0c\u501f\u6b64\u4e86\u89e3PCA\u7684\u9002\u7528\u573a\u666f\u548c\u9650\u5236\uff0c\u4ece\u800c\u66f4\u597d\u7684\u4f7f\u7528\u8fd9\u4e2a\u7b97\u6cd5\u3002

    "},{"location":"AI/pca/#dla","title":"DLA","text":"

    \\(or \\Rightarrow max Tr(w^TS_bS_w^{-1}w) constrained to\\ \\ ww^T=1\\)

    \\(m1 \\ m2 \u90fd\u662f\u5e73\u5747\u503c\\)

    https://zhuanlan.zhihu.com/p/32658341

    "},{"location":"CV/ML-4360/BS/lec2/","title":"Lec2 for ML-4360","text":""},{"location":"CV/ML-4360/BS/lec2/#21-primitives-transformations","title":"2.1 Primitives & Transformations","text":""},{"location":"CV/ML-4360/BS/lec2/#homogeneous","title":"\\(Homogeneous\\)","text":"
    • homogeneous coordinates & inhomogeneous coordinates
    • argmented vector[one element out of the whole equivalent class],homogeneous vectors,homogeneous vectors
    • points at infinity
    • In homogeneous coordinates, the intersection of two lines is given by:

      \\(\\tilde{x}\\)=\\(\\tilde{l1}\\) \u00d7 \\(\\tilde{l2}\\)

    • the line joining two points can be compactly written as:

      \\(\\tilde{l}\\)=\\(\\tilde{x1}\\) \u00d7 \\(\\tilde{x2}\\)

    "},{"location":"CV/ML-4360/BS/lec2/#transformations","title":"\\(Transformations\\)","text":"
    • translation 2DOF
    • Euclidean 3DOF \\(RR^T=I \\ der(R)=1\\)
    • \u6b63\u4ea4\u77e9\u9635\\(A^TA=I\\)

    \\(A^{-1}=A^T\\)

    \\(\\left|A\\right|\\) = +-1

    A\u7684\u884c\uff08\u5217\uff09\u5411\u91cf\u7ec4\u4e3an\u7ef4\u5355\u4f4d\u6b63\u4ea4\u5411\u91cf\u7ec4 * Similarity 4DOF * Affine: 6DOF arbitrary \\(2\u00d72\\) matrix

    Parallels Remain! * Projective :8DOF\u2014\u2014preserve straight lines

    DOF\uff082D\uff09:n(n-1)/2

    \\(\\tilde{l}'\\) = \\((\\tilde{H}^T)^{-1}\\)\\(\\tilde{l}\\)

    "},{"location":"CV/ML-4360/BS/lec2/#direct-linear-transform-for-homography-estimationalgorithm-dlt","title":"Direct Linear Transform for Homography Estimation[algorithm DLT","text":"
    • UDV\uff01 SVD!
    "},{"location":"CV/ML-4360/BS/lec2/#22-geometric-image-formation","title":"2.2 Geometric Image Formation","text":"

    Orthographic projection

    Perspective\u3000projection

    * Complete perspective projection

    lens distortion

    • radial and tangential distortion
    "},{"location":"CV/ML-4360/BS/lec2/#23-photometric-image-formation","title":"2.3 Photometric Image Formation","text":""},{"location":"CV/ML-4360/BS/lec2/#rendering-equation","title":"\\(Rendering Equation\\)","text":"
    • intensity :power per solid angle

      \\(dw=\\sin\\theta\\)\\(d\\theta\\)\\(d\\phi\\)

    • Irradiance \uff1a power per unit area

      E(x)=d\\(\\Phi(x)\\)/dA

    • Radiannce

      L(p,w)=\\(d^2\\Phi(p,\\omega)\\)/\\(d\\omega\\)\\(dAcos\\theta\\)

    "},{"location":"CV/ML-4360/BS/lec2/#brdf-radiance_outirradiance_in","title":"\\(BRDF\\) \"\\(Radiance_{out}/Irradiance_{in}\\)\"","text":""},{"location":"CV/ML-4360/BS/lec2/#the-reflection-equation","title":"\\(The Reflection Equation\\)","text":""},{"location":"CV/ML-4360/BS/lec2/#back-to-cameras","title":"Back To Cameras","text":""},{"location":"CV/ML-4360/BS/lec2/#chromatic-aberration","title":"\\(Chromatic Aberration\\)","text":""},{"location":"CV/ML-4360/BS/lec2/#24-image-sensing-pipeline","title":"2.4 Image Sensing Pipeline","text":""},{"location":"CV/ML-4360/PGM/lec5/","title":"Probabilistic Graphical Models","text":""},{"location":"CV/ML-4360/PGM/lec5/#structured-prediction","title":"Structured Prediction","text":""},{"location":"CV/ML-4360/PGM/lec5/#spatial-regularization","title":"Spatial regularization","text":"

    \\(p(D)\\propto e^{-\\sum_i\\phi_{data}(d_i)-\\lambda\\sum_{(i\uff0cj)\\in S}\\phi_{smooth}(d_i,d_j)}\\)

    • i~j neighbouring pixels (on a 4-connected grid).
    • $\\phi_{smooth} $ is a regularization term that encourages neighboring pixels to have similar disparities.

    \\(\\phi_{data}(di) =min(|I(xi, yi) - J(xi - di, yi)|, \u03c3)\\)

    \\(\\phi_{smooth} (di,dj) = min(|di - dj|,\u03c4)\\)

    where\\(I\\)and \\(J\\) are the image pairs

    \\(\u03c3\\) and \\(\u03c4\\) are truncation thresholds.

    • Structured Prediction:

    Probabilistic graphical models encode local dependencies of the problem

    Deep neural netwoks with image-based outputs (stereo, flow, semantics)

    "},{"location":"CV/ML-4360/PGM/lec5/#markov-random-fields","title":"Markov Random Fields","text":""},{"location":"CV/ML-4360/PGM/lec5/#undirected-graphical-models-ugm","title":"Undirected graphical models (UGM)","text":"
    • Pairwise (non-causal) relationships
    • Can write down model, and score specific configurations of the graph, but no explicit way to generate samples
    • Contingency constrains on node configurations
    "},{"location":"CV/ML-4360/PGM/lec5/#cliques","title":"cliques","text":"

    Refers to fully connected subgraphs in a graphical model, particularly in models like Markov Random Fields or Conditional Random Fields.

    In this context, a clique is a group of nodes in a graph where every pair of nodes is directly connected.

    "},{"location":"CV/ML-4360/PGM/lec5/#potential","title":"potential","text":"
    • A potential \\(\u03c6(x)\\)is a non-negative function of the variable x
    • A joint potential \\(\u03c6(x1, x2, . . . )\\) is a non-negative function of a set of variables.
    "},{"location":"CV/ML-4360/PGM/lec5/#definations-of-an-undirected-graphical-model","title":"Definations of an undirected graphical model","text":"

    \\((P(x_1\u2026\u2026x_n)=\\frac{1}{Z}\\prod_{c\\in C}\\phi_c(x_c)\\)

    \\((Z = \\sum_{x_1\u2026\u2026x_n}\\prod_{c\\in C}\\phi_c(x_c)\\)

    "},{"location":"CV/ML-4360/PGM/lec5/#defination-of-markov-random-field","title":"Defination of Markov Random Field","text":"
    • For a set of variables \\(X ={x_1,...,x_M}\\), a Markov Random Field is defined as a product of potentials over the (maximal) cliques \\({(X_k)}_{k=1}^K\\)of the undirected graph G

    \\(p(X)=\\frac{1}{Z}\\prod_{k=1}^K\\phi_k(X_k)\\)

    • \\(Z\\) normalizes the distribution and is called partition function
    • Examples\uff1a

    "},{"location":"CV/ML-4360/PGM/lec5/#properties","title":"Properties","text":"

    \\(Condition \\ One\\)

    "},{"location":"CV/ML-4360/PGM/lec5/#marginalizing-over-c-makes-a-and-b-dependent","title":"Marginalizing over c makes a and b dependent","text":"

    \\(Proof\\)

    • Explain:take \\(\\sum_c\\phi_1(a,c)\\phi_2(b,c)\\) for example
    a b c \u03c61(a,c) \u03c62(b,c) \u03c61(a,c)*\u03c62(b,c) sum 0 0 0 1 1 1 1 1 0 0 0 1 1 0 0 0 0 1 1 1 1 1 0 1 0 1 0 0 0 1 0 1 0 1 0 0 0 1 0 0 1 1 0 0"},{"location":"CV/ML-4360/PGM/lec5/#conditioning-on-c-makes-a-and-b-independent","title":"Conditioning on c makes a and b independent","text":"

    \\(Proof\\)

    • Global Markov Property

    Markov blanket

    "},{"location":"CV/ML-4360/PGM/lec5/#hammersley-clifford-theorem","title":"Hammersley-Clifford Theorem","text":"

    A probability distribution that has a strictly positive mass or density satisfies the Markov properties with respect to an undirected graph G if and only if it is a Gibbs random field,

    i.e. its density can be factorized over the (maximal) cliques of the graph.

    "},{"location":"CV/ML-4360/PGM/lec5/#factor-graphs","title":"Factor Graphs","text":"

    $p(X) = \\frac{1}{Z}\\prod_{k=1}^Kf_k(X_k)_{k=1}^K $

    "},{"location":"CV/ML-4360/PGM/lec5/#belief-propagation","title":"Belief Propagation","text":""},{"location":"CV/ML-4360/PGM/lec5/#inference-in-chain-structured-factor-graphs","title":"Inference in Chain Structured Factor Graphs","text":"

    \\(p(a, b, c, d) = \\frac{1}{Z}f_1(a, b)f_2(b, c)f_3(c, d)f4(d)\\)

    \\(p(a,b,c) = \\sum_{d}p(a,b,c,d)\\)

    \\(\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ = \\frac{1}{Z}f_1(a,b)f_2(b,c)\\underbrace{\\sum_{d}f_3(c,d)f_4(d)}_{\u03bc_{d\u2192c}(c)}\\)

    \\(p(a,b) = \\sum_{c}p(a,b,c)\\)

    \\(\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ = \\frac{1}{Z}f_1(a,b)\\underbrace{\\sum_{c}f_2(b,c)\u03bc_{d\u2192c}(c)}_{\u03bc_{c\u2192b}(b)}\\)

    \\(\u2026\u2026\\)

    Belief Propagation assumes a singly-connected graph G = (V,E), which means it has \\(|V|\u22121 = O(|V|)\\) many edges (in contrast to \\(|V|(|V| \u2212 1)/2 = O(|V|^2)\\) of a fully connected graph).

    That simplifies the computation of any marginal distribution significantly

    "},{"location":"CV/ML-4360/PGM/lec5/#inference-in-tree-structured-factor-graphs","title":"Inference in Tree Structured Factor Graphs","text":""},{"location":"CV/ML-4360/PGM/lec5/#factor-to-variable-messages","title":"Factor-to-Variable Messages","text":""},{"location":"CV/ML-4360/PGM/lec5/#variable-to-factor-messages","title":"Variable-to-Factor Messages","text":""},{"location":"CV/ML-4360/PGM/lec5/#sum-product-algorithm","title":"Sum-Product Algorithm","text":""},{"location":"CV/ML-4360/PGM/lec5/#belief-propagation_1","title":"Belief Propagation:","text":"
    • Algorithm to compute all messages efficiently
    • Assumes that the graph is singly-connected (chain, tree)
    "},{"location":"CV/ML-4360/PGM/lec5/#algorithm","title":"Algorithm:","text":"
    • Initialization
    • Variable to Factor message
    • Factor to Variable message
    • Repeat until all messages have been calculated
    • Calculate the desired marginals from the messages
    "},{"location":"CV/ML-4360/PGM/lec5/#log-representation","title":"Log Representation","text":""},{"location":"CV/ML-4360/PGM/lec5/#max-product-algorithm","title":"Max-Product Algorithm","text":"
    • Example: Chain

    \\(\\begin{align*}\\underset{\\text{a,b,c,d}}{\\text{max}}p(a,b,c,d)&= \\underset{\\text{a,b,c,d}}{\\text{max}}f_1(a,b)f2(b,c)f_3(c,d)\\\\&=\\underset{\\text{a,b,c}}{\\text{max}}f_1(a,b)f2(b,c)\\underbrace{\\underset{\\text{d}}{\\text{max}}f_3(c,d)}_{\\mu_{d->c}(c)}\\\\&=\u2026\u2026\\\\ &=\\underset{\\text{a}}{\\text{max}}\\mu_{b->a}(a)\\end{align*}\\)

    "},{"location":"CV/ML-4360/PGM/lec5/#loopy-belief-propagation","title":"Loopy Belief Propagation","text":"
    • Messages are also well defined for loopy graphs!
    • Simply apply them to loopy graphs as well
    • We loose exactness (\u21d2 approximate inference)
    • Even no guarantee of convergence [Yedida et al. 2004] I But often works surprisingly well in practice
    "},{"location":"CV/ML-4360/PGM/lec5/#summary","title":"Summary","text":""},{"location":"CV/ML-4360/PGM/lec5/#examples","title":"Examples","text":""},{"location":"CV/ML-4360/PGM/lec5/#example-1-vehicle-localization","title":"Example 1: Vehicle Localization","text":"

    # Max-Product Belief Propagation on chain structured Markov Random Fields for Vehicle Localization

    Let's consider an autonomous vehicle driving on a highway and tracking a vehicle in front in order to initiate an overtaking maneuver. Let \\(x_t\\in\\{1,2,3\\}\\) denote the lane the vehicle in front is driving on at time \\(t\\in\\{1,\\dots,10\\}\\). Unfortunately, the sensor readings are noisy as depicted below.

    Selecting the most likely lane at each time \\(t\\) independently (green) leads to wrong estimates for \\(t=\\{3,7,10\\}\\). To solve this problem, and recover the correct situation depicted below

    we can integrate prior knowledge and infer the most likely situation using max-product belief propagation. A sensible prior would favor staying on the same lane over changing one lane at a time over changing two lanes at a time. This prior can be integrated via a pairwise, chain-structured Markov Random Field (also called: Hidden Markov Model or HMM) where pairwise factors between adjacent frames modulate transition likelihoods:

    \\[g_\\theta(x_i,x_{i+1}) = \\begin{bmatrix}0.8 & 0.2 & 0.0\\\\ 0.2 & 0.6 & 0.2 \\\\ 0.0 & 0.2 & 0.8\\end{bmatrix}\\] \\[ p_\\theta({\\bf x}) \\propto \\prod_{1}^{10} f_i(x_i)\\prod_{1}^{9}g_{\\theta}(x_i, x_{i+1})\\]
    • Coding
    # import modules\nimport numpy as np\nimport matplotlib.pyplot as plt\nfrom scipy import misc\n\n# plot function\n# input: Nx3 matrix of values & title string\ndef plot(vals,title=''):\n    plt.close()\n    vals /= np.tile(np.sum(vals,1),(3,1)).transpose()\n    f, axarr = plt.subplots(1,10,figsize=(10,2))\n    plt.suptitle(title, fontsize=16, fontweight='bold')\n    for i in range(vals.shape[0]):\n        axarr[i].barh([0,1,2],np.array([1,1,1]),color='white',edgecolor='black',linewidth=2)\n        axarr[i].barh([0,1,2],vals[i],color='red')\n        axarr[i].axis('off')\n    plt.show()\n\n# unary: Nx3 matrix specifying unary likelihood of each state\nunary = np.array([[0.7,0.1,0.2],[0.7,0.2,0.1],[0.2,0.1,0.7],[0.7,0.2,0.1],\n                  [0.2,0.6,0.2],[0.1,0.8,0.1],[0.4,0.3,0.3],[0.1,0.8,0.1],\n                  [0.1,0.1,0.8],[0.1,0.5,0.4]])\n# pairwise: 3x3 matrix specifying transition probabilities (rows=t -> columns=t+1)\npairwise = np.array([[0.8,0.2,0.0],[0.2,0.6,0.2],[0.0,0.2,0.8]])\n\n# model parameters (number of variables/states)\n[num_vars,num_states] = unary.shape\n\n# compute messages\nmsg = np.zeros([num_vars-1, num_states]) # (num_vars-1) x num_states matrix\nfor i in range(num_vars-2, -1, -1):\n    if i == num_vars-2:\n        msg[i, :] = np.max(pairwise*unary[i+1, :], 1)\n    else:\n        msg[i, :] = np.max(pairwise*unary[i+1, :]*msg[i+1, :],1)\n# calculate max-marginals (num_vars x num_states matrix) and MAP estimates (num_vars x 1 matrix)\nmax_marginals = np.zeros([num_vars,num_states])\nmap = np.zeros(num_vars, dtype=int)\nfor i in range(num_vars):\n    if i == 0:\n        max_marginals[i,:] = msg[i, :]\n    if i == num_vars-1:\n        max_marginals[i,:] = pairwise[map[i-1],:]*unary[i,:]\n    else:\n        max_marginals[i,:] = pairwise[map[i-1],:]*unary[i,:]*msg[i, :]\n    map[i] = np.argmax(max_marginals[i, :])\n# plot max-marginals\nplot(max_marginals,'Max Marginals')\n\n# print MAP state\nprint(\"MAP Estimate:\")\nprint(np.argmax(max_marginals,axis=1))\n
    "},{"location":"CV/ML-4360/PGM/lec5/#example-2-image-denoising","title":"Example 2: Image Denoising","text":""},{"location":"CV/ML-4360/PGM/lec5/#image-denoising","title":"Image Denoising","text":"

    You are given a noisy binary image (\\(10 \\times 10\\) pixels) which you want to denoise.

    Make use of the Ising model for that purpose where neighboring pixels are encouraged to take the same value: \\(\\(p(x_1,\\dots,x_{100}) \\propto \\exp \\left\\{\\sum_{i=1}^{100} \\psi_i(x_i) + \\sum_{i\\sim j} \\psi_{ij} (x_i,x_j) \\right\\}\\)\\)

    Here, \\(i\\) is the pixel index and \\(i\\sim j\\) are neighboring pixels on a 4-connected grid. The unary term \\(\\psi_i(x_i) = [x_i = o_i]\\) models the observation at pixel \\(i\\), and the pairwise term is the Ising prior \\(\\psi_{ij}(x_i,x_j) = \\alpha \\cdot [x_i = x_j]\\), where \\(\\alpha\\) controls the strength of the interaction/smoothing.

    Because we have large number of variables in this exercise, we use logarithm factors to avoid potential numerical underflow issues.

    Inputs: * num_vars, num_states, factors, msg_fv, msg_vf, ne_var

    Outputs: * max_marginals: num_vars x num_states array of estimated max-marginals * map_est: array comprising the estimated MAP state of each variable

    Algorithm Pseudocode:

    • For N=30 iterations do:
    • Update all unary factor-to-variable messages: \\(\\lambda_{f\\rightarrow x}(x) = f(x)\\)
    • Update all pairwise factor-to-variable messages: \\(\\lambda_{f\\rightarrow x}(x) = \\max_y \\left[f(x,y)+\\lambda_{y\\rightarrow f}(y)\\right]\\)
    • Update all variable-to-factor messages: \\(\\lambda_{x\\rightarrow f}(x) = \\sum_{g\\in\\{ ne(x)\\setminus f\\}}\\lambda_{g\\rightarrow x}(x)\\)

    • Calculate Max-Marginals: \\(\\gamma_x(x) = \\sum_{g\\in\\{ ne(x)\\}}\\lambda_{g\\rightarrow x}(x)\\)

    • Calculate MAP Solution: \\(x^* = \\underset{x}{\\mathrm{argmax}} ~ \\gamma_x(x)\\)

    CODE

    # import modules\nimport numpy as np\nimport matplotlib.pyplot as plt\nimport imageio\n\n# load and plot input image\nimg = imageio.imread('gfx/image.png')/255\nplt.imshow(img,interpolation='nearest');\nplt.gray()\nplt.show()\n\n# model parameters\n[h,w] = img.shape # get width & height of image\nnum_vars = w*h    # number of variables = width * height\nnum_states = 2    # binary segmentation -> two states\n\n# initialize factors (list of dictionaries), each factor comprises:\n#   vars: array of variables involved\n#   vals: vector/matrix of factor values\nfactors = []\n# add unary factors\nfor u in range(w):\n  for v in range(h):\n    factors.append({'vars':np.array([v*w+u]), 'vals':np.array([1-img[v,u],img[v,u]])})\n\n# add pairwise factors\nalpha = 0.4 # smoothness weight\nE = alpha*np.array([[1,0],[0,1]]) # energy matrix for pairwise factor\nfor u in range(w):\n  for v in range(h):\n    if v<h-1:\n      factors.append({'vars':np.array([v*w+u,(v+1)*w+u]), 'vals':E})\n    if u<w-1:\n      factors.append({'vars':np.array([v*w+u,v*w+u+1]), 'vals':E})\n# initialize all messages\nmsg_fv = {} # f->v messages (dictionary)\nmsg_vf = {} # v->f messages (dictionary)\nne_var = [[] for i in range(num_vars)] # neighboring factors of variables (list of list)\n\n# set messages to zero; determine factors neighboring each variable\nfor [f_idx,f] in enumerate(factors):\n    for v_idx in f['vars']:\n        msg_fv[(f_idx,v_idx)] = np.zeros(num_states) # factor->variable message\n        msg_vf[(v_idx,f_idx)] = np.zeros(num_states) # variable->factor message\n        ne_var[v_idx].append(f_idx) # factors neighboring variable v_idx\n\n# status message\nprint(\"Messages initialized!\")\n\n# run inference\nfor it in range(30):\n\n    # for all factor-to-variable messages do\n    for [key,msg] in msg_fv.items():\n\n        # shortcuts to variables\n        f_idx = key[0] # factor (source)\n        v_idx = key[1] # variable (target)\n        f_vars = factors[f_idx]['vars'] # variables connected to factor\n        f_vals = factors[f_idx]['vals'] # vector/matrix of factor values \n\n        # unary factor-to-variable message\n        if np.size(f_vars)==1:\n            msg_fv[(f_idx,v_idx)] = f_vals\n\n        # pairwise factor-to-variable-message\n        else:\n\n            # if target variable is first variable of factor\n            if v_idx==f_vars[0]:\n                msg_in = np.tile(msg_vf[(f_vars[1],f_idx)],(num_states,1))\n                msg_fv[(f_idx,v_idx)] = (f_vals+msg_in).max(1) # max over columns\n\n            # if target variable is second variable of factor\n            else:\n                msg_in = np.tile(msg_vf[(f_vars[0],f_idx)],(num_states,1))\n                msg_fv[(f_idx,v_idx)] = (f_vals+msg_in.transpose()).max(0) # max over rows\n\n        # normalize\n        msg_fv[(f_idx,v_idx)] = msg_fv[(f_idx,v_idx)] - np.mean(msg_fv[(f_idx,v_idx)])\n\n    # for all variable-to-factor messages do\n    for [key,msg] in msg_vf.items():\n\n        # shortcuts to variables\n        v_idx = key[0] # variable (source)\n        f_idx = key[1] # factor (target)\n\n        # add messages from all factors send to this variable (except target factor)\n        # and send the result to the target factor\n        msg_vf[(v_idx,f_idx)] = np.zeros(num_states)\n        for f_idx2 in ne_var[v_idx]:\n            if f_idx2 != f_idx:\n                msg_vf[(v_idx,f_idx)] += msg_fv[(f_idx2,v_idx)]\n\n        # normalize\n        msg_vf[(v_idx,f_idx)] = msg_vf[(v_idx,f_idx)] - np.mean(msg_vf[(v_idx,f_idx)])\n\n# calculate max-marginals (num_vars x num_states matrix)\nmax_marginals = np.zeros([num_vars,num_states])\nfor v_idx in range(num_vars):\n\n    # add messages from all factors sent to this variable\n    max_marginals[v_idx] = np.zeros(num_states)\n    for f_idx in ne_var[v_idx]:\n        max_marginals[v_idx] += msg_fv[(f_idx,v_idx)]\n    #print max_marginals[v_idx]\n\n# get MAP solution\nmap_est = np.argmax(max_marginals,axis=1)\n\n# plot MAP estimate\nplt.imshow(map_est.reshape(h,w),interpolation='nearest');\nplt.gray()\nplt.show()\n
    "},{"location":"CV/ML-4360/SFM/lec3/","title":"Structure Form Motion","text":""},{"location":"CV/ML-4360/SFM/lec3/#preliminarynaries","title":"preliminarynaries","text":""},{"location":"CV/ML-4360/SFM/lec3/#point-features","title":"Point Features","text":"
    • Point features describe the appearance of local, salient regions in an image
    • They can be used to describe and match images taken from different viewpoints
    • They form the basis of sparse 3D reconstruction methods covered in this lecture
    • Features should be invariant to perspective effects and illumination
    • The same point should have similar vectors independent of pose/viewpoint
    • Plain RGB/intensity patches will not have this property, we need something better
    "},{"location":"CV/ML-4360/SFM/lec3/#scale-invariant-feature-transform-sift","title":"Scale Invariant Feature Transform (SIFT)","text":"

    Reference to https://medium.com/@deepanshut041/introduction-to-sift-scale-invariant-feature-transform-65d7f3a72d40 https://www.qixinbo.info/2021/10/26/sift/ - SIFT constructs a scale space by iteratively filtering the image with a Gaussian - Adjacent scales are subtracted, yielding Difference of Gaussian (DoG) images - Interest points (=blobs) are detected as extrema in the resulting scale space

    "},{"location":"CV/ML-4360/SFM/lec3/#1-scale","title":"(1) Scale","text":"

    \\(L(x,y,\u03c3)=G(x,y,\u03c3)\u2217I(x,y)\\)

    Note \uff1a\u5377\u79ef

    \u8fde\u7eed\u5f62\u5f0f\uff1a

    \\((f\u2217g)(n)=\\int_{-\\infty }^{\\infty}f(\\tau )g(n-\\tau)d\\tau\\)

    \u79bb\u6563\u5f62\u5f0f\uff1a

    \\((f\u2217g)(n)=\\sum_{\\tau=-\\infty }^{\\infty}f(\\tau)g(n-\\tau)\\)

    \u5bf9\u56fe\u50cf\u7684\u5904\u7406\u51fd\u6570\uff08\u5982\u5e73\u6ed1\uff0c\u6216\u8005\u8fb9\u7f18\u63d0\u53d6\uff09\uff0c\u4e5f\u53ef\u4ee5\u7528\u4e00\u4e2ag\u77e9\u9635\u6765\u8868\u793a\uff0c\u5982\uff1a

    \\(g=\\begin{bmatrix} &b_{-1,-1} &b_{-1,0} &b_{-1,1}\\\\ &b_{0,-1} &b_{0,0} &b_{0,1} \\\\ &b_{1,-1} &b_{1,0} &b_{1,1} \\end{bmatrix}\\)

    \\(f(x,y)=a_{x,y}\\)

    \\(g(x,y)=b_{x,y}\\)

    \u6309\u5377\u79ef\u7684\u5b9a\u4e49\uff0c\u4e8c\u7ef4\u79bb\u6563\u5f62\u5f0f\u7684\u5377\u79ef\u516c\u5f0f\u5e94\u8be5\u662f\uff1a

    \\((f\u2217g)(u,v)=\u2211_i\u2211_jf(i,j)g(u-i,v-j)=\\sum_{i} \\sum_{j} a_{i,j} b_{u-i,v-j}\\)

    \u9996\u5148\u6211\u4eec\u5728\u539f\u59cb\u56fe\u50cf\u77e9\u9635\u4e2d\u53d6\u51fa\uff08u,v)\u5904\u7684\u77e9\u9635\uff1a

    \\(f=\\begin{bmatrix} &a_{u-1,v-1} &a_{u-1,v} &a_{u-1,v+1}\\\\ &a_{u,v-1} &a_{u,v} &a_{u,v+1} \\\\ &a_{u+1,v-1} &a_{u+1,v} &a_{u+1,v+1} \\end{bmatrix}\\)

    \u7136\u540e\u5c06\u56fe\u50cf\u5904\u7406\u77e9\u9635\u7ffb\u8f6c

    • \u539f\u59cb\u77e9\u9635\uff1a

    • \u7ffb\u8f6c\u540e\u7684\u77e9\u9635\uff1a

    \\((g^{'}=\\begin{bmatrix} &b_{1,1} &b_{1,0} &b_{1,-1}\\\\ &b_{0,1} &b_{0,0} &b_{0,-1} \\\\ &b_{-1,1} &b_{-1,0} &b_{-1,-1} \\end{bmatrix}\\)

    "},{"location":"CV/ML-4360/SFM/lec3/#2construct-the-gaussian-pyramid","title":"(2)Construct the Gaussian Pyramid","text":"
    • Apply Gaussian blur at different scales to the image.
    • Downsample the image, typically reducing it by half in the horizontal and vertical directions before sampling.
    • To reflect the continuity of scale space ,Gaussian pyramids perform Gaussian blurring in addition to simple downsampling.
    • Different parameters are used for Gaussian blurring on each image in each level of the pyramid, resulting in multiple Gaussian-blurred images within each level of the pyramid. Here, each level of the pyramid with multiple images is referred to as a \"group\" (Octave).
    • Each level of the pyramid contains one group of images, and it's easy to see that the number of groups is equal to the number of levels in the pyramid. Each image within a group is referred to as a \"layer\" (Interval) in that group.
    • IGaussian pyramids consist of multiple groups, and each group contains multiple layers.
    • The scales between the layers within a group are different (meaning different Gaussian parameters \u03c3 are used),and the scale difference between adjacent layers is a factor of k.
    • If each group has S layers, then \\(k = 2^{1/S}\\). The bottommost image in the previous group is obtained by downsampling the image with a scale of 2\u03c3 from the previous group by a factor of 2 (Gaussian pyramids are built from the bottom-up).
    "},{"location":"CV/ML-4360/SFM/lec3/#3difference-of-gaussian-dog","title":"(3)Difference of Gaussian (DoG)","text":"

    Image feature points are composed of local extrema in the DoG (Difference of Gaussians) scale space. To find these extrema in the DoG space, each pixel is compared with all of its neighboring points to determine whether it is larger or smaller than its neighboring points in both the image domain and scale domain. As shown in the figure below, the central detection point is compared with its 8 neighboring points at the same scale and 18 points corresponding to the upper and lower adjacent scales, totaling 26 points to ensure the detection of extrema in both the two-dimensional image space and scale space. If a point is the maximum or minimum value among these 26 points in the DoG scale space at the current layer and the two neighboring layers, it is considered a feature point in the image at that scale.

    "},{"location":"CV/ML-4360/SFM/lec3/#4keypoint-localization","title":"\uff084\uff09Keypoint Localization","text":"

    Key0points generated in the previous step produce a lot of keypoints. Some of them lie along an edge, or they don\u2019t have enough contrast. In both cases, they are not as useful as features. So we get rid of them. The approach is similar to the one used in the Harris Corner Detector for removing edge features. For low contrast features, we simply check their intensities.

    They used Taylor series expansion of scale space to get a more accurate location of extrema, and if the intensity at this extrema is less than a threshold value (0.03 as per the paper), it is rejected. DoG has a higher response for edges, so edges also need to be removed. They used a 2x2 Hessian matrix (H) to compute the principal curvature.

    Detailed explanation:

    • Keypoint Filtering: Keypoints generated in the previous step might include features along edges or those with low contrast, which may not be sufficiently prominent or useful. For features with low contrast, their intensities are examined. If the intensity is below a specified threshold (as mentioned in the paper, 0.03), the feature is excluded.

    • Taylor Series Expansion: Utilizing a Taylor series expansion of the scale space to obtain a more accurate location of extrema, improving the precision of keypoint localization. Intensity Check and Exclusion: For extrema identified through the Taylor series expansion, their intensities are checked. If the intensity falls below the set threshold, they are excluded.

    • Edge Removal: Due to the higher response of the Difference of Gaussians (DoG) for edges, further removal of edge features is necessary. A 2x2 Hessian matrix is employed to calculate the principal curvature. If the principal curvature is small, indicating the point may lie along an edge, it can be excluded. (\\(f=\\frac{\\lambda_1\\lambda_2}{\\lambda_1+\\lambda_2}\\)) for the Harris operator Which means f is large indicates an edge

    "},{"location":"CV/ML-4360/SFM/lec3/#5-orientation-assignment","title":"(5) Orientation Assignment","text":"

    Now we have legitimate keypoints. They\u2019ve been tested to be stable. We already know the scale at which the keypoint was detected (it\u2019s the same as the scale of the blurred image). So we have scale invariance. The next thing is to assign an orientation to each keypoint to make it rotation invariance.

    A neighborhood is taken around the keypoint location depending on the scale, and the gradient magnitude and direction is calculated in that region. An orientation histogram with 36 bins covering 360 degrees is created. Let's say the gradient direction at a certain point (in the \u201corientation collection region\u201d) is 18.759 degrees, then it will go into the 10\u201319-degree bin. And the \u201camount\u201d that is added to the bin is proportional to the magnitude of the gradient at that point. Once you\u2019ve done this for all pixels around the keypoint, the histogram will have a peak at some point. The highest peak in the histogram is taken and any peak above 80% of it is also considered to calculate the orientation. It creates keypoints with same location and scale, but different directions. It contributes to the stability of matching.

    "},{"location":"CV/ML-4360/SFM/lec3/#6keypoint-descriptor","title":"(6)Keypoint descriptor","text":"

    At this point, each keypoint has a location, scale, orientation. Next is to compute a descriptor for the local image region about each keypoint that is highly distinctive and invariant as possible to variations such as changes in viewpoint and illumination.

    To do this, a 16x16 window around the keypoint is taken. It is divided into 16 sub-blocks of 4x4 size. For each sub-block, 8 bin orientation histogram is created.

    So 4 X 4 descriptors over 16 X 16 sample array were used in practice. 4 X 4 X 8 directions give 128 bin values. It is represented as a feature vector to form keypoint descriptor. This feature vector introduces a few complications. We need to get rid of them before finalizing the fingerprint.

    • Rotation dependence The feature vector uses gradient orientations. Clearly, if you rotate the image, everything changes. All gradient orientations also change. To achieve rotation independence, the keypoint\u2019s rotation is subtracted from each orientation. Thus each gradient orientation is relative to the keypoint\u2019s orientation.
    • Illumination dependence If we threshold numbers that are big, we can achieve illumination independence. So, any number (of the 128) greater than 0.2 is changed to 0.2. This resultant feature vector is normalized again. And now you have an illumination independent feature vector!
    "},{"location":"CV/ML-4360/SFM/lec3/#7keypoint-matching","title":"\uff087\uff09Keypoint Matching","text":"
    • Feature Descriptor Extraction: For each detected feature point, SIFT calculates the gradient direction histogram in its surrounding neighborhood and arranges these histograms into a 128-dimensional vector, acting as the feature descriptor of this feature point. This step is based on the detection of keypoints, ensuring the scale and rotation invariance of the descriptor.
    • Feature Matching: A feature descriptor is used to find the nearest neighbor in the feature descriptor set of another image. The nearest neighbor distance measurement often uses Euclidean distance, meaning the smaller the distance, the higher the match. If no obvious nearest neighbor can be found, this feature point will be discarded and not used for further matching.
    • Discarding Mismatches: To enhance the reliability of matches, SIFT employs a ratio test to discard potential mismatches. This criterion involves the ratio of the distance of the nearest neighbor to that of the second nearest neighbor of a feature descriptor. If this ratio exceeds a predetermined threshold (such as 0.8), then the nearest neighbor is deemed a mismatch and should be discarded.
    "},{"location":"CV/ML-4360/SFM/lec3/#epipolar-geometry","title":"Epipolar Geometry","text":"
    • Let R and t denote the relative pose between two perspective cameras

    • A 3D point x is projected to pixel \\(\\bar{x}_1\\)in image 1 and to pixel \\(\\bar{x_2}\\) in image 2

    • The 3D point x and the two cameracenters span the epipolar plane

    • The correspondence of pixel \\(\\bar{x}_1\\) in image 2 must lie on the epipolar line \\(\\widetilde{l2}\\)in image 2

    • All epipolar lines pass through the epipole

    • Equations:

    • Let \\(Ki \u2208 R_{3\u00d73}\\)denote the camera matrix of camera i.

    • Let \\(\\widetilde{x}i\\)= \\(K^{-1} x \u0304_i\\)denote the local ray direction of pixel \\(x \u0304_i\\) in camera i.

    • We have:

    • \\(x~_2 \u221d x_2 = Rx_1+t \u221d Rx~_1+st\\)

    • Taking the cross product of both sides with t we obtain:

    • \\([t]\u00d7x~2 \u221d [t]\u00d7R x~1\\)

    • Taking the dotproduct of both sides with\\(x~^\u22a4_2\\)yields (triple product):

    • \\(x~^\u22a4_2 [t]\u00d7R x~1 \u221d x~^\u22a4_2 [t]\u00d7x~2 = 0 \u21d2 x~^\u22a4_2 [t]\u00d7R x~1 = 0\\)

    • We arrive at the epipolar constraintwith essential matrix:

    • \\(x~^\u22a4_2 E~ x~ _1 = 0 \\ \\ \\widetilde{E} = [ t ] \u00d7 R\\)

    • \\(\\widetilde{E}\\) maps a point \\(x~_1\\) in image 1 to the corresponding epipolar line in image 2 \\(\\widetilde{l}_2=\\widetilde{E} x~ 1\\)

    • Similarly, by transposition, we obtain the epipolar line in image 1:\\(\\widetilde{l}_1 = \\widetilde{E}^\u22a4 x~ 2\\)

    • For any point \\(x~1\\)in the first image, the corresponding epipolar line \\(\\widetilde{l}_2 = \\widetilde{E}x~_1\\)in the second image passes through the so-called epipole \\(\\tilde{e}_2\\) which therefore satisfies \\(\\widetilde{e}^\u22a4_2 \\ \\widetilde{l}_2 = \\widetilde{e}^\u22a4_2 \\widetilde{E}x~_1 = 0\\) for all \\(x~_1.\\)

    • It follows that:\\(\\widetilde{e}^\u22a4_2 \\widetilde{E} = 0\\)Thus,\\(e~^\u22a4_2\\)is the leftnull-space (left singular vector with singular value 0)of\\(\\widetilde{E}\\).Further:\\(\\widetilde{E}e~_1 = 0\\) Thus,\\(e~^\u22a4_1\\) is the rightnull-space (right singular vector with singular value 0)of \\(\\widetilde{E}.\\)

    • Recover R & t

    • Derivation

    \\(\\widetilde{x_{2i}}^T \\widetilde{E} \\widetilde{x_{1i}}=0\\)

    • \\(\\widetilde{E}=\\begin{pmatrix} e_{11} & e_{12} & e_{13} \\\\ e_{21} & e_{22} & e_{23} \\\\ e_{31} & e_{32} & e_{33} \\end{pmatrix} \\ \\ \\ \\ \\ \\ \\ \\ E = \\begin{pmatrix} e_{11} \\\\ e_{12} \\\\ e_{13} \\\\ e_{21} \\\\ e_{22} \\\\ e_{23} \\\\ e_{31} \\\\ e_{32} \\\\ e_{33} \\end{pmatrix}\\)\\(\\Rightarrow x_1x_2e_{11} + y_1x_2e_{12} + x_2e_{13}+ x_1y_2e_{21} + y_1y_2e_{22} + y_2e_{23}+ x_1e{31} + y_1e_{32} + e_{33 }= 0\\)

    • As \\(\\widetilde{E}\\) is homogeneous we use singular value decomposition to constrain the scale.

    • Note that some terms are products of two image measurements and hence amplify measurement noise asymmetrically. Thus, the normalized 8-point algorithm whitens the observations to have zero-mean and unit variance before the calculation and back-transforms the matrix recovered by SVD accordingly.

    • SVD Method

    • Rearranging the product, so E is on the left hand side:\\(\\widetilde{x_2}^T\\widetilde{E}\\widetilde{x_1} =\\begin{pmatrix} x_{11}x_{12} & y_{11}x_{12} & x_{12}&x_{11}y_{12}&y_{11}y_{12}&y_{12}&x_{11}&y_{11}&1 \\\\ \u2026\u2026 \\\\ x_{i1}x_{i2} & y_{i1}x_{i2} & x_{i2}&x_{i1}y_{i2}&y_{i1}y_{i2}&y_{i2}&x_{i1}&y_{i1}&1 \\\\\u2026\u2026 \\\\x_{81}x_{82} & y_{81}x_{82} & x_{82}&x_{81}y_{82}&y_{81}y_{82}&y_{82}&x_{81}&y_{81}&1\\end{pmatrix} \\begin{pmatrix} e_{11} \\\\ e_{12} \\\\ e_{13} \\\\ e_{21} \\\\ e_{22} \\\\ e_{23} \\\\ e_{31} \\\\ e_{32} \\\\ e_{33} \\end{pmatrix} =0\\)\\(\\Rightarrow AE = 0\\)

    • If there are more than 8 point correspondences, the system is usually over-determined and an exact solution is not possible. Instead, we solve a least squares problem for AE

    • \\(min(||AE||),||E||=1\\)

    Credits to Carnegie Mellon University and Kris Kitani, http://www.cs.cmu.edu/~16385/s17/Slides/11.5_SVD.pdf

    • Properties of the \\(\\widetilde{E}\\)

    • by readjustment:

    • \\(\\widetilde{E} =\\begin{bmatrix} u0&u1&u2 \\end{bmatrix}\\begin{bmatrix} s&0&0\\\\0&s&0\\\\0&0&s \\end{bmatrix} \\begin{bmatrix}v0^T\\\\v1^T\\\\v2^T \\end{bmatrix} =U\\sum V^T\\)

    • \\(s=\\frac{\\lambda_1+\\lambda_2}{2}\\) \\(\\lambda_1\\ge \\lambda_2\\ge\\lambda_3\\)

    • Proof

    • \u8bc1\u660e\u672c\u8d28\u77e9\u9635E EE\u5947\u5f02\u503c\u5177\u6709\\([\u03c3,\u03c3,0]^ T\\)\u7684\u5f62\u5f0f\uff0c\u53ea\u9700\u8bc1\u660e\u77e9\u9635\\(E^TE\\)\u7684\u7279\u5f81\u503c\u5177\u6709\\([\\lambda, \\lambda, 0]^T\\)\u7684\u5f62\u5f0f\u3002\u7531\u4e8e\u77e9\u9635 \\(EE^T\\)\u4e0e \\(E^{T}E\\)\u6709\u76f8\u540c\u7684\u975e\u96f6\u7279\u5f81\u503c\uff0c\u6240\u4ee5\u8bc1\u660e\u5185\u5728\u6027\u8d28\u4e5f\u7b49\u4ef7\u4e8e\u8bc1\u660e\u77e9\u9635\\(EE^T\\)\u7684\u7279\u5f81\u503c\u5177\u6709\\([\\lambda, \\lambda, 0]^T\\)\u7684\u5f62\u5f0f

    • \u5177\u4f53\u8bc1\u660e\u89c1https://blog.csdn.net/weixin_44387324/article/details/119182590

    • Thus we have

    \\(W=\\begin{bmatrix} 0&-1&0\\\\1&0&0\\\\0&0&1 \\\\ \\end{bmatrix} \\\\ t_x=UW\\sum U^T \\\\ R=UW^{-1}V^T \\\\E=U\\sum V^T\\)

    • Fundamental matrix (if Ki unknown):

    • \\(\\widetilde{x_2}^T\\widetilde{E}\\widetilde{x_1}=\\bar{x_2}^T\\widetilde{F}\\bar{x_1}\\)

    • \\(\\widetilde{F} = K_2^{-1}\\widetilde{E} K_1^{-1}\\)

    "},{"location":"CV/ML-4360/SFM/lec3/#triangulation","title":"Triangulation","text":"
    • Let \\(x~^s_i = \\widetilde{P}_ i x~_w\\) denote the projection of a 3D world point \\(x~_w\\) onto the image of the i\u2019th camera \\(x~^s_i\\).

    • Consider the cross product \\(x \u0304^s_i \u00d7 \\widetilde{P}_ix~_w =0\\).

    • Using \\(p~^\u22a4_{ik}\\) to denote the k\u2019th row of the i\u2019th camera\u2019s projection matrix \\(\\widetilde{P_i}\\), we obtain:

    • \\(\\begin{bmatrix}x^s_i\\widetilde{p}_{i3}^T - \\widetilde{p}_{i1} \\\\ y^s_i\\widetilde{p}_{i3}^T - \\widetilde{p}_{i2} \\end{bmatrix}\\widetilde{x}_w=0\\)

    • \\(\\bar{x}_i^s=(x_i^s,y_i^s,1)\\)

    • Stacking N \u2265 2 observations of a point, we obtain a linear system \\(Ax~_w = 0.\\)As \\(x~_w\\) is homogeneous this leads to a constrained least squares problem. The solution to this problem is the right singular vector corresponding to the smallest singular value of A. This is the Direct Linear Transformation we are already familiar with from Lecture 2.

    • Proof https://blog.csdn.net/u011178262/article/details/86729887

    • Reprojection Error Minimization:

    While DLT often works well, it is not invariant to perspective transformations.The gold standard is to minimize the reprojection error using numerical methods:

    • This allows to take measurement noise appropriately into account
    • The minimum can also be obtained in closed form as the solution of a sixth degree polynomial, see Hartley & Zisserman, Section 12.5 for details.
    "},{"location":"CV/ML-4360/SFM/lec3/#factorization","title":"Factorization","text":""},{"location":"CV/ML-4360/SFM/lec3/#orthographic-factorization","title":"Orthographic Factorization","text":""},{"location":"CV/ML-4360/SFM/lec3/#algorithm","title":"Algorithm:","text":"

    1.Take measurements \\(\\hat{W}\\)

    2.Compute SVD $\\hat{W} = U\u03a3V^\u22a4 $and keep the top 3 SVs

    3.Define\\(\\hat{R} =U\u03a3^{\\frac{1}{2}}\\) and \\(\\hat{X} =\\sum^{\\frac{1}{2}}V^T\\)

    4.Compute \\(QQ^\u22a4\\) and from this Q

    5.Compute\\(R=\\hat{R}Q\\)and\\(X=Q^{-1}\\hat{X}\\)

    Remarks:

    • Advantage: closed form solution (determined up to an arbitrary global rotation)
    • Disadvantage: complete feature tracks required (\u21d2 cannot handle occlusions)
    • Solution: Apply to subsets of features/frames and propagate (see T&K, Sec. 5)
    "},{"location":"CV/ML-4360/SFM/lec3/#bundle-adjustment","title":"Bundle Adjustment","text":""},{"location":"CV/ML-4360/SFM/lec3/#appendix","title":"Appendix","text":"
    • CNN https://www.zhihu.com/question/52668301/answer/1231346589
    "},{"location":"CV/ML-4360/SR/lec4/","title":"Stereo Reconstruction","text":""},{"location":"CV/ML-4360/SR/lec4/#preliminaries","title":"Preliminaries","text":""},{"location":"CV/ML-4360/SR/lec4/#epipolar-geometry","title":"Epipolar Geometry","text":"
    • A point\\(\\bar{x}\\)in the left image must be located on the epipolar line\\(\\widetilde{l}_2\\)
    • This reduces correspondence search to a (much simpler) 1D problem I For VGA images: \uff5e640 instead of \uff5e300k hypotheses (factor 480 less)
    "},{"location":"CV/ML-4360/SR/lec4/#image-rectification","title":"Image Rectification","text":"

    What if both cameras face exactly the same direction?

    • Image planes are co-planar \u21d2 Epipoles at infinity, epipolar lines parallel.
    • Correspondences search along horizontal scanlines (simplifies implementation)
    • Let\\(K1 = K2 = R = I\\) and\\(t = (t,0,0)^\u22a4\\)

    • \\(\\bar{x_2}^T\\tilde{E}\\bar{x_1}=\\bar{x_2}^T \\begin{bmatrix}0&0&0\\\\0&0&-t\\\\0&t&0\\end{bmatrix}\\bar{x1}=ty1-ty2=0\\)

    • Thus \\(y1=y2\\)

    What if the images are not in the required setup?

    • There is a trick: We can rewarp them through rotation, mapping both image planes to a common plane parallel to the baseline, this is called
    • For this rotation around the camera center, the 3D structure must not be known

    How can we make epipolar lines horizontal?

    • Step1:Estimate\\(\\tilde{E}\\) , decompose into \\(t\\)and \\(R\\)

    • Step2: Find \\(R_{rect}\\)

    Choose \\(OO^\u2032=t=(t_x,t_y,t_z)^T\\)

    \\(e_1=\\frac{T}{\u2223\u2223T\u2223\u2223}\\)

    \\(e_2=\\frac{1}{\\sqrt{T_x^2+T_y^2}}(-Ty,Tx,0)^T= [(0, 0, 1)^\u22a4]\u00d7r_1\\)

    \\(e_3=e_2\\) x \\(e_1\\)

    \\(\\Rightarrow R_{rect}=\\begin{bmatrix}e_1^T\\\\e_2^T\\\\e_3^T\\end{bmatrix}\\)

    • Step3:Adjust \\(\\tilde{x}_i\\)

    Warp pixels in the first image as follows: \\(\\tilde{x}_1^{'}= KR_{rect}K_1^{-1}x \u0304_1\\)

    Warp pixels in the second image as follows: \\(\\tilde{x}_2^{'}=KRR_{rect}K_2^{-1}x \u0304_2\\)

    NOTE \uff1aDifferent coordinate systems result in different perception of \\(R_{rect}\\),Thus the \\(R_{rect}^{'}=RR_{rect}\\)

    K is a shared projection matrix that can be chosen arbitrarily (e.g., K = K1)

    In practice, the inverse transformation is used for warping (i.e. query the source)

    "},{"location":"CV/ML-4360/SR/lec4/#disparity-to-depth","title":"Disparity to Depth","text":""},{"location":"CV/ML-4360/SR/lec4/#block-matching","title":"Block Matching","text":"
    • Choosedisparityrange[0,D]
    • For all pixels x = (x, y) compute the best disparity \u21d2 winner-takes-all (WTA)
    • Do this for both images and apply left-right consistency check to remove outliers
    "},{"location":"CV/ML-4360/SR/lec4/#zero-normalized-cross-correlation","title":"Zero Normalized Cross-Correlation","text":""},{"location":"CV/ML-4360/SR/lec4/#sum-of-squared-differences-ssd","title":"Sum of squared differences (SSD)","text":""},{"location":"CV/ML-4360/SR/lec4/#assumption-violations","title":"Assumption Violations","text":"
    • Block matching assumes that all pixels inside the window are displaced by d

    • This is called the fronto-parallel assumption which is often invalid

    • Slanted surfaces deform perspectively when the viewpoint changes

    • Effect of Window Size

    • Small windows lead to matching ambiguities and noise in the disparity maps

    • Larger windows lead to smoother results, but loss of details and border bleeding

    • Border Bleeding:

    • Left-Right Consistency Test:
    "},{"location":"CV/ML-4360/SR/lec4/#siamese-networks","title":"Siamese Networks","text":""},{"location":"CV/ML-4360/SR/lec4/#training","title":"Training","text":""},{"location":"CV/ML-4360/SR/lec4/#loss-function","title":"Loss Function","text":"

    Hinge Loss:\\(L = max(0, m + s_- - s_+)\\)

    • \\(s_- / s_+\\) is the score of the network for the negative/positive example

    • The loss is zero when the similarity of the positive example is greater than the similarity of the negative example by at least margin m

    • The network is trained by minimizing a hinge loss.

    • The loss is computed by considering pairs of examples centered around the same image position where one example belongs to the positive and one to the negative class.

    • Let \\(s_+\\)be the output of the network for the positive example, \\(s_-\\) be the output of the network for the negative example

    • Let m, the margin, be a positive real number.

    • The hinge loss for that pair of examples is defined as \\(L = max(0, m + s_- - s_+)\\) The loss is zero when the similarity of the positive example is greater than the similarity of the negative example by at least the margin m.

    • Set the margin to 0.2 in our experiments.

    "},{"location":"CV/ML-4360/SR/lec4/#paper","title":"Paper","text":"

    https://www.jmlr.org/papers/volume17/15-535/15-535.pdf

    "},{"location":"CV/ML-4360/SR/lec4/#spatial-regularization","title":"Spatial Regularization","text":"
    • Add Pairwise terms: Smoothness between adjacent pixels in addition to matching costs;

    • Potts: \\(\u03c8_{smooth}(d, d^\u2032) = [d\\ne d^\u2032]\\)

    • Truncated\\(l_1:\u03c8+{smooth}(d,d^\u2032)=min(|d-d^\u2032|,\u03c4)\\)

    • Paper

    https://dash.harvard.edu/bitstream/handle/1/3637107/Mumford_StatRangeImage.pdf?sequence=3&isAllowed=y

    "},{"location":"CV/ML-4360/SR/lec4/#end-to-end-learning","title":"End-to-End Learning","text":"

    End to End learning in the context of AI and ML is a technique where the model learns all the steps between the initial input phase and the final output result. This is a deep learning process where all of the different parts are simultaneously trained instead of sequentially.

    "},{"location":"CV/ML-4360/SR/lec4/#dispnet","title":"DISPNET","text":""},{"location":"CV/ML-4360/SR/lec4/#gcnet","title":"GCNET","text":""},{"location":"CV/ML-4360/SR/lec4/#stereo-mixture-density-networks-smd-nets","title":"STEREO MIXTURE DENSITY NETWORKS (SMD-NETS)","text":""},{"location":"DIP/Basic/DIP/","title":"Basic concept and programming introduction","text":""},{"location":"DIP/Basic/DIP/#image-format","title":"Image Format","text":"

    Digital image can be represented as a 2D array or matrix.

    • Grayscale:Each pixel in a grayscale image is represented by a byte (8 bits), which covers 256 degrees by [0..255]

    • Colour image: Each pixel in a color image is represented by 3 bytes (24 bits), which are for R (red), G (Green) and B (Blue), respectively.

    \u76ee\u7684\uff1a\u5b58\u50a8\u56fe\u50cf

    \u4fe1\u606f\u56fe\u50cf\u7279\u70b9\uff1a\u4ee5\u50cf\u7d20\u4e3a\u5355\u4f4d\uff0c\u77e9\u5f62\u533a\u57df\u4fe1\u606f\u91cf\u5927

    \u6709\u4e9b\u6587\u4ef6\u683c\u5f0f\u4e0e\u64cd\u4f5c\u7cfb\u7edf\u6709\u5173\uff1awindows\u3001unix\u3001mac\u7f16\u7801\u65b9\u5f0f\uff1a\u65e0\u538b\u7f29\u3001\u65e0\u635f\u538b\u7f29\u3001\u6709\u635f\u538b\u7f29

    "},{"location":"DIP/Basic/DIP/#1bmp","title":"1.BMP\u7684\u6587\u4ef6\u683c\u5f0f\uff1a","text":"

    \u200b BMP\uff08Bitmap\uff09\u662f\u4e00\u79cd\u5e38\u89c1\u7684\u56fe\u50cf\u6587\u4ef6\u683c\u5f0f\uff0c\u662fWindows\u7cfb\u7edf\u7684\u4e00\u79cd\u6807\u51c6\u6587\u4ef6\u683c\u5f0f\u3002BMP \u4f4d\u56fe\u6587\u4ef6\u9ed8\u8ba4\u7684\u6587\u4ef6\u6269\u5c55\u540d\u662f bmp \u6216\u8005 dib\u3002\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0cBMP \u56fe\u50cf\u91c7\u7528\u975e\u538b\u7f29\u65b9\u5f0f\uff1b\u7136\u800c\uff0c\u5b83\u4e5f\u652f\u6301\u56fe\u50cf\u538b\u7f29\uff0c\u4f8b\u5982 RLE \u683c\u5f0f\u3002\u4e0b\u9762\u4ecb\u7ecdBMP\u6587\u4ef6\u7684\u5177\u4f53\u6587\u4ef6\u7ed3\u6784\u3002

    BMP \u56fe\u50cf\u6bcf\u4e00\u884c\u626b\u63cf\u7531\u8868\u793a\u56fe\u50cf\u50cf\u7d20\u7684\u8fde\u7eed\u7684\u5b57\u8282\u7ec4\u6210\uff0c\u6bcf\u4e00\u884c\u4ee5\u56db\u5b57\u8282\u5bf9\u9f50\uff08\u4ee50\u8865\u9f50\uff09\u3002\u56fe\u50cf\u7684\u626b\u63cf\u884c\u662f\u7531\u5e95\u5411\u4e0a\u5b58\u50a8\u7684\uff0c\u8fd9\u5c31\u662f\u8bf4\uff0c\u9635\u5217\u4e2d\u7684\u7b2c\u4e00\u4e2a\u5b57\u8282\u8868\u793a\u4f4d\u56fe\u5de6\u4e0b\u89d2\u7684\u50cf\u7d20\uff0c\u800c\u6700\u540e\u4e00\u4e2a\u5b57\u8282\u8868\u793a\u4f4d\u56fe\u53f3\u4e0a\u89d2\u7684\u50cf\u7d20\u3002

    // \u5b9a\u4e49BMP\u6587\u4ef6\u5934\u7684\u5927\u5c0f\u4e3a54\u4e2a\u5b57\u8282\uff0c\u901a\u5e38\u60c5\u51b5\u4e0b\u56fa\u5b9a\u4e0d\u53d8\n#define HEADERSIZE 54\n\n// \u5b9a\u4e49\u51e0\u79cd\u4e0d\u540c\u6570\u636e\u7c7b\u578b\u7684\u522b\u540d\uff0c\u4ee5\u4fbf\u5728\u4ee3\u7801\u4e2d\u4f7f\u7528\u66f4\u5177\u53ef\u8bfb\u6027\u7684\u540d\u79f0\ntypedef unsigned char byte;\ntypedef unsigned short word;\ntypedef unsigned int dword;\n\n// \u4f7f\u7528#pragma pack(1)\u6307\u4ee4\u8bbe\u7f6e\u7ed3\u6784\u4f53\u7684\u5b57\u8282\u5bf9\u9f50\u65b9\u5f0f\u4e3a1\u5b57\u8282\n#pragma pack(1)\n\n// \u5b9a\u4e49BMP\u6587\u4ef6\u5934\u7684\u7ed3\u6784\u4f53\ntypedef struct {\n    word bfType;          // BMP\u6587\u4ef6\u7684\u7c7b\u578b\u6807\u8bc6\uff0c\u901a\u5e38\u4e3a\"BM\"\n    dword bfSize;         // BMP\u6587\u4ef6\u7684\u5927\u5c0f\uff0c\u4ee5\u5b57\u8282\u4e3a\u5355\u4f4d\n    word reserved1;       // \u4fdd\u7559\u5b57\u6bb5\uff0c\u8bbe\u7f6e\u4e3a0\n    word reserved2;       // \u4fdd\u7559\u5b57\u6bb5\uff0c\u8bbe\u7f6e\u4e3a0\n    dword bfOffset;       // \u4f4d\u56fe\u6570\u636e\u7684\u504f\u79fb\u91cf\uff0c\u5373\u6587\u4ef6\u5934\u7684\u5927\u5c0f\n} BMPHeader;\n\n// \u5b9a\u4e49BMP\u4fe1\u606f\u5934\u7684\u7ed3\u6784\u4f53\ntypedef struct {\n    dword size;           // \u4fe1\u606f\u5934\u7684\u5927\u5c0f\uff0c\u901a\u5e38\u4e3a40\u5b57\u8282\n    int width;            // \u56fe\u50cf\u7684\u5bbd\u5ea6\uff0c\u4ee5\u50cf\u7d20\u4e3a\u5355\u4f4d\n    int height;           // \u56fe\u50cf\u7684\u9ad8\u5ea6\uff0c\u4ee5\u50cf\u7d20\u4e3a\u5355\u4f4d\n    word planes;          // \u989c\u8272\u5e73\u9762\u6570\uff0c\u901a\u5e38\u4e3a1\n    word bitCount;        // \u6bcf\u4e2a\u50cf\u7d20\u7684\u4f4d\u6570\n    dword compression;    // \u538b\u7f29\u7c7b\u578b\n    dword imageSize;      // \u4f4d\u56fe\u6570\u636e\u7684\u5927\u5c0f\uff0c\u4ee5\u5b57\u8282\u4e3a\u5355\u4f4d\n    int xPixelsPerMeter;  // \u6c34\u5e73\u5206\u8fa8\u7387\uff0c\u6bcf\u7c73\u7684\u50cf\u7d20\u6570\n    int yPixelsPerMeter;  // \u5782\u76f4\u5206\u8fa8\u7387\uff0c\u6bcf\u7c73\u7684\u50cf\u7d20\u6570\n    dword colorsUsed;     // \u4f7f\u7528\u7684\u989c\u8272\u6570\n    dword colorsImportant; // \u91cd\u8981\u989c\u8272\u6570\n} BMPInfoHeader;\n\n// \u5b9a\u4e49\u8c03\u8272\u677f\u4e2d\u7684\u4e00\u4e2a\u989c\u8272\u7684\u7ed3\u6784\u4f53\ntypedef struct {\n    byte blue;     // \u84dd\u8272\u5206\u91cf\n    byte green;    // \u7eff\u8272\u5206\u91cf\n    byte red;      // \u7ea2\u8272\u5206\u91cf\n    byte reserved; // \u4fdd\u7559\u5b57\u6bb5\uff0c\u901a\u5e38\u8bbe\u7f6e\u4e3a0\n} pallete;\n\n// \u5b9a\u4e49\u5305\u542bBMP\u6587\u4ef6\u5934\u3001BMP\u4fe1\u606f\u5934\u3001\u8c03\u8272\u677f\u548c\u4f4d\u56fe\u6570\u636e\u7684\u5b8c\u6574BMP\u56fe\u50cf\u7684\u7ed3\u6784\u4f53\ntypedef struct {\n    BMPHeader bmph;         // BMP\u6587\u4ef6\u5934\n    BMPInfoHeader bmpih;    // BMP\u4fe1\u606f\u5934\n    pallete colours[256];   // \u8c03\u8272\u677f\uff0c\u901a\u5e38\u7528\u4e8e8\u4f4d\u989c\u8272\u7d22\u5f15\u56fe\u50cf\n    byte *bitmap;           // \u4f4d\u56fe\u6570\u636e\n} BMP;\n
    "},{"location":"DIP/Basic/DIP/#1bmp_1","title":"(1)BMP\u6587\u4ef6\u6574\u4f53\u7ed3\u6784\uff1a","text":""},{"location":"DIP/Basic/DIP/#_1","title":"Basic concept and programming introduction","text":"

    BMP \u6587\u4ef6 \u5927\u4f53\u4e0a\u5206\u4e3a\u56db\u4e2a\u90e8\u5206:\u56fe\u50cf\u6587\u4ef6\u5934\uff08Image file header\uff09\u3001\u56fe\u50cf\u4fe1\u606f\u5934\uff08Image information header\uff09\u3001\u8c03\u8272\u677f\uff08Palette\uff09\u3001\u56fe\u50cf\u6570\u636e\u5b57\u8282\u9635\u5217\uff08Image data\uff09

    • \u5bf9\u7528\u5230\u8c03\u8272\u677f\u7684\u4f4d\u56fe\uff0c\u56fe\u50cf\u6570\u636e\u4e3a\u8be5\u50cf\u7d20\u989c\u8272\u5728\u8c03\u8272\u677f\u4e2d\u7684\u7d22\u5f15\u503c
    • \u5bf9\u4e8e\u771f\u5f69\u8272\u56fe\uff0c\u56fe\u50cf\u6570\u636e\u5c31\u662f\u5b9e\u9645\u7684 R\u3001G\u3001B \u503c\u3002
    "},{"location":"DIP/Basic/DIP/#2bmpimage-file-header","title":"(2)BMP\u56fe\u50cf\u6587\u4ef6\u5934\uff08Image file header\uff09","text":"Start Size(Byte) Name Purpose 1 2 bfType Must always be set to 'BM'(0x4D42) to declare that this is a .bmp-file 3 4 bfSize Specifies the size of the file in bytes. 7 2 bfReserved1 Must always be set to zero. 9 2 bfReserved2 Must always be set to zero. 11 4 bfOffBits Specifies the offset from the beginning of the file to the bitmap data
    • \\(bfOffbits\\) \u8bf4\u660e\u4ece\u6587\u4ef6\u5934\u5f00\u59cb\u5230\u5b9e\u9645\u7684\u56fe\u8c61\u6570\u636e\u4e4b\u95f4\u7684\u5b57\u8282\u7684\u504f\u79fb\u91cf\u3002\u8fd9\u4e2a\u53c2\u6570\u662f\u975e\u5e38\u6709\u7528\u7684\uff0c\u56e0\u4e3a\u4f4d\u56fe\u4fe1\u606f\u5934\u548c\u8c03\u8272\u677f\u7684\u957f\u5ea6\u4f1a\u6839\u636e\u4e0d\u540c\u60c5\u51b5\u800c\u53d8\u5316\uff0c\u6240\u4ee5\u4f60\u53ef\u4ee5\u7528\u8fd9\u4e2a\u504f\u79fb\u503c\u8fc5\u901f\u7684\u4ece\u6587\u4ef6\u4e2d\u8bfb\u53d6\u5230\u4f4d\u6570\u636e\u3002
    "},{"location":"DIP/Basic/DIP/#3bmpimage-information-header","title":"(3)BMP\u56fe\u50cf\u4fe1\u606f\u5934\uff08image information header\uff09","text":"Size(Byte) Name Purpose 4 biSize Number of bytes to define BITMAPINFOHEADER structure 4 biWidth Image width (number of pixels) 4 biHeight Image height (number of pixels). 2 biPlane Number of planes. Always be 1. 2 biBitCount Bits per pixel (Bits/pixel), which is 1, 4, 8, 16, 24 or 32. 4 biCompression Compression type. Only non-compression is discussed here: BI_RGB. 4 biSizeImage Image size with bytes. When biCompression=BI_RGB, biSizeImage=0. 4 biXPelsPerMeter Horizontal resolution, pixels/meter. 4 biYPelsPerMeter Vertical resolution, pixels/meter 4 biClrUsed Number of color indices used in the bitmap (0->all the palette items are used). 4 biClrImportant Number of important color indices for image display. 0->all items are important.
    • \u6ce8\u660e \\(biHeight\\) \u53ef\u4ee5\u8868\u793a\u56fe\u50cf\u662f\u5426\u5012\u7f6e\uff0c\\(biHeight\\) \u4e3a\u6b63\u6570\u8868\u793a\u5012\u7f6e\uff08inverted\uff09\uff0c \u8d1f\u6570\u8868\u793a\u6b63\u5e38\uff08upright)\uff0c\u5927\u591a\u6570BMP\u6587\u4ef6\u662f\u5012\u7f6e\u7684\u4f4d\u56fe\uff0c\u5373 \\(biHeight\\)>0
    • biClrUsed\u8bf4\u660e\u4f4d\u56fe\u5b9e\u9645\u4f7f\u7528\u7684\u5f69\u8272\u8868\u4e2d\u7684\u989c\u8272\u7d22\u5f15\u6570\uff08\u8bbe\u4e3a0\u7684\u8bdd\uff0c\u5219\u8bf4\u660e\u4f7f\u7528\u6240\u6709\u8c03\u8272\u677f\u9879
    • biClrImportant\u8bf4\u660e\u5bf9\u56fe\u8c61\u663e\u793a\u6709\u91cd\u8981\u5f71\u54cd\u7684\u989c\u8272\u7d22\u5f15\u7684\u6570\u76ee\uff0c\u5982\u679c\u662f0\uff0c\u8868\u793a\u90fd\u91cd\u8981
    "},{"location":"DIP/Basic/DIP/#4palette","title":"(4)\u8c03\u8272\u677f\uff08Palette\uff09","text":"
    • \u8c03\u8272\u677f\u7684\u5927\u5c0f\u4e3a\\(N*4\\) (bytes)\u3002\u8c03\u8272\u677f\u4e2d\u7684\u6bcf\u4e00\u9879\u75281 \u5b57\u8282\u8868\u793a\u84dd\u8272\u5206\u91cf\u30011 \u5b57\u8282\u8868\u793a\u7eff\u8272\u5206\u91cf\u30011 \u5b57\u8282\u8868\u793a\u7ea2\u8272\u5206\u91cf\u30011 \u5b57\u8282\u7528\u4e8e\u586b\u5145\u7b26 (\u8bbe\u7f6e\u4e3a 0)

    \u6709\u4e00\u4e2a\u957f\u5bbd\u5404\u4e3a200\u4e2a\u8c61\u7d20\uff0c\u989c\u8272\u6570\u4e3a16\u8272\u7684\u5f69\u8272\u56fe\uff0c\u6bcf\u4e00\u4e2a\u8c61\u7d20\u90fd\u7528R\u3001G\u3001B\u4e09\u4e2a\u5206\u91cf\u8868\u793a

    \u56e0\u4e3a\u6bcf\u4e2a\u5206\u91cf\u6709256\u4e2a\u7ea7\u522b\uff0c\u8981\u75288\u4f4d(bit)\uff0c\u5373\u4e00\u4e2a\u5b57\u8282(byte)\u6765\u8868\u793a\uff0c\u6240\u4ee5\u6bcf\u4e2a\u8c61\u7d20\u9700\u8981\u75283\u4e2a\u5b57\u8282\u3002\u6574\u4e2a\u56fe\u8c61\u8981\u7528200\u00d7200\u00d73\uff0c\u7ea6120k\u5b57\u8282\uff0c\u53ef\u4e0d\u662f\u4e00\u4e2a\u5c0f\u6570\u76ee\u5440\uff01\u5982\u679c\u6211\u4eec\u7528\u4e0b\u9762\u7684\u65b9\u6cd5\uff0c\u5c31\u80fd\u7701\u7684\u591a\u3002

    \u56e0\u4e3a\u662f\u4e00\u4e2a16\u8272\u56fe\uff0c\u4e5f\u5c31\u662f\u8bf4\u8fd9\u5e45\u56fe\u4e2d\u6700\u591a\u53ea\u670916\u79cd\u989c\u8272\uff0c\u6211\u4eec\u53ef\u4ee5\u7528\u4e00\u4e2a\u8868\uff1a\u8868\u4e2d\u7684\u6bcf\u4e00\u884c\u8bb0\u5f55\u4e00\u79cd\u989c\u8272\u7684R\u3001G\u3001B\u503c\u3002\u8fd9\u6837\u5f53\u6211\u4eec\u8868\u793a\u4e00\u4e2a\u8c61\u7d20\u7684\u989c\u8272\u65f6\uff0c\u53ea\u9700\u8981\u6307\u51fa\u8be5\u989c\u8272\u662f\u5728\u7b2c\u51e0\u884c\uff0c\u5373\u8be5\u989c\u8272\u5728\u8868\u4e2d\u7684\u7d22\u5f15\u503c\u3002\u4e3e\u4e2a\u4f8b\u5b50\uff0c\u5982\u679c\u8868\u7684\u7b2c0\u884c\u4e3a255\uff0c0\uff0c0(\u7ea2\u8272)\uff0c\u90a3\u4e48\u5f53\u67d0\u4e2a\u8c61\u7d20\u4e3a\u7ea2\u8272\u65f6\uff0c\u53ea\u9700\u8981\u6807\u660e0\u5373\u53ef

    \u8fd9\u5f20R\u3001G\u3001B\u7684\u8868\uff0c\u5c31\u662f\u6211\u4eec\u5e38\u8bf4\u7684\u8c03\u8272\u677f(Palette)\uff0c\u53e6\u4e00\u79cd\u53eb\u6cd5\u662f\u989c\u8272\u67e5\u627e\u8868LUT(Look Up Table)\uff0c\u4f3c\u4e4e\u66f4\u786e\u5207\u4e00\u4e9b\u3002Windows\u4f4d\u56fe\u4e2d\u4fbf\u7528\u5230\u4e86\u8c03\u8272\u677f\u6280\u672f\u3002\u5176\u5b9e\u4e0d\u5149\u662fWindows\u4f4d\u56fe\uff0c\u8bb8\u591a\u56fe\u8c61\u6587\u4ef6\u683c\u5f0f\u5982pcx\u3001tif\u3001gif\u7b49\u90fd\u7528\u5230\u4e86\u3002\u6240\u4ee5\u5f88\u597d\u5730\u638c\u63e1\u8c03\u8272\u677f\u7684\u6982\u5ff5\u662f\u5341\u5206\u6709\u7528\u7684\u3002

    "},{"location":"DIP/Basic/DIP/#5image-data","title":"(5)\u56fe\u50cf\u6570\u636e\u5b57\u8282\u9635\u5217\uff08Image data\uff09","text":"
    • \u56fe\u50cf\u6570\u636e\u5b57\u8282\u9635\u5217\u5b58\u50a8\u4e86\u8c03\u8272\u677f\u7684\u7d22\u5f15\u53f7\uff0c\u6216\u8005\u53d6\u51b3\u4e8e\u989c\u8272\u6df1\u5ea6\u7684RGB\u503c

    • \u5176\u5927\u5c0f\u53d6\u51b3\u4e8e\u56fe\u50cf\u5927\u5c0f\u548c\u989c\u8272\u6df1\u5ea6\u3002

    (1)\u6bcf\u4e00\u884c\u7684\u5b57\u8282\u6570\u5fc5\u987b\u662f4\u7684\u6574\u500d\u6570\uff0c\u5982\u679c\u4e0d\u662f\uff0c\u5219\u9700\u8981\u8865\u9f50(append zero)

    (2)\u4e00\u822c\u6765\u8bf4\uff0c.bMP\u6587\u4ef6\u7684\u6570\u636e\u4ece\u4e0b\u5230\u4e0a\uff0c\u4ece\u5de6\u5230\u53f3\u7684

    • \u4e5f\u5c31\u662f\u8bf4\uff0c\u4ece\u6587\u4ef6\u4e2d\u6700\u5148\u8bfb\u5230\u7684\u662f\u56fe\u8c61\u6700\u4e0b\u9762\u4e00\u884c\u7684\u5de6\u8fb9\u7b2c\u4e00\u4e2a\u8c61\u7d20\uff0c\u7136\u540e\u662f\u5de6\u8fb9\u7b2c\u4e8c\u4e2a\u8c61\u7d20\u2026\u2026\u63a5\u4e0b\u6765\u662f\u5012\u6570\u7b2c\u4e8c\u884c\u5de6\u8fb9\u7b2c\u4e00\u4e2a\u8c61\u7d20\uff0c\u5de6\u8fb9\u7b2c\u4e8c\u4e2a\u8c61\u7d20\u2026\u2026\u4f9d\u6b21\u7c7b\u63a8 \uff0c\u6700\u540e\u5f97\u5230\u7684\u662f\u6700\u4e0a\u9762\u4e00\u884c\u7684\u6700\u53f3\u4e00\u4e2a\u8c61\u7d20\u3002

    • You do not need to turn around the rows manually. The API functions which also display the bitmap will do that for you automatically.

    6 bytes that represent a row in the bitmap: A0 37 F2 8B 31 C4 must be saved as: A0 37 F2 8B 31 C4 00 00"},{"location":"DIP/Basic/DIP/#2bmp","title":"2.BMP\u6587\u4ef6\u7684\u8bfb\u5165\u548c\u5b58\u50a8","text":"

    \u5229\u7528 C \u8bed\u8a00\u4e2d\u7684 fopen fread fwrite \u8fdb\u884c\u8bfb\u5165\u3001\u5199\u51fa\u5373\u53ef

    \u5728\u8bfb\u5165\u4e0e\u5199\u51fa\u7684\u8fc7\u7a0b\u4e2d\uff0c\u9700\u8981\u6ce8\u610f BMP\u6587\u4ef6\u4fe1\u606f\u7684\u8c03\u6574\uff0c\u4f8b\u5982\u753124\u4f4d\u5f69\u8272BMP\u8f6c\u4e3a\u7070\u8272\u56fe\u65f6\uff0c\u9700\u8981\u6ce8\u610f\u8c03\u8272\u677f\u3001\u4f4d\u6df1\u7b49\u7684\u8c03\u6574\u3002

    FILE *inputFile = fopen(\"input.bmp\", \"rb\");\n // \u68c0\u67e5\u6587\u4ef6\u662f\u5426\u6210\u529f\u6253\u5f00\nif (!inputFile) {\n    printf(\"Unable to open input BMP file.\\n\"); // \u8f93\u51fa\u9519\u8bef\u4fe1\u606f\n    return 0; // \u9000\u51fa\u7a0b\u5e8f\n}\nprintf(\"successfully loaded!\"); // \u6210\u529f\u52a0\u8f7d\u7684\u63d0\u793a\u4fe1\u606f\nBMP bmp; // \u521b\u5efa\u4e00\u4e2aBMP\u7ed3\u6784\u4f53\u53d8\u91cf\u7528\u4e8e\u5b58\u50a8BMP\u6587\u4ef6\u7684\u4fe1\u606f\u548c\u6570\u636e\n// \u4ece\u6587\u4ef6\u4e2d\u8bfb\u53d6BMP\u6587\u4ef6\u5934\u548c\u4fe1\u606f\u5934\nfread(&(bmp), HEADERSIZE, 1, inputFile);\nint width = bmp.bmpih.width; // \u83b7\u53d6\u56fe\u50cf\u7684\u5bbd\u5ea6\nint height = bmp.bmpih.height; // \u83b7\u53d6\u56fe\u50cf\u7684\u9ad8\u5ea6\n// \u5982\u679c\u56fe\u50cf\u5927\u5c0f\u4e3a0\uff0c\u5219\u8ba1\u7b97\u56fe\u50cf\u6570\u636e\u5927\u5c0f\nif (bmp.bmpih.imageSize == 0) {bmp.bmpih.imageSize = bmp.bmph.bfSize - bmp.bmph.bfOffset;}\n// \u4e3a\u4f4d\u56fe\u6570\u636e\u5206\u914d\u5185\u5b58\nbmp.bitmap = (byte*)malloc(sizeof(byte) * (bmp.bmph.bfSize - HEADERSIZE));\n// \u4ece\u6587\u4ef6\u4e2d\u8bfb\u53d6\u4f4d\u56fe\u6570\u636e\nfread(bmp.bitmap, bmp.bmph.bfSize - HEADERSIZE, 1, inputFile);\nfclose(inputFile); // \u5173\u95ed\u6587\u4ef6\n
    "},{"location":"DIP/Basic/DIP/#visual-intelligence-and-pattern-analysis","title":"Visual Intelligence and Pattern Analysis","text":""},{"location":"DIP/Basic/DIP/#history","title":"History","text":""},{"location":"DIP/Basic/DIP/#_2","title":"\u9488\u5b54\u6210\u50cf","text":"
    • \u6295\u5f71\u4fbf\u6210\u4e3a\u5012\u7acb\u7684\uff1b\u7269\u8ddd\u8d8a\u8fdc,\u50cf\u8d8a\u5c0f\uff1b\u7269\u8ddd\u8d8a\u8fd1,\u50cf\u8d8a\u5927

    • \u5982\u524d\u9762\u63d0\u5230\u7684\u60c5\u51b5\uff0c\u5149\u5708\u5b54\u5f84\u5927\u7684\u65f6\u5019\uff0c\u4f1a\u5bfc\u81f4\u6a21\u7cca\uff1b\u90a3\u662f\u4e0d\u662f\u53ef\u4ee5\u5c3d\u91cf\u7f29\u5c0f\u5149\u5708\u7684\u5b54\u5f84\u5462\uff1f

    NO.\u5982\u679c\u5b54\u5f84\u592a\u5c0f\uff0c\u53ef\u901a\u8fc7\u7684\u5149\u7ebf\u5c31\u5f88\u5c11\uff0c\u5bfc\u81f4\u5149\u5f3a\u592a\u5f31\uff0c\u540c\u65f6\u5f53\u5b54\u5f84\u5c0f\u5230\u4e00\u5b9a\u7a0b\u5ea6\u65f6\uff0c\u4f1a\u4ea7\u751f\u884d\u5c04\u73b0\u8c61\u3002

    "},{"location":"DIP/Basic/DIP/#lenses","title":"Lenses","text":"
    • \u901a\u8fc7\u4f7f\u7528\u900f\u955c\u53ef\u4ee5\u4f1a\u805a\u66f4\u591a\u7684\u5149\u7ebf\u5230\u4e00\u4e2a\u6210\u50cf\u70b9\uff0c\u53ea\u662f\u53ea\u6709\u5728\u7279\u6b8a\u7684\u4f4d\u7f6e\u4e0a\u624d\u80fd\u8fbe\u5230\u8fd9\u4e2a\u76ee\u6807\uff0c\u5373\u5927\u5bb6\u4ee5\u524d\u5c31\u5b66\u4e60\u8fc7\u7684\u900f\u955c\u805a\u7126

    • \u4f4d\u4e8e\u5408\u9002\u8ddd\u79bb\u7684\u7269\u4f53\u70b9\u53ef\u4ee5\u6210\u6e05\u6670\u50cf\uff0c\u5176\u4ed6\u7684\u70b9\u5219\u4f1a\u4ea7\u751f\u5f25\u6563\u5706 \u901a\u8fc7\u6539\u53d8\u955c\u5934\u7684\u5f62\u72b6\u53ef\u4ee5\u6539\u53d8\u805a\u7126\u65f6\u7684\u7269\u4f53\u70b9\u6240\u9700\u8981\u7684\u8ddd\u79bb

    • \u5f25\u6563\u5706(circle of confusion) \uff1a\u5728\u7126\u70b9\u524d\u540e\uff0c\u5149\u7ebf\u5f00\u59cb\u805a\u96c6\u548c\u6269\u6563\uff0c\u70b9\u7684\u5f71\u50cf\u53d8\u6a21\u7cca\uff0c\u5f62\u6210\u4e00\u4e2a\u6269\u5927\u7684\u5706
    • \u5982\u679c\u5f25\u6563\u5706\u7684\u76f4\u5f84\u5c0f\u4e8e\u4eba\u773c\u7684\u9274\u522b\u80fd\u529b\uff0c\u5728\u4e00\u5b9a\u8303\u56f4\u5185\u5b9e\u9645\u5f71\u50cf\u4ea7\u751f\u7684\u6a21\u7cca\u662f\u4e0d\u80fd\u8fa8\u8ba4\u7684\u3002\u4e0d\u80fd\u8fa8\u8ba4\u7684\u76f4\u5f84\u53eb\u505a\u5bb9\u8bb8\u5f25\u6563\u5706\u3002\u7126\u70b9\u524d\u540e\u5404\u6709\u4e00\u4e2a\u5bb9\u8bb8\u5f25\u6563\u5706
    • \u5bf9\u4e8e6\u5bf8\u7167\u7247\uff0c\u89c2\u5bdf\u8ddd\u79bb25\uff0d30cm \uff0c\u5927\u6982\u662f\u5e95\u7247\u5bf9\u89d2\u7ebf1/1000-1/1500.

    • \u5149\u5708\u7684\u5927\u5c0f\u4e0e\u666f\u6df1\u6709\u5bc6\u5207\u5173\u7cfb\uff1a\u7126\u70b9\u524d\u540e\u5404\u6709\u4e00\u4e2a\u5bb9\u8bb8\u5f25\u6563\u5706\uff0c\u4ed6\u4eec\u4e4b\u95f4\u7684\u8ddd\u79bb\u53eb\u505a\u666f\u6df1

    \u666f\u6df1\u968f\u955c\u5934\u7684\u7126\u8ddd\u3001\u5149\u5708\u503c\u3001\u62cd\u6444\u8ddd\u79bb\u800c\u53d8\u5316

    (1)\u955c\u5934\u5149\u5708\uff1a\u5149\u5708\u8d8a\u5927\uff0c\u666f\u6df1\u8d8a\u5c0f\uff1b\u5149\u5708\u8d8a\u5c0f\uff0c\u666f\u6df1\u8d8a\u5927

    (2)\u955c\u5934\u7126\u8ddd\uff1a\u955c\u5934\u7126\u8ddd\u8d8a\u957f\uff0c\u666f\u6df1\u8d8a\u5c0f\uff1b\u7126\u8ddd\u8d8a\u77ed\uff0c\u666f\u6df1\u8d8a\u5927

    (3)\u62cd\u6444\u8ddd\u79bb\uff1a\u8ddd\u79bb\u8d8a\u8fdc\uff0c\u666f\u6df1\u8d8a\u5927\uff1b\u8ddd\u79bb\u8d8a\u8fd1\uff0c\u666f\u6df1\u8d8a\u5c0f

    For a given subject framing and camera position, the DOF is controlled by the lens aperture diameter, which is usually specified as the f-number, the ratio of lens focal length to aperture diameter.

    Reducing the aperture diameter (increasing the f-number) increases the DOF; however, it also reduces the amount of light transmitted, and increases diffraction, placing a practical limit on the extent to which DOF can be increased by reducing the aperture diameter.

    "},{"location":"DIP/Basic/DIP/#digital-camera","title":"Digital camera","text":"
    • \u62cd\u6444\u666f\u7269\u65f6\uff0c\u666f\u7269\u53cd\u5c04\u7684\u5149\u7ebf\u901a\u8fc7\u6570\u7801\u76f8\u673a\u7684\u955c\u5934\u900f\u5c04\u5230CCD\u4e0a
    • \u5f53CCD\u66dd\u5149\u540e\uff0c\u5149\u7535\u4e8c\u6781\u7ba1\u53d7\u5230\u5149\u7ebf\u7684\u6fc0\u53d1\u800c\u91ca\u653e\u51fa\u7535\u8377\uff0c\u751f\u6210\u611f\u5149\u5143\u4ef6\u7684\u7535\u4fe1\u53f7

    • CCD\u63a7\u5236\u82af\u7247\u5229\u7528\u611f\u5149\u5143\u4ef6\u4e2d\u7684\u63a7\u5236\u4fe1\u53f7\u7ebf\u8def\u5bf9\u53d1\u5149\u4e8c\u6781\u7ba1\u4ea7\u751f\u7684\u7535\u6d41\u8fdb\u884c\u63a7\u5236\uff0c\u7531\u7535\u6d41\u4f20\u8f93\u7535\u8def\u8f93\u51fa\uff0cCCD\u4f1a\u5c06\u4e00\u6b21\u6210\u50cf\u4ea7\u751f\u7684\u7535\u4fe1\u53f7\u6536\u96c6\u8d77\u6765\uff0c\u7edf\u4e00\u8f93\u51fa\u5230\u653e\u5927\u5668\u3002

    • \u7ecf\u8fc7\u653e\u5927\u548c\u6ee4\u6ce2\u540e\u7684\u7535\u4fe1\u53f7\u88ab\u4f20\u9001\u5230ADC\uff0c\u7531ADC\u5c06\u7535\u4fe1\u53f7\uff08\u6a21\u62df\u4fe1\u53f7\uff09\u8f6c\u6362\u4e3a\u6570\u5b57\u4fe1\u53f7\uff0c\u6570\u503c\u7684\u5927\u5c0f\u548c\u7535\u4fe1\u53f7\u7684\u5f3a\u5ea6\u4e0e\u7535\u538b\u7684\u9ad8\u4f4e\u6210\u6b63\u6bd4\uff0c\u8fd9\u4e9b\u6570\u503c\u5176\u5b9e\u4e5f\u5c31\u662f\u56fe\u50cf\u7684\u6570\u636e\u3002
    • \u6b64\u65f6\u8fd9\u4e9b\u56fe\u50cf\u6570\u636e\u8fd8\u4e0d\u80fd\u76f4\u63a5\u751f\u6210\u56fe\u50cf\uff0c\u8fd8\u8981\u8f93\u51fa\u5230DSP\uff08\u6570\u5b57\u4fe1\u53f7\u5904\u7406\u5668\uff09\u4e2d\uff0c\u5728DSP\u4e2d\uff0c\u5c06\u4f1a\u5bf9\u8fd9\u4e9b\u56fe\u50cf\u6570\u636e\u8fdb\u884c\u8272\u5f69\u6821\u6b63\u3001\u767d\u5e73\u8861\u5904\u7406\uff0c\u5e76\u7f16\u7801\u4e3a\u6570\u7801\u76f8\u673a\u6240\u652f\u6301\u7684\u56fe\u50cf\u683c\u5f0f\u3001\u5206\u8fa8\u7387\uff0c\u7136\u540e\u624d\u4f1a\u88ab\u5b58\u50a8\u4e3a\u56fe\u50cf\u6587\u4ef6\u3002
    • \u5f53\u5b8c\u6210\u4e0a\u8ff0\u6b65\u9aa4\u540e\uff0c\u56fe\u50cf\u6587\u4ef6\u5c31\u4f1a\u88ab\u4fdd\u5b58\u5230\u5b58\u50a8\u5668\u4e0a,\u6211\u4eec\u5c31\u53ef\u4ee5\u6b23\u8d4f\u4e86\u3002
    "},{"location":"DIP/Basic/DIP/#physical-meaning-of-color","title":"Physical meaning of color","text":"

    Colorful view is generated by the interactions between light and objects, e.g., reflection, refraction, scattering, transmission, absorption, and diffraction.

    \u8272\u5f69\u573a\u666f\u662f\u7531\u5149\u4e0e\u7269\u4f53\u4e4b\u95f4\u7684\u4ea4\u4e92\u8fc7\u7a0b\u4ea7\u751f\u7684\u3002\u5982\uff1a\u53cd\u5c04\u3001\u6298\u5c04\u3001\u6563\u5c04\u3001\u4f20\u64ad\u3001\u5438\u6536\u4ee5\u53ca\u884d\u5c04\u7b49\u7b49

    \u8272\u5f69\u53ef\u4ee5\u5206\u4e3a\u5f69\u8272\uff08chromatic color\uff09\u548c\u6d88\u8272\uff08achromatic color\uff09\u4e24\u5927\u7c7b

    • \u5f69\u8272\u662f\u6307\u7ea2\u3001\u9ec4\u3001\u84dd\u7b49\u5355\u8272\u4ee5\u53ca\u5b83\u4eec\u7684\u6df7\u5408\u8272\uff0c\u5f69\u8272\u7269\u4f53\u5bf9\u5149\u8c31\u5404\u6ce2\u957f\u7684\u53cd\u5c04\u5177\u6709\u9009\u62e9\u6027\uff0c\u6240\u4ee5\u5b83\u4eec\u5728\u767d\u5149\u7167\u5c04\u4e0b\u5448\u73b0\u51fa\u4e0d\u540c\u7684\u989c\u8272
    • \u6d88\u8272\uff0c\u53c8\u79f0\u975e\u5f69\u8272\uff0c\u4e5f\u5c31\u662f\u6211\u4eec\u901a\u5e38\u6240\u8bf4\u7684\u7070\u5ea6\uff0c\u662f\u6307\u767d\u8272\uff0c\u9ed1\u8272\u4ee5\u53ca\u5404\u79cd\u6df1\u6d45\u4e0d\u540c\u7684\u7070\u8272\u3002\u6d88\u8272\u7269\u4f53\u5bf9\u5149\u8c31\u5404\u6ce2\u957f\u7684\u53cd\u5c04\u6ca1\u6709\u9009\u62e9\u6027\uff0c\u5b83\u4eec\u662f\u4e2d\u6027\u8272
    "},{"location":"DIP/Basic/DIP/#light-and-colour","title":"Light and Colour","text":"

    \u8272\u89c9(colour vision)\u662f\u6307\u4e0d\u540c\u6ce2\u957f\u7684\u5149\u7ebf\u4f5c\u7528\u4e8e\u89c6\u7f51\u819c\u800c\u5728\u5927\u8111\u4e2d\u5f15\u8d77\u7684\u611f\u89c9

    • \u4eba\u773c\u53ef\u89c1\u5149\u7ebf\u7684\u6ce2\u957f\u662f390nm\uff5e780nm\uff0c\u4e00\u822c\u53ef\u8fa8\u51fa\u5305\u62ec\u7d2b\u3001\u84dd\u3001\u9752\u3001\u7eff\u3001\u9ec4\u3001\u6a59\u3001\u7ea27\u79cd\u4e3b\u8981\u989c\u8272\u5728\u5185\u7684120\uff5e180\u79cd\u4e0d\u540c\u7684\u989c\u8272

    • \u89c6\u7f51\u819c\u662f\u4eba\u773c\u4e2d\u6700\u91cd\u8981\u7684\u7ec4\u6210\u90e8\u5206\uff0c\u5c31\u50cf\u76f8\u673a\u91cc\u7684\u611f\u5149\u5e95\u7247\uff0c\u4e13\u95e8\u8d1f\u8d23\u611f\u5149\u6210\u50cf\u3002\u89c6\u7f51\u819c\u4e0a\u5206\u5e03\u7740\u4e24\u79cd\u89c6\u89c9\u7ec6\u80de\uff0c\u4e00\u79cd\u4e3a\u6746\u72b6\u4f53\uff0c\u53e6\u4e00\u79cd\u4e3a\u9525\u72b6\u4f53

    \u6746\u72b6\u4f53\u7ec6\u80de\u6bd4\u8f83\u591a\uff0c\u5927\u7ea6\u6709\u4e0a\u4ebf\u4e2a\uff0c\u5b83\u5bf9\u5149\u6781\u4e3a\u7075\u654f\uff0c\u4f46\u6ca1\u6709\u533a\u5206\u8272\u5f69\u7684\u80fd\u529b

    \u9525\u72b6\u4f53\u7ec6\u80de\u5219\u53ea\u6709\u516d\u3001\u4e03\u767e\u4e07\u4e2a\uff0c\u5b83\u8981\u5728\u8f83\u5f3a\u7684\u7167\u5ea6\u4e0b\u624d\u80fd\u6fc0\u53d1\uff0c\u5b83\u7684\u5b58\u5728\u4f7f\u6211\u4eec\u80fd\u591f\u8fa8\u522b\u5404\u79cd\u4e0d\u540c\u7684\u989c\u8272

    • \\(\\lambda:\\ Red>Green>Blue\\)

    "},{"location":"DIP/Basic/DIP/#three-primary-colors","title":"Three-primary colors","text":"

    \u89c6\u7f51\u819c\u4e0a\u5b58\u5728\u4e09\u79cd\u5206\u522b\u5bf9\u7ea2\u7eff\u84dd\u5149\u6ce2\u957f\u7279\u522b\u654f\u611f\u7684\u89c6\u9525\u7ec6\u80de\u6216\u76f8\u5e94\u7684\u611f\u5e94\u8272\u7d20\uff0c\u4e0d\u540c\u6ce2\u957f\u7684\u5149\u8fdb\u5165\u773c\u775b\u540e\uff0c\u4e0e\u4e4b\u76f8\u7b26\u6216\u76f8\u8fd1\u7684\u89c6\u9525\u7ec6\u80de\u53d1\u751f\u4e0d\u540c\u7a0b\u5ea6\u7684\u5174\u594b\uff0c\u4e8e\u662f\u5728\u5927\u8111\u4ea7\u751f\u76f8\u5e94\u7684\u8272\u89c9\uff1b\u82e5\u4e09\u79cd\u89c6\u9525\u7ec6\u80de\u53d7\u5230\u540c\u7b49\u7a0b\u5ea6\u7684\u523a\u6fc0\uff0c\u90a3\u4e48\u4ea7\u751f\u6d88\u8272

    "},{"location":"DIP/Basic/DIP/#perception-priority-and-sensitivity","title":"Perception priority and sensitivity","text":"
    • Priority: Under the same setting, human notices first the hue (H) (\u8272\u8c03)changes, then the saturation (S) (\u9971\u548c\u5ea6), then the lightness value (V) (\u4eae\u5ea6).

    • Sensitivity: Human eyes are the most sensitive to the lightness changes and have the best resolution, which is responsible for the eyes\u2019 HDR capacity

    \u4eba\u773c\u5bf9\u4e8e\u4eae\u5ea6\u7684\u53d8\u5316\u6700\u4e3a\u654f\u611f\uff0c\u5206\u8fa8\u80fd\u529b\u6700\u5f3a\u3002\u6070\u597d\u4e0e\u4eba\u773c\u7684\u9ad8\u52a8\u6001\u80fd\u529b\u76f8\u5339\u914d\u3002

    "},{"location":"DIP/Basic/DIP/#definition-of-color-space","title":"Definition of color space","text":"
    • Device dependent color space model:RGB CMY HSV (HSV more similar to human's sensation)
    • Device independent color space model:Most of them are defined by CIE :CIE XYZ, CIE \\(L^*a^*b\\), CIE YUV
    "},{"location":"DIP/Basic/DIP/#rgb-color-model","title":"RGB color model","text":"

    RGB color model is a unit cube in a Cartesian coordinates system.

    • The magnitudes of each primary color are equivalent on the main diagonal line, which lead to the white color from darkness to brightness, i.e., grayscale. (0,0,0)-dark, (1,1,1)-bright.

    • The other 6 corners are respectively red, yellow, cyan, blue and magenta.(\u7ea2\u3001\u9ec4\u3001\u7eff\u3001\u9752\u3001\u84dd\u548c\u54c1\u7ea2)

    • RGB is a subset of CIE primary color space.

    • RGB is usually used in Color cathode ray tube and Color raster graphics display (computer , TV).

    RGB\u989c\u8272\u6a21\u578b\u901a\u5e38\u7528\u4e8e\u5f69\u8272\u9634\u6781\u5c04\u7ebf\u7ba1\u548c\u5f69\u8272\u5149\u6805\u56fe\u5f62\u663e\u793a\u5668\uff08\u8ba1\u7b97\u673a\u548c\u7535\u89c6\u673a\u91c7\u7528\uff09

    "},{"location":"DIP/Basic/DIP/#cmy-color-model","title":"CMY color model","text":"
    • \u5f69\u8272\u5370\u5237\u6216\u8005\u5f69\u8272\u6253\u5370\u7684\u7eb8\u5f20\u4e0d\u80fd\u53d1\u5c04\u5149\u7ebf\uff0c\u56e0\u800c\u5370\u5237\u673a\u6216\u6253\u5370\u673a\u5c31\u53ea\u80fd\u4f7f\u7528\u4e00\u4e9b\u80fd\u591f\u5438\u6536\u7279\u5b9a\u5149\u6ce2\u800c\u53cd\u5c04\u5176\u4ed6\u5149\u6ce2\u7684\u6cb9\u58a8\u6216\u8005\u989c\u8272

    • \u6cb9\u58a8\u6216\u989c\u6599\u76843\u79cd\u57fa\u8272\u662f\u4ee5\u7ea2\u3001\u7eff\u3001\u84dd\u4e09\u8272\u7684\u8865\u8272 : \u9752\uff08Cyan\uff09\u3001\u54c1\u7ea2\uff08Magenta\uff09\u3001\u9ec4\uff08Yellow\uff09\u4e3a\u57fa\u8272

    • \u7528CMY\u6a21\u578b\u4ea7\u751f\u7684\u989c\u8272\u79f0\u4e3a\u76f8\u51cf\u8272\uff0c\u662f\u56e0\u4e3a\u5b83\u51cf\u6389\u4e86\u4e3a\u89c6\u89c9\u7cfb\u7edf\u8bc6\u522b\u989c\u8272\u6240\u9700\u8981\u7684\u53cd\u5c04\u5149

    • CMY\u7a7a\u95f4\u4e0eRGB\u7a7a\u95f4\u4e92\u8865\uff0c\u4e5f\u5c31\u662f\u7528\u767d\u8272\u51cf\u53bbRGB\u7a7a\u95f4\u4e2d\u7684\u67d0\u4e00\u989c\u8272\u503c\u5c31\u7b49\u4e8e\u540c\u6837\u989c\u8272\u5728CMY\u7a7a\u95f4\u4e2d\u7684\u503c

    "},{"location":"DIP/Basic/DIP/#hsv-color","title":"HSV color","text":"

    HIS/HSV color space is defined based on human visual system.

    \u8272\u8c03\uff08Hue)\u3001\u8272\u9971\u548c\u5ea6\uff08Saturation\uff09\u548c\u4eae\u5ea6\uff08Intensity\uff0c\u6216\u8005Value\uff09

    • Hue, Saturation, Intensity/ValueHIS can be depicted as a cone
    • Top surface of cone: \\(V=1\\), which includes R=1, G=1, B=1.
    • Hue: around the axis: RED-- \\(0^o\\) , GREEN-- \\(120^o\\) , BLUE-- \\(240^o\\)
    • Saturation: along the radial direction.
    • Bottom point of cone: \\(V=0\\)\uff0c\\(H =null, S=null\\), for darkness.
    • Center of the top surface: \\(S=0, V=1, H=null\\), for brightness.

    Advantages:

    • Close to human color vision.
    • When using RGB or CMY, if you want to change hue, you must adjust R, G, and B at the same time. But using HSV, you DON\u2019T have to do that. Only ONE channel is adjusted.
    • HSV color model is a uniform color space, linearly distributed. The color difference perception is proportional to Euclidean distance on the HSV cone volume.

    "},{"location":"DIP/Basic/DIP/#cie-color-model","title":"CIE color model","text":""},{"location":"DIP/Basic/DIP/#cie-color-model_1","title":"CIE color model","text":"
    • A series of color models according to the response of human eyes to RGB, which are carefully measured.

    Device independent:

    • Such color models are used to define device-independent color.
    • Help people to reproduce color consistently on different devices such as scanner, monitor, and printer. CIE color modelsCIE XYZ, CIE \\(L^*a^*b\\) CIE YUV etc.
    "},{"location":"DIP/Basic/DIP/#cie-xyz","title":"CIE XYZ","text":"

    XYZ concept is based on the three-primary color theory, which describes human eyes have RGB receptors and all other color are mixture of RBG.

    • Computed by using functions\\(\\overline{x(\\lambda)},\\overline{y(\\lambda)},\\overline{z(\\lambda)}\\)

    • \\(Y_{xy}\\)color space given in 1931: Y->luminance, x,y are color coordinates computed based XYZ.

    • Describes the color range human can perceives.
    "},{"location":"DIP/Basic/DIP/#cie-lab","title":"CIE \\(L^*a^*b\\)","text":"
    • Defined in 1976
    • Modification of CIE XYZ
    • Overcomes the un-proportional problem in Yxy color space: \\(x,y\\) distance does not reflect the color difference you observe.
    • L: lightness a: green to red b: blue to yellow
    • L,a, b can be adjust separately.
    • \u662fCIE XYZ\u989c\u8272\u6a21\u578b\u7684\u6539\u8fdb\u578b\uff0c\u4ee5\u4fbf\u514b\u670d\u539f\u6765\u7684Yxy\u989c\u8272\u7a7a\u95f4\u5b58\u5728\u7684\u5728x\uff0cy\u8272\u5ea6\u56fe\u4e0a\u76f8\u7b49\u7684\u8ddd\u79bb\u5e76\u4e0d\u76f8\u5f53\u4e8e\u6211\u4eec\u6240\u89c9\u5bdf\u5230\u7684\u76f8\u7b49\u8272\u5dee\u7684\u95ee\u9898
    • \u5b83\u7684\u201cL\u201d\uff08\u660e\u4eae\u5ea6\uff09\uff0c\u201ca\u201d\uff08\u7eff\u8272\u5230\u7ea2\u8272\uff09\u548c\u201cb\u201d(\u84dd\u8272\u5230\u9ec4\u8272)\u4ee3\u8868\u8bb8\u591a\u7684\u503c
    • \u4e0eXYZ\u6bd4\u8f83\uff0cCIE \\(L^*a^*b*\\) \u989c\u8272\u66f4\u9002\u5408\u4e8e\u4eba\u773c\u7684\u611f\u89c9
    • \u989c\u8272\u7684\u4eae\u5ea6\uff08L\uff09\u3001\u7070\u9636\u548c\u9971\u548c\u5ea6\uff08a,b\uff09\u53ef\u4ee5\u5355\u72ec\u4fee\u6b63\uff0c\u8fd9\u6837\uff0c\u56fe\u50cf\u7684\u6574\u4e2a\u989c\u8272\u90fd\u53ef\u4ee5\u5728\u4e0d\u6539\u53d8\u56fe\u50cf\u6216\u5176\u4eae\u5ea6\u7684\u60c5\u51b5\u4e0b\uff0c\u53d1\u751f\u6539\u53d8\u3002
    "},{"location":"DIP/Basic/DIP/#cie-yuv","title":"CIE YUV","text":"

    \u5728\u73b0\u4ee3\u5f69\u8272\u7535\u89c6\u7cfb\u7edf\u4e2d\uff0c\u901a\u5e38\u91c7\u7528\u4e09\u7ba1\u5f69\u8272\u6444\u50cf\u673a\u6216\u5f69\u8272CCD\uff08\u7535\u8377\u8026\u5408\u5668\u4ef6\uff09\u6444\u50cf\u673a\uff0c\u5b83\u628a\u6444\u5f97\u7684\u5f69\u8272\u56fe\u50cf\u4fe1\u53f7\uff0c\u7ecf\u5206\u8272\uff0c\u5206\u522b\u653e\u5927\u6821\u6b63\u5f97\u5230RGB\uff0c\u518d\u7ecf\u8fc7\u77e9\u9635\u53d8\u6362\u7535\u8def\u5f97\u5230\u4eae\u5ea6\u4fe1\u53f7Y\u548c\u4e24\u4e2a\u8272\u5dee\u4fe1\u53f7R\uff0dY\u3001B\uff0dY\uff0c\u6700\u540e\u53d1\u9001\u7aef\u5c06\u4eae\u5ea6\u548c\u8272\u5dee\u4e09\u4e2a\u4fe1\u53f7\u5206\u522b\u8fdb\u884c\u7f16\u7801\uff0c\u7528\u540c\u4e00\u4fe1\u9053\u53d1\u9001\u51fa\u53bb,\u8fd9\u5c31\u662f\u6211\u4eec\u5e38\u7528\u7684YUV\u989c\u8272\u7a7a\u95f4

    \u91c7\u7528YUV\u989c\u8272\u7a7a\u95f4\u7684\u91cd\u8981\u6027\u662f\u5b83\u7684\u4eae\u5ea6\u4fe1\u53f7Y\u548c\u8272\u5ea6\u4fe1\u53f7U\u3001V\u662f\u5206\u79bb\u7684

    • \u5982\u679c\u53ea\u6709Y\u4fe1\u53f7\u5206\u91cf\u800c\u6ca1\u6709U\u3001V\u5206\u91cf\uff0c\u90a3\u4e48\u8fd9\u6837\u8868\u793a\u7684\u56fe\u5c31\u662f\u9ed1\u767d\u7070\u5ea6\u56fe
    • \u5f69\u8272\u7535\u89c6\u91c7\u7528YUV\u7a7a\u95f4\u6b63\u662f\u4e3a\u4e86\u7528\u4eae\u5ea6\u4fe1\u53f7Y\u89e3\u51b3\u5f69\u8272\u7535\u89c6\u673a\u4e0e\u9ed1\u767d\u7535\u89c6\u673a\u7684\u517c\u5bb9\u95ee\u9898\uff0c\u4f7f\u9ed1\u767d\u7535\u89c6\u673a\u4e5f\u80fd\u63a5\u6536\u5f69\u8272\u4fe1\u53f7\u3002
    "},{"location":"DIP/Basic/DIP/#transformation-between-color-spaces","title":"Transformation between color spaces","text":""},{"location":"DIP/Basic/DIP/#rgb-cmy","title":"RGB<->CMY","text":"

    \\(RGB->CMY\\\\ C = 255 \u2013 R\\\\ M = 255 \u2013 G\\\\ Y = 255 \u2013 B\\\\\\)

    "},{"location":"DIP/Basic/DIP/#rgb-hsv","title":"RGB<->HSV","text":"

    Search in table:

    • CIE has defined transformation tables

    \\(RGB<->XYZ\\\\HSV<->XYZ\\)

    • Compute directly

    "},{"location":"DIP/Basic/DIP/#rgb-cie-xyz-in-a-computable-way","title":"RGB<->CIE XYZ in a computable way","text":"

    \\(\\begin{gathered}\\begin{bmatrix} X \\\\ Y \\\\ Z\\end{bmatrix}=\\begin{bmatrix} 0.608 & 0.714 & 0.200 \\\\0.299& 0.587&0.133 \\\\0.000 &0.066& 1.112\\end{bmatrix}\\begin{bmatrix} R \\\\ G\\\\ B\\end{bmatrix}\\quad\\end{gathered}\\)

    "},{"location":"DIP/Basic/DIP/#cie-xyz-cie-lab","title":"CIE XYZ<->CIE Lab*","text":""},{"location":"DIP/Basic/DIP/#rgb-yuv","title":"RGB \u548c YUV \u7684\u76f8\u4e92\u8f6c\u5316","text":"

    RGB\uff08\u7ea2\u7eff\u84dd\uff09\u548cYUV\u662f\u4e24\u79cd\u989c\u8272\u8868\u793a\u65b9\u5f0f\uff0c\u5e38\u7528\u4e8e\u56fe\u50cf\u548c\u89c6\u9891\u5904\u7406\u4e2d\u3002RGB\u662f\u4e00\u79cd\u76f4\u63a5\u8868\u793a\u989c\u8272\u7684\u65b9\u5f0f\uff0c\u5176\u4e2d\u7ea2\u8272\uff08R\uff09\u3001\u7eff\u8272\uff08G\uff09\u548c\u84dd\u8272\uff08B\uff09\u5206\u91cf\u7684\u503c\u51b3\u5b9a\u4e86\u989c\u8272\u7684\u5177\u4f53\u5916\u89c2

    • RGB\u53ef\u4ee5\u6d6e\u70b9\u8868\u793a\u65b9\u5f0f\uff1a\u53d6\u503c\u8303\u56f4\u4e3a 0.0 ~ 1.0
    • \u6216\u4ee5\u6574\u6570\u8868\u793a\uff1a\u53d6\u503c\u8303\u56f4\u4e3a 0 ~ 255 \u6216\u8005 00 ~ FF\u3002RGB \u989c\u8272\u6a21\u578b \u901a\u5e38\u7528\u4e8e\u5f69\u8272\u9634\u6781\u5c04\u7ebf\u7ba1\u548c\u5f69\u8272\u5149\u6805\u56fe\u5f62\u663e\u793a\u5668(\u8ba1\u7b97\u673a\u548c\u7535\u89c6\u673a\u91c7\u7528)\u3002

    • YUV\u662f\u4e00\u79cd\u989c\u8272\u7a7a\u95f4\uff0c\u57fa\u4e8e YUV \u7684\u989c\u8272\u7f16\u7801\u662f\u6d41\u5a92\u4f53\u7684\u5e38\u7528\u7f16\u7801\u65b9\u5f0f\uff0c\u8fd9\u79cd\u8868\u8fbe\u65b9\u5f0f\u8d77\u521d\u662f\u4e3a\u4e86\u5f69\u8272\u7535\u89c6\u4e0e\u9ed1\u767d\u7535\u89c6\u4e4b\u95f4\u7684\u4fe1\u53f7\u517c\u5bb9\uff1b\u5176\u4e2d\uff1aY\uff1a\u8868\u793a\u660e\u4eae\u5ea6\uff08Luminance \u6216 Luma\uff09\uff0c\u4e5f\u79f0\u7070\u5ea6\u56fe\u3002U\u3001V\uff1a\u8868\u793a\u8272\u5ea6\uff08Chrominance \u6216 Chroma\uff09\uff0c\u4f5c\u7528\u662f\u63cf\u8ff0\u5f71\u50cf\u7684\u8272\u5f69\u53ca\u9971\u548c\u5ea6\uff0c\u7528\u4e8e\u6307\u5b9a\u50cf\u7d20\u7684\u989c\u8272\u3002

    • RGB\u8f6c\u5316\u4e3aYUV\u7684\u516c\u5f0f\u5982\u4e0b\uff1a

    \\(\\begin{gathered}\\begin{bmatrix} Y \\\\ U \\\\ V\\end{bmatrix}=\\begin{bmatrix} 0.299 & 0.587 & 0.114 \\\\ \u22120.147& \u22120.289 &0.435 \\\\0.615 &\u22120.515& \u22120.100\\end{bmatrix}\\begin{bmatrix} R \\\\ G\\\\ B\\end{bmatrix}\\quad\\end{gathered}\\)

    • YUV \u8f6c\u5316\u4e3aRGB\u7684\u516c\u5f0f\u5982\u4e0b\uff1a

    \\(\\begin{gathered}\\quad\\quad\\begin{bmatrix} R \\\\ G \\\\ B\\end{bmatrix}=\\begin{bmatrix} 1.0000 &0.0000& 1.3707 \\\\1.0000& \u22120.3376 &-0.6980 \\\\ 1.0000&1.7324& 0.0000\\end{bmatrix}\\begin{bmatrix} Y \\\\ U\\\\ V\\end{bmatrix}\\quad\\end{gathered}\\)

    • \u7531BMP\u5f69\u8272\u56fe\u8f6c\u4e3a\u7070\u5ea6\u56fe\u65f6\uff0c\u53ea\u9700\u5c06RGB\u8f6c\u4e3aYUV\uff0c\u5e76\u53ea\u4fdd\u7559 Y\u5206\u91cf \u5373\u53ef\u5f97\u5230\u7070\u5ea6\u56fe\u5728\u8c03\u8282BMP\u56fe\u7247\u4eae\u5ea6\u65f6\uff0c\u53ea\u9700\u5c06RGB\u8f6c\u4e3aYUV\uff0c\u6539\u53d8 Y \u5206\u91cf\u7684\u503c\uff0c\u968f\u540e\u5c06 YUV \u8f6c\u56de RGB \u5373\u53ef\u5f97\u5230\u88ab\u66f4\u6539\u8fc7\u4eae\u5ea6\u7684\u56fe\u7247
    "},{"location":"DIP/Basic/DIP/#jpeg-format","title":"JPEG Format","text":"
    • File extension: .JPEG, .JFIF, .JPG, .JPE

    • Compression format for static image :

    As a counterpart of Moving Picture Expert Group.

    Lossy encoding method

    Allow user to make balance between image quality and image size.

    • Encoding based on transformation, e.g. Discrete Cosine Transformation (DCT)JPEG2000 is based on wavelet.

    • Different manipulations for high-frequency signal and low-frequency signal.

    "},{"location":"DIP/Basic/DIP/#compression-strategy","title":"Compression Strategy","text":"

    Compression strategy: According to the requirement of compression ratio, remove information from high frequency to low frequency.

    Advantages:

    • High frequency information occupies much more memory. Hence, high frequency removal leads to high compression ratio
    • Low frequency information preserves the principle structure and color distribution of object, which is the key factors of an image.
    • Suitable for internet based visual media.

    \u538b\u7f29\u7b56\u7565\uff1a\u6839\u636e\u538b\u7f29\u6bd4\u8981\u6c42\uff0c\u4ece\u9ad8\u9891\u5230\u4f4e\u9891\u9010\u6b65\u524a\u51cf\u4fe1\u606f

    • \u9ad8\u9891\u4fe1\u606f\u5360\u7528\u5b58\u50a8\u7a7a\u95f4\u5927\uff0c\u51cf\u5c11\u9ad8\u9891\u4fe1\u606f\u66f4\u5bb9\u6613\u83b7\u5f97\u9ad8\u538b\u7f29\u6bd4
    • \u4f4e\u9891\u4fe1\u606f\u53ef\u4ee5\u4fdd\u7559\u7269\u4f53\u7684\u57fa\u672c\u8f6e\u5ed3\u548c\u8272\u5f69\u5206\u5e03\uff0c\u6700\u5927\u9650\u5ea6\u7ef4\u6301\u56fe\u50cf\u8d28\u91cf
    • \u9002\u5408\u7528\u4e8e\u4e92\u8054\u7f51
    • \u4eba\u773c\u5bf9\u4e8e\u4e00\u4e2a\u76f8\u5bf9\u8f83\u5927\u8303\u56f4\u7684\u533a\u57df\uff0c\u8fa8\u522b\u8272\u5f69\u7ec6\u5fae\u5dee\u5f02\u80fd\u529b\u6bd4\u8f83\u5f3a\uff08\u4f4e\u9891\uff09\uff0c\u4f46\u5bf9\u4e8e\u9ad8\u9891\u533a\u57df\uff0c\u5374\u8868\u73b0\u4e00\u822c
    • \u53d7\u6b64\u542f\u53d1\uff0c\u4eba\u4eec\u53ef\u4ee5\u5bf9\u9ad8\u9891\u90e8\u5206\u8fdb\u884c\u91cf\u5316\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u628a\u9891\u57df\u4e0a\u7684\u6bcf\u4e2a\u5206\u91cf\uff0c\u9664\u4ee5\u9488\u5bf9\u8be5\u5206\u91cf\u7684\u5e38\u6570\uff0c\u7136\u540e\u56db\u820d\u4e94\u5165\u53d6\u6574\uff0c\u8fd9\u6837\u4e00\u822c\u4f1a\u628a\u9ad8\u9891\u5206\u91cf\u53d8\u4e3a0
    • \u4f46\u8fd9\u6837\u64cd\u4f5c\u5c31\u8981\u6c42\u9488\u5bf9\u6bcf\u4e00\u4e2a\u5206\u91cf\u8bbe\u7f6e\u4e00\u4e2a\u5e38\u6570\u503c\uff0c\u6240\u4ee5\u5c31\u6700\u7ec8\u5f62\u6210\u4e86\u91cf\u5316\u8868\u3002

    More specifically,refer to the PPT(Chapter I)

    "},{"location":"DIP/Basic/DIP/#disadvantages","title":"Disadvantages","text":"
    • Not for line drawing, text, symbol, icon, etc..
    • Its lossy compression leads to unavoidable artifacts.

    \u4e0d\u9002\u5408\u7528\u4e8e\u7ebf\u6761\u753b\u3001\u6587\u5b57\u3001\u56fe\u6807\u7b49\uff0c\u5176\u6709\u635f\u538b\u7f29\u4f1a\u5bfc\u81f4\u8fd9\u7c7b\u5bf9\u8c61\u7684\u7455\u75b5\u4e25\u91cd

    "},{"location":"DIP/Basic/DIP/#tiff-format","title":"TIFF format","text":""},{"location":"DIP/Basic/DIP/#gif-format","title":"GIF format","text":""},{"location":"DIP/Basic/DIP/#chains","title":"Chains","text":"

    Chains are used for description of object borders

    Chains can be represented using static data structures (e.g., 1D arrays); their size is the longest length of the chain expected.

    "},{"location":"DIP/Basic/DIP/#run-length-encoding-rle","title":"Run length encoding (RLE)","text":"

    RLE is run-length encoding. It is used to encode the location of foreground objects in segmentation. Instead of outputting a mask image, you give a list of start pixels and how many pixels after each of those starts is included in the mask.

    • In binary images, run length coding records only areas that belong to the object in the image,the area is then represented as a list of lists.
    • Each row of the image is described by a sublist, the first element of which is the row number. Subsequent terms are coordinate pairs; the first element of a pair is the beginning of a run and the second is the end.
    • There can be several such sequences in the row.

    "},{"location":"DIP/DL/DL/","title":"Deep Learning","text":"
    • CNNs have won several competitions
    • ImageNet, Kaggle Facial Expression, Kaggle Multimodal Learning, German Traffic Signs, Handwriting, \u2026.

    • CNNs are deployed in many practical applications

    • Image recognition, speech recognition, Google\u2019s and Baidu\u2019s photo taggers

    • xCNNs are applicable to array data where nearby values are correlated

    • Images, sound, time-frequency representations, video, volumetric images, RGB-Depth images, \u2026

    • CNN is one of the few deep models that can be trained in supervised way.

    • Easy to understand and implement.
    "},{"location":"DIP/DL/DL/#what-is-the-neural","title":"What is the neural ?","text":""},{"location":"DIP/DL/DL/#multilayer-neural-network","title":"Multilayer neural network","text":"
    • And return to repeat step 1-3 until error is smaller than threshold
    "},{"location":"DIP/DL/DL/#back-propagation","title":"Back propagation","text":"

    https://towardsdatascience.com/understanding-backpropagation-algorithm-7bb3aa2f95fd

    http://galaxy.agh.edu.pl/%7Evlsi/AI/backp_t_en/backprop.html

    • Proof https://towardsdatascience.com/backpropagation-the-natural-proof-946c5abf63b1

    • \\(\\eta\\) \u5b66\u4e60\u7387

    \u5b66\u4e60\u7387\u4f4e\uff0c\u6536\u655b\u6162\uff0c\u5bb9\u6613\u6389\u5230\u5751\u91cc\u9677\u5165\u5c40\u90e8\u6700\u4f18\uff1b\u5b66\u4e60\u7387\u9ad8\uff0c\u53ef\u80fd\u4f7f\u5f97\u6536\u655b\u8fc7\u7a0b\u4e0d\u7a33\u5b9a\uff0c\u6765\u56de\u9707\u8361\uff0c\u4e00\u76f4\u4e0d\u6536\u655b

    idea:

    • \u8bbe\u7f6e\u4e0d\u540c\u7684\u5b66\u4e60\u7387\uff0c\u770b\u54ea\u79cd\u60c5\u51b5\u6700\u597d
    • \u8bbe\u8ba1\u4e00\u4e2a\u81ea\u9002\u5e94\u5b66\u4e60\u7387\u3002\u6b64\u65f6\u5b66\u4e60\u7387\u4e0d\u518d\u56fa\u5b9a\uff0c\u53ef\u4ee5\u901a\u8fc7\u5916\u5728\u6761\u4ef6\u7b97(\u68af\u5ea6\uff0c\u5b66\u4e60\u8981\u6709\u591a\u5feb\uff0c\u7279\u5f81\u6743\u91cd\u7684\u5927\u5c0f...)
    "},{"location":"DIP/DL/DL/#deep-learning-for-image-understanding","title":"Deep Learning For Image Understanding","text":""},{"location":"DIP/DL/DL/#advantages-for-convolution","title":"Advantages for convolution","text":"

    Example:

    • 200x200 image
    • 10 filters of size 10x10
    • 10 feature maps of size 200x200
    • 400,000 hidden units with 10x10
    • fields=1000 parameters

    \u4e3a\u4ec0\u4e48\u5f15\u5165CNN\u53ef\u4ee5\u5927\u89c4\u6a21\u51cf\u5c11\u6743\u6570\u53c2\u6570\u8bad\u7ec3\u91cf\u56e0\u4e3aCNN\u901a\u8fc7

    1\uff09 \u5c40\u90e8\u8fde\u63a5\uff08Local Connectivity\uff09

    2\uff09 \u6743\u503c\u5171\u4eab\uff08Shared Weights\uff09

    3\uff09 \u6c60\u5316\uff08Pooling\uff09

    • \u6765\u964d\u4f4e\u53c2\u6570\u91cf
    "},{"location":"DIP/DL/DL/#pooling","title":"Pooling","text":"

    CNN\u6c60\u5316\u53ef\u4ee5\u901a\u8fc7\u6c60\u5316\u5c42\u6765\u964d\u4f4e\u5377\u79ef\u5c42\u8f93\u51fa\u7684\u7279\u5f81\u7ef4\u5ea6\uff0c\u5728\u6709\u6548\u51cf\u5c11\u7f51\u7edc\u53c2\u6570\u7684\u540c\u65f6\u8fd8\u53ef\u4ee5\u9632\u6b62\u8fc7\u62df\u5408\u73b0\u8c61

    https://zhuanlan.zhihu.com/p/78760534

    "},{"location":"DIP/DL/DL/#cnn-in-detail","title":"CNN in Detail","text":"
    • \u6b65\u957f\uff1f

    • Refer to the PPT !

    • \u4f20\u7edf\u56fe\u50cf\u5206\u7c7b\uff1a\u5206\u6bb5\uff1b\u6df1\u5ea6\u5b66\u4e60\u56fe\u50cf\u5206\u7c7b\uff1a\u7aef\u5230\u7aef
    • \u4ea4\u53c9\u5546

    • Minimize Loss - Gradient Descent.
    "},{"location":"DIP/Fourier/Fourier/","title":"Fourier transform","text":"

    Many mathematicians tried to find a way to approximate a complex function by some simple functions for many years. Apart from the theoretical concern, this technique is invaluable for many practical applications.

    Before the invention of differential calculus, this problem kept open.

    "},{"location":"DIP/Fourier/Fourier/#fourier-transform","title":"Fourier Transform","text":"
    • British mathematician Taylor invented a method to represent one analytic function by infinite linear combination of power functions.
    • In the middle of 18th century, Fourier found that the infinite linear combination of trigonometric functions could represent a general function in a finite interval, when he was studying the heat propagation problem.
    Fourier

    \\(\\begin{align*}f(x)&=\\frac{1}{2}a_0+\\sum_{n=1}^{\\infty}a_ncos(nx)+\\sum_{n=1}^{\\infty}b_nsin(nx)\\\\ a_0 &= \\frac{1}{\\pi}\\int_{-\\pi}^{\\pi}f(x)dx\\\\a_n &= \\frac{1}{\\pi}\\int_{-\\pi}^{\\pi}f(x)cos(nx)dx\\\\b_n &= \\frac{1}{\\pi}\\int_{-\\pi}^{\\pi}f(x)sin(nx)dx \\end{align*}\\)

    Just like Calculus invented by Newton, Fourier analysis is another mathematical tool

    • BIOM: fake iris detection
    • CS: anti-aliasing in computer graphics
    "},{"location":"DIP/Fourier/Fourier/#complex-numbers","title":"Complex Numbers","text":"
    • Magnitude-Phase\uff08vector\uff09\\(x=|x|e^{j\\phi(x)}\\) where \\(|x|=\\sqrt{a^2+b^2}\\ \\phi(x)=tan^{-1(\\frac{b}{a})}\\)

    • Basic Properties

    \\(xy=|x|e^{j\\phi(x)}|y|e^{j\\phi(y)}=|x||y|e^{j(\\phi(x)+\\phi(y))}\\)

    \\(|x|=|x^*|\\)

    \\(\\phi(x)=-\\phi(x^*)\\)

    \\(xx^*=|x|^2\\)

    • Euler\u2019s formula \\(e^{j\\theta}=cos\\theta + isin\\theta\\)
    Basic Properties

    "},{"location":"DIP/Fourier/Fourier/#image-transform","title":"Image Transform","text":"

    Many times, image processing tasks are best performed in transformed domain other than the spatial domain.

    Key steps:

    (1) Transform the image

    (2) Carry out the task(s) in the transformed domain.

    (3) Apply inverse transform to return to the spatial domain.

    "},{"location":"DIP/Fourier/Fourier/#transformation-kernels","title":"Transformation Kernels","text":""},{"location":"DIP/Fourier/Fourier/#continuous-fourier-transform-ft","title":"Continuous Fourier Transform (FT)","text":"
    • \\(1-D\\)

    Transforms a signal (i.e., function) from the spatial domain to the frequency domain.

    • Example: Removing undesirable frequencies

    To remove certain frequencies, set their corresponding F(u) coefficients to zero!

    • How do frequencies show up in an image?

    Low frequencies correspond to slowly varying information (e.g., continuous surface).

    High frequencies correspond to quickly varying information (e.g., edges)

    • \\(2-D\\)

    "},{"location":"DIP/Fourier/Fourier/#discrete-fourier-transform-dft","title":"Discrete Fourier Transform (DFT)","text":"
    • \\(2-D\\)

    \u4e8c\u7ef4\u79bb\u6563\u5085\u7acb\u53f6\u53d8\u6362\u5b9a\u4e49\u4e3a

    \u4e8c\u7ef4\u79bb\u6563\u5085\u7acb\u53f6\u9006\u53d8\u6362\u5b9a\u4e49\u4e3a

    \u4e3a\u4e86\u65b9\u4fbf\uff0c\u6211\u4eec\u53ef\u5c06\u4e0a\u8ff0\u4e24\u5f0f\u6539\u4e3a\u5411\u91cf\u5f62\u5f0f

    \u5176\u4e2d \u3002

    For Images

    \\((u,v)\\)-- \u76f8\u4f4d

    \\(F(u,v)\\)-- \u5e45\u503c

    "},{"location":"DIP/Fourier/Fourier/#fast-fourier-transformfft","title":"Fast Fourier Transform\uff08FFT\uff09","text":"

    Speed up the discrete Fourier Transform

    There are many repetitive work in the computation.

    Cooley and Tukey presented in 1965:

    • Divide the original N-points sequence into several short sequence successively
    • Compute the Discrete Fourier Transform of these short sequences
    • Make up the wanted transform value
    • Computational workload: \\(2N^2\\rightarrow2Nlog_2N\\)
    "},{"location":"DIP/Fourier/Fourier/#fft-principle","title":"FFT Principle","text":"
    • \u52d8\u8bef\uff1a \\(F(k)=\\frac{1}{N}\\sum_{n=0}^{N-1}f(n)e^{-j2\\pi kn/N}\\)
    • HENCE \\(F(k+M)=\\lfloor F_e(k)-F_o(k)W_{2M}^k\\rfloor\\)!!

    • \u610f\u4e49\uff1a\u5bf9\u4e00\u4e2a\u957f\u5ea6\u4e3a N \u7684\u5e8f\u5217\u8fdb\u884c\u5085\u7acb\u53f6\u53d8\u6362\u53ef\u4ee5\u901a\u8fc7\u5c06\u5176\u5206\u6210\u4e24\u534a\u8ba1\u7b97\uff0c\u5bf9\u7b2c\u4e00\u90e8\u5206\u7684\u8ba1\u7b97\u9700\u8981\u901a\u8fc7\u8ba1\u7b97\u4e24\u4e2a\u957f\u5ea6\u4e3a N/2 \u957f\u5ea6\u5e8f\u5217\u7684\u5085\u7acb\u53f6\u53d8\u6362\u5f0f\u8fdb\u884c\uff0c\u7136\u540e\u5229\u7528\u8fd9\u4e24\u4e2a\u957f\u5ea6\u4e3a N/2 \u7684\u5e8f\u5217\u53ef\u4ee5\u5f97\u5230\u7b2c\u4e8c\u90e8\u5206\u7684\u503c

    "},{"location":"DIP/Fourier/Fourier/#magnitude-and-phase-of-dft","title":"Magnitude and Phase of DFT","text":"

    Hint: use inverse DFT to reconstruct the image by magnitude or phase only information

    • magnitude determines the contribution of each component!(cannot be used to reconstruct a image!)

    • phase determines which components are present!

    • PHASE is more important!

    "},{"location":"DIP/chap2/chap2/","title":"Binary Image and Morphological Operation","text":""},{"location":"DIP/chap2/chap2/#binary-image","title":"Binary image","text":"

    \u4f18\u70b9\uff1a\u66f4\u5c0f\u7684\u5185\u5b58\u9700\u6c42 \u8fd0\u884c\u901f\u5ea6\u66f4\u5feb \u4e3a\u4e8c\u503c\u56fe\u50cf\u5f00\u53d1\u7684\u7b97\u6cd5\u5f80\u5f80\u53ef\u4ee5\u7528\u4e8e\u7070\u5ea6\u7ea7\u56fe\u50cf \u66f4\u4fbf\u5b9c \u7f3a\u70b9\uff1a\u5e94\u7528\u8303\u56f4\u6bd5\u7adf\u6709\u9650\uff1b \u66f4\u65e0\u6cd5\u63a8\u5e7f\u5230\u4e09\u7ef4\u7a7a\u95f4\u4e2d\u8868\u73b0\u529b\u6b20\u7f3a\uff0c\u4e0d\u80fd\u8868\u73b0\u7269\u4f53\u5185\u90e8\u7ec6\u8282\u65e0\u6cd5\u63a7\u5236\u5bf9\u6bd4\u5ea6

    "},{"location":"DIP/chap2/chap2/#_1","title":"\u56fe\u50cf\u4e8c\u503c\u5316\uff1a","text":""},{"location":"DIP/chap2/chap2/#1","title":"\uff081\uff09\u4e8c\u503c\u56fe\u50cf","text":"

    \u4e8c\u503c\u56fe\u50cf\uff08Binary Image\uff09\u4e2d\uff0c\u50cf\u7d20\u503c\u9650\u5b9a\u4e3a \\(0\\) \u6216 \\(1\\)\uff08\u7f16\u7a0b\u4e2d\u4e00\u822c\u7528 \\(0\\) \u548c\\(255\\) \u6765\u6784\u9020\u4e8c\u503c\u56fe\u50cf)\u3002

    • \u4f18\u70b9\uff1a\u5360\u7528\u66f4\u5c11\u5185\u5b58\u3001\u66f4\u9ad8\u6548\uff0c\u6709\u65f6\u53ef\u5e94\u7528\u4e8e\u7070\u5ea6\u56fe\u50cf\uff0c\u540c\u65f6\u66f4\u52a0\u4fbf\u5b9c\u3002
    • \u7f3a\u70b9\uff1a\u5e94\u7528\u9886\u57df\u6709\u9650\uff0c\u4e0d\u80fd\u7528\u4e8e\u4e09\u7ef4\u6570\u636e\uff0c\u8868\u8fbe\u80fd\u529b\u8f83\u5f31\uff0c\u96be\u4ee5\u4f20\u8fbe\u89c6\u89c9\u7ec6\u8282\uff0c\u4e5f\u4e0d\u80fd\u63a7\u5236\u5bf9\u6bd4\u5ea6\u3002
    "},{"location":"DIP/chap2/chap2/#2otsus-algorithm","title":"\uff082\uff09\u5927\u6d25\u7b97\u6cd5\uff08Otsu's algorithm\uff09","text":"

    \u5728\u628a\u7070\u5ea6\u56fe\u8f6c\u6362\u4e3a\u4e8c\u503c\u56fe\u50cf\u7684\u65f6\u5019\uff0c\u4e00\u4e2a\u57fa\u672c\u7684\u60f3\u6cd5\u662f\u627e\u5230\u4e00\u4e2a\u5408\u9002\u7684\u9608\u503c\uff08Threshold\uff09\uff0c\u50cf\u7d20\u70b9\u503c\u6bd4\u9608\u503c\u5927\u7684\u8bbe\u4e3a\\(255\\)\uff0c\u6bd4\u9608\u503c\u5c0f\u7684\u8bbe\u4e3a\\(0\\)\u3002\u5373\u4e3a\u5982\u4e0b\uff1a

    \\(\\left\\{ \\begin{array}{**lr**} I(x,y) = 0\\ if\\ I(x,y)\\leq Threshold \\\\ I(x,y) = 255\\ if\\ I(x,y)\\geq Threshold \\\\ \\end{array} \\right.\\)

    • \u800c\u5927\u6d25\u7b97\u6cd5\u5c31\u662f\u4e00\u79cd\u81ea\u52a8\u786e\u5b9a\u8be5\u5408\u9002\u9608\u503c\u7684\u65b9\u6cd5\uff0c\u65e8\u5728\u627e\u5230\u4e00\u4e2a\u9608\u503c\uff0c\u5c06\u56fe\u50cf\u5206\u6210\u4e24\u4e2a\u7c7b\u522b\uff08\u524d\u666f\u548c\u80cc\u666f\uff09\uff0c\u4ee5\u4f7f\u4e24\u4e2a\u7c7b\u522b\u5185\u7684\u65b9\u5dee\u6700\u5c0f\uff0c\u540c\u65f6\u4e24\u4e2a\u7c7b\u522b\u4e4b\u95f4\u7684\u65b9\u5dee\u6700\u5927\uff0c\u6b65\u9aa4\u5982\u4e0b\u3002

    a.\u7edf\u8ba1\u50cf\u7d20\u70b9\u7684\u6700\u5927\u503c\u548c\u6700\u5c0f\u503c

    b.\u5bf9\u4e8e\u6bcf\u4e2a\u53ef\u80fd\u7684\u9608\u503c\uff0c\u8ba1\u7b97\u5206\u6210\u4e24\u4e2a\u7c7b\u522b\u540e\u7684\u80cc\u666f\u548c\u524d\u666f\u7684\u5185\u90e8\u534f\u65b9\u5dee\u548c\u5916\u90e8\u534f\u65b9\u5dee\u3002

    c.\u9009\u62e9\u6700\u5927\u5916\u90e8\u548c\u6700\u5c0f\u5185\u90e8\u534f\u65b9\u5dee\u5bf9\u5e94\u7684 threshold\u4f5c\u4e3a\u4e8c\u503c\u5316\u9608\u503c\u3002

    d.\u5e94\u7528\u9009\u62e9\u7684\u9608\u503c\u5c06\u56fe\u50cf\u5206\u5272\u6210\u524d\u666f\u548c\u80cc\u666f\u3002

    \u5176\u4e2d\uff0c\u6700\u5927\u5916\u90e8\u65b9\u5dee\u548c\u6700\u5c0f\u5185\u90e8\u65b9\u5dee\u662f\u7b49\u4ef7\u7684\uff0c\u6211\u4eec\u9009\u62e9\u627e\u5230\u6700\u5927\u5916\u90e8\u65b9\u5dee\uff0c\u63a8\u5bfc\u8fc7\u7a0b\u5982\u4e0b\uff1a

    \u8bbe\u56fe\u50cf\u5c3a\u5bf8\u4e3a\\(M\\ *\\ N\\)\uff0c\u5176\u4e8c\u503c\u5316\u7684\u6700\u4f73\u9608\u503c\u4e3a\\(T\\)\uff0c\u8be5\u9608\u503c\u5c06\u56fe\u50cf\u5206\u4e3a\u80cc\u666f\u548c\u76ee\u6807\u4e24\u4e2a\u7c7b\u522b\u3002\u5176\u4e2d\u5c5e\u4e8e\u80cc\u666f\u7684\u50cf\u7d20\u70b9\u6570\u91cf\u4e3a\\(N0\\),\u5c5e\u4e8e\u76ee\u6807\u7684\u50cf\u7d20\u70b9\u6570\u91cf\u4e3a\\(N1\\),\u80cc\u666f\u50cf\u7d20\u70b9\u6570\u5360\u6574\u5e45\u56fe\u50cf\u7684\u6bd4\u4f8b\\(\\omega0\\),\u5176\u7070\u5ea6\u5747\u503c\\(\u03bc0\\),\u76ee\u6807\u50cf\u7d20\u70b9\u6570\u5360\u6574\u5e45\u56fe\u50cf\u7684\u6bd4\u4f8b\u4e3a\\(\u03c91\\),\u5176\u7070\u5ea6\u5747\u503c\u4e3a\\(\u03bc1\\) \uff0c\u6574\u5e45\u56fe\u50cf\u7684\u7070\u5ea6\u5747\u503c\u4e3a\\(\\mu\\)\u3002

    \\(\\omega_0=\\frac{N0}{M*N}\\\\\\) \\(\\omega_1=\\frac{N1}{M*N}\\) \\(N0+N1=M*N\\\\\\) \\(\\omega0\\ + \\omega1\\ = 1\\\\\\)

    \\(\\mu = \\frac{\\mu0*N0+\\mu1*N1}{M*N}=\\mu0\\omega0\\ + \\mu1\\omega1\\\\\\)

    \\(\u7c7b\u5185\u65b9\u5dee(Within-class\\ variance)\u516c\u5f0f:\\)

    \\(\\sigma_{Withen}^{2}=\\omega_{0} \\sigma_{0}^{2}+\\omega_{1} \\sigma_{1}^{2} \\\\\\)

    \\(\u7c7b\u95f4\u65b9\u5dee(Between-class\\ variance)\u7684\u516c\u5f0f:\\sigma_{Between}^{2}=\\sigma^{2}-\\sigma_{Within}^{2}\\\\\\)

    \\(\u6709\u6b64\u53ef\u63a8\u5bfc\u5f97\u5230\\)

    \\(\\sigma_{Between}^{2}=\\omega_{0}(\\mu_{0}-\\mu)^{2}+\\omega_{1}(\\mu_{1}-\\mu)^{2}\\)

    \\(\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ =\\omega0(\\mu0-\\omega0\\mu0-\\omega1\\mu1)^{2}+\\omega1(\\mu1-\\omega0\\mu0-\\omega1\\mu1)^{2}\\) \\(\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ =\\omega0(\\omega1\\mu0-\\omega1\\mu1)^{2}+\\omega1(\\omega0\\mu1-\\omega0\\mu0)^{2}\\\\\\) \\(\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ =(\\omega0\\omega1^{2}+\\omega1\\omega0^{2})(\\mu1-\\mu0)^{2}\\\\\\)

    \\(\\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ =\\omega0\\omega1(\\mu0-\\mu1)^{2}\\\\\\)

    • \u5373\u5728\u8ba1\u7b97\u6700\u5927\u5916\u90e8\u548c\u6700\u5c0f\u5185\u90e8\u65b9\u5dee\u65f6\uff0c\u53ea\u9700\u5224\u65ad\\(\\omega0\\omega1(\\mu0-\\mu1)^{2}\\)\u53d6\u5f97\u6700\u5927\u503c\u5373\u53ef

    Step 1: \u786e\u5b9a\u539f\u59cb\u56fe\u50cf\u4e2d\u50cf\u7d20\u7684\u6700\u5927\u503c\u548c\u6700\u5c0f\u503c

    Step 2: \u6700\u5c0f\u503c\u52a01\u4f5c\u4e3a\u521d\u59cbthreshold\u5bf9\u539f\u59cb\u56fe\u50cf\u8fdb\u884c\u4e8c\u503c\u5316\u64cd\u4f5c

    Step 3: \u6839\u636e\u5bf9\u5e94\u5173\u7cfb\u786e\u5b9a\u524d\u666f\u548c\u80cc\u666f\uff0c\u5206\u522b\u8ba1\u7b97\u5f53\u524dthreshold\u4e0b\u7684\u5185\u90e8\u534f\u65b9\u5dee\u548c\u5916\u90e8\u534f\u65b9\u5dee

    Step 4: \u56de\u5230Step 2\u76f4\u5230\u8fbe\u5230\u50cf\u7d20\u6700\u5927\u503c

    Step 5\uff1a\u627e\u5230\u6700\u5927\u5916\u90e8\u548c\u6700\u5c0f\u5185\u90e8\u534f\u65b9\u5dee\u5bf9\u5e94\u7684threshold.

    • \u524d\u8ff0thresholding\u7b56\u7565\u63a8\u5e7f\u5230\u5f69\u8272\u56fe\u50cf\uff0c\u540c\u65f6\u8003\u8651rgb\u4e09\u4e2a\u901a\u9053\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u9488\u5bf9\u7279\u5b9a\u7684\u8272\u5f69\u8fdb\u884cthresholding\u64cd\u4f5c\uff0c
    "},{"location":"DIP/chap2/chap2/#_2","title":"\u6539\u8fdb","text":"
    • \u5c40\u90e8\u81ea\u9002\u5e94\u64cd\u4f5c\u8bbe\u5b9a\u4e00\u4e2a\u5c40\u90e8\u7a97\u53e3\uff0c\u5728\u6574\u4e2a\u56fe\u50cf\u4e0a\u6ed1\u52a8\u8be5\u7a97\u53e3
    • \u5bf9\u4e8e\u6bcf\u4e00\u7a97\u53e3\u4f4d\u7f6e\uff0c\u786e\u5b9a\u9488\u5bf9\u8be5\u7a97\u53e3\u7684threshold

    • \u76f8\u6bd4\u5168\u5c40\u5927\u6d25\u6cd5\uff0c\u6211\u4eec\u4f9d\u6b21\u679a\u4e3e\u7070\u5ea6\u56fe\u4e2d\u7684\u6bcf\u4e2a\u50cf\u7d20\\(\uff08i,j)\\)\uff0c\u4ee5\u7528\u6237\u8f93\u5165\u4e00\u4e2a\u6574\u6570\u4e3a\u8fb9\u957f\uff0c\u5728\\((i - length / 2, j - length / 2, i + length / 2, j + length / 2, i, j)\\)\u8fd9\u4e2a\u6b63\u65b9\u5f62\u4e2d\u8fdb\u884c\u5927\u6d25\u6cd5\uff0c\u5f97\u5230\u9608\u503c\u540e\u4ec5\u5bf9\\((i,j)\\)\u70b9\u8fdb\u884c\u4e8c\u503c\u5316\u5904\u7406\u3002

    • \u76f8\u6bd4\u5168\u5c40\u5927\u6d25\u6cd5\uff0c\u5c40\u90e8\u5927\u6d25\u6cd5\u8017\u65f6\u663e\u8457\u589e\u52a0\u3002

    "},{"location":"DIP/chap2/chap2/#morphological-operation","title":"Morphological Operation","text":"

    \u200b \u6570\u5b66\u5f62\u6001\u5b66\uff08\u4e5f\u79f0\u56fe\u50cf\u4ee3\u6570\uff09\u662f\u4e00\u79cd\u7528\u4e8e\u5206\u6790\u56fe\u50cf\u5f62\u6001\u548c\u7ed3\u6784\u7684\u5de5\u5177\u3002\u5176\u57fa\u672c\u601d\u60f3\u662f\u901a\u8fc7\u5229\u7528\u7ed3\u6784\u5143\u7d20\u6765\u5ea6\u91cf\u548c\u63d0\u53d6\u5f62\u72b6\uff0c\u4ece\u800c\u5b9e\u73b0\u5bf9\u56fe\u50cf\u7684\u5206\u6790\u548c\u8bc6\u522b\u3002\u56fe\u50cf\u5f62\u6001\u5b66\u64cd\u4f5c\u57fa\u4e8e\u96c6\u5408\u8bba\uff0c\u53ef\u4ee5\u7b80\u5316\u56fe\u50cf\uff0c\u53bb\u9664\u4e0d\u9700\u8981\u7684\u7ed3\u6784\uff0c\u540c\u65f6\u4fdd\u7559\u4e3b\u8981\u7684\u5f62\u72b6\u7279\u5f81\u3002\u5728\u8fd9\u91cc\u6709\u56db\u79cd\u5f62\u6001\u5b66\u64cd\u4f5c\u7b26\uff1a\u81a8\u80c0\u3001\u8150\u8680\u3001\u5f00\u8fd0\u7b97\u548c\u95ed\u8fd0\u7b97\u3002

    \u200b \u5728\u4e0b\u9762\u7684\u4ecb\u7ecd\u4e2d\uff0c\u6211\u4eec\u7684 A \u6307\u4e8c\u503c\u56fe\u50cf; B \u6307\u4e8c\u503c\u6a21\u677f\uff0c\u79f0\u4e3a\u7ed3\u6784\u5143(structure element)\u3002

    "},{"location":"DIP/chap2/chap2/#_3","title":"\u81a8\u80c0","text":"

    \u200b \u5f62\u6001\u5b66\u7684\u81a8\u80c0\u64cd\u4f5c\u662f\u56fe\u50cf\u5904\u7406\u4e2d\u7684\u4e00\u79cd\u57fa\u672c\u64cd\u4f5c\uff0c\u901a\u5e38\u7528\u4e8e\u589e\u5f3a\u56fe\u50cf\u4e2d\u7684\u7279\u5b9a\u76ee\u6807\u6216\u7ed3\u6784\uff0c\u4f7f\u5176\u66f4\u52a0\u663e\u8457\u548c\u5bb9\u6613\u68c0\u6d4b\u3002\u81a8\u80c0\u64cd\u4f5c\u7684\u4e3b\u8981\u601d\u60f3\u662f\u5229\u7528\u4e00\u4e2a\u79f0\u4e3a\u7ed3\u6784\u5143\u7d20\u7684\u5c0f\u7a97\u53e3\u6216\u6a21\u677f\uff0c\u6cbf\u7740\u56fe\u50cf\u7684\u5404\u4e2a\u65b9\u5411\u626b\u63cf\uff0c\u5e76\u6839\u636e\u7ed3\u6784\u5143\u7d20\u4e0e\u56fe\u50cf\u7684\u91cd\u53e0\u7a0b\u5ea6\u6765\u6539\u53d8\u56fe\u50cf\u7684\u50cf\u7d20\u503c\u3002

    \u200b \u81a8\u80c0\u64cd\u4f5c\u7684\u7ed3\u679c\u901a\u5e38\u662f\u589e\u5f3a\u4e86\u539f\u59cb\u56fe\u50cf\u4e2d\u7684\u76ee\u6807\u6216\u7279\u5b9a\u7ed3\u6784\u3002\u8fd9\u662f\u56e0\u4e3a\u5b83\u53ef\u4ee5\u5c06\u76ee\u6807\u533a\u57df\u6269\u5c55\uff0c\u586b\u5145\u7a7a\u6d1e\uff0c\u4f7f\u8fb9\u7f18\u66f4\u52a0\u6e05\u6670\u3002\u56e0\u6b64\uff0c\u81a8\u80c0\u64cd\u4f5c\u53ef\u7528\u4e8e\u6539\u5584\u56fe\u50cf\u4e2d\u7684\u7279\u5b9a\u7279\u5f81\uff0c\u4f7f\u5b83\u4eec\u66f4\u5bb9\u6613\u68c0\u6d4b\u548c\u5206\u6790\u3002 $$ A\u2295B={ z|(B)_z \u2229A\\ne\u2205 } $$

    • Dilation: Bridging gaps in images

    • \u7531B\u5bf9A\u81a8\u80c0\u6240\u4ea7\u751f\u7684\u4e8c\u503c\u56fe\u8c61D\u662f\u6ee1\u8db3\u4ee5\u4e0b\u6761\u4ef6\u7684\u70b9(x,y)\u7684\u96c6\u5408\uff1a

    \u5982\u679cB\u7684\u539f\u70b9\u5e73\u79fb\u5230\u70b9(x,y)\uff0c\u90a3\u4e48\u5b83\u4e0eA\u7684\u4ea4\u96c6\u975e\u7a7a\u3002

    "},{"location":"DIP/chap2/chap2/#_4","title":"\u8150\u8680","text":"

    \u200b \u5f62\u6001\u5b66\u7684\u8150\u8680\u64cd\u4f5c\u662f\u56fe\u50cf\u5904\u7406\u4e2d\u7684\u4e00\u79cd\u57fa\u672c\u64cd\u4f5c\uff0c\u901a\u5e38\u7528\u4e8e\u51cf\u5c0f\u56fe\u50cf\u4e2d\u7684\u7279\u5b9a\u76ee\u6807\u6216\u7ed3\u6784\uff0c\u4ece\u800c\u5f31\u5316\u6216\u6d88\u9664\u4e00\u4e9b\u7279\u5f81\u3002\u8150\u8680\u64cd\u4f5c\u7684\u4e3b\u8981\u601d\u60f3\u662f\u5229\u7528\u4e00\u4e2a\u79f0\u4e3a\u7ed3\u6784\u5143\u7d20\u7684\u5c0f\u7a97\u53e3\u6216\u6a21\u677f\uff0c\u6cbf\u7740\u56fe\u50cf\u7684\u5404\u4e2a\u65b9\u5411\u626b\u63cf\uff0c\u5e76\u6839\u636e\u7ed3\u6784\u5143\u7d20\u4e0e\u56fe\u50cf\u7684\u91cd\u53e0\u7a0b\u5ea6\u6765\u6539\u53d8\u56fe\u50cf\u7684\u50cf\u7d20\u503c\u3002

    \u200b \u8150\u8680\u64cd\u4f5c\u7684\u7ed3\u679c\u901a\u5e38\u662f\u51cf\u5c0f\u4e86\u539f\u59cb\u56fe\u50cf\u4e2d\u7684\u76ee\u6807\u6216\u7279\u5b9a\u7ed3\u6784\u3002\u8fd9\u662f\u56e0\u4e3a\u5b83\u53ef\u4ee5\u53bb\u9664\u5c0f\u7684\u7279\u5f81\u3001\u7f29\u5c0f\u76ee\u6807\u533a\u57df\u6216\u6d88\u9664\u566a\u58f0\u3002\u8150\u8680\u64cd\u4f5c\u53ef\u7528\u4e8e\u5f31\u5316\u56fe\u50cf\u4e2d\u7684\u7279\u5b9a\u7279\u5f81\uff0c\u4f7f\u5176\u66f4\u5bb9\u6613\u68c0\u6d4b\u548c\u5206\u6790\u3002 $$ A\u2296B={(x,y)|(B)_{xy} \u2286A} $$

    • \u7531B\u5bf9A\u8150\u8680\u6240\u4ea7\u751f\u7684\u4e8c\u503c\u56fe\u8c61E\u662f\u6ee1\u8db3\u4ee5\u4e0b\u6761\u4ef6\u7684\u70b9(x,y)\u7684\u96c6\u5408\uff1a

    \u5982\u679cB\u7684\u539f\u70b9\u5e73\u79fb\u5230\u70b9(x,y)\uff0c\u90a3\u4e48B\u5c06\u5b8c\u5168\u5305\u542b\u4e8eA\u4e2d

    "},{"location":"DIP/chap2/chap2/#duality","title":"Duality","text":""},{"location":"DIP/chap2/chap2/#application-boundary-extraction","title":"Application: Boundary Extraction","text":""},{"location":"DIP/chap2/chap2/#application-filling-holes","title":"Application: Filling holes\uff01","text":""},{"location":"DIP/chap2/chap2/#_5","title":"\u5f00\u64cd\u4f5c","text":"

    \u200b \u5f62\u6001\u5b66\u7684\u5f00\u64cd\u4f5c\u662f\u4e00\u79cd\u5e38\u89c1\u7684\u56fe\u50cf\u5904\u7406\u64cd\u4f5c\uff0c\u5b83\u7ed3\u5408\u4e86\u8150\u8680\uff08erosion\uff09\u548c\u81a8\u80c0\uff08dilation\uff09\u64cd\u4f5c\uff0c\u901a\u5e38\u7528\u4e8e\u53bb\u566a\u548c\u5206\u5272\u56fe\u50cf\u4e2d\u7684\u76ee\u6807\u3002\u5f00\u64cd\u4f5c\u7684\u4e3b\u8981\u601d\u60f3\u662f\u9996\u5148\u5bf9\u56fe\u50cf\u6267\u884c\u8150\u8680\u64cd\u4f5c\uff0c\u7136\u540e\u518d\u5bf9\u5176\u6267\u884c\u81a8\u80c0\u64cd\u4f5c\uff0c\u8fd9\u4e2a\u8fc7\u7a0b\u901a\u5e38\u4f7f\u7528\u4e00\u4e2a\u7279\u5b9a\u7684\u7ed3\u6784\u5143\u7d20\u8fdb\u884c\u3002

    \u200b \u5f00\u64cd\u4f5c\u5728\u56fe\u50cf\u5904\u7406\u4e2d\u5e38\u7528\u4e8e\u53bb\u9664\u566a\u58f0\u3001\u5206\u5272\u76ee\u6807\u3001\u51cf\u5c0f\u76ee\u6807\u533a\u57df\u7684\u4e0d\u89c4\u5219\u6027\u4ee5\u53ca\u51cf\u5c0f\u76ee\u6807\u4e4b\u95f4\u7684\u5e72\u6270\u3002\u5b83\u4e5f\u6709\u52a9\u4e8e\u6539\u5584\u4e8c\u503c\u5316\u56fe\u50cf\u7684\u8d28\u91cf\uff0c\u4ee5\u4fbf\u540e\u7eed\u7684\u5206\u6790\u548c\u7279\u5f81\u63d0\u53d6\u3002 $$ A \u25e6 B = (A \u2296 B) \u2295 B $$

    • \u7528\u6765\u5728\u7ea4\u7ec6\u70b9\u5904\u5206\u79bb\u7269\u4f53\uff0c\u6d88\u9664\u5c0f\u7269\u4f53\u3001\u5e73\u6ed1\u5176\u8fb9\u754c\u7684\u540c\u65f6\u5e76\u4e0d\u660e\u663e\u6539\u53d8\u5176\u9762\u79ef\u3002
    "},{"location":"DIP/chap2/chap2/#_6","title":"\u95ed\u64cd\u4f5c","text":"

    \u200b \u5f62\u6001\u5b66\u7684\u5f00\u64cd\u4f5c\u662f\u4e00\u79cd\u5e38\u89c1\u7684\u56fe\u50cf\u5904\u7406\u64cd\u4f5c\uff0c\u5b83\u7ed3\u5408\u4e86\u8150\u8680\uff08erosion\uff09\u548c\u81a8\u80c0\uff08dilation\uff09\u64cd\u4f5c\uff0c\u901a\u5e38\u7528\u4e8e\u53bb\u566a\u548c\u5206\u5272\u56fe\u50cf\u4e2d\u7684\u76ee\u6807\u3002\u5f00\u64cd\u4f5c\u7684\u4e3b\u8981\u601d\u60f3\u662f\u9996\u5148\u5bf9\u56fe\u50cf\u6267\u884c\u8150\u8680\u64cd\u4f5c\uff0c\u7136\u540e\u518d\u5bf9\u5176\u6267\u884c\u81a8\u80c0\u64cd\u4f5c\uff0c\u8fd9\u4e2a\u8fc7\u7a0b\u901a\u5e38\u4f7f\u7528\u4e00\u4e2a\u7279\u5b9a\u7684\u7ed3\u6784\u5143\u7d20\u8fdb\u884c\u3002

    \u200b \u95ed\u64cd\u4f5c\u5728\u56fe\u50cf\u5904\u7406\u4e2d\u5e38\u7528\u4e8e\u53bb\u9664\u5c0f\u5b54\u3001\u8fde\u63a5\u65ad\u5f00\u7684\u7ebf\u6761\u3001\u586b\u5145\u4e0d\u89c4\u5219\u76ee\u6807\u7684\u5185\u90e8\u7a7a\u6d1e\u3001\u589e\u5f3a\u56fe\u50cf\u4e2d\u7684\u8fde\u901a\u533a\u57df\uff0c\u5e73\u6ed1\u5176\u8fb9\u754c\u7684\u540c\u65f6\u5e76\u4e0d\u660e\u663e\u6539\u53d8\u5176\u9762\u79ef\u3002\u5b83\u4e5f\u6709\u52a9\u4e8e\u6539\u5584\u4e8c\u503c\u5316\u56fe\u50cf\u7684\u8d28\u91cf\uff0c\u4ee5\u4fbf\u540e\u7eed\u7684\u5206\u6790\u548c\u7279\u5f81\u63d0\u53d6\u3002 $$ A \u2022 B = (A \u2295 B) \u2296 B $$

    "},{"location":"DIP/chap3/chap3/","title":"Basic Operation","text":""},{"location":"DIP/chap3/chap3/#visibility-enhancement","title":"Visibility enhancement","text":""},{"location":"DIP/chap3/chap3/#logarithmic-operation","title":"logarithmic operation","text":"

    \u4e3a\u4e86\u589e\u5f3a\u56fe\u50cf\u7684\u53ef\u89c6\u4fe1\u606f\uff0c\u5bf9\u56fe\u50cf\u4e2d\u7684\u50cf\u7d20\u8fdb\u884c\u57fa\u4e8e\u5bf9\u6570\u7684\u64cd\u4f5c \\(L_d = \\frac{log{({L_{w}+1})}}{log{({L_{max}+1})}}\\) \u5176\u4e2d\uff0c\\(L_d\\)\u662f\u663e\u793a\u4eae\u5ea6\uff0c\\(L_w\\)\u662f\u771f\u5b9e\u4e16\u754c\u4eae\u5ea6\uff0c\\(L_{max}\\)\u662f\u573a\u666f\u4e2d\u7684\u6700\u4eae\u503c\u3002

    • \u8fd9\u4e2a\u6620\u5c04\u80fd\u591f\u786e\u4fdd\u4e0d\u7ba1\u573a\u666f\u7684\u52a8\u6001\u8303\u56f4\u662f\u600e\u4e48\u6837\u7684\uff0c\u5176\u6700\u5927\u503c\u90fd\u80fd\u6620\u5c04\u5230 1(\u767d)\uff0c\u5176\u4ed6\u7684\u503c\u80fd\u591f\u6bd4\u8f83\u5e73\u6ed1\u5730\u53d8\u5316\u3002
    "},{"location":"DIP/chap3/chap3/#grayscale-perception","title":"Grayscale perception","text":""},{"location":"DIP/chap3/chap3/#histogram-equalization","title":"Histogram equalization","text":""},{"location":"DIP/chap3/chap3/#1","title":"(1)\u76f4\u65b9\u56fe","text":""},{"location":"DIP/chap3/chap3/#a","title":"a.\u7070\u5ea6\u76f4\u65b9\u56fe","text":"
    • \u7070\u5ea6\u76f4\u65b9\u56fe\u662f\u4e00\u79cd\u7edf\u8ba1\u56fe\uff0c\u5b83\u8868\u793a\u7ed9\u5b9a\u56fe\u50cf\u4e2d\u4e0d\u540c\u7070\u5ea6\u7ea7\u7684\u50cf\u7d20\u6570\u5360\u603b\u50cf\u7d20\u6570\u7684\u6bd4\u4f8b\u3002
    • \u8ba1\u7b97\u516c\u5f0f\u5982\u4e0b\uff1a \\(p(r_k)=\\frac{n_k}{MN}\\)

    \\(r_k - \u50cf\u7d20\u7684\u7070\u5ea6\u7ea7\\)

    \\(n_k - \u5177\u6709\u7070\u5ea6rk\u7684\u50cf\u7d20\u7684\u4e2a\u6570\\)

    \\(MN - \u56fe\u50cf\u4e2d\u603b\u7684\u50cf\u7d20\u4e2a\u6570\\)

    \\(\\sum_{k=0}^{MN-1}P(r_k)=1\\)

    "},{"location":"DIP/chap3/chap3/#b","title":"b.\u5f69\u8272\u76f4\u65b9\u56fe","text":"
    • \u5f69\u8272\u76f4\u65b9\u56fe\u8868\u793a\u7ed9\u5b9a\u56fe\u50cf\u4e2d\u4e0d\u540c R\u3001G\u3001B\u7b49\u7ea7\u7684\u50cf\u7d20\u6570\u5360\u603b\u50cf\u7d20\u6570\u7684\u6bd4\u4f8b,\u8ba1\u7b97\u65b9\u6cd5\u4e0e\u7070\u5ea6\u76f4\u65b9\u56fe\u7c7b\u4f3c
    "},{"location":"DIP/chap3/chap3/#2","title":"\uff082\uff09\u76f4\u65b9\u56fe\u5747\u8861\u5316","text":"

    \u76f4\u65b9\u56fe\u5747\u8861\u5316\uff08Histogram Equalization\uff09\u662f\u4e00\u79cd\u7528\u4e8e\u589e\u5f3a\u6570\u5b57\u56fe\u50cf\u5bf9\u6bd4\u5ea6\u7684\u56fe\u50cf\u5904\u7406\u6280\u672f\u3002\u5b83\u901a\u8fc7\u91cd\u65b0\u5206\u5e03\u56fe\u50cf\u7684\u50cf\u7d20\u503c\uff0c\u4f7f\u76f4\u65b9\u56fe\u53d8\u5f97\u66f4\u5747\u5300\uff0c\u4ece\u800c\u6539\u5584\u56fe\u50cf\u7684\u89c6\u89c9\u8d28\u91cf

    \u76f4\u65b9\u56fe\u5747\u8861\u5316\u5e38\u88ab\u7528\u4e8e\u63d0\u9ad8\u56fe\u50cf\u7684\u53ef\u89c6\u6027\u3001\u5206\u6790\u6027\u80fd\u548c\u81ea\u52a8\u56fe\u50cf\u5904\u7406\u5e94\u7528\u4e2d\u3002\u4f8b\u5982\uff0c\u8fc7\u66dd\u5149\u56fe\u50cf\u7684\u7070\u5ea6\u7ea7\u96c6\u4e2d\u5728\u9ad8\u4eae\u5ea6\u8303\u56f4\u5185\uff0c\u800c\u66dd\u5149\u4e0d\u8db3\u5c06\u4f7f\u56fe\u50cf\u7070\u5ea6\u7ea7\u96c6\u4e2d\u5728\u4f4e\u4eae\u5ea6\u8303\u56f4\u5185\u3002\u91c7\u7528\u76f4\u65b9\u56fe\u5747\u8861\u5316\uff0c\u53ef\u4ee5\u628a\u539f\u59cb\u56fe\u50cf\u7684\u76f4\u65b9\u56fe\u53d8\u6362\u4e3a\u5747\u5300\u5206\u5e03(\u5747\u8861)\u7684\u5f62\u5f0f\uff0c\u8fd9\u6837\u5c31\u589e\u52a0\u4e86\u50cf\u7d20\u4e4b\u95f4\u7070\u5ea6\u503c\u5dee\u522b\u7684\u52a8\u6001\u8303\u56f4\uff0c\u4ece\u800c\u8fbe\u5230\u589e\u5f3a\u56fe\u50cf\u6574\u4f53\u5bf9\u6bd4\u5ea6\u7684\u6548\u679c

    \u6362\u8a00\u4e4b\uff0c\u76f4\u65b9\u56fe\u5747\u8861\u5316\u7684\u57fa\u672c\u539f\u7406\u662f:\u5bf9\u5728\u56fe\u50cf\u4e2d\u50cf\u7d20\u4e2a\u6570\u591a\u7684\u7070\u5ea6\u503c(\u5373\u5bf9\u753b\u9762\u8d77\u4e3b\u8981\u4f5c\u7528\u7684\u7070\u5ea6\u503c)\u8fdb\u884c\u5c55\u5bbd\uff0c\u800c\u5bf9\u50cf\u7d20\u4e2a\u6570\u5c11\u7684\u7070\u5ea6 \u503c(\u5373\u5bf9\u753b\u9762\u4e0d\u8d77\u4e3b\u8981\u4f5c\u7528\u7684\u7070\u5ea6\u503c)\u8fdb\u884c\u5f52\u5e76\uff0c\u4ece\u800c\u589e\u5927\u5bf9\u6bd4\u5ea6\uff0c\u4f7f\u56fe\u50cf\u6e05\u6670\uff0c\u8fbe\u5230\u589e\u5f3a\u7684\u76ee\u7684

    \u5c3d\u7ba1\u76f4\u65b9\u56fe\u5747\u8861\u5316\u5177\u6709\u663e\u8457\u7684\u4f18\u70b9\uff0c\u4f46\u5b83\u4e5f\u6709\u4e00\u4e9b\u9650\u5236\u3002\u5b83\u53ef\u80fd\u5bfc\u81f4\u56fe\u50cf\u51fa\u73b0\u566a\u70b9\u6216\u8fc7\u5ea6\u589e\u5f3a\u7ec6\u8282\uff0c\u7279\u522b\u662f\u5728\u566a\u97f3\u5b58\u5728\u7684\u60c5\u51b5\u4e0b

    • \u6b64\u5916\uff0c\u5747\u8861\u5316\u53ef\u80fd\u6539\u53d8\u56fe\u50cf\u7684\u6574\u4f53\u4eae\u5ea6\uff0c\u8fd9\u53ef\u80fd\u4e0d\u9002\u7528\u4e8e\u6240\u6709\u56fe\u50cf

    • \u8fde\u7eed\u60c5\u51b5\u7684\u8f6c\u6362\\(T\\):

    • \u8bbe r \u4e3a\u8f6c\u6362\u524d\u7684\u7070\u5ea6\u7ea7\uff0c s \u4e3a\u53d8\u6362\u524d\u540e\u7684\u7070\u5ea6\u7ea7

    • \\(0 \u2264 r,s \u2264 1\\) [\u5bf9\u5e94\\((0,255)\\)]

    • P\u00ae \u548c P(s) \u662f\u5bf9\u5e94\u4e8e r \u548c s \u7684\u6982\u7387\u3002\u8f6c\u6362\u89c4\u5219\u4e3a:

      • T\u00ae\u662f\u5355\u8c03\u9012\u589e\u51fd\u6570\uff0c\\(0\u2264r\u22641\\)\u4e14\\(0\u2264T(r)\u22641\\)

      • \u9006\u53d8\u6362 r = \\(T^{-1}(s)\\)\u4e5f\u662f\u4e00\u4e2a\u5355\u8c03\u9012\u589e\u51fd\u6570 \u8003\u8651\u5230\u7070\u5ea6\u53d8\u6362\u4e0d\u4f1a\u6539\u53d8\u4f4d\u7f6e\u548c\u50cf\u7d20\u6570

      • \u6211\u4eec\u6709 \\(\\int_0^rP(r)dr = \\int_0^sP(s)ds=\\int_0^s 1*ds = s = T(r)\\)

      \\(Thus: T(r)=\\int_0^rP(r)dr\\)

    • \u79bb\u6563\u60c5\u51b5\u7684\u8f6c\u6362 \\(T\\):

    \u8bbe\u4e00\u5e45\u56fe\u50cf\u7684\u50cf\u7d20\u603b\u6570\u4e3an\uff0c\u5206L\u4e2a\u7070\u5ea6\u7ea7\uff0c\\(n_k\\)\u4e3a\u7b2ck\u4e2a\u7070\u5ea6\u7ea7\u51fa\u73b0\u7684\u50cf\u7d20\u6570\uff0c\u5219\u7b2c\\(k\\)\u4e2a\u7070\u5ea6\u7ea7\u51fa\u73b0\u7684\u6982\u7387\u4e3a\uff1a $$ P(r_k)= \\frac{n_k}{n}(0\u2264n_k \u22641,k=0,1,2,...,MN\u22121) $$

    • \u79bb\u6563\u7070\u5ea6\u76f4\u65b9\u56fe\u5747\u8861\u5316\u7684\u8f6c\u6362\u516c\u5f0f\u4e3a $$ s_k = T(r_k)=\\sum_{i=0}^kP(ri)=\\frac{1}{n}\\sum_{i=0}^{k}ni $$

    \u5bf9\u4e8e\u539f\u76f4\u65b9\u56fe\u4e2d\u7684\u4efb\u610f\u4e00\u4e2a\u7070\u5ea6\u7ea7\\(r_k\\)\uff0c\u53ea\u9700\u5c06\u7070\u5ea6\u7ea7\u4e3a\\([0,r_k]\\)\u4ee5\u5185\u7684\u6240\u6709\u50cf\u7d20\u4e2a\u6570\u7684\u548c\u9664\u4ee5\u56fe\u50cf\u7684\u50cf\u7d20\u603b\u6570\uff0c\u5c31\u53ef\u4ee5\u5f97\u5230\u8f6c\u6362\u4e4b\u540e\u7684\u5bf9\u5e94\u7070\u5ea6\u7ea7\\(s_k\\)

    • Problem

    \u6309\u7167\u5747\u8861\u5316\u7684\u8981\u6c42\uff0c\u5728\u5747\u8861\u5316\u540e\u7684\u7ed3\u679c\u76f4\u65b9\u56fe\u4e2d\uff0c\u5404\u7070\u5ea6\u7ea7\u53d1\u751f\u7684\u6982\u7387\u5e94\u8be5\u662f\u76f8\u540c\u7684\uff0c\u5982\u53f3\u4e0a\u56fe\u6240\u793a\u8fde\u7eed\u7070\u5ea6\u7ea7\u5747\u8861\u5316\u7ed3\u679c\u90a3\u6837\u3002\u4f46\u662f\uff0c\u53f3\u4e0b\u56fe\u4e2d\u79bb\u6563\u7070\u5ea6\u7ea7\u5747\u8861\u5316\u540e\uff0c\u5404\u7070\u5ea6\u7ea7\u51fa\u73b0\u7684\u6982\u7387\u5e76\u4e0d\u5b8c\u5168\u4e00\u6837\u3002\u4e3a\u4ec0\u4e48\uff1f

    • \u6b65\u9aa42\u4e2d\uff0c\u6240\u5f97\u7684\\(s_k\\)\u4e0d\u53ef\u80fd\u6b63\u597d\u7b49\u4e8e8\u7ea7\u7070\u5ea6\u503c\u4e2d\u7684\u67d0\u4e00\u7ea7\uff0c\u56e0\u6b64\u9700\u8981\u5c31\u8fd1\u5f52\u5165\u67d0\u4e00\u4e2a\u7070\u5ea6\u7ea7\u4e2d

    \u8fd9\u6837\uff0c\u76f8\u90bb\u7684\u591a\u4e2a\\(s_k\\)\u5c31\u53ef\u80fd\u843d\u5165\u540c\u4e00\u4e2a\u7070\u5ea6\u7ea7\uff0c\u9700\u8981\u5728\u6b65\u9aa43\u65f6\u5c06\u5904\u4e8e\u540c\u4e00\u4e2a\u7070\u5ea6\u7ea7\u7684\u50cf\u7d20\u4e2a\u6570\u7d2f\u52a0,\u56e0\u6b64\uff0c\u79bb\u6563\u7070\u5ea6\u76f4\u65b9\u56fe\u5747\u8861\u5316\u64cd\u4f5c\u4ee5\u540e\uff0c\u6bcf\u4e2a\u7070\u5ea6\u7ea7\u5904\u7684\u6982\u7387\u5bc6\u5ea6\uff08\u6216\u50cf\u7d20\u4e2a\u6570\uff09\u5e76\u4e0d\u5b8c\u5168\u4e00\u6837\u3002

    "},{"location":"DIP/chap3/chap3/#histogram-fitting","title":"Histogram fitting","text":"
    • \u6240\u8c13\u76f4\u65b9\u56fe\u5339\u914d\uff0c\u5c31\u662f\u4fee\u6539\u4e00\u5e45\u56fe\u50cf\u7684\u76f4\u65b9\u56fe\uff0c\u4f7f\u5f97\u5b83\u4e0e\u53e6\u4e00\u5e45\u56fe\u50cf\u7684\u76f4\u65b9\u56fe\u5339\u914d\u6216\u5177\u6709\u4e00\u79cd\u9884\u5148\u89c4\u5b9a\u7684\u51fd\u6570\u5f62\u72b6
    • \u76f4\u65b9\u56fe\u5339\u914d\u7684\u76ee\u6807\uff0c\u662f\u7a81\u51fa\u6211\u4eec\u611f\u5174\u8da3\u7684\u7070\u5ea6\u8303\u56f4\uff0c\u4f7f\u56fe\u50cf\u8d28\u91cf\u6539\u5584
    • \u5229\u7528\u76f4\u65b9\u56fe\u5747\u8861\u5316\u64cd\u4f5c\uff0c\u53ef\u4ee5\u5b9e\u73b0\u76f4\u65b9\u56fe\u5339\u914d\u8fc7\u7a0b\u3002
    "},{"location":"DIP/chap3/chap3/#steps","title":"Steps","text":"
    • Step 1 : Base on the equation \\(s=T(r)=\\int_0^rP(r)dr\\) map r in the original histogram to be s
    • Step 2 : Based on equation \\(v=T(z)=\\int_0^zP(z)dz\\) map the gray level z in the resulted histogram to be \\(v\\)
    • Step 3 : obtain \\(z=G^{-1}(v)\\) from \\(v=G(z)\\) beacuse s and v have the same distribution obtain \\(z=G^{-1}(s)\\) corresponding \\(r\\)
    • Simple version:

    \u5728\u6b65\u9aa41\u548c2\u4e2d\uff0c\u5206\u522b\u8ba1\u7b97\u83b7\u5f97\u4e24\u5f20\u8868\uff08\u53c2\u89c1\u76f4\u65b9\u56fe\u5747\u8861\u5316\u4e2d\u7684\u7b97\u4f8b\uff09\uff0c\u4ece\u4e2d\u9009\u53d6\u4e00\u5bf9\\(v_k\u3001s_j\\)\uff0c\u4f7f\\(v_k = s_j\\)\uff0c\u5e76\u4ece\u4e24\u5f20\u8868\u4e2d\u67e5\u51fa\u5bf9\u5e94\u7684\\(z_k\\)\u3001\\(r_j\\)

    \u8fd9\u6837\uff0c\u539f\u59cb\u56fe\u50cf\u4e2d\u7070\u5ea6\u7ea7\u4e3a\\(r_j\\)\u7684\u6240\u6709\u50cf\u7d20\u90fd\u6620\u5c04\u6210\u7070\u5ea6\u7ea7\\(z_k\\)\uff0c\u6700\u7ec8\u5f97\u5230\u6240\u671f\u671b\u7684\u56fe\u50cf\u3002

    "},{"location":"DIP/chap3/chap3/#histogram-transform","title":"Histogram transform","text":""},{"location":"DIP/chap3/chap3/#linear-histogram-transform","title":"Linear histogram transform","text":"
    • Contrast stretching
    • Piecewise linear grayscale transform

    Linear grayscale transform by using a piecewise function, which strengthen the region of interest, weaken the region of no-interest.

    \u5229\u7528\u5206\u6bb5\u76f4\u65b9\u56fe\u53d8\u6362\uff0c\u53ef\u4ee5\u5c06\u611f\u5174\u8da3\u7684\u7070\u5ea6\u8303\u56f4\u7ebf\u6027\u6269\u5c55\uff0c\u540c\u65f6\u76f8\u5bf9\u6291\u5236\u4e0d\u611f\u5174\u8da3\u7684\u7070\u5ea6\u533a\u57df

    "},{"location":"DIP/chap3/chap3/#nonlinear-histogram-transform","title":"Nonlinear histogram transform","text":"

    Logarithmic function and Exponential function are two popular nonlinear transform functions.

    Logarithmic

    • Stretch low grayscale region
    • Compress high grayscale region

    Expoential

    • Stretch high grayscale region
    • Compress low grayscale region

    "},{"location":"DIP/chap3/chap3/#geometric-transform","title":"Geometric transform","text":""},{"location":"DIP/chap3/chap3/#1_1","title":"1.\u57fa\u672c\u51e0\u4f55\u53d8\u5316","text":""},{"location":"DIP/chap3/chap3/#translation","title":"\u5e73\u79fb\uff08Translation\uff09","text":"

    \u5c06\u56fe\u50cf\u6cbf\u6c34\u5e73\u548c\u7ad6\u76f4\u65b9\u5411\u79fb\u52a8\uff0c\u4ece\u800c\u4ea7\u751f\u65b0\u56fe\u50cf\u7684\u8fc7\u7a0b\u3002

    \u5e73\u79fb\u540e\u7684\u666f\u7269\u4e0e\u539f\u56fe\u50cf\u76f8\u540c\uff0c\u4f46\u201c\u753b\u5e03\u201d\u4e00\u5b9a\u662f\u6269\u5927\u4e86\uff0c\u5426\u5219\u5c31\u4f1a\u4e22\u5931\u4fe1\u606f\u3002 * \u77e9\u9635\u8868\u793a \\(\\begin{bmatrix}x^{'}\\\\y^{'}\\\\1\\end{bmatrix}=\\begin{bmatrix}1&0&x_0\\\\0&1&y_0\\\\0&0&1\\end{bmatrix}\\begin{bmatrix}x\\\\y\\\\1\\end{bmatrix}\\)

    "},{"location":"DIP/chap3/chap3/#rotation","title":"\u65cb\u8f6c\uff08Rotation\uff09","text":"
    • \u7ed5\u539f\u70b9\u65cb\u8f6c\\(\\theta\\)\u89d2\uff0c\u5f97\u5230\u65b0\u56fe\u50cf\u7684\u8fc7\u7a0b
    • \u6ce8\u610f\uff1a\u65cb\u8f6c\u53d8\u6362\u7684\u8fc7\u7a0b\u4e2d\uff0c\u56fe\u50cf\u4e2d\u4f1a\u4ea7\u751f\u7a7a\u6d1e\uff0c\u7528\u63d2\u503c\u6cd5\u8865\u5168(\u884c\u63d2\u503c\u2014\u2014\u6309\u987a\u5e8f\u5bfb\u627e\u6bcf\u4e00\u884c\u4e2d\u7684\u7a7a\u6d1e\u50cf\u7d20\uff0c\u8bbe\u7f6e\u5176\u50cf\u7d20\u503c\u4e0e\u540c\u4e00\u884c\u4e2d\u524d\u4e00\u4e2a\u50cf\u7d20\u7684\u50cf\u7d20\u503c\u76f8\u540c\u3002)
    • \u77e9\u9635\u8868\u793a \\(\\begin{bmatrix}x^{'}\\\\y^{'}\\\\1\\end{bmatrix}=\\begin{bmatrix}cos\\theta&-sin\\theta&0\\\\sin\\theta&cos\\theta&0\\\\0&0&1\\end{bmatrix}\\begin{bmatrix}x\\\\y\\\\1\\end{bmatrix}\\)
    "},{"location":"DIP/chap3/chap3/#3-scale","title":"\uff083\uff09\u7f29\u653e (Scale)","text":"

    \u5c06\u56fe\u50cf\u4e58\u4ee5\u4e00\u5b9a\u7cfb\u6570\uff0c\u4ece\u800c\u4ea7\u751f\u65b0\u56fe\u50cf\u7684\u8fc7\u7a0b

    • \u6cbfx\u8f74\u65b9\u5411\u7f29\u653ec\u500d\uff08c>1\u65f6\u4e3a\u653e\u5927\uff0c0<c<1\u65f6\u4e3a\u7f29\u5c0f\uff09

    \u6cbfy\u8f74\u65b9\u5411\u7f29\u653ed\u500d\uff08d>1\u65f6\u4e3a\u653e\u5927\uff0c0<d<1\u65f6\u4e3a\u7f29\u5c0f\uff09

    • \u5f53c=d\u65f6\uff0c\u56fe\u50cf\u7b49\u6bd4\u7f29\u653e\uff1b\u5426\u5219\u4e3a\u975e\u7b49\u6bd4\u7f29\u653e\uff0c\u5bfc\u81f4\u56fe\u50cf\u53d8\u5f62\u3002
    • \u7f29\u5c0f \uff1a\u6309\u4e00\u5b9a\u95f4\u9694\u9009\u53d6\u67d0\u4e9b\u884c\u548c\u5217\u7684\u50cf\u7d20\u6784\u6210\u7f29\u5c0f\u540e\u7684\u65b0\u56fe\u50cf\uff1b
    • \u653e\u5927 \uff1a\u65b0\u56fe\u50cf\u51fa\u73b0\u7a7a\u884c\u548c\u7a7a\u5217\uff0c\u53ef\u91c7\u7528\u63d2\u503c\u7684\u65b9\u6cd5\u52a0\u4ee5\u586b\u8865\uff0c\u4f46\u5b58\u5728\u201c\u9a6c\u8d5b\u514b\u201d\u73b0\u8c61\u3002

    • \u77e9\u9635\u8868\u793a \\(\\begin{bmatrix}x^{'}\\\\y^{'}\\\\1\\end{bmatrix}=\\begin{bmatrix}c&0&0\\\\0&d&0\\\\0&0&1\\end{bmatrix}\\begin{bmatrix}x\\\\y\\\\1\\end{bmatrix}\\)

    "},{"location":"DIP/chap3/chap3/#shear","title":"\u56fe\u50cf\u526a\u5207 (Shear)","text":"

    \u56fe\u50cf\u7684\u9519\u5207\u53d8\u6362\u5b9e\u9645\u4e0a\u662f\u666f\u7269\u5728\u5e73\u9762\u4e0a\u7684\u975e\u5782\u76f4\u6295\u5f71\u6548\u679c

    \\(Shear\\ on\\ x-axis:\\left\\{\\begin{aligned}&a(x, y) = x + d_xy \\\\&b(x, y) = y\\end{aligned}\\right.\\) \\(Shear\\ on\\ y-axis:\\left\\{\\begin{aligned}&a(x, y) = x \\\\&b(x, y) = y+d_yx\\end{aligned}\\right.\\)

    • \u77e9\u9635\u8868\u793a \\(\\begin{bmatrix}x^{'}\\\\y^{'}\\\\1\\end{bmatrix}=\\begin{bmatrix}1&d_x&0\\\\d_y&1&0\\\\0&0&1\\end{bmatrix}\\begin{bmatrix}x\\\\y\\\\1\\end{bmatrix}\\)
    "},{"location":"DIP/chap3/chap3/#mirror","title":"\u955c\u50cf\u53d8\u6362 (Mirror)","text":"

    \u7ed5x\u8f74\u6216y\u8f74\u7ffb\u8f6c\uff0c\u4ece\u800c\u4ea7\u751f\u4e0e\u539f\u56fe\u50cf\u5bf9\u79f0\u7684\u65b0\u56fe\u50cf\u7684\u8fc7\u7a0b * \u77e9\u9635\u8868\u793a \\(\\begin{bmatrix}x^{'}\\\\y^{'}\\\\1\\end{bmatrix}=\\begin{bmatrix}s_x&0&0\\\\0&s_y&0\\\\0&0&1\\end{bmatrix}\\begin{bmatrix}x\\\\y\\\\1\\end{bmatrix}\\)

    • \u5f53\\(S_x\\) =\\(1\\)\uff0c\u4e14\\(S_y\\) =\\(-1\\)\u65f6\u5b9e\u73b0\u7ed5x\u8f74\u7684\u955c\u50cf\u53d8\u6362
    • \u5f53\\(S_x\\) = \\(-1\\)\uff0c\u4e14\\(S_y\\) =\\(1\\)\u65f6\u5b9e\u73b0\u7ed5y\u8f74\u7684\u955c\u50cf\u53d8\u6362
    "},{"location":"DIP/chap3/chap3/#_1","title":"\u590d\u5408\u51e0\u4f55\u53d8\u6362","text":"\\[\\begin{bmatrix}x^{'}\\\\y^{'}\\\\1\\end{bmatrix}=\\begin{bmatrix}a&b&c\\\\d&e&f\\\\g&h&1\\end{bmatrix}\\begin{bmatrix}x\\\\y\\\\1\\end{bmatrix}\\]"},{"location":"DIP/chap3/chap3/#_2","title":"\u63d2\u503c","text":""},{"location":"DIP/chap3/chap3/#nearest-neighbor","title":"\u6700\u90bb\u8fd1\u63d2\u503c (Nearest neighbor)","text":"
    • \u6700\u90bb\u8fd1\u63d2\u503c\uff0c\u5373\u8f93\u51fa\u50cf\u7d20\u7684\u7070\u5ea6\u503c\u7b49\u4e8e\u79bb\u5b83\u6240\u6620\u5c04\u5230\u7684\u4f4d\u7f6e\u6700\u8fd1\u7684\u8f93\u5165\u50cf\u7d20\u7684\u7070\u5ea6\u503c\u3002

    \u4e3a\u4e86\u8ba1\u7b97\u51e0\u4f55\u53d8\u6362\u540e\u65b0\u56fe\u50cf\u4e2d\u67d0\u4e00\u70b9\\(P\u2019\\)\u5904\u7684\u50cf\u7d20\u503c\uff0c\u53ef\u4ee5\u9996\u5148\u8ba1\u7b97\u8be5\u51e0\u4f55\u53d8\u6362\u7684\u9006\u53d8\u6362\uff0c\u8ba1\u7b97\u51fa \\(P\u2019\\) \u6240\u5bf9\u5e94\u7684\u539f\u56fe\u50cf\u4e2d\u7684\u4f4d\u7f6e \\(P\\)

    \u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\\(P\\) \u7684\u4f4d\u7f6e\u4e0d\u53ef\u80fd\u6b63\u597d\u5904\u5728\u539f\u56fe\u50cf\u7684\u67d0\u4e00\u4e2a\u50cf\u7d20\u4f4d\u7f6e\u4e0a(\u5373 $P $\u70b9 \u7684\u5750\u6807\u901a\u5e38\u90fd\u4e0d\u4f1a\u6b63\u597d\u662f\u6574\u6570)

    \u5bfb\u627e\u4e0e \\(P\\) \u70b9\u6700\u63a5\u8fd1\u7684\u50cf\u7d20\\(Q\\)\uff0c\u628a \\(Q\\) \u70b9\u7684\u50cf\u7d20\u503c\u4f5c\u4e3a\u65b0\u56fe\u50cf\u4e2d \\(P\u2019\\)\u70b9\u7684 \u50cf\u7d20\u503c\u3002

    • \\(Steps\\) \\((x^{'},y^{'})\\Rightarrow{\\text{Inverse Transtion}}(x,y)\\\\ \\Rightarrow{\\text{rounding operation}}(x_{int},y_{int})\\\\ \\Rightarrow{\\text{assign value}}I_{new}(x^{'},y^{'})=I_{old}(x_{int},y_{int})\\\\\\)

    • \u5f53\u56fe\u50cf\u4e2d\u5305\u542b\u660e\u663e\u7684\u51e0\u4f55\u7ed3\u6784\u65f6\uff0c\u7ed3\u679c\u5c06\u4e0d\u592a\u5149\u6ed1\u8fde\u7eed\uff0c\u4ece\u800c\u5728\u56fe\u50cf\u4e2d\u4ea7\u751f\u4eba\u4e3a\u7684\u75d5\u8ff9

    "},{"location":"DIP/chap3/chap3/#linear-interpolation","title":"\u7ebf\u6027\u63d2\u503c (Linear interpolation)","text":"
    • \u5728\u4e00\u7ef4\u60c5\u51b5\u4e0b\uff0c\u5df2\u77e5x1\u548cx2\u5904\u7684\u7070\u5ea6\u503c\u5206\u522b\u4e3ag1\u548cg2\uff0c\u5219x3\u5904\u7684\u7070\u5ea6\u503cg3\u4e3a\uff1a $$ g_3 = \\frac{g_2-g_1}{x_2-x_1}(x_3-x_1)+g1 $$

    • \u5728\u4e8c\u7ef4\u60c5\u51b5\u4e0b\uff0c\u79f0\u4e3a\u53cc\u7ebf\u6027\u63d2\u503c

    • \u6ce8\uff1a\u53ef\u7531\u4e00\u7ef4\u7684\u60c5\u51b5\u63a8\u5bfc\u800c\u6765\uff0c\u5f97\u5230\u53cc\u7ebf\u6027\u65b9\u7a0bg(x,y)\u4e3a $$ g(x,y)=\\frac{(y_1-y)(x_1-x)}{(y_1-y_0)(x_1-x_0)}g(0,0)+\\frac{(y_1-y)(x-x_0)}{(y_1-y_0)(x_1-x_0)}g(1,0)+\\frac{(y-y_0)(x_1-x)}{(y_1-y_0)(x_1-x_0)}g(0,1)+\\frac{(y-y_0)(x-x_0)}{(y_1-y_0)(x_1-x_0)}g(1,1) $$ \u5373\u6ee1\u8db3\\(g(x,y)=ax+by+cxy+d\\)\u7684\u5f62\u5f0f

    • \u5df2\u77e5\u56fe\u50cf\u7684\u6b63\u65b9\u5f62\u7f51\u683c\u4e0a\u56db\u4e2a\u70b9A\u3001B\u3001C\u3001D\u7684\u7070\u5ea6\uff0c\u6c42P\u70b9\u7684\u7070\u5ea6:

      • \u5b9a\u4e49\u53cc\u7ebf\u6027\u65b9\u7a0b$g(x,y)=ax+by+cxy+d $
      • \u5206\u522b\u5c06\\(A\\ B\\ C\\ D\\)\u56db\u70b9\u7684\u4f4d\u7f6e\u548c\u7070\u5ea6\u4ee3\u5165\u65b9\u7a0b\uff0c\u5f97\u5230\u65b9\u7a0b\u7ec4
      • \u89e3\u65b9\u7a0b\u7ec4\uff0c\u89e3\u51fa\\(a\\ b\\ c\\ d\\)\u56db\u4e2a\u7cfb\u6570
      • \u5c06P\u70b9\u7684\u4f4d\u7f6e\u4ee3\u5165\u65b9\u7a0b\uff0c\u5f97\u5230P\u70b9\u7684\u7070\u5ea6
    "},{"location":"DIP/chap3/chap3/#radial-basis-function-rbf-based-interpolation","title":"\u5f84\u5411\u57fa\u51fd\u6570\u63d2\u503c[Radial Basis Function (RBF) based interpolation]","text":"
    • \u5f84\u5411\u57fa\u51fd\u6570\\(\\phi(x)\\)

    • \u6700\u5e38\u89c1\u4e3a\u9ad8\u65af\u51fd\u6570\\(\u03c6(r)=e^{\\frac{\u2212r^2}{2\u03c3^2}}\\)

    • Multiquadrics:\\(\\phi(r)=\\sqrt{1+\\frac{r^2}{\\sigma^2}}\\)

    • Linear: \\(\\phi(r)=r\\)

    • Cubic:\\(\\phi(r)=r^3\\)

      \u2026\u2026

    • \u63d2\u503c\u51fd\u6570 \\(\\hat{f}(x)=\\sum_{i=1}^Nw_i\\phi(||x-x_i||)\\) where \\(w_i=\\frac{\\phi(|x-c_i|)}{\\sum_{i=1}^n\\phi(|x-c_i|)}\\)

    "},{"location":"DIP/feature/feature/","title":"Feature detection","text":""},{"location":"DIP/feature/feature/#feature-detection-the-math","title":"Feature detection: the math","text":"

    Consider shifting the window \\(W\\) by \\((u,v)\\)

    \\(\\begin{align*}Error(u,v)&=\\sum_{(x,y)\\in W}[I(x+u,y+v)-I(x,y)]^2\\\\ &\\approx\\sum_{(x,y)\\in W}[I(x,y)+\\frac{\\partial I}{\\partial x}u+\\frac{\\partial I}{\\partial y}v-I(x,y)]^2\\\\ &\\approx\\sum_{(x,y)\\in W}[u,v]\\begin{bmatrix}I_x^2&I_xI_y\\\\I_yI_x&I_y^2\\end{bmatrix}\\begin{bmatrix}u\\\\v\\end{bmatrix} \\\\ \\end{align*}\\)

    • Which directions will result in the largest and smallest E values?

    We can find these directions by looking at the eigenvectors of H \\((\\begin{bmatrix}I_x^2&I_xI_y\\\\I_yI_x&I_y^2\\end{bmatrix})\\)

    Eigenvalues and eigenvectors of H

    • Define shifts with the smallest and largest change (E value)
    • \\(x_+\\) = direction of largest increase in E.
    • \\(\\lambda_+\\) = amount of increase in direction x+ \\(Hx_{+}=\\lambda_{x_+}x_+\\)
    • \\(x_-\\) = direction of smallest increase in E.
    • \\(\\lambda_-\\) = amount of increase in direction x- . \\(Hx_{-}=\\lambda_{x_-}x_-\\)

    Since \\(H\\) is symmetric ,so \\(H=R^{-1}\\begin{bmatrix}\\lambda_1&0\\\\0&\\lambda_2\\end{bmatrix}R\\)

    • Compute the gradient at each point in the image
    • Create the \\(H\\) matrix from the entries in the gradient
    • Compute the eigenvalues.
    • Find points with large response (\\(\\lambda_-\\) > threshold)
    • Choose those points where \\(\\lambda_-\\) is a local maximum as features
    "},{"location":"DIP/feature/feature/#the-harris-operator","title":"The Harris operator","text":"
    • \\(\\lambda_-\\) is a variant of the Harris operator for feature detection

    \\(f=\\frac{\\lambda_1\\lambda_2}{\\lambda_1+\\lambda_2}=\\frac{determinant(H)}{trace(H)}\\)

    • The trace is the sum of the diagonals, i.e., \\(trace(H) = h_{11} + h_{22}\\)
    • Very similar to \\(\\lambda_-\\) but less expensive (no square root)
    • Called the \u201cHarris Corner Detector\u201d or \u201cHarris Operator\u201dLots of other detectors, this is one of the most popular
    "},{"location":"DIP/feature/feature/#some-properties","title":"Some Properties","text":"
    • Rotation Invariance

    • Partial Invariance to additive and multiplicative intensity changes

    • Not invariance to scaling. !!!

    "},{"location":"DIP/feature/feature/#scale-invariant-detection","title":"Scale Invariant Detection","text":"
    • Eg. Take a local \\(MAXIMUM\\)
    "},{"location":"DIP/feature/feature/#harris-laplacian","title":"Harris-Laplacian","text":"

    We define the characteristic scale as the scale that produces peak of Laplacian response

    Stage 1: Initialization--Multiscale Harris Corner Detection

    1. Image Pyramid Construction: Begin by constructing a scale-space pyramid of the image, generating different scales by applying Gaussian smoothing and downsampling.
    2. Computation of Harris Corner Response: At each scale, calculate the corner response using the Harris corner detection method. This typically involves computing local gradients at each pixel position, forming the autocorrelation matrix, calculating the corner response function, and identifying local maxima as keypoints.
    3. Non-Maximum Suppression: For each scale, perform non-maximum suppression to eliminate redundant keypoints in the corner response function, retaining only the keypoints corresponding to local maxima.

    Stage 2: Scale Selection Based on Laplacian

    1. Laplacian Scale Selection:

    The Laplacian is an operator used to detect edges and texture variations in an image by computing the second derivative at each point.

    In the context of scale selection, the Laplacian serves to measure the changes in the image at different scales.

    • Example: Consider an image containing a circle. As you view this circle at different scales, its edges will exhibit varying degrees of change. By applying the Laplacian at different scales, we can observe the intensity of edge variations.

    The optimal scale for a keypoint is where the maximum edge response occurs, indicating that the details of the keypoint are most pronounced at that scale.

    1. Keypoint Filtering:

    For the same corner, even with changes in scale, the corner remains detectable, indicating robustness in terms of repeatability.

    The content within the feature scale range of the same corner in images of different sizes should be consistent.

    Therefore, the pixel locations within the feature scale range of corners in images of varying scales are proportional to the scale.(\u4e0d\u540c\u5c3a\u5bf8\u56fe\u7247\u4e2d\u7684\u76f8\u540c\u89d2\u70b9\u7684\u7279\u5f81\u5c3a\u5ea6\u8303\u56f4\u4e2d\u7684\u5185\u5bb9\u8981\u76f8\u540c\uff0c\u56e0\u6b64\uff0c\u4e0d\u540c\u5c3a\u5ea6\u7684\u56fe\u7247\u7684\u89d2\u70b9\u7684\u7279\u5f81\u5c3a\u5ea6\u8303\u56f4\u5185\u7684\u50cf\u7d20\u70b9\u4e0e\u5c3a\u5ea6\u6210\u6bd4\u4f8b\u5173\u7cfb\u3002)

    "},{"location":"DIP/feature/feature/#local-extrema-detection","title":"Local Extrema Detection","text":"
    • Maxima and minima
    • Compare \\(x\\) with its 26 neighbors at 3 scales
    "},{"location":"DIP/feature/feature/#orientation","title":"Orientation","text":""},{"location":"DIP/feature/feature/#sift","title":"SIFT","text":"

    Let's illustrate the construction process of a Gaussian pyramid with a simple example. We assume that each group contains S layers, and the scale differences within each group are achieved through downsampling by a factor of 2 and using different Gaussian blur parameters \u03c3.

    1. Initial Image: Suppose we have an initial image, labeled as Group 0, containing image A.
    2. Group 1: - We apply Gaussian blur to image A in Group 0, obtaining image B in Group 1. The Gaussian blur parameter here is \u03c31. - Next, we downsample (reduce by half) image B, resulting in image C in Group 1.
    3. Group 2: - We apply Gaussian blur to image B in Group 1, obtaining image D in Group 2. The Gaussian blur parameter here is \u03c32. - We then downsample image D, obtaining image E in Group 2.
    4. Group 3: - Gaussian blur is applied to image D in Group 2, resulting in image F in Group 3. The Gaussian blur parameter here is \u03c33. - Image F is then downsampled, resulting in image G in Group 3.

    This process can be repeated iteratively, and each round of Gaussian blur and downsampling constructs one level of the pyramid. Within each group, we have S images at different scales (determined by different Gaussian blur parameters), and each image, obtained by downsampling, aligns with the corresponding image from the previous group in terms of scale.

    This ensures that the construction of the pyramid is \"bottom-up,\" reflecting the features of the image at different scales.

    • REFER TO ML-4360 Structure from motion

    "},{"location":"DIP/feature/feature/#visual-word-generation","title":"Visual Word Generation","text":"

    Based on the collected images we detect their interest points with Difference of Gaussian, and extract the SIFT descriptors.

    The extracted descriptors are then clustered to generate the vocabulary tree with the hierarchical k-means clustering. In this experiment we generated a visual vocabulary containing 32357 visual words

    "},{"location":"DIP/feature/feature/#surf-detectors-and-descriptors","title":"SURF detectors and descriptors","text":"

    Reference to https://medium.com/@deepanshut041/introduction-to-surf-speeded-up-robust-features-c7396d6e7c4e

    • speeded up robust features

    "},{"location":"DIP/feature/feature/#1feature-extraction","title":"(1)Feature Extraction","text":"

    Basic Hessian matrix approximation.

    "},{"location":"DIP/feature/feature/#aintegral-images","title":"a.Integral images","text":"

    The Integral Image or Summed-Area Table was introduced in 1984. The Integral Image is used as a quick and effective way of calculating the sum of values (pixel values) in a given image \u2014 or a rectangular subset of a grid (the given image). It can also, or is mainly, used for calculating the average intensity within a given image.

    "},{"location":"DIP/feature/feature/#bhessian-matrix-based-interest-points","title":"b.Hessian matrix-based interest points","text":"

    \\(SURF\\) uses the Hessian matrix because of its good performance in computation time and accuracy. Rather than using a different measure for selecting the location and the scale (Hessian-Laplace detector), surf relies on the determinant of the Hessian matrix for both.

    For adapt to any scale, we filtered the image by a Gaussian kernel, so given a point \\(X = (x, y)\\), the Hessian matrix \\(H(x, \u03c3)\\) in x at scale \u03c3 is defined as:

    \\(H(\\vec{x},\\sigma)=\\begin{bmatrix}L_{xx}(x,\\sigma)&L_{xy}(x,\\sigma)\\\\ L_{xy}(x,\\sigma)&L_{yy}(x,\\sigma)\\end{bmatrix}\\)

    where \\(L_{xx}(x, \u03c3)\\) is the convolution of the Gaussian second order derivative with the image \\(I\\) in point \\(x\\), and similarly for \\(L_{xy} (x, \u03c3)\\) and \\(L_{yy} (x, \u03c3)\\).

    Gaussians are optimal for scale-space analysis but in practice, they have to be discretized and cropped. This leads to a loss in repeatability under image rotations around odd multiples of \\(\u03c0 /4\\). This weakness holds for Hessian-based detectors in general. Nevertheless, the detectors still perform well, and the slight decrease in performance does not outweigh the advantage of fast convolutions brought by the discretization and cropping.

    After Lowe\u2019s success with LoG approximations(SIFT), SURF pushes the approximation(both convolution and second-order derivative) even further with box filters. These approximate second-order Gaussian derivatives and can be evaluated at a very low computational cost using integral images and independently of size, and this is part of the reason why SURF is fast.

    • eg.

    \\(d^2L(x)/dx^2=(L(x+1)-L(x))-(L(x)-L(x-1))=-2*L(x)+L(x+1)+L(x-1)\\)

    The \\(9 \u00d7 9\\) box filters in the above images are approximations for Gaussian second order derivatives with \u03c3 = 1.2.

    We denote these approximations by \\(D_{xx}, D_{yy}, and D_{xy}\\).

    Now we can represent the determinant of the Hessian (approximated) as:\\(det(H_{approx})=D_{xx}D_{yy}-(wD_{xy})^2\\) \\(w=0.9 (Bay\u2019s\\ suggestion)\\)

    "},{"location":"DIP/feature/feature/#cscale-space-representation","title":"c.Scale-space representation","text":"

    SURF can be considered as a faster feature extraction method compared to SIFT.

    It processes the original image directly using box filters at different scales, eliminating the need to build multiple layers of a pyramid like SIFT. This makes SURF computationally more efficient, especially in scenarios where large-scale image databases or real-time applications are involved.

    • \u6211\u7684\u7406\u89e3\uff0c\u56e0\u4e3a\u76d2\u5b50\u6ee4\u6ce2\u53ef\u4ee5\u7528\u540c\u6837\u5904\u7406\u5728\u4e00\u5f20\u56fe\u4e0a\u5b8c\u6210\u8c61\u5f81\u7740\u6539\u53d8\u5c3a\u5ea6\uff08\u5bf9\u4e0d\u540c\u5c3a\u5ea6\u7684\u64cd\u4f5c\uff09\uff08\u6bd4\u5982\u4e0a\u56fe\u5c31\u662f\u5728\u505a\u5bf9\u5df2\u7ecf\uff08\u5bf9\u539f\u56fe\uff09\u964d\u91c7\u6837\u540e\u56fe\u7247\uff0c\u7684\u4e8c\u9636\u5fae\u5206)

    If you use a 9x9 box filter on a 36x36 image, and you start from the center of the filter, moving the width of the filter at each step, you would end up with a 4x4 grid, deriving 16 new coordinate detection points. This is because 36 divided by 9 equals 4, thus, you can get 4 coordinate points in each direction.

    However, this is just a logical understanding, and the actual results may vary due to the details of filter processing, such as edge handling, stride of the filter, and other factors.

    \u8fd9\u91cc\u53ef\u4ee5\u770b\u5230\u4e00\u4e2a\u95ee\u9898\uff0c\u627e\u5230\u7684\u5c40\u90e8\u6700\u5927\u503c\u5982\u679c\u653e\u56de\u539f\u56fe\u7684\u5c3a\u5ea6\uff0c\u5176\u5b9e\u662f\u5bf9\u5e94\u7740\u4e00\u4e2a\u533a\u57df\u7684\uff0c\u90a3\u4e48\u5982\u4f55\u786e\u5b9a\u4e00\u4e2a\u7cbe\u786e\u7684\u5750\u6807\u5462\uff1f

    To locate the precise position of feature points, we apply a Taylor expansion to the Hessian matrix at the local maximum points. This approximates a smooth surface depicting the variation of image intensity around the feature points. Then, we identify the peak of this smooth surface. Compared to the original discrete maximum point, the location of this peak is more accurate. Hence, we refer to it as the true location of the feature point.

    "},{"location":"DIP/feature/feature/#interpolation","title":"Interpolation","text":"

    For each local maximum, need to interpolate to get true location (to overcome discretization effects)

    "},{"location":"DIP/feature/feature/#2feature-description","title":"(2)Feature Description","text":""},{"location":"DIP/feature/feature/#orientation-assignment","title":"Orientation Assignment","text":"
    1. First calculate the Haar-wavelet responses in \\(x\\) and \\(y\\)-direction, and this in a circular neighborhood of radius \\(6*s\\) around the keypoint, with \\(s\\) the scale at which the keypoint was detected.

    Also, the sampling step is scale dependent and chosen to be s, and the wavelet responses are computed at that current scale s.

    Accordingly, at high scales the size of the wavelets is big. Therefore integral images are used again for fast filtering.

    1. Then we calculate the sum of vertical and horizontal wavelet responses in a scanning area, then change the scanning orientation (add \\(\u03c0/3\\)), and re-calculate, until we find the orientation with largest sum value, this orientation is the main orientation of feature descriptor.

    "},{"location":"DIP/feature/feature/#descriptor-components","title":"Descriptor Components","text":"

    Now it\u2019s time to extract the descriptor

    1. The first step consists of constructing a square region centered around the keypoint and oriented along the orientation we already got above. The size of this window is 20s.

    2. Then the region is split up regularly into smaller 4 \u00d7 4 square sub-regions. For each sub-region, we compute a few simple features at 5\u00d75 regularly spaced sample points.

    For reasons of simplicity, we call dx the Haar wavelet response in the horizontal direction and dy the Haar wavelet response in the vertical direction (filter size 2s).

    To increase the robustness towards geometric deformations and localization errors, the responses dx and dy are first weighted with a Gaussian (\u03c3 = 3.3s) centered at the keypoint.

    Then, the wavelet responses dx and dy are summed up over each subregion and form a first set of entries to the feature vector.

    In order to bring in information about the polarity of the intensity changes, we also extract the sum of the absolute values of the responses, |dx| and |dy|.

    Hence, each sub-region has a four-dimensional descriptor vector \\(\\vec{v}\\) for its underlying intensity structure \\(V = (\u2211 dx, \u2211 dy, \u2211|dx|, \u2211|dy|)\\).

    This results in a descriptor vector for all 4\u00d74 sub-regions of length 64.

    • (In \\(SIFT\\), our descriptor is the 128-D vector, so this is part of the reason that SURF is faster than Sift).
    "},{"location":"DIP/feature/feature/#image-stitching","title":"Image Stitching","text":"

    Procedure

    • Detect feature points in both images. --Build SIFT descriptors
    • Find correponding pairs -- Match SIFT descriptors (Euclidean distance)
    • Use these pairs to align the images -- Fitting the transformation
    • RANSAC
    • Image Blending
    "},{"location":"DIP/feature/feature/#ransac","title":"RANSAC","text":"

    A further refinement of matches.--RANdom SAmple Consensus

    In short words, \\(RANSAC\\) fits \\(N\\) models using different random sample S of the whole available data each time. Then, for each model it evaluates its performance P (i.e. number of inliers or outliers) and chooses the best one. Note that RANSAC doesn\u2019t determine what method should you use to find model parameters.(least squares for example)

    • How many samples are needed?

    • Suppose \\(w\\) is fraction of inliers (points from line).

    • \\(n\\) points needed to define hypothesis (2 for lines)

    • \\(k\\) samples chosen.

      Prob. that a single sample of n points is correct \\(w^n\\)

      Prob. that all k samples fail is: \\((1-w^n)^k\\)

      • Choose k high enough to keep this below desired failure rate.

    • k-- iterations

    • RANSAC divides data into inliers and outliers and yields estimate computed from minimal set of inliers.Improve this initial estimate with estimation over all inliers (e.g. with standard least-squares minimization).

    • But this may change inliers, so alternate fitting with re-classification as inlier/outlier.

    "},{"location":"DIP/feature/feature/#pros","title":"Pros:","text":"
    • General method suited for a wide range of model fitting problems
    • Easy to implement and easy to calculate its failure rate
    "},{"location":"DIP/feature/feature/#cons","title":"Cons:","text":"
    • Only handles a moderate percentage of outliers without cost blowing up
    • Many real problems have high rate of outliers (but sometimes selective choice of random subsets can help)

    A voting strategy, the Hough transform, can handle high percentage of outliers

    "},{"location":"DIP/feature/feature/#image-blending","title":"Image Blending","text":""},{"location":"DIP/feature/feature/#image-pyramids","title":"Image Pyramids","text":"
    • An image pyramid can be constructed by repeatedly downsampling (or upsampling) an image and creating a set of images at different resolutions.

    • The resulting images are referred to as \u201clevels\u201d of the pyramid, with the highest resolution image at the top and the lowest resolution image at the bottom.

    "},{"location":"DIP/feature/feature/#gaussian-pyramids","title":"Gaussian Pyramids","text":"

    This type of pyramid is constructed by repeatedly applying a Gaussian blur filter to an image and downsampling it by a factor of two. The resulting images are smoother and have lower resolution than the original image because Gaussians are low pass filters.

    "},{"location":"DIP/feature/feature/#laplacian-pyramid","title":"Laplacian Pyramid","text":"

    This type of pyramid is constructed by subtracting a downsampled version of an image from the original image.

    • The resulting images are high-pass filtered versions of the original image, which highlight the fine details and edges.
    "},{"location":"DIP/feature/feature/#procedure","title":"Procedure","text":"

    \u2022 Build Laplacian pyramid for both images: \\(L_A, L_B\\).

    \u2022 Build Gaussian pyramid for mask: \\(G\\).

    \u2022 Build a combined Laplacian pyramid: \\(L(j) = G(j) LA(j) + (1-G(j)) LB(j).\\)

    \u2022 Collapse \\(L\\) to obtain the blended image.

    "},{"location":"DIP/filter/filter/","title":"\u6ee4\u6ce2","text":""},{"location":"DIP/filter/filter/#_2","title":"\u5377\u79ef","text":"

    \\(L(x,y,\u03c3)=G(x,y,\u03c3)\u2217I(x,y)\\)

    \u8fde\u7eed\u5f62\u5f0f\uff1a\\((f\u2217g)(n)=\\int_{-\\infty }^{\\infty}f(\\tau )g(n-\\tau)d\\tau\\)

    \u79bb\u6563\u5f62\u5f0f\uff1a\\((f\u2217g)(n)=\\frac{1}{M}\\sum_{\\tau=0 }^{M-1}f(\\tau)g(n-\\tau)\\)

    "},{"location":"DIP/filter/filter/#properties","title":"Properties","text":"

    \\(f(x)*h(x)=h(x)*f(x)\\\\ f*(g+h)=f*g+f*h\\\\f*(g*h)=(f*g)*h\\)

    "},{"location":"DIP/filter/filter/#examples","title":"Examples","text":"
    • Effective range\uff1a

    Covers all the points that \\(h(t)\\) go through during the sliding operation.

    In this example, the effective range of x is from 0 to 799.

    "},{"location":"DIP/filter/filter/#_3","title":"\u57fa\u672c\u6982\u5ff5","text":"

    \u6ee4\u6ce2\u5668\u662f\u4e00\u4e2a\u5927\u5c0f\u4e3a \\(M\\times N\\) \u7684\u7a97\u53e3\uff0c\u5176\u4e2d\u7a97\u53e3\u4e2d\u7684\u5143\u7d20\u5bf9\u5e94\u4e8e\u539f\u59cb\u56fe\u50cf\u4e2d\u7684\u76f8\u5e94\u50cf\u7d20\u8fdb\u884c\u64cd\u4f5c\uff0c\u7ed3\u679c\u4fdd\u5b58\u4e3a\u65b0\u56fe\u50cf\u4e2d\u7684\u50cf\u7d20

    \u6ee4\u6ce2\u4e5f\u88ab\u79f0\u4f5c:\u906e\u7f69 (mask)\u3001\u5185\u6838 (kernel)\u3001\u6a21\u677f (template) \u7b49\u3002\u6ee4\u6ce2\u5668\u4e2d\u7684\u5143\u7d20\u662f\u7cfb\u6570\u800c\u4e0d\u662f\u50cf\u7d20\u503c\uff0c\u5b83\u4eec\u8868\u793a\u5e94\u7528\u4e8e\u539f\u59cb\u56fe\u50cf\u4e2d\u50cf\u7d20\u7684\u6743\u91cd\u3002\u5728\u5f85\u5904\u7406\u56fe\u50cf\u4e2d\u9010\u70b9\u79fb\u52a8\u63a9\u6a21\uff0c\u5728\u6bcf\u4e00\u70b9(x,y)\u5904\uff0c\u6ee4\u6ce2\u5668\u5728\u8be5\u70b9\u7684\u54cd\u5e94\u901a\u8fc7\u5b9e\u73b0\u5b9a\u4e49\u7684\u5173\u7cfb\u6765\u8ba1\u7b97\u3002\u5bf9\u4e8e\u7ebf\u6027\u7a7a\u95f4\u6ee4\u6ce2\uff0c\u5176\u54cd\u5e94\u7531\u6ee4\u6ce2\u5668\u7cfb\u6570\u4e0e\u6ee4\u6ce2\u63a9\u6a21\u626b\u8fc7\u533a\u57df\u7684\u5bf9\u5e94\u50cf\u7d20\u503c\u7684\u4e58\u79ef\u4e4b\u548c\u7ed9\u51fa\u3002

    \u901a\u5e38\uff0c\u63a9\u6a21\u7684\u957f\u5bbd\u90fd\u4e3a\u5947\u6570

    • \u5047\u8bbe\u5206\u522b\u4e3a\\(2a+1\\)\u548c\\(2b+1\\)\u3002\u5f53\u7a97\u53e3\u4e2d\u5fc3\u5904\u4e8e\u50cf\u7d20\\((x,y)\\)\u5904\u65f6\uff0c\u65b0\u7684\u50cf\u7d20\u503c\u4e3a\uff1a\\(g(x,y)=\\sum_{s=-a}^a\\sum_{t=-b}^b w(s,t)f(x+s,y+t)\\).\u5bf9\u56fe\u50cff\u4e2d\u6240\u6709\u50cf\u7d20\u90fd\u4e0e\u63a9\u6a21\u8fdb\u884c\u8fd0\u7b97\u4e4b\u540e\uff0c\u6700\u7ec8\u4ea7\u751f\u4e00\u5e45\u65b0\u56fe\u50cfg (\u8fd9\u5b9e\u9645\u4e0a\u662f\u4e00\u79cd\u5377\u79ef\u64cd\u4f5c)

    \u56fe\u50cf\u5728\u4f20\u8f93\u8fc7\u7a0b\u4e2d\uff0c\u7531\u4e8e\u4f20\u8f93\u4fe1\u9053\u3001\u91c7\u6837\u7cfb\u7edf\u8d28\u91cf\u8f83\u5dee\uff0c\u6216\u53d7\u5404\u79cd\u5e72\u6270\u7684\u5f71\u54cd\uff0c\u800c\u9020\u6210\u56fe\u50cf\u6bdb\u7cd9\uff0c\u6b64\u65f6\uff0c\u5c31\u9700\u5bf9\u56fe\u50cf\u8fdb\u884c\u5e73\u6ed1\u5904\u7406\u3002\u5e73\u6ed1\u53ef\u4ee5\u6291\u5236\u9ad8\u9891\u6210\u5206\uff0c\u4f46\u4e5f\u4f7f\u56fe\u50cf\u53d8\u5f97\u6a21\u7cca\u3002 \u5e73\u6ed1\u7a7a\u95f4\u6ee4\u6ce2\u5668\u7528\u4e8e\u6a21\u7cca\u5904\u7406\u548c\u51cf\u5c11\u566a\u58f0\u3002\u6a21\u7cca\u5904\u7406\u7ecf\u5e38\u7528\u4e8e\u9884\u5904\u7406\uff0c\u4f8b\u5982\uff0c\u5728\u63d0\u53d6\u5927\u7684\u76ee\u6807\u4e4b\u524d\u53bb\u9664\u56fe\u50cf\u4e2d\u4e00\u4e9b\u7410\u788e\u7684\u7ec6\u8282\uff0c\u6865\u63a5\u76f4\u7ebf\u6216\u66f2\u7ebf\u7684\u7f1d\u9699\u3002

    "},{"location":"DIP/filter/filter/#_4","title":"\u5e73\u6ed1\u7ebf\u6027\u7a7a\u95f4\u6ee4\u6ce2\u5668","text":"

    \u5e73\u6ed1\u7ebf\u6027\u7a7a\u95f4\u6ee4\u6ce2\u5668\u7684\u8f93\u51fa\u662f\u5305\u542b\u5728\u6ee4\u6ce2\u63a9\u6a21\u90bb\u57df\u5185\u50cf\u7d20\u7684\u7b80\u5355\u5e73\u5747\u503c\u3002\u56e0\u6b64\uff0c\u8fd9\u4e9b\u6ee4\u6ce2\u5668\u4e5f\u79f0\u4e3a\u5747\u503c\u6ee4\u6ce2\u5668\u3002

    • \u7b80\u5355\u5e73\u5747(simple mean)\uff0c\u8868\u793a\u7a97\u53e3\u4e2d\u6bcf\u4e00\u4e2a\u50cf\u7d20\u5bf9\u54cd\u5e94\u7684\u8d21\u732e\u662f\u4e00\u6837\u7684, \u6ee4\u6ce2\u7a97\u53e3\uff1a\\(\\frac{1}{9} \\times \\begin{bmatrix}1&1&1 \\\\ 1&1&1\\\\ 1&1&1\\end{bmatrix}\\)

    • \u52a0\u6743\u5e73\u5747(weighted mean)\uff0c\u8868\u793a\u7a97\u53e3\u4e2d\u7684\u50cf\u7d20\u5bf9\u76f8\u5e94\u7684\u8d21\u732e\u6709\u5927\u5c0f\u4e4b\u5206\uff0c\u6ee4\u6ce2\u7a97\u53e3\uff1a\\(\\frac{1}{16} \\times \\begin{bmatrix}1&2&1 \\\\ 2&4&2\\\\ 1&2&1\\end{bmatrix}\\)

    • General Equation

    \u5176\u4e2d\uff0c\u6ee4\u6ce2\u5668\u5927\u5c0f\u4e3a\\((2a+1) \u00d7(2b+1)\\)\uff0c\\(w\\)\u4e3a\u6ee4\u6ce2\u5668\uff0c\\(f\\)\u4e3a\u8f93\u5165\u56fe\u50cf\uff0c\\(g\\)\u4e3a\u8f93\u51fa\u56fe\u50cf\u3002

    • \u6ee4\u6ce2\u63a9\u6a21\u7684\u5927\u5c0f\u4e0e\u56fe\u50cf\u7684\u5e73\u6ed1\u6548\u679c\u6709\u76f4\u63a5\u7684\u5173\u7cfb

    \u5f53\u63a9\u6a21\u6bd4\u8f83\u5c0f\u65f6\uff0c\u53ef\u4ee5\u89c2\u5bdf\u5230\u5728\u6574\u5e45\u56fe\u50cf\u4e2d\u6709\u8f7b\u5fae\u7684\u6a21\u7cca

    \u5f53\u63a9\u6a21\u5927\u5c0f\u589e\u52a0\uff0c\u6a21\u7cca\u7a0b\u5ea6\u4e5f\u968f\u4e4b\u589e\u52a0

    • \u4e3a\u4e86\u5bf9\u611f\u5174\u8da3\u7269\u4f53\u5f97\u5230\u4e00\u4e2a\u7c97\u7565\u7684\u63cf\u8ff0\u800c\u6a21\u7cca\u4e00\u5e45\u56fe\u50cf\uff0c\u8fd9\u6837\uff0c\u90a3\u4e9b\u8f83\u5c0f\u7269\u4f53\u7684\u5f3a\u5ea6\u4e0e\u80cc\u666f\u6df7\u5408\u5728\u4e00\u8d77\u4e86\uff0c\u8f83\u5927\u7269\u4f53\u53d8\u5f97\u50cf\u201c\u6591\u70b9\u201d\u800c\u6613\u4e8e\u68c0\u6d4b\u3002\u63a9\u6a21\u7684\u5927\u5c0f\u7531\u90a3\u4e9b\u5373\u5c06\u878d\u5165\u80cc\u666f\u4e2d\u53bb\u7684\u7269\u4ef6\u5c3a\u5bf8\u6765\u51b3\u5b9a\u3002
    "},{"location":"DIP/filter/filter/#_5","title":"\u7edf\u8ba1\u6ee4\u6ce2\u5668","text":"

    \u7edf\u8ba1\u6ee4\u6ce2\u5668\u662f\u4e00\u79cd\u975e\u7ebf\u6027\u7684\u7a7a\u95f4\u6ee4\u6ce2\u5668\uff0c\u5b83\u7684\u54cd\u5e94\u662f\u57fa\u4e8e\u7a97\u53e3\u5185\u56fe\u50cf\u533a\u57df\u4e2d\u50cf\u7d20\u503c\u7684\u6392\u5e8f\uff0c\u7531\u7edf\u8ba1\u6392\u5e8f\u7ed3\u679c\u51b3\u5b9a\u7684\u503c\u4ee3\u66ff\u4e2d\u5fc3\u50cf\u7d20\u7684\u503c\u3002

    • \u7edf\u8ba1\u6ee4\u6ce2\u5668\u4e2d\u6700\u5e38\u89c1\u7684\u4f8b\u5b50\u5c31\u662f\u4e2d\u503c\u6ee4\u6ce2\u5668\u3002
    • \u7528\u50cf\u7d20\u90bb\u57df\u5185\u7070\u5ea6\u7684\u4e2d\u503c\u4ee3\u66ff\u8be5\u50cf\u7d20\u7684\u503c
    • \u63d0\u4f9b\u4e86\u4f18\u79c0\u7684\u53bb\u566a\u80fd\u529b\uff0c\u6bd4\u5c0f\u5c3a\u5bf8\u7684\u7ebf\u6027\u5e73\u6ed1\u6ee4\u6ce2\u5668\u7684\u6a21\u7cca\u7a0b\u5ea6\u660e\u663e\u8981\u4f4e
    • \u5bf9\u5904\u7406\u8109\u51b2\u566a\u58f0\uff08\u4e5f\u79f0\u4e3a\u6912\u76d0\u566a\u58f0\uff09\u975e\u5e38\u6709\u6548\uff0c\u56e0\u4e3a\u8fd9\u79cd\u566a\u58f0\u662f\u4ee5\u9ed1\u767d\u70b9\u53e0\u52a0\u5728\u56fe\u50cf\u4e0a\u7684\u3002

    • \u4e3a\u4e86\u5bf9\u4e00\u5e45\u56fe\u50cf\u4e0a\u7684\u67d0\u4e2a\u70b9\u4f5c\u4e2d\u503c\u6ee4\u6ce2\u5904\u7406\u3002\u5fc5\u987b\u5148\u5c06\u63a9\u6a21\u5185\u6b32\u6c42\u7684\u50cf\u7d20\u53ca\u5176\u90bb\u57df\u7684\u50cf\u7d20\u503c\u6392\u5e8f\uff0c\u786e\u5b9a\u51fa\u4e2d\u503c\uff0c\u5e76\u5c06\u4e2d\u503c\u8d4b\u4e88\u8be5\u50cf\u7d20\u70b9

    \u4e2d\u503c\\(\u03be\\) --\u6570\u503c\u96c6\u5408\u4e2d\uff0c\u6709\u4e00\u534a\u6570\u503c\u5c0f\u4e8e\u6216\u7b49\u4e8e\\(\u03be\\)\uff0c\u8fd8\u6709\u4e00\u534a\u5927\u4e8e\u6216\u7b49\u4e8e\\(\u03be\\)

    \u4e3a\u4e86\u5bf9\u4e00\u5e45\u56fe\u50cf\u4e0a\u7684\u67d0\u4e2a\u70b9\u4f5c\u4e2d\u503c\u6ee4\u6ce2\u5904\u7406,\u5fc5\u987b\u5148\u5c06\u63a9\u6a21\u5185\u6b32\u6c42\u7684\u50cf\u7d20\u53ca\u5176\u90bb\u57df\u7684\u50cf\u7d20\u503c\u6392\u5e8f\uff0c\u786e\u5b9a\u51fa\u4e2d\u503c\uff0c\u5e76\u5c06\u4e2d\u503c\u8d4b\u4e88\u8be5\u50cf\u7d20\u70b9

    • \u5e38\u7528\\(n\\times n\\)\u7684\u4e2d\u503c\u6ee4\u6ce2\u5668\u53bb\u9664\u90a3\u4e9b\u76f8\u5bf9\u4e8e\u5176\u90bb\u57df\u50cf\u7d20\u66f4\u4eae\u6216\u66f4\u6697\uff0c\u5e76\u4e14\u5176\u533a\u57df\u5c0f\u4e8e\\(n^2/2\\)\uff08\u6ee4\u6ce2\u5668\u533a\u57df\u7684\u4e00\u534a\uff09\u7684\u5b64\u7acb\u50cf\u7d20\u96c6
    "},{"location":"DIP/filter/filter/#sharpening-spatial-filter","title":"Sharpening spatial filter","text":"

    \u62c9\u666e\u62c9\u65af\u9510\u5316\u662f\u4e00\u79cd\u56fe\u50cf\u5904\u7406\u6280\u672f\uff0c\u65e8\u5728\u7a81\u51fa\u56fe\u50cf\u4e2d\u7684\u8fb9\u7f18\u548c\u7ec6\u8282\uff0c\u4f7f\u56fe\u50cf\u770b\u8d77\u6765\u66f4\u52a0\u9510\u5229\u3002\u8fd9\u79cd\u6280\u672f\u4f7f\u7528\u62c9\u666e\u62c9\u65af\u7b97\u5b50\uff08Laplacian operator\uff09\u6216\u62c9\u666e\u62c9\u65af\u6ee4\u6ce2\u5668\u5bf9\u56fe\u50cf\u8fdb\u884c\u5377\u79ef\u64cd\u4f5c\uff0c\u4ee5\u589e\u5f3a\u56fe\u50cf\u4e2d\u7684\u9ad8\u9891\u4fe1\u606f\u3002

    "},{"location":"DIP/filter/filter/#1","title":"(1)\u62c9\u666e\u62c9\u65af\u7b97\u5b50","text":"

    \u4e00\u9636\u5fae\u5206\u7b97\u5b50:\\(\\frac{\\partial{f}}{\\partial{x}}\\)$= f(x + 1) \u2212 f(x) $

    \u4e8c\u9636\u5fae\u5206\u7b97\u5b50:\\(\\frac{\\partial^2{f}}{\\partial{x}^2}\\)\\(= f(x + 1) +f(x-1)\u2212 2f(x)\\)

    • \u5bf9\u4e8e\u51fd\u6570f(x,y)\uff0c\u9996\u5148\u5b9a\u4e49\u4e00\u4e2a\u4e8c\u7ef4\u5217\u5411\u91cf\uff1a

    • \u5bf9\u6574\u5e45\u56fe\u50cf\u8ba1\u7b97\u68af\u5ea6\u65f6\uff0c\u8fd0\u7b97\u91cf\u4f1a\u5f88\u5927\uff0c\u56e0\u6b64\uff0c\u5728\u5b9e\u9645\u64cd\u4f5c\u4e2d\uff0c\u5e38\u7528\u7edd\u5bf9\u503c\u4ee3\u66ff\u5e73\u65b9\u4e0e\u5e73\u65b9\u6839\u8fd0\u7b97\u8fd1\u4f3c\u6c42\u68af\u5ea6\u7684\u6a21\u503c \\(\\triangledown f \\approx |G_x|+|G_y|\\)

    • \u79bb\u6563\u5f62\u5f0f

    \\(\\ \\ \\ \\triangledown^2f=f(x+1,y)+f(x-1,y)+f(x,y+1),F(x,y-1)-4f(x,y)\\)

    • Laplacian operator is defined as \\(\\triangledown^2 f=\\frac{\\partial^2f}{\\partial x ^2}+\\frac{\\partial^2f}{\\partial y ^2}\\)
    • Along x axis \\(\\frac{\\partial^2{f}}{\\partial{x}^2}= f(x + 1,y) +f(x-1,y)\u2212 2f(x,y)\\)
    • Along y axis \\(\\frac{\\partial^2{f}}{\\partial{y}^2}= f(x,y+1) +f(x,y-1)\u2212 2f(x,y)\\)
    • discrete Laplacian operator \\(\\triangledown^2f=f(x+1,y)+f(x-1,y)+f(x,y+1),F(x,y-1)-4f(x,y)\\)
    "},{"location":"DIP/filter/filter/#2","title":"(2)\u62c9\u666e\u62c9\u65af\u53d8\u6362\u56fe\u50cf\u9510\u5316","text":"
    • \u63a9\u6a21

    \u5982\u679c\u8003\u8651\u5bf9\u89d2\u7ebf\u5143\u7d20

    • \u7531\u4e8e\u62c9\u666e\u62c9\u65af\u7b97\u5b50\u662f\u4e00\u79cd\u5bfc\u6570\u7b97\u5b50\uff0c\u5b83\u7684\u4f7f\u7528\u4f1a\u7a81\u51fa\u663e\u793a\u56fe\u50cf\u4e2d\u7684\u5f3a\u5ea6\u4e0d\u8fde\u7eed\u6027\uff0c\u800c\u4e0d\u5f3a\u8c03\u5177\u6709\u7f13\u6162 \u53d8\u5316\u7684\u5f3a\u5ea6\u7ea7\u522b\u7684\u533a\u57df\u3002\u8fd9\u5c06\u503e\u5411\u4e8e\u751f\u6210\u5177\u6709\u7070\u8272\u8fb9\u7f18\u7ebf\u548c\u5176\u4ed6\u4e0d\u8fde\u7eed\u6027\u7684\u56fe\u50cf\uff0c\u6240\u6709\u8fd9\u4e9b\u56fe\u50cf\u90fd\u53e0\u52a0\u5728\u9ed1\u6697\u3001\u65e0\u7279\u5f81\u7684\u80cc\u666f\u4e0a\u3002\u53ea\u9700\u5c06\u62c9\u666e\u62c9\u65af\u56fe\u50cf\u6dfb\u52a0\u5230\u539f\u59cb\u56fe\u50cf\u4e2d\uff0c\u5373\u53ef\u201c\u6062\u590d\u201d\u80cc\u666f\u7279\u5f81\uff0c\u540c\u65f6\u4ecd\u4fdd\u6301\u62c9 \u666e\u62c9\u65af\u56fe\u50cf\u7684\u9510\u5316\u6548\u679c

    • \u4e5f\u5c31\u662f\u8bf4\uff0c\u5982\u679c\u4f7f\u7528\u7684\u5b9a\u4e49\u5177\u6709\u8d1f\u4e2d\u5fc3\u7cfb\u6570\uff0c\u5219\u6211\u4eec\u51cf\u53bb\u800c\u4e0d\u662f\u6dfb\u52a0\u62c9\u666e\u62c9\u65af\u56fe\u50cf\u4ee5\u83b7\u5f97\u9510\u5316\u7ed3\u679c

    • \u56e0\u6b64\uff0c\u6211\u4eec\u4f7f\u7528\u62c9\u666e\u62c9\u65af\u51fd\u6570\u8fdb\u884c\u56fe\u50cf\u9510\u5316\u7684\u57fa\u672c\u65b9\u6cd5\u662f:

    \\(g(x,y)=\\left\\{\\begin{array}{ll}f(x,y)-\\triangledown^2f(x,y)& if\\ the\\ center\\ of\\ the\\ mask\\ is\\ negative \\\\ f(x,y)+\\triangledown^2f(x,y)& if\\ the\\ center\\ of\\ the\\ mask\\ is\\ positive \\end{array} \\right.\\)

    • \u5c06\u539f\u59cb\u56fe\u50cf\u548c\u62c9\u666e\u62c9\u65af\u56fe\u50cf\u53e0\u52a0\u5728\u4e00\u8d77\u7684\u7b80\u5355\u65b9\u6cd5\u53ef\u4ee5\u4fdd\u62a4\u62c9\u666e\u62c9\u65af\u9510\u5316\u5904\u7406\u7684\u6548\u679c\uff0c\u540c\u65f6\u53c8\u80fd\u590d\u539f\u80cc\u666f\u4fe1\u606f\u3002
    "},{"location":"DIP/filter/filter/#_6","title":"\u9ad8\u65af\u6ee4\u6ce2","text":"

    \u9ad8\u65af\u6ee4\u6ce2\u662f\u4e00\u79cd\u5e38\u7528\u7684\u56fe\u50cf\u5904\u7406\u6ee4\u6ce2\u5668\uff0c\u5176\u4e3b\u8981\u76ee\u7684\u662f\u5bf9\u56fe\u50cf\u8fdb\u884c\u5e73\u6ed1\u5904\u7406\u3002\u5b83\u7684\u540d\u79f0\u6765\u6e90\u4e8e\u6240\u4f7f\u7528\u7684\u6ee4\u6ce2\u6838\uff08\u5377\u79ef\u6838\uff09\u662f\u4e00\u4e2a\u4e8c\u7ef4\u9ad8\u65af\u51fd\u6570\u3002\u9ad8\u65af\u6ee4\u6ce2\u5728\u53bb\u9664\u56fe\u50cf\u4e2d\u7684\u566a\u58f0\u3001\u6a21\u7cca\u5904\u7406\u3001\u8fb9\u7f18\u68c0\u6d4b\u7b49\u65b9\u9762\u6709\u7740\u5e7f\u6cdb\u7684\u5e94\u7528\u3002

    \u9ad8\u65af\u6ee4\u6ce2\u7684\u6838\u5fc3\u601d\u60f3\u662f\u5bf9\u56fe\u50cf\u4e2d\u7684\u6bcf\u4e2a\u50cf\u7d20\u70b9\u8fdb\u884c\u52a0\u6743\u5e73\u5747\uff0c\u5176\u4e2d\u6743\u503c\u662f\u7531\u4e8c\u7ef4\u9ad8\u65af\u51fd\u6570\u786e\u5b9a\u7684\u3002\u8fd9\u610f\u5473\u7740\u79bb\u4e2d\u5fc3\u50cf\u7d20\u8d8a\u8fdc\u7684\u50cf\u7d20\u5bf9\u4e2d\u5fc3\u50cf\u7d20\u7684\u5f71\u54cd\u8d8a\u5c0f\uff0c\u8fd9\u79cd\u6743\u503c\u7684\u5206\u5e03\u7b26\u5408\u9ad8\u65af\u5206\u5e03\u3002\u901a\u8fc7\u8c03\u6574\u9ad8\u65af\u51fd\u6570\u7684\u6807\u51c6\u5dee\\(\u03c3\\)\uff0c\u53ef\u4ee5\u63a7\u5236\u6743\u503c\u7684\u5206\u5e03\u8303\u56f4\uff0c\u4ece\u800c\u8c03\u6574\u6ee4\u6ce2\u6548\u679c\u3002

    "},{"location":"DIP/filter/filter/#1_1","title":"(1)\u6570\u5b66\u8868\u8fbe","text":"
    • \u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u4e8c\u7ef4\u9ad8\u65af\u51fd\u6570\u8868\u793a\u4e3a\\(f(x,y)=\\frac{1}{\\sqrt{2\\pi}\\sigma_x}e^{-\\frac{(x-\\mu_x)^2}{2\\sigma_x^2}}\\cdot \\frac{1}{\\sqrt{2\\pi}\\sigma_y}e^{-\\frac{(y-\\mu_y)^2}{2\\sigma_y^2}}\\)

    \u5728\u56fe\u50cf\u6ee4\u6ce2\u4e2d,\u4e00\u822c\u60c5\u51b5\u4e0b\\(\u03bc_x = \u03bc_y = 0\\)\u56e0\u6b64\u4e8c\u7ef4\u9ad8\u65af\u51fd\u6570\u53ef\u8868\u793a\u4e3a\\(f(x,y)=\\frac{1}{2\\pi\\sigma^2}e^{-\\frac{x^2+y^2}{2\\sigma^2}}\\)

    "},{"location":"DIP/filter/filter/#2_1","title":"(2)\u6ee4\u6ce2\u8fc7\u7a0b","text":"
    • \u9ad8\u65af\u6838\u7684\u6c42\u89e3\uff1a

    \u5c06\u5404\u4e2a\u4f4d\u7f6e\u7684\u5750\u6807\u4ee3\u5165\u5230\u9ad8\u65af\u51fd\u6570\u4e2d,\u5f97\u5230\u7684\u503c\u5c31\u662f\u521d\u6b65\u7684\u9ad8\u65af\u6838

    • \u5f52\u4e00\u5316\uff1a

    "},{"location":"DIP/filter/filter/#3","title":"(3) \u5206\u79bb\u5b9e\u73b0\u9ad8\u65af\u6ee4\u6ce2","text":"

    \u5229\u7528\u9ad8\u65af\u51fd\u6570\u8fdb\u884c\u5377\u79ef(\u9ad8\u65af\u6ee4\u6ce2)\u7684\u8fc7\u7a0b\u5177\u6709\u53ef\u5206\u79bb\u6027\u3002

    "},{"location":"DIP/filter/filter/#_7","title":"\u53cc\u8fb9\u6ee4\u6ce2","text":"

    \u53cc\u8fb9\u6ee4\u6ce2\uff08Bilateral filter\uff09\u662f\u4e00\u79cd\u975e\u7ebf\u6027\u7684\u6ee4\u6ce2\u65b9\u6cd5\uff0c\u662f\u7ed3\u5408\u56fe\u50cf\u7684\u7a7a\u95f4\u90bb\u8fd1\u5ea6\u548c\u50cf\u7d20\u503c\u76f8\u4f3c\u5ea6\u7684\u4e00\u79cd\u6298\u8877\u5904\u7406\uff0c\u540c\u65f6\u8003\u8651\u7a7a\u57df\u4fe1\u606f\u548c\u7070\u5ea6\u76f8\u4f3c\u6027\uff0c\u8fbe\u5230\u4fdd\u8fb9\u53bb\u566a\u7684\u76ee\u7684\u3002\u5177\u6709\u7b80\u5355\u3001\u975e\u8fed\u4ee3\u3001\u5c40\u90e8\u7684\u7279\u70b9

    • \u53bb\u566a\uff0c\u5e73\u6ed1\uff0c\u4fdd\u7559\u8fb9\u7f18

    \u53cc\u8fb9\u6ee4\u6ce2\u5668\u7684\u597d\u5904\u662f\u53ef\u4ee5\u505a\u8fb9\u7f18\u4fdd\u5b58\uff08edge preserving\uff09\uff0c\u4e00\u822c\u7528\u9ad8\u65af\u6ee4\u6ce2\u53bb\u964d\u566a\uff0c\u4f1a\u8f83\u660e\u663e\u5730\u6a21\u7cca\u8fb9\u7f18\uff0c\u5bf9\u4e8e\u9ad8\u9891\u7ec6\u8282\u7684\u4fdd\u62a4\u6548\u679c\u5e76\u4e0d\u660e\u663e\u3002\u53cc\u8fb9\u6ee4\u6ce2\u5668\u987e\u540d\u601d\u4e49\u6bd4\u9ad8\u65af\u6ee4\u6ce2\u591a\u4e86\u4e00\u4e2a\u9ad8\u65af\u65b9\u5deesigma\uff0dd\uff0c\u5b83\u662f\u57fa\u4e8e\u7a7a\u95f4\u5206\u5e03\u7684\u9ad8\u65af\u6ee4\u6ce2\u51fd\u6570\uff0c\u6240\u4ee5\u5728\u8fb9\u7f18\u9644\u8fd1\uff0c\u79bb\u7684\u8f83\u8fdc\u7684\u50cf\u7d20\u4e0d\u4f1a\u592a\u591a\u5f71\u54cd\u5230\u8fb9\u7f18\u4e0a\u7684\u50cf\u7d20\u503c\uff0c\u8fd9\u6837\u5c31\u4fdd\u8bc1\u4e86\u8fb9\u7f18\u9644\u8fd1\u50cf\u7d20\u503c\u7684\u4fdd\u5b58\u3002\u4f46\u662f\u7531\u4e8e\u4fdd\u5b58\u4e86\u8fc7\u591a\u7684\u9ad8\u9891\u4fe1\u606f\uff0c\u5bf9\u4e8e\u5f69\u8272\u56fe\u50cf\u91cc\u7684\u9ad8\u9891\u566a\u58f0\uff0c\u53cc\u8fb9\u6ee4\u6ce2\u5668\u4e0d\u80fd\u591f\u5e72\u51c0\u7684\u6ee4\u6389\uff0c\u53ea\u80fd\u591f\u5bf9\u4e8e\u4f4e\u9891\u4fe1\u606f\u8fdb\u884c\u8f83\u597d\u7684\u6ee4\u6ce2

    • \u5f15\u5165\u4e86\u5feb\u901f\u5085\u7acb\u53f6\u53d8\u6362\u624d\u5b9e\u73b0\u4e86\u52a0\u901f!
    "},{"location":"DIP/filter/filter/#brute-force-implementation","title":"Brute-force Implementation","text":"
    • Nonlinear

    • Complex, spatially varying kernels

    • Cannot be pre-computed

    • Brute-force implementation is slow > 10min

    "},{"location":"DIP/filter/filter/#1_2","title":"(1)\u6570\u5b66\u63a8\u5bfc","text":"

    \\(h(x)=k_r^{\u22121}(x)\u222b^{+\u221e}_{\u2212\u221e}\u222b^{+\u221e}_{\u2212\u221e}f(\u03be)c(\u03be,x)s(f(\u03be),f(x))d\u03be\\)

    \\(c(\u03be,x)=\\frac{1}{2\\pi\\sigma_s^2}e^{-\\frac{||\u03be-x||^2}{2\\sigma_s^2}}\\)

    \\(s(f(\u03be),f(x))=\\frac{1}{2\\pi\\sigma_r^2}e^{-\\frac{||f(\u03be)-f(x)||^2}{2\\sigma_r^2}}\\)

    • \\(Which\\) \\(is\\) \\(BF[I]p=\\frac{1}{W_p}\\sum_{q\\in S}G_{\\sigma_s}(||p-q||)G_{\\sigma_r}(|O_p-I_q|)I_q\\) !!!

    • \\(\\frac{1}{W_p}\\)\u4e3a\u5f52\u4e00\u5316\u56e0\u5b50

    "},{"location":"DIP/filter/filter/#2_2","title":"(2)\u53c2\u6570\u8bbe\u7f6e","text":"
    • \\(\u03c3_s\\) \u8d8a\u5927\uff0c\u56fe\u50cf\u8d8a\u5e73\u6ed1\uff0c\u8d8b\u4e8e\u65e0\u7a77\u5927\u65f6\uff0c\u6bcf\u4e2a\u6743\u91cd\u90fd\u4e00\u6837\uff0c\u7c7b\u4f3c\u5747\u503c\u6ee4\u6ce2.

    \\(\u03c3_s\\) \u8d8a\u5c0f\uff0c\u4e2d\u5fc3\u70b9\u6743\u91cd\u8d8a\u5927\uff0c\u5468\u56f4\u70b9\u6743\u91cd\u8d8a\u5c0f\uff0c\u5bf9\u56fe\u50cf\u7684\u6ee4\u6ce2\u4f5c\u7528\u8d8a\u5c0f\uff0c\u8d8b\u4e8e\u96f6\u65f6\uff0c\u8f93\u51fa\u7b49\u540c\u4e8e\u539f\u56fe.

    • \\(\u03c3_r\\) \u8d8a\u5927\uff0c\u8fb9\u7f18\u8d8a\u6a21\u7cca\uff0c\u6781\u9650\u60c5\u51b5\u4e3a\\(\u03c3_r\\) \u65e0\u7a77\u5927\uff0c\u503c\u57df\u7cfb\u6570\u8fd1\u4f3c\u76f8\u7b49(\u5ffd\u7565\u5e38\u6570\u65f6\uff0c\u5c06\u8fd1\u4e3a \\(e_0 = 1\\))\uff0c\u4e0e\u9ad8\u65af\u6a21\u677f(\u7a7a\u95f4\u57df\u6a21\u677f)\u76f8\u4e58\u540e\u53ef\u8ba4\u4e3a\u7b49\u6548\u4e8e\u9ad8\u65af\u6ee4\u6ce2.

    \\(\u03c3_r\\) \u8d8a\u5c0f\uff0c\u8fb9\u7f18\u8d8a\u6e05\u6670\uff0c\u6781\u9650\u60c5\u51b5\u4e3a \\(\u03c3_r\\) \u65e0\u9650\u63a5\u8fd1 0\uff0c\u503c\u57df\u7cfb\u6570\u9664\u4e86\u4e2d\u5fc3\u4f4d\u7f6e\uff0c\u5176\u4ed6\u8fd1\u4f3c\u4e3a 0(\u63a5\u8fd1 \\(e_\u221e = 0\\))\uff0c\u4e0e\u9ad8\u65af\u6a21\u677f(\u7a7a\u95f4\u57df\u6a21\u677f)\u76f8\u4e58\u8fdb\u884c\u6ee4\u6ce2\u7684\u7ed3\u679c\u7b49\u6548\u4e8e\u539f\u56fe\u50cf.

    "},{"location":"DIP/filter/filter/#how-to-set-the-parameters","title":"How to Set the Parameters","text":"

    Depends on the application. For instance:

    • space parameter: proportional to image size

    e.g., 2% of image diagonal

    • intensity parameter: proportional to edge amplitude

    e.g., mean or median of image gradients

    • independent of resolution and exposure

    • Iterating the Bilateral Filter

    "},{"location":"DIP/filter/filter/#bilateral-filtering-color-images","title":"Bilateral Filtering Color Images","text":""},{"location":"DIP/filter/filter/#denoising","title":"Denoising","text":"
    • Small spatial sigma (e.g. 7x7 window)

    • Adapt intensity sigma to noise level

    • Maybe not best denoising method, but best simplicity/quality trade-off
    • No need for acceleration (small kernel)But the denoising feature in e.g. Photoshop is better
    "},{"location":"DIP/filter/filter/#tone-mapping","title":"Tone mapping","text":"
    • Match limited contrast of the medium
    • Preserve details
    "},{"location":"DIP/filter/filter/#disadvantages","title":"Disadvantages","text":"
    • Nonlinear
    • Vompex spatially varying kernels
    • Connot be pre-computed
    • Brute-force implementation is slow
    • \u68af\u5ea6\u7ffb\u8f6c
    "},{"location":"DIP/filter/filter/#a-fast-approximation-of-the-bilateral-filter-using-a-signal-processing-approach","title":"A Fast Approximation of the bilateral filter using a signal processing approach","text":""},{"location":"DIP/filter/filter/#preknowledge","title":"PreKnowledge","text":"

    \u5377\u79ef\u5b9a\u7406\u544a\u8bc9\u6211\u4eec\uff0c\u5728\u9891\u57df\u4e2d\uff0c\u5377\u79ef\u7b49\u4ef7\u4e8e\u76f8\u4e58\u3002\u6240\u4ee5\uff0c\u5728\u9891\u57df\u4e2d\uff0c\u56fe\u50cf F(u,v*) \u4e0e\u6ee4\u6ce2\u6838 Hb(u,v)\u7684\u5377\u79ef\u7ed3\u679c G(u,v)\u53ef\u4ee5\u8868\u793a\u4e3a\uff1a

    \\(G(u,v)=F(u,v)\u22c5H_b(u,v)\\)

    \u53c2\u8003 https://blog.csdn.net/xijuezhu8128/article/details/111304006

    \u5176\u57fa\u672c\u601d\u60f3\u5c31\u662f\u5c06\u975e\u7ebf\u6027\u7684\u53cc\u8fb9\u6ee4\u6ce2\u6539\u6210\u53ef\u5206\u79bb\u7684\u7ebf\u6027\u64cd\u4f5c\u548c\u975e\u7ebf\u6027\u64cd\u4f5c\u3002\u6362\u53e5\u8bdd\u8bf4\uff0c\u539f\u6765\u7684\u53cc\u8fb9\u6ee4\u6ce2\u5728\u56fe\u50cf\u4e0d\u540c\u4f4d\u7f6e\u5e94\u7528\u4e0d\u540c\u7684\u6743\u91cd\uff0c\u4e5f\u5c31\u662f\u4f4d\u79fb\u6539\u53d8\u5377\u79ef\uff0c\u4ed6\u4eec\u901a\u8fc7\u589e\u52a0\u4e00\u4e2a\u7ef4\u5ea6\uff0c\u4e5f\u5c31\u662f\u5c06\u7070\u5ea6\u503c\u4f5c\u4e3a\u4e00\u4e2a\u65b0\u7684\u7ef4\u5ea6\uff0c\u5c06\u53cc\u8fb9\u6ee4\u6ce2\u8868\u8fbe\u62103D\u7a7a\u95f4\u4e2d\u7684\u7ebf\u6027\u4f4d\u79fb\u4e0d\u53d8\u5377\u79ef\uff0c\u6700\u540e\u518d\u6267\u884c\u975e\u7ebf\u6027\u7684\u5f52\u4e00\u5316\u64cd\u4f5c\u3002

    "},{"location":"DIP/filter/filter/#derivation","title":"Derivation","text":"

    (1\uff09 \u9996\u5148\u5c06\u539f\u59cb\u53cc\u8fb9\u6ee4\u6ce2\u516c\u5f0f\u7b49\u5f0f\u5de6\u53f3\u7686\u5de6\u4e58\\(W_p^b\\)\uff0c\u5e76\u5c06\u4e24\u4e2a\u516c\u5f0f\u901a\u8fc7\u4e8c\u7ef4\u5411\u91cf\u8868\u8fbe\u6210\u5355\u4e2a\u516c\u5f0f\uff1a

    \uff082\uff09\u7b49\u5f0f\u53f3\u4fa7\u4e58\u4ee5\\(W_q\\)\uff0c\\(W_q\\)=1\uff1a

    \u4e0a\u56fe\u4e2d\uff0c\u5982\u679c\u5ffd\u7565\u7b49\u5f0f\u53f3\u4fa7\u7684\\(G_{\\sigma_r}(|I_p-I_q|)\\)\u8fd9\u4e00\u9879\uff0c\u90a3\u4e48\u8be5\u7b49\u5f0f\u8868\u8fbe\u7684\u5c31\u662f\u7ecf\u5178\u7684\u9ad8\u65af\u6ee4\u6ce2

    \u53ef\u4ee5\u7b80\u5199\u4e3a\u4ee5\u4e0b\u5377\u79ef\u7684\u5f62\u5f0f\uff1a\\(\\begin{pmatrix}W^bI^b\\\\W^b\\end{pmatrix}=G_{\\sigma_r}*\\begin{pmatrix}WI\\\\W\\end{pmatrix}\\)

    \uff083\uff09\u589e\u7ef4\uff0c\u589e\u52a0\u5f3a\u5ea6\u7ef4\uff08\u4e5f\u5c31\u662f\u7070\u5ea6\u503c\uff09\uff1a

    \u4f7f\u7528\\(Kronecker\\)\u51fd\u6570\uff0c\\(\\delta\\)\u53ea\u5728\\(0\\)\u70b9\u4e3a\\(1\\)\uff0c\u5176\u4ed6\u4e3a0

    THUS

    \u4e0a\u5f0f\u53ef\u4ee5\u8868\u8fbe\u4e3a\u5728\u70b9\uff08\\(p\\), \\(I_p\\)\uff09\u4f4d\u7f6e\u5904\u4e09\u7ef4\u5377\u79ef\u7684\u5f62\u5f0f\uff1a

    \uff085\uff09\u6574\u4e2a\u6d41\u7a0b\uff1a\u7ebf\u6027\u5377\u79ef+\u975e\u7ebf\u6027\u5f52\u4e00\u5316

    \u5728\u8fd9\u4e2a\u8fc7\u7a0b\u4e2d\uff0c\u4e3b\u8981\u7684\u52a0\u901f\u6765\u81ea\u4e8e\u5728\u9891\u57df\u4e2d\u6267\u884c\u5377\u79ef\u64cd\u4f5c\u3002\u9891\u57df\u5377\u79ef\u901a\u5e38\u6bd4\u65f6\u57df\u5377\u79ef\u66f4\u5feb\uff0c\u5c24\u5176\u662f\u5728\u4f7f\u7528\u5feb\u901f\u5085\u91cc\u53f6\u53d8\u6362\uff08FFT\uff09\u7b49\u9ad8\u6548\u7b97\u6cd5\u65f6\u3002

    "},{"location":"DIP/filter/filter/#guided-filter","title":"Guided Filter","text":"
    • \u4fdd\u6301\u68af\u5ea6\u662fbilateral\uff08\u4fdd\u6301\u7684\u662f\u68af\u5ea6\u7684\u7edd\u5bf9\u503c\uff09\u505a\u4e0d\u5230\u7684\uff0c\u56e0\u4e3a\u4f1a\u6709\u68af\u5ea6\u7ffb\u8f6c\u73b0\u8c61\uff08Preserves edges, but not gradients\uff09\u800c\u5bfc\u5411\u6ee4\u6ce2\u53ef\u4ee5\u907f\u514d\u8fd9\u4e00\u7f3a\u70b9

    \u5f15\u5165 guided image \\(I\\)

    • \u4fdd\u6301\u68af\u5ea6\uff0cso \\(q_i(output\\ image)=aI_i(guided\\ image)+b\\)

    • Use Lagrange multiplier method , we can get \\(a=\\frac{cov(I,p)}{var(I)+\\epsilon} \\ \\ \\ b=\\bar{p}-a\\bar{I}\\)

    • \\(\\epsilon\\) -- Degree of edge preserving !!

    • No Distortion

    • Limitation : LOCAL FILTER

    \u5bf9\u8fb9\u7f18\u7684\u5b9a\u4e49\u4e0d\u6e05\u6dc5\uff0c\u800c\u4e14\u8fb9\u7f18\u662f context-dependent \u7684\u3002\u8089\u773c\u4e2d\u7684\u8fb9\u754c\uff0c\u53ef\u80fd\u4e0d\u88ab\u8ba4\u4e3a\u662f\u8fb9\u754c\uff0c\u6700\u7ec8\u8fd8\u662f\u4f1a\u51fa\u73b0 halo \u7684\u73b0\u8c61\u3002

    "},{"location":"DIP/filter/filter/#sparse-norm-filter","title":"Sparse Norm Filter","text":"

    https://note.hobbitqia.cc/dip/dip9/#core-algorithm

    "},{"location":"DIP/filter/filter/#p1","title":"p=1","text":"

    \\(l^1\\) norm filter is the median filter(\u4e2d\u503c\u6ee4\u6ce2)

    • Because the diffusion in SNF is non-local, it is less likely to be trapped as in gradient descent based algorithms.
    "},{"location":"DIP/filter/filter/#p2","title":"p=2","text":"

    \\(l^2\\) norm mean filter(\u5747\u503c\u6ee4\u6ce2)

    "},{"location":"DIP/morph/morph/","title":"Morph","text":"

    Morph is not warp (geometric transformation)Morph is a kind of morphological changing, which makes an image change to another image gradually. Morph handles both the location and the intensity of a pixel.The beginning image and end image are two key frames. Other frames between the two key frames are generated automatically.

    • \u5927\u5c0f\u76f8\u540c\u7684\u4e24\u5e45\u56fe\u7684\u8f6c\u6362\u4f5c\u9759\u6001\u53d8\u6362\u4ece\u4e00\u5e45\u56fea\u9010\u6e10\u53d8\u5316\u6210\u7b2c\u4e8c\u5e45\u56feb
    • \u539f\u7406\uff1a\u8ba9\u56fea\u4e2d\u6bcf\u4e2a\u50cf\u7d20\u7684\u989c\u8272\uff0c\u9010\u6e10\u53d8\u6210\u56feb\u76f8\u540c\u4f4d\u7f6e\u50cf\u7d20\u7684\u989c\u8272
    • \u65b9\u6cd5\uff1a\u6839\u636e\u53d8\u6362\u7684\u5feb\u6162\uff0c\u8bbe\u7f6e\u76f8\u5e94\u7684\u6b65\u957f\uff0c\u5c06\u56fea\u6bcf\u4e00\u70b9\u7684RGB\u9010\u6e10\u53d8\u6210\u56feb\u76f8\u540c\u4f4d\u7f6e\u8c61\u7d20\u7684RGB,\u53ef\u4ee5\u9009\u62e9\u7b49\u6bd4\u6216\u7b49\u5dee\u7684\u65b9\u5f0f\uff0c\u6216\u5176\u5b83\u65b9\u5f0f\u8ba9\uff1a\\(ra-->rb\\)
    • \u5bf9\u4e8e\u7070\u5ea6\u56fe\u50cf\uff0c\u53ef\u4ee5\u76f4\u63a5\u7528\u7b49\u6bd4\u6216\u7b49\u5dee\u7ea7\u6570\u5b9a\u4e49\u6b65\u957f\uff0c\u4f7f\u989c\u8272\u4ece\u539f\u56fe\u53d8\u5230\u76ee\u6807\u56fe\u3002

    • \u5bf9\u4e8e\u5f69\u8272\u56fe\u50cf\uff0cRGB\u4e09\u8272\u540c\u65f6\u4ece\u539f\u56fe\u53d8\u5230\u76ee\u6807\u56fe\u50cf\u3002\u53ef\u4ee5\u5206\u522b\u53d8\u5316\uff0c\u4e5f\u53ef\u8003\u8651RGB\u7684\u76f8\u5bf9\u6bd4\u4f8b\u5173\u7cfb\u540c\u65f6\u53d8\u5316\u3002

    • \u9009\u62e9\u4e24\u5e45\u7ed3\u6784\u76f8\u4f3c\u3001\u5927\u5c0f\u76f8\u540c\u7684\u753b\u9762\u4f5c\u4e3a\u8d77\u59cb\u548c\u7ed3\u675f\u5173\u952e\u5e27\uff0c\u8fd9\u6837\u624d\u80fd\u6bd4\u8f83\u5bb9\u6613\u5730\u5b9e\u73b0\u81ea\u7136\u3001\u8fde\u7eed\u7684\u4e2d\u95f4\u53d8\u5f62\u8fc7\u7a0b\u3002

    • \u5728\u8d77\u59cb\u548c\u7ed3\u675f\u753b\u9762\u4e0a\u786e\u5b9a\u548c\u52fe\u753b\u51fa\u5404\u90e8\u5206\uff08\u4e3b\u8981\u8f6e\u5ed3\uff09\u7684\u7ed3\u6784\u5bf9\u5e94\u5173\u7cfb\uff0c\u4e5f\u5373\u4ece\u8d77\u59cb\u753b\u9762\u4e0a\u7684\u4e00\u4e2a\u70b9\u53d8\u5230\u7ed3\u675f\u753b\u9762\u4e0a\u7684\u53e6\u4e00\u4e2a\u5bf9\u5e94\u70b9\u7684\u4f4d\u7f6e\uff0c\u8fd9\u662f\u53d8\u5f62\u8fd0\u7b97\u6240\u9700\u8981\u7684\u53c2\u6570

    \u6839\u636e\u9700\u8981\uff0c\u5bf9\u5e94\u70b9\u7684\u4f4d\u7f6e\u53ef\u4ee5\u4efb\u610f\u79fb\u52a8\u3002\u8c03\u6574\u8d77\u59cb\u5e27\u7684\u5bf9\u5e94\u70b9\u4f4d\u7f6e\uff0c\u53ef\u4ee5\u6a21\u62df\u6444\u50cf\u4e2d\u7684\u955c\u5934\u6e10\u53d8\u6548\u679c

    "},{"location":"DIP/morph/morph/#morph-based-on-segment-two-points","title":"Morph based on segment (two points)","text":""},{"location":"DIP/morph/morph/#morph-based-on-grid","title":"Morph based on grid","text":"
    • \u89c6\u70b9\u53d8\u6362\u5c31\u662f\u6c42\u5728\u89c6\u70b9\u79fb\u52a8\u540e\u539f\u59cb\u56fe\u50cf\u53d8\u6362\u751f\u6210\u7684\u65b0\u89c6\u56fe

    • \u5728\u7528\u76f8\u673a\u62cd\u6444\u7269\u4f53\u65f6\uff0c\u4fdd\u6301\u7269\u4f53\u7684\u4f4d\u7f6e\u4e0d\u52a8\uff0c\u800c\u5c06\u76f8\u673a\u79fb\u79bb\u7269\u4f53\uff0c\u8fd9\u5c31\u76f8\u5f53\u4e8e\u89c6\u70b9\u53d8\u6362

    • \u5982\u679c\u6211\u4eec\u4fdd\u6301\u76f8\u673a\u56fa\u5b9a\u4f4d\u7f6e\uff0c\u5c06\u7269\u4f53\u79fb\u79bb\u76f8\u673a\uff0c\u8fd9\u5c31\u76f8\u5f53\u4e8e\u6a21\u578b\u8f6c\u6362\u3002\u89c6\u70b9\u53d8\u5f62\u8981\u6c42\u5bf9\u7269\u4f53\u6709\u4e09\u7ef4\u5750\u6807\u77e5\u8bc6\u3002

    "},{"location":"DIP/morph/morph/#application","title":"Application","text":"

    Expressive Expression Mapping with Ratio Images

    "},{"location":"DIP/morph/morph/#lambertian-model","title":"Lambertian model","text":"

    Assume there are m point light sources:

    \\(I=\\rho\\sum_{1\\le i\\le m}S_iI_in\u00b7l_i=\\rho E(n)\\)

    \\(S_i=\\left\\{\\begin{array}{ll}0 & \\text{if the point cannot be seen from light i }\\\\1& \\text{Otherwise}\\end{array}\\right.\\)

    • \u5176\u4e2d \\(l_i\\) \u7b2c i \u4e2a\u5149\u6e90\u7167\u8fc7\u6765\u7684\u89d2\u5ea6

    • \\(n\\) \u8868\u793a\u5f53\u524d\u8fd9\u4e2a\u66f2\u9762\u7684\u6cd5\u5411\u91cf\uff0c\u6240\u4ee5\\(n\u00b7l_i\\)\u76f8\u5f53\u4e8e\u4f59\u5f26\u5173\u7cfb

    • \\(I_i\\) \u8868\u793a\u7b2c i \u4e2a\u5149\u6e90\u7684\u4eae\u5ea6

    • \\(S_i\\)\u8868\u793a\u66f2\u9762\u80fd\u4e0d\u80fd\u88ab\u7b2c i \u4e2a\u70b9\u5149\u6e90\u7167\u5230

    • \\(\\rho\\) \u8868\u793a\u66f2\u9762\u7684\u6750\u8d28

    "},{"location":"DIP/morph/morph/#expression-ratio-image","title":"Expression ratio image","text":"
    • Before deformation \\(I=\\rho E(n)\\)
    • After deformation \\(I'=\\rho E(n')\\)
    • Expression ratio image \\(\\frac{I'}{I}=\\frac{E(n')}{E(n)}\\)
    "},{"location":"DIP/morph/morph/#surface-deformation-mapping","title":"Surface deformation mapping","text":"
    • Assumption : HUman faces have approxiamtely the same normals
    "},{"location":"DIP/morph/morph/#algorithm","title":"Algorithm","text":""},{"location":"DIP/morph/morph/#image-alignment","title":"Image alignment","text":"
    • Use image wraping to obtain pixel correspondence
    "},{"location":"GP/AMAS/AMAS/","title":"Angular Momentum and Spin","text":"
    • Question \\(p_x=i\\bar{h}\\frac{\\partial}{\\partial x}\\)

    ?(12-17\u8bfe\u7a0b\u7ed3\u675f)

    The wave function of a particular quantum state of the hydrogen atom can be labeled by a set of quantum numbers \\((n, l, m_l)\\).

    • The corresponding energy only depends on the principal quantum number \\(n = 1,2,3,....\\)

    • The orbital quantum number \\(l = 0, 1, 2, . . . , n \u2212 1\\) is a measure of the magnitude of the angular momentum of the quantum state. States with \\(l = 0, 1, 2, 3\\) are called \\(s, p, d, f\\) .

    • The orbital magnetic quantum number

    \\(ml =\u2212l,\u2212l+1,...,l\u22121,l\\) is related to the space orientation of this angular momentum vector.

    "},{"location":"GP/AMAS/AMAS/#classical-loop-model-for-electron-orbits","title":"Classical Loop Model for Electron Orbits","text":"
    • Heuristically,\\(\u2206L_x,\u2206L_y\\) involves \\(\u2206_z,\u2206p_z\\), therefore cannot vanish due to the uncertainty principle. In other words, one cannot simultaneously measure any two components of \\(L\\). However, one can simultaneously measure \\(L^2\\) and \\(L_z\\) .
    • Quantized by \\(\\bar{h}\\)

    • We can measure definite values of a component \\(L_z\\) along a chosen measurement axis(usally taken to be a z axis) as given by \\(L_z=m_l\\bar{h}\\) for \\(m_l=0,\u00b11,\u00b12,\u2026\u2026\u00b1l\\)

    • In general , if the electron has a definite value of \\(L_z\\) it may not have definite values of \\(L_x\\) and \\(L_y\\)

    • This is a manifestation of Heisenberg's uncertainty principle.

    • Therefore, the orbital magnetic dipole moment is also quantized

    \\(\\mu_{orb}=|\\gamma|L=\\frac{e}{2m}\\sqrt{l(l+1)}\\bar{h}\\)

    \\(\\mu_{orb},z=\\gamma L_z=-m_l\\frac{e\\bar{h}}{2m}=-m_l\\mu_B\\)

    \u200b Define the Bohr magneton \\(\\mu_B=\\frac{eh}{4\\pi m}=\\frac{e\\bar{h}}{2m}=9.274*10^{-24}J/T\\)

    "},{"location":"GP/AMAS/AMAS/#dynamics-in-a-uniform-magnetic-field","title":"Dynamics in a Uniform Magnetic Field","text":"

    An external magnetic field B\u20d7 will rotate a magnetic dipole moment \u03bc\u20d7 with a total torque \\(\\vec{\\tau}=\\vec{\\mu}\\times\\vec{B}\\) , or, for an electron with orbital angular momentum \\(\\vec{L}\\) , \\(\\vec{\\tau}=\\frac{d\\vec{L}}{dt}=\\gamma\\vec{L}\\times\\vec{B}\\)

    "},{"location":"GP/AMAS/AMAS/#dipole-in-a-nonuniform-magnetic-field","title":"Dipole in a Nonuniform Magnetic Field","text":"

    \u300cdiphole parallel to the magnetic field.\u300d

    "},{"location":"GP/AMAS/AMAS/#the-stern-gerlach-experiment","title":"The Stern-Gerlach Experiment","text":"

    In the Stern-Gerlach experiment, a narrow beam of silver atoms passes through an electromagnet (with a nonuniform magnetic field) and then lands on a glass detector plate.

    • Classical View

    • In the old quantum theory by Bohr (and Sommerfeld)

    An atom in a state with angular momentum equal to one \\((L = 1)\\) would have a magnetic moment with two components relative to the direction of the magnetic field.

    In this case the spot on the receiving plate will therefore be split into two, each of them having the same size but half the intensity of the original spot.

    • In (Then) New Quantum Theory

    The later, or new, quantum theory developed by Heisenberg, Schroedinger, and others, predicted that for an \\(L = 1\\) state the beam should split into three components.

    In fact, we now know that a silver atom consists of many electrons ([Kr]4d105s1).

    We also know that all those magnetic moments vectorially cancel out except for a single electron \\((5s1)\\), and the orbital dipole moment of that electron is zero.

    Therefore, the Stern-Gerlach result posed a serious problem for the new quantum theory.

    This was solved when Uhlenbeck and Goudsmit (1925, 1926) proposed that the electron had an intrinsic angular momentum, not associated with its orbital motion.

    "},{"location":"GP/AMAS/AMAS/#spin","title":"Spin","text":"

    The Stern-Gerlach experiment belongs to a class of quantum phenomena involving a quantum degree of freedom called spin, which has no classical counterpart.

    Fortunately, one can describe spin and its dynamics without appealing to any mechanical model (such as that of a spinning top), starting with just the observed fact that it is a form of angular momentum.

    "},{"location":"GP/AMAS/AMAS/#electron-spin","title":"Electron Spin","text":"

    Every electron, whether trapped in an atom or free, has a spin angular momentum and a spin magnetic dipole moment that are as intrinsic as its mass and charge. The existence of electron spin was postulated on experimental evidence by George Uhlenbeck and Samuel Goudsmit from their studies of atomic spectra.

    For every electron, \\(spin s = 1/2\\) and the electron is said to be a \\(spin-1/2\\) particle. (Protons and neutrons are also \\(spin-1/2\\) particles.)

    As with the angular momentum associated with motion, spin angular momentum can have a definite magnitude but does not have a definite direction.

    The best we can do is to measure its component along the \\(z\\) axis (or along any axis), and that component can have only the definite values given by \\(S_z =m_s\\bar{h}, for\\ m_s =\u00b1s=\u00b11/2\\).

    Here \\(m_s\\) is the spin magnetic quantum number, which can have only two values: \\(m_s = +s = +1/2\\) (the electron is said to be spin up) and \\(m_s = \u2212s = \u22121/2\\) (the electron is said to be spin down).

    • The electron is not spinning
    • As with the orbital angular momentum, a magnetic dipole moment is associated with the spin angular momentum. Let us write \\(\\vec{\\mu}_s = g \u03b3\\vec{S}\\) where \\(\u03b3 = \u2212e/(2m)\\) and the constant g is referred to as the \\(g-factor\\).
    • It turns out that the spin angular momentum generates a magnetic moment twice as large as the orbital angular momentum does, i.e. g = 2.

    "},{"location":"GP/AMAS/AMAS/#nuclear-spin-and-magnetic-resonance","title":"Nuclear Spin and Magnetic Resonance","text":"
    • Such absorption is called magnetic resonance or, as originally, nuclear magnetic resonance (NMR).
    • In practice, the photons required for magnetic resonance have an associated frequency in the radio-frequency (RF)range.
    • NMR is usually detected by sweeping the magnitude \\(B_{ext}\\) through a range of values while the frequency \\(\u03c9\\) of the RF source is kept at a predetermined value and the energy loss of the RF source is monitored.

    Proton NMR, which studies the precession of the proton spin in the magnetic field, is a practical medical imaging technique.

    • A strong magnetic field produces partial polarization of the protons (hydrogen nuclei) in a human body.
    • A strong RF field is also imposed to excite some of the nuclear spins into their higher energy state.
    • When this strong RF signal is switched off, the spins tend to return to their lower state, producing a small amount of radiation at the Larmor frequency associated with that field.
    • The emission of radiation is associated with the \u201cspin relaxation\u201d of the protons from their excited state.
    • It induces a radio frequency (RF) signal in a detector coil which is amplified to display the NMR signal.

    Since the Larmor frequency depends on the applied magnetic field, placing a magnetic field gradient across the human body allows you to locate the source of the MRI signal (hence the name Magnetic Resonance Imaging).

    "},{"location":"GP/AMAS/AMAS/#spin-orbit-coupling","title":"Spin-Orbit Coupling","text":"
    • Crudely speaking, to the electron the nucleus appears to rotate around it and the moving nuclear charge or current creates a magnetic field \\(B^\u2217 \u221d L\\).

    Orbital motion cause relative motion of the nucleus to the electron ,creating a magnetic filed(connected with spin)

    • The spin\u2013orbit interaction Hamiltonian is given by \\(H_{SO}=\\epsilon_{nl}\\vec{L}\\vec{S}\\) where the spin-orbit coupling constant \\(\u03be_{nl}\\), which is positive, is essentially the averaged gradient of the Coulomb interaction.

    • To solve the Hamiltonian with such an interaction, we need to introduce the total angular momentum \\(\\vec{J}=\\vec{L}+\\vec{S}\\) and and use the expression \\(\\vec{J}\u00b7\\vec{J}=(\\vec{L}+\\vec{S})\u00b7(\\vec{L}+\\vec{S})=\\vec{S}\u00b7\\vec{S}+2\\vec{L}\u00b7\\vec{S}+\\vec{L}\u00b7\\vec{L}\\)

    • \\(S^2 =s(s+1)\\bar{h} \\\\ L^2 =l(l+1)\\bar{h}^2\\\\J^2=j(j+1)\\bar{h}^2\\)

    • \\(\\vec{L}\\vec{S}=\\frac{\\bar{h}^2}{2}[j(j+1)-l(l+1)-s(s+1)]\\)

    "},{"location":"GP/AMAS/AMAS/#the-pauli-exclusion-principle","title":"The Pauli Exclusion Principle","text":"

    For multiple electrons in the same trap, we must consider the Pauli exclusion principle, named after \\(Wolfgang\\ Pauli\\).

    The Pauli principle states that no two electrons confined to the same trap can have the same set of values for their quantum numbers.In other words, there can be two electrons at most at any energy level; they have opposite spins.

    This principle applies not only to electrons but also to protons and neutrons, all of which have \\(s = 1/2\\); they are known as fermions.

    A remark on fermions and bosons

    More generally, fermions are particles with half-integer spin s \\((i.e., s = 1/2, 3/2, etc.)\\). On the other hand, particles with integer s \\((i.e., s = 0, 1, 2, etc.)\\) are called bosons.

    Fermions follow the Pauli principle, but bosons do not.

    Many particles consisting of matter, such as electrons, protons, and neutrons (s = \u00bd for either of them) are fermions. On the other hand, photons(s = 1) are bosons.

    Regarding composite particles consisting of multiple fermions (such as atoms), those with odd number of fermions can behave as fermions while those with even number of fermions as bosons. (\\(^3He\\): \\(2p + 1n + 2e \u2192\\) fermion; \\(^4He: 2p + 2n + 2e\\) \u2192 boson)

    "},{"location":"GP/AMAS/AMAS/#the-helium-atom","title":"The Helium Atom","text":"

    The second simplest atom is the heliuxim atom, which has two 1s electrons (spin up and spin down) in the Coulomb potential of the charge 2e nucleus that obey time-independent Schroedinger\u2019s equation of the form \\((H_1+H_2+V_{12})\u03a8(\\vec{r_1},\\vec{r_2})=E\u03a8(\\vec{r_1},\\vec{r_2})\\) where \\(H_i=-\\frac{\\bar{h^2}}{2m}\\triangledown_i^2\uff08Kinetic\uff09-\\frac{2e^2}{4\\pi\\epsilon_0r_i}\uff08Potential\uff09\\ and\\ V_{12}=\\frac{e^2}{4\\pi\\epsilon_0|\\vec{r_1}-\\vec{r_2}|}\\)

    • An approximation starts from throwing away the interaction term, which we have not learned to deal with, i.e.,\\((H_1 + H_2) \u03a8_0 = E_0\u03a8_0\\),

    • The ground state of either \\(H_1\\) or \\(H_2\\) has an energy \\(\u22124E_R\\) (Because of two protons so raidus gets smaller)

    • and a wave function \\(\u03c8_{100}(\\vec{r})=\\frac{1}{\\pi}(\\frac{2}{a_B})^{3/2}e^{-2r/a_B}\\)

    • One may verify that \\(\u03a8_0(\\vec{r}_1,\\vec{r}_2)=\u03c8_{100}(\\vec{r_1})\u03c8_{100}(\\vec{r_2})\\) is an exact solution.

    • The corresponding energy is \\(E_0=-8E_R\\approx -109eV\\)

    Others pleae refer to the related PPT

    "},{"location":"GP/AMAS/AMAS/#shells-and-subshells","title":"Shells and Subshells","text":""},{"location":"GP/HA/HA/","title":"The Hydrogen Atom","text":"

    https://www.youtube.com/watch?v=-Y0XL-K0jy0

    https://youtube.com/watch?v=acN7E7AUHPk

    "},{"location":"GP/HA/HA/#quiz","title":"Quiz","text":"

    https://www.youtube.com/watch?v=9GOuZAh9Wg0

    "},{"location":"GP/HA/HA/#mystery-of-the-hydrogen-atom","title":"Mystery of the Hydrogen Atom","text":"

    Because the proton\u2019s mass is much greater than the electron\u2019s mass, we shall assume that the proton is fixed in place. So, the atom is a fixed potential trap with the electron moving around inside it.

    A hydrogen atom contains an electron that is trapped by the Coulomb force it experiences from the proton, which is the nucleus of the atom.

    Under Newtonian laws, the electron would move around the proton, like planets around the Sun, i.e. \\(\\frac{1}{4\\pi\\epsilon_0}\\frac{e^2}{r^2}=m\\frac{v^2}{r}\\)

    Multiplying by \u2212r, we obtain \\(E_c=-\\frac{e^2}{4\\pi \\epsilon _0 r}=-mv^2=-2E_k\\)

    Alternatively, the total energy of the electron is\\(E=E_k+E_c=\\frac{E_c}{2}=-E_k\\)

    However, any charged particle which moves in a curved path will emit electromagnetic radiation, hence losing energy continuously. Why doesn\u2019t the electrical attraction between the electron and the positive charge simply cause the two to collapse together?

    • One clue lies in the experimental fact that a hydrogen atom can emit and absorb only four wavelengths in the visible spectrum (656 nm, 486 nm, 434 nm, and 410 nm).
    "},{"location":"GP/HA/HA/#the-bohr-model-of-hydrogen-1913","title":"The Bohr Model of Hydrogen (1913)","text":"

    Bohr made two bold (and completely unjustified) assumptions:

    • The electron in a hydrogen atom orbits the nucleus in a circlemuch like Earth orbits the Sun.
    • The magnitude of the angular momentum \\(\\vec{L}\\) of the electron in its orbit is restricted (quantized) to the values \\(L = n\\bar{h}\\), for \\(n = 1,2,3,....\\)

    However, as successful as his theory was on the four visible wavelengths and on why the atom did not simply collapse, it turned out to be quite wrong in almost every other aspect of the atom.

    "},{"location":"GP/HA/HA/#physical-meaning-of-the-assumption","title":"Physical meaning of the assumption","text":"

    The de Broglie wavelength \\(\u03bb\\) of a free particle with momentum p is \\(\u03bb = h/p = h/mv\\).For an electron in a hydrogen atom whose orbital radius \\(r\\), the above equation leads to \\(\u03bb/r = h/rmv = h/L\\). Therefore, we obtain \\(2\u03c0r/\u03bb = L/\\bar{h}\\).

    \\(L=n\\bar{h}\\) means that the length of the orbit is an integer multiple of \\(\u03bb\\). Namely, the phase of the electron wave function returns to the initial value by moving for one cycle of the orbit.

    "},{"location":"GP/HA/HA/#analysis-based-on-bohrs-model","title":"Analysis based on Bohr\u2019s model","text":"
    • Bohr to quantize the electron orbit \\(L=rmv=n\\bar{h} \\Rightarrow v=\\frac{n\\bar{h}}{mr}\\)
    • Combining with the Newtonian result \\(\\frac{e^2}{4\\pi\\epsilon_0r^2}=m\\frac{v^2}{r}\\) we find \\(r_n =n^2a_B\\). where the characteristic length \\(a_B=\\frac{\\bar{h}^2}{me^2/(4\\pi\\epsilon_0)}=0.529 A\u030a\\)

    In the Bohr model of the hydrogen atom, the electron\u2019s orbital radius r is quantized and the smallest possible orbital radius (for \\(n = 1\\)) is \\(a_B\\), which is called the Bohr radius.

    • Can you obtain the length scale, alternatively, from dimension analysis?sIn order that the attraction between electron and nucleus does not simply collapse them together in the Bohr model, the electron should not get any closer to the nucleus than orbital radius aB by taking

    • The energy of the hydrogen atom, according to the Bohr model, is then \\(E_n=\\frac{1}{2}mv^2-\\frac{1}{4\\pi\\epsilon_0}\\frac{e^2}{r}=-\\frac{E_R}{n^2}\\) where \\(E_R=\\frac{me^4/(4\\pi\\epsilon_0)^2}{2\\bar{h}^2}=13.6eV\\)

    • We still have, for each orbit \\(E=E_k+E_c=\\frac{E_c}{2}=-E_k\\)
    "},{"location":"GP/HA/HA/#the-hydrogen-spectrum","title":"The Hydrogen Spectrum","text":"

    The energy of a hydrogen atom (or, equivalently, of its electron) changes when the atom emits or absorbs light. Emission and absorption involve a quantum of light according to \\(\\bar{h}\u03c9_{nm} =E_R(\\frac{1}{n^2} \u2212\\frac{1}{m^2})\\) for integers \\(m > n\\).

    The wavelengths of the emitted or absorbed light are given by $ \\frac{1}{\\lambda}=\\frac{E_R}{hc}(\\frac{1}{n^2}-\\frac{1}{m^2})$

    • \\(1\\ \u00c5ngstr\u00f6m - 1\u00d710^{\u221210}m\\)
    "},{"location":"GP/HA/HA/#combinations-of-physical-constants","title":"Combinations of Physical Constants","text":""},{"location":"GP/HA/HA/#gs-energy-from-uncertainty-principleground-state","title":"GS Energy from Uncertainty Principle[Ground State]","text":"

    The ground-state energy is the lowest energy allowed by Heisenberg\u2019s uncertainty principle.

    • For a hydrogen atom, the size of the wave function, \\(\u2206r\\), is the uncertainty in position.
    • The uncertainty in momentum is, roughly speaking, \\(\u2206p \u223c \\bar{h}/\u2206r\\), by the uncertainty principle.
    • The energy of the electron can be estimated to be \\(E \u223c \\frac{(\\triangle p)^2}{2m}-\\frac{e^2}{4\\pi\\epsilon_0\\triangle r}=\\frac{\\bar{h}^2}{2m(\\triangle r)^2}-\\frac{e^2}{4\\pi\\epsilon_0\\triangle r}\\)\\((Mean(p)=0\\ Thus\\ use\\ \\triangle p\\ to\\ approximate\\ p)\\)

    To find the minimal energy, we solve for \\(\\triangle r\\) \\(\\Rightarrow\\frac{dE}{d(\\triangle r)}=0 \\Rightarrow \\triangle r = \\frac{\\bar{h}^2}{me^2/(4\\pi\\epsilon_0)}=a_B\\) and \\(E=-\\frac{me^4/(4\\pi\\epsilon_0)^2}{2\\bar{h}^2}=-E_R\\)

    The energy of the ground state (or any stationary state) is uniquely determined. \u300cThough the uncertainty of \\(t\\ \\&\\ x\\)\u300d

    This is because of the energy-time uncertainty principle, \\(\u2206t \u00b7 \u2206E \u2265 \\bar{h}/2\\).

    • In the extreme case of a stationary state, \\(\u2206t = \u221e\\), so we have \\(\u2206E = 0\\).

    Note, however, both kinetic energy and potential energy have uncertainties, due to the uncertainties of position and momentum.

    Hydrogen is a three-dimensional, finite electron trap, with walls that vary in depth with distance.

    "},{"location":"GP/HA/HA/#schroedingers-equation-for-the-h-atom","title":"Schroedinger's Equation for the H-atom","text":""},{"location":"GP/HA/HA/#derive","title":"Derive","text":""},{"location":"GP/HA/HA/#ground-state-wave-function","title":"Ground State Wave Function","text":"

    \\(\u03c8_{100}(\\vec{r})=R_{10}(r)=\\frac{1}{\\sqrt{\\pi}a_B^{3/2}}e^{\\frac{r}{a_B}}\\)

    Note that the hydrogen atom in its ground state has zero angular momentum (\\(l = 0\\) more details will be discussed in the next lecture), which is not predicted in the Bohr model.)

    The probability that the electron can be detected in any given (infinitesimal) volume element \\(dV\\) located at radius \\(r\\) from the center of the atom is \\(|\u03c8_{100}(\\vec{r})|^2dV.\\)

    • Define radial Probability density \\(P(r)\\) such that \\(P(r)dr=|\u03c8_{100}(\\vec{r})|^2dV\\ (dV=4\\pi r^2)\\)
    • \\(P(r)\\) takes a maximum at \\(r=a_B\\)
    • All we can ever know abount the location of the electron in the ground state of the hydrogen atom is the radial probability density
    • Dot Plot
    "},{"location":"GP/HA/HA/#excited-states-of-the-hydrogen-atom","title":"Excited States of the Hydrogen Atom","text":""},{"location":"GP/HA/HA/#bohrs-correspondence-principle","title":"Bohr\u2019s Correspondence Principle","text":""},{"location":"GP/Polar/Polarization/","title":"Polarization","text":""},{"location":"GP/Polar/Polarization/#preknowledge","title":"PreKnowledge","text":"
    • consider \\(cos(kx+wt)\\) and \\(cos(kx-wt)\\)
    • \\(cos(kx+wt)\\) propagate along -x axis
    • \\(cos(kx-wt)\\) propogate along +x axis
    • Linear Waves
    "},{"location":"GP/Polar/Polarization/#polarization","title":"Polarization","text":"

    To observe interference of the two waves

    • two beams must have (nearly) the same frequency \u03c9
    • interfering waves have comparable amplitude
    • the phase difference between sources must remains constant.

    In this lecture we consider the direction of \\(\\vec{E}\\)

    Light is a transverse electromagnetic wave. Thus far we have considered only light for which the orientation of the electric field is constant, although its magnitude and sign vary in time.

    In general, we can consider two such harmonic lightwaves of the same frequency, moving through the same region of space, in the same direction \\(\\hat{z}\\)

    \\(\\vec{E}_x(z,t)=\\hat{i}E_{0x}cos(kz\u2212\u03c9t)\\)

    \\(\\vec{E}_y(z,t)=\\hat{j}E_{0y}cos(kz\u2212\u03c9t+\\epsilon)\\)

    "},{"location":"GP/Polar/Polarization/#polarization-and-its-mathematical-description","title":"Polarization and Its Mathematical Description","text":""},{"location":"GP/Polar/Polarization/#linear-polarization","title":"Linear polarization","text":"

    If \\(\u03b5\\) is zero or an integral multiple of \\(\u00b12\u03c0\\), the resultant wave is \\(\\vec{E}=(\\hat{i}E_{0x}+\\hat{j}E_{0y})cos(kz-wt)\\)

    "},{"location":"GP/Polar/Polarization/#circular-polarization","title":"Circular polarization","text":"

    When both constituent waves have equal amplitudes and \\(\\epsilon=-\\pi/2+2m\\pi\\)(m is an integer) the resultant wave is \\(\\vec{E}=E_0(\\hat{i}cos(kz-wt)+\\hat{j}sin(kz-wt))\\)

    When both constituent waves have equal amplitudes and \\(\\epsilon=\\pi/2+2m\\pi\\)(m is an integer) the resultant wave is \\(\\vec{E}=E_0(\\hat{i}cos(kz-wt)-\\hat{j}sin(kz-wt))\\)

    The amplitude is unaffected, but \\(\\vec{E}\\) at a fixed z now rotates counterclockwise, and the wave is left-circularly polarized.

    A linearly polarized wave can be synthesized from two oppositely polarized circular waves of equal amplitude.

    "},{"location":"GP/Polar/Polarization/#a-math-description-of-polarization","title":"A Math Description of Polarization","text":"
    • Jones vector
    • Horizontal and vertical linearly polarized are thus given by

    \\(|H\u27e9=\\begin{pmatrix}1\\\\0\\end{pmatrix}\\\\|V\u27e9= \\begin{pmatrix}0\\\\1\\end{pmatrix}\\)

    • Linearly polarized at +45\u25e6 from the x-axis (diagonal) and at \u221245\u25e6 from the x-axis (anti-diagonal) are given by

    \\(|D\u27e9=\\frac{1}{\\sqrt{2}}(|H\u27e9+|V\u27e9)=\\frac{1}{\\sqrt{2}}\\begin{pmatrix}1\\\\1\\end{pmatrix}\\)

    \\(|A\u27e9=\\frac{1}{\\sqrt{2}}(|H\u27e9\u2212|V\u27e9)=\\frac{1}{\\sqrt{2}}\\begin{pmatrix}1\\\\-1\\end{pmatrix}\\)

    Note that we are only interested in polarization, so the vectors are normalized, or in one unit length

    • Right-circular light is given by

    \\(|R\u27e9=\\frac{1}{\\sqrt{2}}(|H\u27e9\u2212i|V\u27e9)=\\frac{1}{\\sqrt{2}}\\begin{pmatrix}1\\\\-i\\end{pmatrix}\\)

    • Left-circular light is given by

    \\(|L\u27e9=\\frac{1}{\\sqrt{2}}(|H\u27e9+i|V\u27e9)=\\frac{1}{\\sqrt{2}}\\begin{pmatrix}1\\\\i\\end{pmatrix}\\)

    "},{"location":"GP/Polar/Polarization/#orthogonal","title":"Orthogonal","text":"

    Note that in the lecture on interference, we discussed the addition in a two-dimensional real space \\(R_2\\). The space is also equivalent to a one-dimensional complex space \\(C_1\\), or a two-component real vector space.

    Now, with polarization, we have generalized the one-dimensional complex space \\(C_1\\) to a two-dimensional complex space \\(C2 = C1 \u2297 C1\\), or a two-component complex vector space (in Jones\u2019 vector representation). The additional \\(C_1\\) space is spanned by the two orthogonal, linearly polarized states \\(|H\u27e9\\) and \\(|V\u27e9\\).

    • Two vectors A\u20d7 and B\u20d7 are said to be orthogonal whenA\u20d7 \u00b7 B\u20d7 = 0.

    similarly, two complex vectors A\u20d7 and B\u20d7 are said to be orthogonal when \\(\u27e8A|B\u27e9 \u2261 \\vec{A}^{*} \u00b7 \\vec{B} = 0\\).

    • Any polarization state will have a corresponding orthogonal state.

    Notice that\\(\u27e8H|V\u27e9 = \u27e8D|A\u27e9 = \u27e8L|R\u27e9 = 0\\).

    As we have seen, any polarization state can be described by a linear combination of the vectors in either one of the orthogonal sets.

    These same ideas are of considerable importance in quantum mechanics, where one deals with orthonormal wave functions.

    "},{"location":"GP/Polar/Polarization/#monochromatic-light-and-natural-light","title":"Monochromatic Light and Natural Light","text":""},{"location":"GP/Polar/Polarization/#light-trains-and-monochromatic-light","title":"Light Trains and Monochromatic Light","text":"

    In reality, a non-laser source emits, to the best, quasimonochromatic light trains, whose frequency can be represented by a bell-shaped Gaussian function.

    \"\u51c6\u5355\u8272\"\uff08quasi-monochromatic\uff09\u662f\u6307\u5149\u6ce2\u5728\u9891\u7387\u4e0a\u7684\u5206\u5e03\u76f8\u5bf9\u72ed\u7a84\uff0c\u4f46\u5e76\u975e\u5b8c\u5168\u5355\u4e00\u9891\u7387\u7684\u5149\u3002\u51c6\u5355\u8272\u5149\u901a\u5e38\u5177\u6709\u4e00\u4e2a\u4e3b\u5bfc\u7684\u4e2d\u5fc3\u9891\u7387\uff0c\u800c\u5728\u8be5\u4e2d\u5fc3\u9891\u7387\u5468\u56f4\u6709\u4e00\u5b9a\u7684\u9891\u7387\u5bbd\u5ea6\u3002\u8fd9\u79cd\u5149\u7684\u9891\u8c31\u5f62\u72b6\u53ef\u80fd\u7c7b\u4f3c\u4e8e\u9ad8\u65af\u5206\u5e03\u6216\u5176\u4ed6\u8fd1\u4f3c\u5355\u5cf0\u7684\u5206\u5e03\u3002

    That is, the irradiance (hence its square root, the amplitude) versus frequency is found to be Gaussian with a width \\(\u2206\u03c9 = 2\u03c0\u2206\u03bd.\\)

    Quasimonochromatic light resembles a series of randomly phased finite wave trains.Such a disturbance is nearly sinusoidal,although the frequence dose vary slowly about some mean value.

    Moreover,the amplitude fluctuates as well,but this too is a comparatively slow variation.

    The average constittuent wavetrain exists roughly for the coherence time \\(\\triangle t_c=\\frac{1}{\\triangle v}\\)

    \u4e24\u5217\u6ce2\u80fd\u53d1\u751f\u5e72\u6d89\u7684\u6700\u5927\u5149\u7a0b\u5dee\u53eb\u76f8\u5e72\u957f\u5ea6\\(\\delta_M=\\frac{\\lambda^2}{\\triangle\\lambda}\\) \\(\\lambda\\)\u4e3a\u4e2d\u5fc3\u6ce2\u957f

    \u5149\u901a\u8fc7\u76f8\u5e72\u957f\u5ea6\u6240\u9700\u65f6\u95f4\u53eb\u76f8\u5e72\u65f6\u95f4

    \u76f8\u5e72\u65f6\u95f4\u7684\u5b9a\u4e49\u662f\u57fa\u4e8e\u5149\u7684\u6ce2\u52a8\u6027\u548c\u5e72\u6d89\u6027\u7684\u3002\u5f53\u4e24\u675f\u5149\u540c\u65f6\u7167\u5c04\u5728\u540c\u4e00\u70b9\uff0c\u5982\u679c\u5b83\u4eec\u7684\u76f8\u4f4d\u5173\u7cfb\u4fdd\u6301\u4e0d\u53d8\uff0c\u90a3\u4e48\u5b83\u4eec\u5c31\u4f1a\u53d1\u751f\u5e72\u6d89\u3002\u76f8\u5e72\u65f6\u95f4\u5c31\u662f\u63cf\u8ff0\u8fd9\u79cd\u76f8\u4f4d\u5173\u7cfb\u4fdd\u6301\u4e0d\u53d8\u7684\u65f6\u95f4\u3002\u5177\u4f53\u6765\u8bf4\uff0c\u5982\u679c\u5149\u7684\u7535\u78c1\u573a\u5728\u4e00\u4e2a\u76f8\u5e72\u65f6\u95f4\u5185\u7684\u5e73\u5747\u503c\u4e0d\u53d8\uff0c\u90a3\u4e48\u6211\u4eec\u5c31\u8bf4\u8fd9\u675f\u5149\u5728\u8fd9\u4e2a\u65f6\u95f4\u5185\u662f\u76f8\u5e72\u7684\u3002\u76f8\u5e72\u65f6\u95f4\u7684\u8ba1\u7b97\u516c\u5f0f\u4e3a\\(T_c=1/\u0394\u03bd\\)\uff0c\u5176\u4e2d\u0394\u03bd\u4e3a\u5149\u7684\u9891\u7387\u5bbd\u5ea6

    \u5149\u7684\u5355\u8272\u6027\u597d\uff0c\u76f8\u5e72\u957f\u5ea6\u548c\u76f8\u5e72\u65f6\u95f4\u5c31\u957f\uff0c\u65f6\u95f4\u76f8\u5e72\u6027\u4e5f\u5c31\u597d

    An idealized monochromatic plane wave must be depicted as an infinite wavetrain. If this disturbance is resolved into two orthogonal components perpendicular to the direction of propagation, they, in turn, must have the same frequency, be infinite in extent, and therefore be mutually coherent (i.e., \\(\u03b5 = constant\\)).

    \\(\\vec{E}_x(z,t)=\\hat{i}E_{0x}cos(kz\u2212\u03c9t)\\)

    \\(\\vec{E}_y(z,t)=\\hat{j}E_{0y}cos(kz\u2212\u03c9t+\\epsilon)\\)

    A perfectly monochromatic plane wave is always polarized.

    The most spectacular of all present-day sources is the laser. Under optimum conditions, with temperature variations and vibrations meticulously suppressed, a laser was actually operated at quite close to its theoretical limit of frequency constancy.

    For example, a short-term frequency stability of about 8 parts per \\(10^{14}\\) was attained with a He\u2013Ne continuous gas laser at \\(\u03bb0 = 1153 nm\\) [Jaseja et al., Phys. Rev. Lett. 10, 165 (1963)].

    That corresponds to a remarkably narrow bandwidth of about \\(\u2206\u03bd = 20 Hz\\).

    "},{"location":"GP/Polar/Polarization/#natural-light","title":"Natural Light","text":"

    Natural light is composed of a rapidly varying succession (~\\(10^{\u22128}\\) s) of the different polarization states. It is also known as unpolarized or randomly polarized light.

    We can mathematically represent natural light in terms of two arbitrary, incoherent, orthogonal, linearly polarized waves of equal amplitude (i.e., waves for which the relative phase difference varies rapidly and randomly).

    "},{"location":"GP/Polar/Polarization/#coherence","title":"Coherence","text":"

    Coherence is a measure of the correlation between the phases measured at different (temporal and spatial) points on a wave.

    Temporal coherence is a measure of the correlation of light wave\u2019s phase at different points along the direction of propagation \u2013 it tells us how monochromatic a source is. (Think about the description of quasimonochromatic light.)

    Spatial coherence is a measure of the correlation of light wave\u2019s phase at different points transverse to the direction of propagation \u2013 it tells us how uniform the phase of the wavefront is. (Think about Young\u2019s interference experiment.)

    The figure illustrates how to prepare a monochromatic wave that is both temporally and spatially coherent from incoherent natural light.

    In reality, light is generally neither completely polarized nor completely unpolarized.

    More often, the electric-field vector varies in a way that is neither totally regular nor totally irregular, and such an optical disturbance is partially polarized.

    One useful way of describing this behavior is to envision it as the result of the superposition of specific amounts of natural and polarized light.

    "},{"location":"GP/Polar/Polarization/#polarizing-sheets","title":"Polarizing Sheets","text":"

    Unpolarized visible light can be transformed into polarized light by sending it through a polarizing sheet,or a Polaroid sheet.

    • A polarizing sheet consists of certain long molecules embedded in plastic.
    • When light is then sent through the sheet,the electric field component parallel to the polarizing direction is passed(transmitted);the component perpendicular to it is absorbed.

    Electric field oscillations of unpolarized light can resolve into two components with equal intensity

    • Therefore, the intensity I of the polarized light emerging from a polarizing sheet is then half the intensity \\(I_0\\) of the original light \\(I=I_0/2\\)

    For polarized light,obly the component \\(E_y\\)=\\(Ecos\\theta\\) parallel to the polarizing direction of the sheet can be transmitted.Therefore,the intensity of the emerging wave is \\(I_0=I_0cos^2\\theta\\)

    • Initially unpolarized light is sent through two polarizing sheets P1 (polarizer) and P (analyzer). In general, some of the light transmitted by P1 will be transmitted by P2.
    • If their polarizing directions are parallel,all the light passed through P1 is transmitted by P2
    • If perpendicular, no light is passed by the second sheet
    "},{"location":"GP/Polar/Polarization/#quiz-23-1-polarizing-sheets","title":"Quiz 23-1: Polarizing Sheets","text":""},{"location":"GP/Polar/Polarization/#polarization-by-reflection","title":"Polarization by Reflection","text":"

    One of the most common sources of polarized light is the ubiquitous process of reflection from dielectric media.

    Consider a ray of unpolarized light incident on a glass surface. The field \\(\\vec{E}\\) of the incident light can be decomposed into two components of equal magnitude, one perpendicular and another parallel to the plane of incidence.

    In general, the reflected light is partially polarized.

    When the light is incident at a particular incident angle, called the Brewster angle \\(\u03b8_B\\) , the reflected light is fully polarized.

    One finds experimentally that at the incident angle \\(\u03b8_B\\), the reflected and refracted rays are perpendicular to each other: \\(\\theta_B+\\theta_r=\\frac{2}{\\pi}\\)

    According to Snell\u2019s law \\(n_i sin\u03b8_B = n_r sin\u03b8_r\\)

    we have \\(n_i sin\u03b8_B =n_r sin\u03b8_r =n_r sin(\\frac{\\pi}{2}\u2212\u03b8_B)=n_r cos\u03b8_B\\) or \\(\\theta_B=tan^{-1}\\frac{n_r}{n_i}\\)

    If the incident and reflected rays travel in air, we can approximate \\(n_i\\) as unity, so \\(n_r\\)=\\(tan\\theta_B\\)

    "},{"location":"GP/QW/QW/","title":"Quantum Wells","text":"

    On a stretched string, we can set up both traveling waves and standing waves.

    • A traveling wave, on a long string, can have any frequency.
    • A standing wave, set up on a string with a finite length, can have only discrete frequencies.

    In other words, confining the wave to a finite region of space leads to quantization of the motion \u2014 to the existence of discrete states for the wave, each state with a sharply defined frequency.

    This observation applies to waves of all kinds, including matter waves. For matter waves, however, it is more convenient to deal with the energy E of the associated particle than with the frequency f of the wave.

    Consider the matter wave associated with an electron moving in the positive x direction and subject to no net force \u2014 a so-called free particle. The energy of such an electron can have any reasonable value, just as a wave traveling along a stretched string of infinite length can have any reasonable frequency.

    Consider next the matter wave associated with an atomic electron, perhaps the valence (least tightly bound) electron.

    The electron \u2014 held within the atom by the attractive Coulomb force between it and the positively charged nucleus \u2014 is a bound particle. It can exist only in a set of discrete states, each having a discrete energy E. This sounds much like the discrete states and quantized frequencies that apply to a stretched string of finite length.

    For matter waves, then, as for all other kinds of waves, we may state a confinement principle: Confinement of a wave leads to quantization \u2014 that is, to the existence of discrete states with discrete energies.

    "},{"location":"GP/QW/QW/#one-dimensional-infinite-potential-well","title":"One-Dimensional Infinite Potential Well","text":"

    Consider a nonrelativistic electron confined to a one-dimensional electron trap (or a limited region of space).

    "},{"location":"GP/QW/QW/#standing-waves-in-a-1d-trap","title":"Standing Waves in a 1D Trap","text":"

    We examine by analogy with standing waves on a string of finite length, stretched along an x axis and confined between rigid supports.

    • Because the supports are rigid, the two ends of the string are nodes, or points at which the string is always at rest. The states, or discrete standing wave patterns in which the string can oscillate, are those for which the length L of the string is equal to an integer number of half-wavelengths

    • That is, the string can occupy only states for which \\(L=\\frac{n\\lambda}{2}\\)

    Each value of the integer n identifies a state of the oscillating string. For a given n, the transverse displacement of the string at any position x \\((0 \u2264 x \u2264 L)\\) along the string is given by \\(y_n(x)=Asin(\\frac{n\\pi}{L}x)\\)where A is the amplitude of the standing wave

    For the n state \\(\\lambda_n=\\frac{2L}{n}\\) Thus \\(sinkx=sin\\frac{2\\pi}{\\lambda_n}x=sin(\\frac{n\\pi}{L}x)\\)

    For the electron in the trap, we promote the transverse displacement to wave function \\(\u03c8_n(x)\\).

    "},{"location":"GP/QW/QW/#probability-of-detection","title":"Probability of Detection","text":"

    Classically, we expect to detect the electron anywhere in the infinite well with a constant probability density.

    Quantum mechanically, we find the probability density \\(p_n(x) = |\u03c8_n(x)|^2 = |A|^2 sin^2(\\frac{n\\pi}{L}x)\\) for given n

    If don't satisfy \\(L=\\frac{n\\lambda}{2}\\) no stable wave formation!

    The constant A (up to a phase) can be determined by the normalization condition

    \\(\\int_{-\u221e}^{+\u221e}|\u03c8_n(x)|^2dx =\\int_0^L|\u03c8_n(x)|^2dx = 1\\), so \\(A=\\sqrt{2/L}\\)

    "},{"location":"GP/QW/QW/#energies-of-the-trapped-electron","title":"Energies of the Trapped Electron","text":"

    The de Broglie wavelength \u03bb of the electron is defined as \\(\u03bb=\\frac{h}{p}=\\frac{h}{\\sqrt{2mk}}\\),where \\(K=\\frac{p^2}{2m}\\)is the kinetic enerrgy of the nonrelativistic electron

    For an electron moving within the central cylinder, where U = 0, the total (mechanical) energy E is equal to the kinetic energy K.

    • Therefore , total energy for an electron moving in the central cylinder is \\(E_n=(\\frac{h}{\\lambda})^2/2m=\\frac{h^2}{8mL^2}n^2 \u221d n^2\\) (\\(\\lambda_n=\\frac{2L}{n}\\))
    • Narrower well \\((smaller\\ L)\\) \\(\u21d2 E_n \u2197\\).

    • The positive integer n is the quantum number of the electron's quantum state in the trap

    • The quantum state with the lowest possible energy level \\(E_1\\) with quantum number n = 1 is called the ground state of the electron.

    • Why is \\(n = 0\\) not allowed?

    Choosing n = 0 would indeed yield a lower energy of zero. However, as we will see below, the corresponding probability density is \\(|\u03c8|^2 = 0\\), which we can interpret only to mean that there is no electron in the well

    so \\(n = 0\\) is not a possible quantum number.

    • It is an important conclusion of quantum physics that confined systems must always have a certain non-zero minimum energy called the zero-point energy.

    • Electrons can be excited or de-excided bynthe absorption or emission of a photon with energy \\(\\bar{h}w=\\frac{hc}{\\lambda}=\\triangle E=E_{High}-E_{Low}\\)

    "},{"location":"GP/QW/QW/#wave-functions-of-the-trapped-electron","title":"Wave Functions of the Trapped Electron","text":"

    If we solve time-independent Schroedinger\u2019s equation, as in the previous lecture, for an electron trapped in the 1D infinite well of width L, we could write the solutions as \\(\u03c8_n(x)=exp (i\\frac{n\\pi}{L}x)\\)or\\(\u03c8_n(x)=exp(-i\\frac{n\\pi}{L}x)\\).

    • However, the above traveling waves do not satisfy the boundary conditions \\(\u03c8_n(0) = \u03c8_n(L) = 0.\\)

    The appropriate solutions can only be certain linear combinations of the traveling wave functions, given by \\(\u03c8_n(x)=Asin(\\frac{n\\pi}{L}x)\\) The constant A is to be determined.

    • Note that the wave functions \\(\u03c8_n(x)\\) have the same form as the displacement functions \\(y_n(x)\\) for a standing wave on a string stretched between rigid supports.

    For sufficiently large \\(n\\), the probability of detection becomes more and more uniform across the well in the coarse-grained scale. This result is an instance of a general principle called the correspondence principle: At large enough quantum numbers, the predictions of quantum physics merge smoothly with those of classical physics.

    "},{"location":"GP/QW/QW/#an-electron-in-a-finite-well","title":"An Electron in a Finite Well","text":"

    We can picture an electron trapped in a one-dimensional well between infinite-potential walls as being a standing matter wave. The solutions must be zero at the infinite walls.

    For finite walls, however, the analogy between waves on a stretched string and matter waves fails. Matter wave nodes no longer exist at \\(x = 0\\) and at \\(x = L\\).

    wave function can penetrate the walls into classically forbidden regions.

    Constraints

    (1)\\(\u03a8(-\\infty)\\rightarrow0\\)

    (2)\\(\u03a8(+\\infty)\\rightarrow0\\)

    (3)\\(\u03a8(0-)=\u03a8(0+)\\)

    (4)\\(\u03a8(L-0)=\u03a8(L+0)\\)

    (5)\\(\u03a8'(-0) = \u03a8'(+0)\\)

    (6)\\(\u03a8'(L-0) = \u03a8'(L+0)\\)

    "},{"location":"GP/QW/QW/#energies-of-the-trapped-electron_1","title":"Energies of the Trapped Electron","text":"

    Thus, the corresponding energy E \u2248 \\((h/\u03bb)^2/(2m)\\) for an electron in any given state is less in the finite well than in the infinite well.\uff08From what is mentioned above\uff09

    An electrons with an energy greater than the well depth\\((E > U_0)\\) has too much energy to be trapped in the finite well.

    Thus, there is a continuum of energies beyond the top of potential well ; a high-energy electron is not confined,and its energy is not quantized

    "},{"location":"GP/QW/QW/#semiconductor-quantum-wells","title":"Semiconductor Quantum Wells","text":"

    Semiconductor similar to finite wells

    "},{"location":"GP/QW/QW/#schroedingers-equation-in-high-dimensions","title":"Schroedinger\u2019s Equation in High Dimensions","text":"

    This has the form \\(E = F(x) + G(y)\\), which can only be satisfied when \\(F(x) = E_1\\) and \\(G(y) = E \u2212 E_1\\), i.e., each function must separately be a constant.

    As a consequence, separation of variables breaks the multivariate partial differential equation into a set of independent ordinary differential equations \\((ODEs)\\).

    We can solve the \\(ODEs\\) for \\(X(x)\\) and \\(Y(y)\\). The wave function for the original equation is simply their product \\(X(x)Y(y)\\).

    [In which case \\(\u03a8(x,y)\\) can be written in the form of \\(\u03a8(x,y) = X(x)Y(y\\)), and in which case cannot be?]

    • Separation of variables was first used by L\u2019Hospital in 1750.

    It is especially useful in solving equations arising in mathematical physics, such as Laplace\u2019s equation, Helmholtz\u2019s equation, and Schroedinger\u2019s equation.

    • Success requires choice of an appropriate coordinate system and may not be attainable at all depending on the equation. In particular, it works when

    \\(U (x , y ) = Ux (x ) + Uy (y )\\),or, in a central potential in spherical coordinates,\\(U(r,\u03b8,\u03c6) = V(r).\\)

    "},{"location":"GP/QW/QW/#2d-3d-infinite-potential-wells","title":"2D & 3D Infinite Potential Wells","text":""},{"location":"GP/QW/QW/#dirac-delta-function-potential-well","title":"Dirac Delta Function Potential Well","text":""},{"location":"GP/com/com/","title":"Electromagnetic Integration","text":""},{"location":"GP/com/com/#faradays-law-of-induction","title":"Faraday\u2019s Law of Induction","text":"

    \\(\\Phi_B=\\int\\vec{B}\\cdot d\\vec{A}\\)

    \\(\\epsilon = -N\\frac{d\\Phi_B}{dt}\\)

    When you move the magnet toward or away from the loop, a magnetic force resists the motion, so Lenz\u2019s law requires your applied force to do positive work.

    At the same time, thermal energy is produced in the material of the loop because of the material\u2019s electrical resistance to the induced current.

    The energy you transfer to the closed loop-magnet system via your applied force ends up in this thermal energy. (For now, we neglect energy that is radiated away from the loop as electromagnetic waves during the induction.)

    \\(\\epsilon= N\\frac{d\\Phi_B}{dt}=BLv\\)

    \\(F=F_1=iLB=B^2L^2v/R\\)

    \\(P_1=Fv=B^2L^2v^2/R\\)

    \\(P_{thermal}=i^2R=(\\frac{BLv}{R})^2R=B^2L^2v^2/R\\)

    "},{"location":"GP/com/com/#a-reformulation-of-faradays-law","title":"A Reformulation of Faraday\u2019s Law","text":"

    We find that an induced emf can be defined without the need of a current or particle: An induced emf is the sum\u2014via integration\u2014of quantities \\(\\vec{E} \u00b7 d\\vec{s}\\) around a closed path, where \\(\\vec{E}\\) is the electric field induced by a changing magnetic flux and \\(d\\vec{s}\\) is a differential length vector along the path.

    • Rewrite Faraday's Law as \\(\\oint \\vec{E}\\cdot d\\vec{s}=-N\\frac{d\\Phi_B}{dt}=-\\frac{d}{dt}\\int\\vec{B}\\cdot d\\vec{A}\\)

    • We can convert it to differential form by applying the Stokes\u2019 theorem (or the fundamental theorem for curls)

    \\(\\oint\\vec{E}\\cdot d\\vec{s}=\\int_S(\\triangledown \\times \\vec{E})\\cdot d\\vec{A}\\)

    • Thus, we get : \\(\\triangledown \\times\\vec{E}=-\\frac{\\partial \\vec{B}}{\\partial t}\\)

    • Electric potential has no meaning for electric fields that are produced by induction

    "},{"location":"GP/com/com/#inductors-and-inductance","title":"Inductors and Inductance","text":""},{"location":"GP/com/com/#revisiting-solenoid","title":"Revisiting Solenoid","text":"

    \\(B=\\mu_0in\\)

    \\(\\Phi_B=BA=\\mu_0inA\\)

    \\(Inductance \\ L \\ =N\\Phi_B/i=\\mu_0n^2lA\\)

    • If the length \\(l\\) of a solenoid is very much longer than its radius, then, to a good approximation, its inductance is \\(L = \u03bc_0n^2lA = N^2(\u03bc_0A/l)\\)(By \\(nl=N\\))
    "},{"location":"GP/com/com/#rl-circuits","title":"RL Circuits","text":"
    • L is like a voltage source

    • \\(E_L = \u2212\\frac{d(N\u03a6_B)}{dt} = \u2212L\\frac{di }{dt}\\)

    \\(\\begin{align*}&\\epsilon= iR-(-L\\frac{di}{dt})\\\\ &\\dot{i}+\\frac{R}{L}i-\\frac{\\epsilon}{L}=0\\end{align*}\\)

    \\(i=\\frac{\\epsilon}{R}(1-e^{-t/\\tau_L}) \\ \\ \\ (\\tau_L=\\frac{L}{R})\\)

    "},{"location":"GP/com/com/#energy","title":"Energy","text":""},{"location":"GP/com/com/#energy-stored-in-a-magnetic-field","title":"Energy Stored in a Magnetic Field","text":"

    \\(\\epsilon i = Li\\frac{di}{dt} + i^2R.\\)

    \\(\\Rightarrow U_B=\\frac{1}{2}Li^2\\)

    "},{"location":"GP/com/com/#energy-density-of-a-magnetic-field","title":"Energy Density of a Magnetic Field","text":"
    • The energy stored per unit volume of the field is

    \\(\\mu_B=\\frac{U_B}{Ah}=\\frac{Li^2}{2Ah}=\\frac{L}{h}\\frac{i^2}{2A}=\\frac{i^2n^2\\mu_0}{2}=\\frac{B^2}{2\\mu_0}\\)

    resembles that in an electric file \\(\\mu_E=\\frac{1}{2}\\epsilon_0E^2\\)

    "},{"location":"GP/com/com/#mutual-inductance-of-two-parallel-coils","title":"Mutual Inductance of Two Parallel Coils","text":"

    \\(M_{21}=\\frac{N_2\\Phi_{21}}{i_1}\\\\M_{12}=\\frac{N_1\\Phi_{12}}{i_2}\\)

    \\(\\epsilon_{21}=-M_{21}\\frac{di_1}{dt}\\\\\\epsilon_{12}=-M_{12}\\frac{di_2}{dt}\\)

    \\(\\epsilon_1=\\epsilon_{1}+\\epsilon_{12}=-L_{1}\\frac{di_{1}}{dt}-M_{12}\\frac{di_2}{dt}\\)

    \\(\\epsilon_2=\\epsilon_{22}+\\epsilon_{21}=-L_{2}\\frac{di_{2}}{dt}-M_{21}\\frac{di_1}{dt}\\)

    \\(\\Rightarrow-\\begin{pmatrix}L_1&M_{12}\\\\M_{21}&L_2\\end{pmatrix}\\frac{d}{dt}\\begin{pmatrix}i_1\\\\i_2\\end{pmatrix}=\\begin{pmatrix}\\epsilon_1\\\\\\epsilon_2\\end{pmatrix}\\)

    "},{"location":"GP/com/com/#alternating-current-circuits","title":"Alternating-Current Circuits","text":""},{"location":"GP/com/com/#lc-oscillations","title":"LC Oscillations","text":"

    \\(L\\frac{di}{dt}+\\frac{q}{C}=0\\)

    \\(\\ddot{q}+\\frac{1}{LC}q=0\\)

    \\(\\Rightarrow q =Acos(w_0t+\\phi)=Qcos(\\frac{1}{\\sqrt{LC}}t+\\phi)\\)

    \\(\\Rightarrow Qcos\\phi=0 \\\\-w_0Qsin\\phi=0\\)

    "},{"location":"GP/com/com/#the-complex-formalism","title":"The Complex Formalism","text":""},{"location":"GP/com/com/#damped-oscillations-in-an-rlc-circuit","title":"Damped Oscillations in an RLC Circuit","text":"
    • With Resistance R

    \\(\\ddot{q}+\\frac{R}{L}\\dot{q}+\\frac{1}{LC}q=0\\)

    \\(\\Rightarrow q=Qe^{-\\frac{t}{\\tau}}cos(wt+\\phi) \\ where\\ \\tau=2L/R \\ and \\ w=\\sqrt{w_0^2-(1/\\tau)^2} \\ and \\ w_0=\\frac{1}{\\sqrt{LC}}\\)

    Note Use ODEs or the method of the below picture

    • When \\(1/\u03c4 < \u03c9_0\\), a real \\(\u03c9\\) can be found and the system still oscillates, but with decreasing amplitude as its energy is converted to heat. The circuit is said to be underdamped. Over time the system should come to rest at equilibrium.
    • When \\(1/\u03c4 > \u03c9_0\\), one can only find imaginary \u03c9, which means the frictional force is so great that the system cannot oscillate. The circuit is said to be overdamped.

    • In between, when \\(1/\u03c4 = \u03c9_0\\), the circuit is said to be critically damped. It is worth noting that the critical damping gives the fastest return of the system to its equilibrium position. In engineering design this is often a desirable property.

    "},{"location":"GP/com/com/#ac-circuits-and-forced-oscillations","title":"AC Circuits and Forced Oscillations","text":"
    • The oscillations in an RLC circuit will not damp out if an external emf device supplies enough energy to make up for the energy dissipated as thermal energy in the resistance R.
    • The energy is supplied via oscillating emfs and currents \u2014 the current is said to be an alternating current, or ac for short. These oscillating emfs and currents vary sinusoidally with time, reversing direction 100 times per second and thus having frequency f = 50 Hz.
    • When the external alternating emf is connected, the oscillations of charge, potential difference, and current are said to be driven oscillations or forced oscillations. These oscillations always occur at the driving angular frequency.
    "},{"location":"GP/com/com/#three-simple-circuits","title":"Three Simple Circuits","text":"
    • For L :

    \\(i(t)=\\tilde{i}e^{iwt}\\)

    \\(V(t)=L\\frac{di}{dt}=L(iw)e^{iwt}\\tilde{i}\\)

    \\(\\tilde{Z}=iwL\\)

    • For C:

    \\(Q(t)=\\tilde{Q}e^{iwt}\\)

    \\(\\tilde{V}(t)=\\tilde{Q}/C\\cdot e^{iwt}\\)

    \\(\\tilde{i}=\\frac{d\\tilde{Q}}{dt}=iw\\tilde{\\tilde{Q}e^{iwt}}\\)

    \\(\\tilde{Z}=\\frac{1}{iwC}=-\\frac{i}{wC}\\)

    "},{"location":"GP/com/com/#the-series-rlc-circuit","title":"The Series RLC Circuit","text":""},{"location":"GP/com/com/#resonance","title":"Resonance","text":"

    When \\(\u03c9_d\\) equals \\(\u03c9_0\\), the circuit is in resonance.

    • The circuit is equally capacitive and inductive \\((|Z_C | = |Z_L|)\\).
    • The current amplitude \\(I = E_m/R\\) is maximum.
    • Current and emf are in phase (\u03c6 = 0).

    "},{"location":"GP/com/com/#maxwells-equations-and-em-waves","title":"Maxwell\u2019s Equations and EM Waves","text":"
    • Applying Divergence to Faraday's Law ,we get:\\(\\triangledown\\cdot(\\triangledown \\times \\vec{E})=\\triangledown \\cdot(-\\frac{\\partial\\vec{B}}{\\partial t})=-\\frac{\\partial}{\\partial t}(\\triangledown\\cdot\\vec{B})=0 (Consistency)\\)

    • However,when applying Divergence to Ampere's Law,we get\\(\\triangledown\\cdot(\\triangledown \\times \\vec{B})=\\triangledown\\cdot(\\mu_0\\vec{J})=\\mu_0(\\triangledown\\cdot\\vec{J})\\)

    While \\(\\triangledown \\cdot \\vec{J} = -\\frac{\\partial\\rho}{\\partial t}=-\\frac{\\partial{(\\epsilon_0\\triangledown\\cdot E)}}{\\partial t} =-\\triangledown\\cdot(\\epsilon_0\\frac{\\partial\\vec{E}}{\\partial t}) \\ Which \\ is\\ not\\ necessarily\\ ZERO\\)

    • Maxwell pointed out that the extra divergence can be removed by fixing Ampere\u2019s law to be:

    \\(\\triangledown\\times\\vec{B}=\\mu_0\\vec{J}+\\mu_0\\vec{J_d}=\\mu_0\\vec{J}+\\mu_0\\epsilon_0\\frac{\\partial\\vec{E}}{\\partial t}\\)

    "},{"location":"GP/com/com/#apply","title":"Apply","text":"

    \\(E=\\frac{\\sigma}{\\epsilon_0}=\\frac{Q}{\\epsilon_0A}\\\\ \\frac{\\partial{E}}{\\partial t}=\\frac{J_d}{\\epsilon_0}=\\frac{I}{\\epsilon_0A}\\)

    • Choose surface 1 to integral : \\(E=0\\ I_{enc}=I\\)

    • Choose surface 2 to integral:

    \\(I_{enc}=0\\\\\\mu_0\\epsilon_0\\frac{\\partial{E}}{\\partial t}=\\mu_0I/A \\ \\iint \\mu_0\\epsilon_0\\frac{\\partial{E}}{\\partial t}\\cdot d\\vec{A}=\\mu_0I\\)

    "},{"location":"GP/com/com/#maxwells-equations","title":"Maxwell\u2019s Equations","text":""},{"location":"GP/com/com/#electromagnetic-waves","title":"Electromagnetic Waves","text":""},{"location":"GP/com/com/#derivation-of-the-wave-equation","title":"Derivation of the Wave Equation","text":"

    1.Decouple

    \\(\\triangledown\\times(\\triangledown\\times\\vec{E})=\\triangledown\\times(-\\frac{\\partial\\vec{B}}{\\partial t})=-\\frac{\\partial}{\\partial t}(\\triangledown\\times\\vec{B})=-\\mu_0\\epsilon_0\\frac{\\partial^2\\vec{E}}{\\partial t^2}\\)

    \\(\\triangledown\\times(\\triangledown\\times\\vec{B})=\\triangledown\\times(\\mu_0\\epsilon_0\\frac{\\partial\\vec{E}}{\\partial t})=\\mu_0\\epsilon_0\\frac{\\partial}{\\partial t}(\\triangledown\\times\\vec{E})=-\\mu_0\\epsilon_0\\frac{\\partial^2\\vec{B}}{\\partial t^2}\\)

    Another way to solution :

    \\(\\vec{A}\\times(\\vec{B}\\times\\vec{C})=\\vec{B}\\cdot(\\vec{A}\\cdot \\vec{C})-\\vec{C}\\cdot(\\vec{A}\\cdot \\vec{B})\\)

    \\(\\triangledown\\times(\\triangledown\\times\\vec{C})=\\triangledown\\cdot(\\triangledown\\cdot \\vec{C})-\\triangledown^2\\vec{C}\\)

    Thus:

    \\(\\triangledown^2\\vec{B}=\\mu_0\\epsilon_0\\frac{\\partial^2\\vec{B}}{\\partial t^2}\\\\ \\triangledown^2\\vec{E}=\\mu_0\\epsilon_0\\frac{\\partial^2\\vec{E}}{\\partial t^2}\\)

    \\(\\lambda=\\frac{2\\pi}{k}\\\\ v=\\lambda f=\\lambda/T \\\\w=\\frac{2\\pi}{T}\\)

    • For \\(\\triangledown\\cdot \\vec{E}=0\\\\\\triangledown\\cdot \\vec{B}=0\\)

    We have \\(E_m(x)=B_m(x)=0\\)

    • For \\(\\triangledown\\times\\vec{E}=-\\frac{\\partial{B}}{\\partial t}\\)

    \\(-k\\hat{x}\\times\\vec{E_m}=-w\\vec{B_m}\\)

    • Therefore \\(\\vec{B}=\\frac{1}{c}(\\hat{x}(unit\\ vector)\\times\\vec{E})\\)

    "},{"location":"GP/com/com/#energy-transport","title":"Energy Transport","text":"
    • For \\(\\vec{B}=\\frac{1}{c}(\\hat{x}(unit\\ vector)\\times\\vec{E})\\) We have \\(\\mu_E=\\frac{\\epsilon_0 E^2}{2}=\\frac{B^2}{2\\mu_0}=\\mu_B\\)
    • The rate of energy transport per unit area in a plane wave is the product of total energy density and the speed of the electromagnetic wave, i.e \\(S=(u_E +u_B)c.\\)
    • \\(I = S_{avg}= \\frac{\\epsilon_0 E_m^2}{2}c=\\frac{B_m^2}{2\\mu_0}c.\\)
    "},{"location":"GP/com/com/#variation-of-intensity-with-distance","title":"Variation of Intensity with Distance","text":"

    When spherical wavefronts spread from an isotropic point source S with power Ps, the energy of the waves is conserved.

    The intensity I at the sphere must decrease with r as \\(I=\\frac{P_S}{4\\pi r^2}\\)

    "},{"location":"GP/current/current/","title":"Current","text":""},{"location":"GP/current/current/#resistance-and-capacitance","title":"Resistance and Capacitance","text":"
    • \\(q=(nAL)e\\)
    • \\(i=\\frac{q}{\\triangle t}=nAe\\vec{v_d}\\)
    • \\(\\vec{J}=ne\\vec{v_d}\\)
    "},{"location":"GP/current/current/#resistance-and-resistivity","title":"Resistance and Resistivity","text":"

    The resistivity \u03c1 and conductivity \u03c3 of a material are related by \\(\u03c1 = 1/\u03c3 = E/J\\), where \\(E\\) is the magnitude of the applied electric field and \\(J\\) is the magnitude of the current density.

    • Resistance is a property of an object, while resistivity is a property of a material.
    • The \\(SI\\) unit for resistance is the ohm (\\(\u03a9\\)). The SI unit for resistivity is the ohm-meter (\\(\u03a9\\)\u00b7\\(m\\)).
    "},{"location":"GP/current/current/#ohms-law","title":"Ohm\u2019s Law","text":"
    • An electron of mass m and charge (\u2212e) experiences an acceleration in an electric field \\(\\vec{E}\\) :

    \\(\\vec{a}=-\\frac{e\\vec{E}}{m}\\)

    • After a typical collision, each electron will \u201close its memory\u201d of its previous drift velocity, starting fresh and moving off in a random direction.

    • In the average time \\(\u03c4\\) (or mean free time) between collisions, the electron will, on average, acquire a drift velocity

    \\(\\vec{v_d}=-\\frac{e\\vec{E}}{m}\\tau \\ \\ \\ Combining \\ with \\vec{J}=-ne\\vec{v_d} \\ We \\ get :\\)

    \\(-\\frac{\\vec{J}}{ne}=-\\frac{e\\vec{E}}{m}\\tau \\ \\ \\ which \\ implies \\vec{E}=\\rho\\vec{J} \\ \\ where\\ \\rho=\\frac{m}{ne^2\\tau}\\)

    • For metals under normal circumstances, both n and \u03c4 can be considered to be a constant. Thus, metals obey Ohm\u2019s law.

    • Thus,\\(V/I=E\\cdot d/J\\cdot S = \\rho d /S\\)

    "},{"location":"GP/current/current/#estimate-the-mean-free-timecopper","title":"estimate the mean free time(Copper)","text":"
    • The free electron density in \\(Cu\\) is \\(n = 8.47 \u00d7 10^{28} m^{\u22123}\\).
    • Cu has a resistivity \\(\u03c1 = 1.56 \u03bc\u03a9\u00b7cm\\).
    • The mean free time can be estimated by \\(\\rho=\\frac{m}{ne^2\\tau}\\)
    • In the classical picture, the mean velocity of an electron at room temperature can be estimated by \\((1/2)mv^2 = (3/2)k_BT.\\)
    "},{"location":"GP/current/current/#equation-of-continuity","title":"Equation of Continuity","text":"

    We have implicitly used the (local) conservation of charge here. Namely, if the total charge in some volume changes, the exactly same amount of charge must have passed in or out through the surface. Otherwise, charge accumulation occurs in the volume enclosed by the surface.

    • Formally, we have
    • \\(\\frac{d}{dt}\\int_V\\rho(\\vec{r},t)dV = \\int_V \\frac{\\partial{\\rho(\\vec{r},t)}}{\\partial{t}}dV=-\\oint_S\\vec{J}(\\vec{r},t)d\\vec{A}\\)

    • To be able to move the derivative under the integral sign this way requires that \\(\u2202\u03c1/\u2202t\\) be continuous.

    • With the divergence theorem, we can rewrite it in the derivative form (note V is arbitrary)\\(\\frac{\\partial \\rho}{\\partial t}=-\\triangledown\\cdot\\vec{J}\\)\uff08By Gauss's Law\uff09

    Such an equation of continuity plays an important role in hydrodynamics, hear flow, and diffusion theory, besides electromagnetic theory. It is simply a mathematical expression of a conservation law.

    "},{"location":"GP/current/current/#capacitor-and-capacitance","title":"Capacitor and Capacitance","text":"

    \\(C=\\frac{Q}{U}\\)

    "},{"location":"GP/current/current/#capacitance-of-a-parallel-plate-capacitor","title":"Capacitance of a Parallel-Plate Capacitor","text":""},{"location":"GP/current/current/#capacitance-of-a-cylindrical-capacitor","title":"Capacitance of a Cylindrical Capacitor","text":"
    • Apparently, the capacitance is proportional to the length of the cylindrical capacitor, just like the resistance of a cylindrical conductor (R = \u03c1L/A).
    "},{"location":"GP/current/current/#energy-stored-in-a-capacitor","title":"Energy stored in a capacitor","text":"

    \\(dW=V'dq'=(\\frac{q'}{C})dq'\\)

    \\(W=\\int_0^q(q'/C)dq'=\\frac{q^2}{2C}\\)

    \\(U=\\frac{q^2}{2C}=\\frac{CV^2}{2}\\)

    "},{"location":"GP/current/current/#dc-circuits","title":"DC Circuits","text":""},{"location":"GP/current/current/#rc-circuits","title":"RC circuits","text":""},{"location":"GP/current/current/#charging-switch-to-a","title":"Charging (switch to a )","text":"

    \\(\\frac{q}{C}\\frac{dq}{dt}+i^2R=i\\epsilon\\)

    \\(\\Rightarrow \\dot{q}+\\frac{q}{RC}=\\frac{\\epsilon}{R}\\)

    \\(\\Rightarrow q=C\\epsilon(1-e^{-t/RC})\\)

    • Note : Derivation see Appendix : ODEs

    • The equilibrium (final) charge on the then fully charged capacitor is equal to \\(q_0 = CE\\).

    \\(\\Rightarrow i = \\frac{dq}{dt}=(\\frac{\\epsilon}{R}e^{-t/RC})\\)

    \\(\\Rightarrow V_c = \\frac{q}{C}=\\epsilon(1-e^{-t/RC})\\)

    "},{"location":"GP/current/current/#dischargingswitch-to-b-from-a","title":"Discharging(switch to b from a)","text":"

    \\(\\dot{q}+\\frac{q}{RC}=0\\)

    \\(\\Rightarrow q=q_0e^{-t/RC}\\)

    \\(\\Rightarrow i = (\\frac{\\epsilon}{R})e^{-t/RC}\\)

    "},{"location":"GP/current/current/#energy-density","title":"Energy Density","text":"

    parallel-plate capacitor:

    \\(U=\\frac{1}{2}CV^2=\\frac{1}{2}\\epsilon_0E^2(Ad)\\)

    • The energy density u, i.e., the potential energy per unit volume between the plates, is thus uniform:\\(u=\\frac{1}{2}\\epsilon_0E^2\\)
    "},{"location":"GP/current/current/#capacitor-with-a-dielectric","title":"Capacitor with a Dielectric","text":""},{"location":"GP/current/current/#appendix","title":"Appendix","text":""},{"location":"GP/current/current/#odes","title":"ODEs","text":"
    • \\(\\dot{y}+p(x)y=q(x) \\Rightarrow y=e^{-\\int pdx}(C+\\int q\\cdot e^{\\int pdx}dx)\\)
    "},{"location":"GP/lec1-3/lec1/","title":"Coulomb's Law and the Electric Field","text":""},{"location":"GP/lec1-3/lec1/#coulombs-law","title":"Coulomb\u2018s Law","text":"

    \\(\\vec{F}=k\\frac{q_1q_2}{r^2}\\)

    \\(k = 8.99 * 10^{-12} N*m^2/C^2=\\frac{1}{4\\pi\\epsilon_0}\\\\\\)

    \\(\\epsilon_0=8.85*10^{-12}C^2/N*m^2\\)

    "},{"location":"GP/lec1-3/lec1/#diphole","title":"Diphole","text":"
    • The product \\(\\vec{q}d\\) is known as the electric dipole moment \\(\\vec{p}\\) of the dipole.
    • Derivation

    \u200b \\(\\begin{align*}E&=\\frac{q}{4\\pi\\epsilon_0(z-\\frac{d}{2})^2}- \\frac{q}{4\\pi\\epsilon_0(z+\\frac{d}{2})^2}\\\\ &=\\frac{q\\vec{d}}{2\\pi\\epsilon_0}*\\frac{z}{(z-\\frac{d}{2})^2(z+\\frac{d}{2})^2}\\\\ &=\\frac{\\vec{p}}{2\\pi\\epsilon_0z^3}*\\frac{1}{(1-\\frac{d}{2z})^2(1+\\frac{d}{2z})^2}\\\\ &=\\frac{1}{2\\pi\\epsilon_0}\\frac{p}{z^3} \\ \\ when (z>>d)\\end{align*}\\)

    "},{"location":"GP/lec1-3/lec1/#a-diphole-in-a-uniform-electric-filed","title":"A diphole in a uniform electric filed","text":"

    Note:\\(\\tau=p\\times E\\)

    "},{"location":"GP/lec1-3/lec1/#the-electric-field-due-to-a-ring-of-charge","title":"The Electric Field Due to a Ring of Charge","text":"
    • When \\(z>>R\\) \\(E=\\frac{qz}{4\\pi\\epsilon_0z^3(1+(\\frac{R}{z})^2)^{\\frac{3}{2}}}=\\frac{q}{4\\pi\\epsilon_0z^2}\\)
    "},{"location":"GP/lec1-3/lec1/#the-electric-field-due-to-a-charged-disk","title":"The Electric Field Due to a Charged Disk","text":"

    \\(\\begin{align*}dE_z &= \\int \\frac{\\sigma(2\u03c0rdr)}{4\\pi\\epsilon_0(z^2+r^2)}\\frac{z}{\\sqrt{z^2+r^2}}=\\frac{\\sigma z}{2\\epsilon_0}\\int_0^R\\frac{rdr}{(z^2+r^2)^\\frac{3}{2}}\\\\ &= \\frac{\\sigma}{2\\epsilon_0}(1-\\frac{z}{\\sqrt{z^2+R^2}})\\end{align*}\\)

    "},{"location":"GP/lec1-3/lec1/#gausss-law","title":"Gauss's Law","text":""},{"location":"GP/lec1-3/lec1/#electric-flux","title":"Electric Flux","text":"

    \\(\u2206\u03a6 = (E cos\u03b8)\u2206A=\\vec{E}\\cdot{\\vec{A}}\\)

    \\(\u03a6=\\int\\vec{E}\\cdot{d\\vec{A}}\\)

    "},{"location":"GP/lec1-3/lec1/#gausss-law_1","title":"Gauss's Law","text":"

    \\(\\epsilon_0 \\oint\\vec{E}\\cdot d\\vec{A}=q_{encore}\\)

    "},{"location":"GP/lec1-3/lec1/#applications","title":"Applications","text":""},{"location":"GP/lec1-3/lec1/#1spherical-symmetry","title":"1.Spherical Symmetry","text":"

    \\(4\\pi r^2\\cdot E = \\frac{q{(\\frac{r}{R})^3}}{\\epsilon_0}\\)

    \\(\\Rightarrow \\ \\vec{E}=\\frac{q}{4\\pi\\epsilon_0R^3}\\cdot \\vec{r}\\)

    "},{"location":"GP/lec1-3/lec1/#2planar-symmetry","title":"2.Planar Symmetry","text":""},{"location":"GP/lec1-3/lec1/#3cylindrical-symmetry","title":"3.Cylindrical Symmetry","text":"
    • \\(\u03b5_0 \u03a6 = \u03bbh\\)

    • \\(E=\\frac{\\lambda}{2\\pi r\\epsilon_0}\\)

    "},{"location":"GP/lec1-3/lec1/#the-electrostatic-potential","title":"The Electrostatic Potential","text":""},{"location":"GP/lec1-3/lec1/#potential-due-to-an-electric-diphole","title":"Potential due to an electric diphole","text":"
    • For points that are relatively far from the the two lines to P as being parallel and their length dif- dipole \\((r \u226b d)\\), we can approximate the leg of a right triangle with hypotenuse d .Thus

    \\(r_--r_+\\approx dcos\\theta\\)

    \\(r_-\\cdot r_+\\approx r^2\\)

    \\(V=\\frac{\\vec{p}\\cdot\\vec{r}}{4\\pi\\epsilon_0r^3}\\)

    "},{"location":"GP/lec1-3/lec1/#systems-of-charged-particles","title":"Systems of Charged Particles","text":"
    • The lesson here is this: If you are given an assembly of charged particles, you can find the potential energy of the assembly by finding the potential of every possible pair of the particles and then summing the results.
    "},{"location":"GP/lec1-3/lec1/#continuous-charge-distribution-rod","title":"Continuous Charge Distribution: Rod","text":"

    \\(\\begin{align*} V &= \\int dV = \\int _0^L \\frac{\\lambda dx}{4\\pi\\epsilon_0\\sqrt{x^2+d^2}}\\\\ &=\\int \\frac{\\lambda}{4\\pi\\epsilon_0}\\int_0^L\\frac{dx}{\\sqrt{x^2+d^2}}\\\\ &=\\frac{\\lambda}{4\\pi\\epsilon_0}ln\\frac{L+\\sqrt{L^2+d^2}}{d} \\end{align*}\\)

    "},{"location":"GP/lec1-3/lec1/#continuous-charge-distribution-disk","title":"Continuous Charge Distribution: Disk","text":"

    \\(\\begin{align*}V &= \\int_0^R \\frac{\\sigma(2\u03c0rdr)}{4\\pi\\epsilon_0\\sqrt{z^2+r^2}}\\\\ &= \\frac{\u03c3}{2\\epsilon_0}(\\sqrt{z^2+R^2}\u2212z)\\end{align*}\\)

    \\(\\Rightarrow Ez=-\\frac{dV}{dz}\\)

    "},{"location":"GP/lec1-3/lec1/#the-triangle-of-electrostatics","title":"The Triangle of Electrostatics","text":""},{"location":"GP/lec1-3/lec1/#preknowledge","title":"PreKnowledge","text":""},{"location":"GP/lec1-3/lec1/#gradient","title":"gradient","text":"

    \\(\u2207V=\\frac{\\partial{V}}{\\partial{x}}\\hat{x}+\\frac{\\partial{V}}{\\partial{y}}\\hat{y}+\\frac{\\partial{V}}{\\partial{z}}\\hat{z}\\)

    "},{"location":"GP/lec1-3/lec1/#curl","title":"curl","text":"

    \\(\u2207 \\times V = \\begin{bmatrix}\\hat{x}&\\hat{y}&\\hat{z}\\\\\\frac{\\partial{}}{\\partial{x}}&\\frac{\\partial{}}{\\partial{y}}&\\frac{\\partial{}}{\\partial{z}}\\\\ V_x&V_y&V_z\\end{bmatrix}\\)

    • The curl of a gradient is always \\(ZERO\\)
    "},{"location":"GP/lec1-3/lec1/#divergence","title":"divergence","text":"

    \\(\u2207 \\cdot V\\)

    \\(\\frac{\\partial E_x}{\\partial x}+\\frac{\\partial E_y}{\\partial y}+\\frac{\\partial E_z}{\\partial z}=\\triangledown \\cdot \\vec{E}\\)

    "},{"location":"GP/lec1-3/lec1/#e-leftrightarrow-rho","title":"\\(E \\Leftrightarrow \\ \\rho\\)","text":"
    • \\(\\oint\\vec{E}\\cdot d\\vec{l}=\\int\\int(\\triangledown\\times \\vec{E})dS = 0\\) \\(By \\ Stokes\\) -- independent of \\(PATHS\\)

    • Choose a Gaussian surface to enclose a small cube centered at \\(\\vec{r}\\) with side \\(\\triangledown x\\triangledown y\\triangledown z\\) such that \\(\\triangle V = \\triangle x \\triangle y \\triangle z\\)

    • In the small \\(\\triangledown V\\) ,We have :
      • \\(\\frac{\\rho(\\vec{r})}{\\epsilon_0}=lim_{\\triangle V \\rightarrow0}\\frac{q_{enc}}{\\triangle V\\epsilon_0}=lim_{\\triangle V \\rightarrow0}\\frac{1}{\\triangle V}\\oint \\vec{E}\\cdot d\\vec{S}\\)
      • \\(\\oint \\vec{E_x}\\cdot d\\vec{S}=\\vec{E}(x + \\frac{\u2206x}{2} ,y,z)\\hat{x}\u2206y\u2206z+\\vec{E}(x - \\frac{\u2206x}{2} ,y,z)(-\\hat{x})\u2206y\u2206z = \\frac{\\partial E_x}{\\partial x}\\triangledown V\\)
      • \\(\\frac{\\rho(\\vec{r})}{\\epsilon_0}=\\frac{\\partial E_x}{\\partial x}+\\frac{\\partial E_y}{\\partial y}+\\frac{\\partial E_z}{\\partial z}=\\triangledown \\cdot \\vec{E}\\)
    • According to Gauss\u2019 law, the only places at which the divergence of the electric field is not zero are those locations at which charge is present. So the divergence is a measure of the tendency of the field to flow away from a (charged) point.
    • \\(\\oiint\\vec{E}\\cdot d\\vec{A} = \\iiint(\\triangledown \\cdot \\vec{E})dV\\) \\(Gauss's\\ Law\\)

    "},{"location":"GP/lec1-3/lec1/#example","title":"Example","text":""},{"location":"GP/lec1-3/lec1/#the-electrical-properties-of-conductors","title":"The Electrical Properties of Conductors","text":""},{"location":"GP/lec1-3/lec1/#a-charged-isolated-conductor","title":"A Charged Isolated Conductor","text":"
    • Consider an isolated conductor with excess charge. In electrostatic equilibrium, the electric field \\(\\vec{E}\\) inside the isolated conductor must be zero. Otherwise, the field would exert forces on the conduction electrons, and thus generate perpetual current in an isolated conductor.
    • Gauss\u2019 law then tells us that the net charge inside the Gaussian surface must also be zero; the excess charge must lie on the actual surface of the conductor.

    For the same conductor with a cavity, is there excess charge on the cavity wall?

    • We draw a Gaussian surface surrounding the cavity, close to its surface but inside the conducting body.
    • Because \\(\\vec{E} = 0\\) inside the conductor,there can be no flux through this new Gaussian surface
    • No charge on the cavity wall
    • The cavity can be enlarged until it consumes the entire conductor, leaving only the charges. The electric field would not change at all; so the electric field is set up by the charges and not by the conductor.
    "},{"location":"GP/lec1-3/lec1/#electric-field-outside-spherical-conductors","title":"Electric Field Outside Spherical Conductors","text":"
    • Shell Therom https://en.m.wikipedia.org/wiki/Shell_theorem

    If we enclose the conductor in a concentric Gaussian sphere, Gauss\u2019 law tells us that the electric field outside the surface of the conductor looks as if all the excess charge on the shell were concentrated at its center.

    "},{"location":"GP/lec1-3/lec1/#electric-field-outside-isolated-conductors","title":"Electric Field Outside Isolated Conductors","text":"
    • the electric field just outside the surface of a conductor can be determined using Gauss\u2019 law.
    • The electric field \\(\\vec{E}\\) at and just outside the conductor\u2019s surface must also be perpendicular to that surface.
    "},{"location":"GP/lec1-3/lec1/#flat-surface","title":"Flat surface","text":""},{"location":"GP/lec1-3/lec1/#parallel-plates","title":"Parallel Plates","text":""},{"location":"GP/lec1-3/lec1/#charge-inside-a-spherical-metal-shell","title":"Charge Inside a Spherical Metal Shell","text":"
    • Therefore, a total charge Q must lie on the inner wall of the shell in order that the net enclosed charge be zero.
    • Because the shell is electrically neutral,a total charge -Q leave the inner wall and move to the outer wall.
    • They must spread out uniformly.(This would be true no matter where inside the shell the particle happened to be located)
    "},{"location":"GP/lec1-3/lec1/#quantify-charge-distributionthe-method-of-images","title":"Quantify Charge Distribution(The Method of Images)","text":""},{"location":"GP/lec1-3/lec1/#asimple-analysis","title":"A.Simple Analysis","text":"

    There is a charge +q outside a spherical metal shell at a distance\\(r+R\\) from its center,how to decide the image?

    • Note:at the center C,all charges on the spherical shell exerts \\(ZERO\\) potentials on the point so \\(V_c=\\frac{kq}{(R+r)^2}\\)
    "},{"location":"GP/lec1-3/lec1/#b-a-single-grounded-pallete-with-a-charge-q-at-a-distance-d","title":"B. A single grounded pallete with a charge q at a distance d","text":"
    • In this way \\(V(x,y,z)=\\frac{\\frac{q}{ 4\\pi\\epsilon_0}}{\\sqrt{x^2+y^2+(z-d)^2}}- \\frac{\\frac{q}{ 4\\pi\\epsilon_0}}{\\sqrt{x^2+y^2+(z+d)^2}}\\)

    • We assert this is the solution for the upper half region.

    • We can check that\\(V(x,y,z=0)=0\\),and\\(V \u21920\\)for\\(x^2 +y^2 +z^2 \u226bd2.\\)

    • At z = 0, \\(\\vec{E}\\) = \u2212\u2207V is perpendicular to the xy plane, just as it would need to be with the grounded plane.
    • The only charge in the region z > 0 is q at (0,0,d).

    • According to Gauss\u2019 law, the surface charge density \u03c3 induced on the conductor is:

    \\(E=-\\epsilon_0\\frac{\\partial V}{\\partial z}|_{z=0}=\\frac{-qd}{2\\pi\\epsilon_0(x^2+y^2+d^2)^\\frac{3}{2}}\\hat{z}\\)

    \\(\\sigma=\\epsilon_0\\cdot E =\\frac{-qd}{2\\pi(x^2+y^2+d^2)^\\frac{3}{2}}\\)

    • Bringing q from infinity needs ? W

    Derive as little circles

    \\(V=\\int_0^\\infty\\frac{qd\\cdot 2\\pi r dr}{2\\pi(r^2+d^2)^{3/2}}\\cdot\\frac{q}{4\\pi\\epsilon_0(r^2+d^2)^{1/2}}=\\frac{q^2d}{8\\pi\\epsilon_0}\\int_0^{\\infty}\\frac{d(r^2)}{r^2+d^2}=-\\frac{q^2}{8\\pi\\epsilon_od}\\)

    which is half of the energy for bringing two point charges to a distance 2d with no conductor.

    "},{"location":"GP/lec1-3/lec1/#positive-charge-q-and-a-conducting-sphere","title":"positive charge +Q and a conducting sphere","text":"

    Solve the electro-static potential function \\(V(x,y,z)\\) and the electrostatic field \\(E(x,y,z)\\) in space, with a positive charge \\(+Q\\) located at \\((\u2212D, 0, 0)\\)and a conducting sphere of radius R (not grounded) at origin \\((R<D)\\).

    Pre - knowledge :

    • the grounded case with a charge outside(pictures below)

    Image : \\(r'=\\frac{R^2}{D}\\) \\(q'=-qR/D\\)

    Derivation :

    \\(\\begin{align*}V(\\theta)&=\\frac{q'}{4\\pi\\epsilon_0}\\cdot\\frac{1}{\\sqrt{R^2+r'^2-2Rr'cos\\theta}}+\\frac{Q}{4\\pi\\epsilon_0}\\cdot\\frac{1}{\\sqrt{R^2+D^2-2RDcos\\theta}}=0\\end{align*}\\)

    \\(\\Rightarrow \\frac{1}{4\\pi\\epsilon_0}[\\frac{\\frac{q'}{\\sqrt{Rr'}}}{\\sqrt{R/r'+r'/R-2cos\\theta}}+\\frac{\\frac{Q}{\\sqrt{RD}}}{\\sqrt{R/D+D/R-2cos\\theta}}]=0\\)

    \\(\\begin{align*}\\Rightarrow &\\frac{q'}{\\sqrt{Rr'}}+\\frac{Q}{\\sqrt{RD}}=0\\\\ &\\frac{R}{r'}+\\frac{r'}{R}=\\frac{R}{D}+\\frac{D}{R}\\end{align*}\\)

    \\(\\Rightarrow R/r'=D/R \\Rightarrow r'=R^2/D \\Rightarrow q'=-\\frac{qR}{D}\\)

    • the grounded case with a charge inside(Actually it's bascially the same thing)

    * Also See https://galileoandeinstein.phys.virginia.edu/Elec_Mag/2022_Lectures/EM_08_Images.html

    "},{"location":"GP/lec1-3/lec1/#appendix","title":"Appendix \uff1a","text":""},{"location":"GP/lec1-3/lec1/#cross-product","title":"Cross product","text":"
    • \\(\\vec{A} \u00d7(\\vec{B} +\\vec{C})=\\vec{A} \u00d7\\vec{B} +\\vec{A} \u00d7\\vec{C}\\)
    "},{"location":"GP/lec1-3/lec1/#_1","title":"\u7acb\u4f53\u89d2","text":"

    \\(dA=r^2sin\\theta d\\theta d\\Phi\\)

    \\(Solid \\ Angle\\ d\\Omega = \\frac{dA}{r^2}=sin\\theta d\\theta d\\Phi\\)

    \\(dV=r^2sin\\theta d\\theta d\\Phi dr\\)

    "},{"location":"GP/light/inteference/","title":"interference & refraction","text":""},{"location":"GP/light/inteference/#interference","title":"Interference","text":""},{"location":"GP/light/inteference/#the-superposition-of-waves","title":"The Superposition of Waves","text":""},{"location":"GP/light/inteference/#wave-equation","title":"Wave Equation","text":"

    Recall that each field component of an electromagnetic wave$ (Ex, Ey, Ez, Bx, By, and Bz) $satisfies the scalar 3D differential wave equation

    \\(\\frac{1}{v^2}\\frac{\\partial^2{\\phi}}{\\partial t^2}=\\frac{\\partial^2{\\phi}}{\\partial x^2}+\\frac{\\partial^2{\\phi}}{\\partial y^2}+\\frac{\\partial^2{\\phi}}{\\partial z^2}\\)

    This equation is linear \\(\\vec{\\phi}(r,t)\\) and its derivatives appear only to the first power.

    Consequently, if \\(\\vec{\\phi}(r,t)\\) are solutions, any linear combination of them \\(\\vec{\\phi}(r,t)=\\sum_{i=1}^nC_i\\vec{\\phi}_i(r,t)\\) will be a solution as well.

    • Examples

    "},{"location":"GP/light/inteference/#trigonometry-formulas","title":"Trigonometry Formulas","text":"

    \\(cos(\u03b1 + \u03b2) = cos \u03b1 cos \u03b2 \u2212 sin \u03b1 sin \u03b2\\)

    \\(cos(\u03b1 \u2212 \u03b2) = cos \u03b1 cos \u03b2 + sin \u03b1 sin \u03b2\\)

    \\(cos \u03b1 + cos \u03b2 = 2 cos \\frac{(\u03b1 + \u03b2)}{2} cos\\frac{(\u03b1 - \u03b2)}{2}\\)

    \\(cos \u03b1 \u2212 cos \u03b2 = -2 sin \\frac{(\u03b1 + \u03b2)}{2} sin\\frac{(\u03b1 - \u03b2)}{2}\\)

    "},{"location":"GP/light/inteference/#the-algebraic-method-of-adding-waves","title":"The Algebraic Method of Adding Waves","text":"

    \\(E_1 = E_{01}cos(\u03b1_1 \u2212 \u03c9t)\\)

    \\(E_2 = E_{02}cos(\u03b1_2 \u2212 \u03c9t)\\)

    \\(\u03b1_i = kx_i + \u03c6_i\\) with \\(x_i\\) being the distance from the source \\(s_i\\) of the waveto the point of observation.

    The linear combination of the waves is \\(E \u2261 E_0 cos(\u03b1 \u2212 \u03c9t) = E_1 + E_2\\)

    We get :

    \\(E_0cos\u03b1=E_{01}cos\u03b1_1 +E_{02}cos\u03b1_2\\)

    \\(E_0sin\u03b1=E_{01}sin\u03b1_1 +E_{02}sin\u03b1_2\\)

    \\(\\Rightarrow \\vec{E_0}=\\vec{E_{01}}+\\vec{E_{02}}\\)

    \\(E_0^2=E_{01}^2+E_{02}^2+2E_{01}E_{02}cos(\\alpha_2-\\alpha_1)\\)

    The resultant intensity is not simply the sum of the component intensity

    there is an additional contribution \\(2E_{01}E_{02}cos(\u03b1_2 \u2212 \u03b1_1)\\), known as the interference term.

    The phase difference may arise from a difference in path length traversed by the two waves, as well as a difference in the initial phase angle \\(\u03b4 =\\alpha_2-\\alpha_1= \\frac{2\u03c0}{\\lambda}(x_2 \u2212x_1)+(\u03c6_2 \u2212\u03c6_1).\\)

    "},{"location":"GP/light/inteference/#the-complex-method","title":"The Complex Method","text":"

    It is often mathematically convenient to make use of the complex representation when dealing with the superposition of harmonic waves.

    We now redo the calculation of adding two waves.

    The wave function \\(E_1 =E_{01}cos(\u03b1_1 \u2212\u03c9t)=E_{01}cos(kx_1 \u2212\u03c9t+\u03c6_1)\\) can be written as \\(\\tilde{E}_1 = E_{01}e^{i(\u03b1_1\u2212\u03c9t)} = E_{01}e^{i\u03b1_1}e^{\u2212i\u03c9t}\\) if we are interested only in the real part.

    • erratum \\(E_0^2=(E_0e^{i\\alpha})(E_0e^{-i\\alpha})\\)
    "},{"location":"GP/light/inteference/#phasor-addition","title":"Phasor Addition","text":"

    Now we discuss a graphical technique that uses vector additions instead of trigonometric additions.

    We can map a wave, which has an amplitude and a phase, to a vector, known as a phasor, in a two-dimensional plane, such that

    "},{"location":"GP/light/inteference/#summary","title":"Summary","text":"
    • The three methods all deal with addition in a two-dimensional space.
    • The phasor addition adds vectors (with x component and y component) in a two-dimensional real space.
    • The complex method is an addition of complex numbers (with real part and imaginary part) in a complex plane.
    • The algebraic or trigonometric method is most complex. In fact, it is an addition of functions (linear combination of \\(cos \u03c9t\\) and \\(sin \u03c9t\\)) in a two-dimensional Hilbert space, spanned by cos \u03c9t and sin \u03c9t.
    "},{"location":"GP/light/inteference/#natural-light","title":"Natural Light","text":"
    • Now, one may think that light from two fine incandescent wires would interfere.
    • This does not occur, because the light is emitted by vast numbers of atoms in the wires, acting randomly and independently for extremely short times \u2014 of the order of nanoseconds. The light is said to be incoherent.
    • As a result, at any given point on the viewing screen, the interference between the waves from the two sources varies rapidly and randomly between fully constructive and fully destructive. The screen is seen as being uniformly illuminated (over the time scale of our observation).
    "},{"location":"GP/light/inteference/#conditions-for-interference","title":"Conditions for Interference","text":"
    • To observe the interference of the two waves describedabove, we need the following conditions.
    • Two beams must have (nearly) the same frequency \u03c9. Otherwise, the phase difference is time-dependent. During the detection interval, the interference pattern will be averaged away.
    • The clearest pattern (with maximum contrast) exists when interfering waves have (nearly) equal amplitude. Why?
    • Initial phase difference can exist between sources, as long as it remains constant; the two sources are said to be coherent.

    • Until the advant of laser, no two individual sources can maintain a constant relative phase long enough for an observable interference pattern.

    "},{"location":"GP/light/inteference/#huygens-principle","title":"Huygens\u2019 Principle","text":"

    Each point on a wavefront may be regarded as a source of waves expanding from that point.

    If waves strike a barrier with a small opening, the waves may be seen to expand from the opening. Notice the wavelength is larger than the opening in this case.

    "},{"location":"GP/light/inteference/#youngs-interference-experiment","title":"Young\u2019s Interference Experiment","text":"
    • The slit \\(S_0\\) in screen A creates a spatially coherent beam that could identically illuminate slits \\(S_1\\) and \\(S_2\\) in screen B.
    • NOTE\uff1aSpatial incoherence arises from the fact that a realistic source (like a lightbulb) contains widely spaced point sources that changes phase rapidly and randomly (due to the granular nature of the emission process).
    • Nowadays screen A is no longer needed, and plane waves from a laser can provide the spatial coherence the experiment needs.
    • Light waves produce fringes in a Young\u2019s double-slit interference experiment, but what exactly determines the locations of the fringes?

    In other words, the light leaving the slits is in phase.

    However, the electric field components of these waves at point P are not in phase and vary with time as

    \\(E_1 =E_0cos(kr_1 \u2212\u03c9t)=E_0cos(kL+\u03b2\u2212\u03c9t)\\)

    \\(E_2 =E_0cos(kr_2 \u2212\u03c9t)=E_0cos(kL\u2212\u03b2\u2212\u03c9t)\\)

    Where the phase difference \\([L = (r_1 + r_2)/2 = \\sqrt{D^2+y^2}]\\) \\([\u03b4_2 = 2\u03b2 = k\u2206L = \\frac{2\u03c0d}{\\lambda} sin\u03b8.]\\)

    • The total intensity is thus given by \\(I \u221d 2E_{0}^2[1 + cos(2\u03b2)] \\ or\\ I = I_{max }cos^2\u03b2.\\)

    Therefore, a bright fringe appears when \\(\u2206L = d sin \u03b8 = m\u03bb\\) where m is an integer.

    On the other hand, a dark fringe appears when \\(\u2206L=dsin\u03b8= (m+\\frac{1}{2}) \u03bb\\) where m is an integer.

    We can then find the angle \u03b8 to any fringe and thus use the values of m to label the fringes.

    • For \\(\\triangle \\theta\\) \\(d(sin\\theta_1-sin\\theta_2)=\\frac{\\lambda}{2} \\Rightarrow dcos(\\frac{\\theta_1+\\theta_2}{2})\\triangle \\theta=\\frac{\\lambda}{2}. \\Rightarrow \\triangle \\theta = \\frac{\\lambda}{2dcos\\theta}\\)
    "},{"location":"GP/light/inteference/#interference-from-thin-films","title":"Interference from Thin Films","text":"

    So, reflecting off higher index, ray \\(r_1\\) has an additionalreflection phase shift 0.5 wavelength. There is no such shift for \\(r_2\\)

    In addition, the light waves of rays \\(r_1\\) and \\(r_2\\) has a path difference \\(2L\\), which occurs in index \\(n_2\\).Notice that the wavelength in the medium is \\(\u03bb_2=\\frac{v_2}{f}=\\frac{c}{n_2}\\frac{1}{f}=\\frac{\\lambda}{n_2}\\)

    Therefore, rays are in phase if \\(2L=(m+\\frac{1}{2})\\frac{\\lambda}{n_2}\\) , for integer m.

    They produce an interference maximum and the nearby region on the film is bright to observers.

    Similarly, if they are exactly out of phase \\(2L=m\\frac{\\lambda}{n_2}\\) they produce an interference minimum and the nearby region is dark, even though it is illuminated.

    "},{"location":"GP/light/inteference/#negligible-film-thickness","title":"Negligible Film Thickness","text":"
    • See at the top BLACK AREA which is because that the film is just so thin
    "},{"location":"GP/light/inteference/#newtons-rings","title":"Newton\u2019s Rings","text":"

    Newton\u2019s rings are interference patterns formed by light incident on the thin film of air between a convex lens and a flat (or between two suitable lenses).

    "},{"location":"GP/light/light/","title":"Light","text":""},{"location":"GP/light/light/#light-as-electromagnetic-waves","title":"Light as Electromagnetic Waves","text":""},{"location":"GP/light/light/#plane-wave","title":"Plane Wave","text":""},{"location":"GP/light/light/#transmission-of-light-in-matter","title":"Transmission of Light in Matter","text":"
    • In dielectric materials, the electric field is altered by a factor \\(\u03b5_r\\) , the relative permittivity (also called the dielectric constant \\(\u03ba\\)).

    • In magnetic materials (therefore, not in glass or plastic), the magnetic field is altered by a factor \\(\u03bc_r\\) , the relative permeability.

    Therefore, a light wave propagating through any substantive medium travels at a speed \\(v=\\frac{c}{n}=\\frac{1}{\\sqrt{\\epsilon_r\\mu_r}}\\frac{1}{\\sqrt{\\epsilon_o\\mu_o}}\\) where the index of refraction \\(n=\\sqrt{\\epsilon_r\\mu_r}\\)

    • The dispersion relation becomes \\(w=vk=ck/n\\) hence\\(k=nk_0\\ where\\ k_0 \\ is\\ the\\ wave\\ number\\ in\\ vaccum\\)
    "},{"location":"GP/light/light/#reflection-and-refraction","title":"Reflection and Refraction","text":"
    • Law of reflection: A reflected ray lies in the plane of incidence and has an angle of reflection equal to the angle of incidence (both relative to the normal)
    • Law of refraction: A refracted ray lies in the plane of incidence and has an angle of refraction \\(\u03b8_2\\) that is related to the angle of incidence \\(\u03b8_1\\) by \\(n_2sin\\theta_2=n_1sin\\theta_1\\) (Snell\u2019s law.)
    "},{"location":"GP/light/light/#total-internal-reflection","title":"Total Internal Reflection","text":""},{"location":"GP/light/light/#fermats-principle","title":"Fermat\u2019s Principle","text":"
    • The actual path between two points taken by a beam of light is the one that is traversed in the least time.
    • For a homogeneous medium the principle reduces to the law of the rectilinearity of a ray of light (in accordance with the axiom of geometry that a straight line is the shortest distance between two points).

    \\(Derivation\\)

    • Reflection(simple ignore)
    • Refraction

    \\(t(x)=\\frac{\\bar{SO}}{v_i}+\\frac{\\bar{OP}}{v_t}=\\frac{\\sqrt{x^2+h^2}}{\\frac{c}{n_i}}+\\frac{\\sqrt{(a-x)^2+b^2}}{\\frac{c}{n_t}}\\)

    • To minimize \\(t(x)\\) with respect to variations in x, we set \\(dt/dx = 0\\)

    \\(\\frac{dt}{dx}=\\frac{n_i}{c}\\frac{x}{\\bar{SO}}-\\frac{n_t}{c}\\frac{a-x}{\\bar{OP}}=0\\)

    Thus \\(n_isin\\theta_i=n_tsin\\theta_t\\)

    "},{"location":"GP/light/light/#huygens-principle","title":"Huygens\u2019 Principle","text":"

    Huygens\u2019 principle is: All points on a wavefront serve as point sources of spherical secondary wavelets. After a time \\(t\\), the new position of the wavefront will be that of a surface tangent to these secondary wavelets.

    • Reflection

    Thus , We get Law of reflection.

    • Refraction

    \\(\\triangle t = \\frac{\\triangle l\\ tan\\theta_1}{v_1}\\)

    \\(R=v_2 \\cdot \\triangle t\\)

    \\(v_i=\\frac{c}{n_i}\\)

    \\(\\Rightarrow R=\\frac{n_1}{n_2}\\triangle l \\cdot tan\\theta_1\\)

    \\(sin\\theta_2=\\frac{R}{\\frac{\\triangle l}{cons\\theta_1}}\\)

    \\(\\Rightarrow n_1sin\\theta_1=n_2sin\\theta_2\\)

    Thus We get Law of refraction.

    "},{"location":"GP/light/light/#the-electromagnetic-approach","title":"The Electromagnetic Approach","text":"

    \\(\\vec{E}_i = \\vec{E}_{0i}cos(\\vec{k}_i \\cdot\\vec{r}\u2212\u03c9_it)\\)

    \\(\\vec{E}_r = \\vec{E}_{0r}cos(\\vec{k}_r \\cdot\\vec{r}\u2212\u03c9_rt+\\phi_r)\\)

    \\(\\vec{E}_t = \\vec{E}_{0t}cos(\\vec{k}_t \\cdot\\vec{r}\u2212\u03c9_tt+\\phi_t)\\)

    • Above the surface : \\(\\vec{E}=\\vec{E_i}+\\vec{E_r}\\)
    • Below the surface \\(\\vec{E}=\\vec{E_t}\\)
    • For simplicity, we consider the case that \\(\\vec{E_{0i}}\\)\\(\\vec{E_{0r}}\\ \\vec{E_{0t}}\\) are constant in time

    \\(Boundary\\ conditions\\)

    • Draw a narrow closed path C that runs parallel to the interface inside bot media. According to the Faraday's Induction Law,we have \\(\\oint\\vec{E}\\cdot d\\vec{s}=-\\frac{d\\Phi_B}{dt}\\)

    • The loop can be made so narrow such that there is no flux through C.
    • Define \\(\\hat{u}_n\\)to be the unit vector normal to the interface
    • The boundary condition leads to :\\((\\vec{E}_i+\\vec{E}_r-\\vec{E}_t)\\)perpendicular to \\(\\vec{l}\\) thus parallel to \\(\\vec{u_n}\\)

    \\(\\hat{u}_n \\times (\\vec{E}_i+\\vec{E}_r)-\\hat{u}_n \\times \\vec{E}_t=0\\) which is satisfied for all values of time and at any point on the interface.

    Thus, we have :

    \\(\\begin{align*}&\\hat{u}_n \\times \\vec{E}_{0i}cos(\\vec{k}_i \\cdot\\vec{r}\u2212\u03c9_it)+\\hat{u}_n \\times \\vec{E}_{0r}cos(\\vec{k}_r \\cdot\\vec{r}\u2212\u03c9_rt+\\phi_r)\\\\ &= \\hat{u}_n \\times \\vec{E}_{0t}cos(\\vec{k}_t \\cdot\\vec{r}\u2212\u03c9_tt+\\phi_t) \\end{align*}\\)

    • This can only be satisfied if \\(\u03c9_i = \u03c9_r = \u03c9_t\\), which means the charged particles within the media are undergoing forced oscillations at the frequency of the incident wave.
    • Furthermore, for any \\(\\vec{r}\\) terminating on the interface

    \\((\\vec{k_i}\\cdot \\vec{r})|_{y=b}=(\\vec{k_r}\\cdot \\vec{r}+\\phi_r)|_{y=b}=(\\vec{k_t}\\cdot \\vec{r}+\\phi_t)|_{y=b}\\)

    Thus,We have \\((\\vec{k_i}-\\vec{k_r})|_{y=b}=\\phi_r\\) or \\((\\vec{k}_i-\\vec{k_r})\\cdot(\\vec{r_1}-\\vec{r_2})=0\\) for any pair of \\(\\vec{r_1}\\) and \\(\\vec{r_2}\\) terminating on the interface.

    For $\\hat{u_n}\\cdot (\\vec{r_1}-\\vec{r_2})=0 $,we know \\((\\vec{k_i}-\\vec{k_r})\\) is parallel to \\(\\hat{u_n}\\) or \\(k_isin\\theta_i=k_rsin\\theta_r\\)\u300cREFLECTION LAW\u300d

    Since the incident and reflected waves are in the same medium, \\(k_i = k_r\\) , so, finally, \\(\u03b8_i = \u03b8_r\\) (the law of reflection).

    • Similarly \\((\\vec{k_i}-\\vec{k_t})\\) is also parallel to \\(\\hat{u_n}\\) we have:

    \\(\\vec{k_i}\\times\\hat{u_n}=\\vec{k_t}\\times\\hat{u_n}\\)

    Or. \\(n_i(\\hat{k_i}\\times\\hat{u_n})=n_t(\\hat{k_t}\\times\\hat{u_n})\\)\u300cREFRACTION LAW\u300d

    • Note that the law of reflection and the law of refraction only rely on the phase relationship that exists among the phases of \\(\\vec{E}_{0i}\\), \\(\\vec{E}_{0r}\\) and \\(\\vec{E}_{0t}\\) at the boundary.

    • There is still an interdependence shared by the amplitudes \\(\\vec{E}_{0i}\\), \\(\\vec{E}_{0r}\\) and \\(\\vec{E}_{0t}\\). The additional constraint can be used to calculate the amplitude of the reflected wave and the transmitted wave (the Fresnel equations). This will lead to the phenomenon of polarization by reflection (to be discussed in the lecture on polarization).

    "},{"location":"GP/light/light/#geometrical-optics","title":"Geometrical Optics","text":""},{"location":"GP/light/light/#spherical-mirrors","title":"Spherical Mirrors","text":"
    • Store surveillance mirrors are usually convex to take advantage of the increase in the field of view \u2014 more of the store can then be seen with a single mirror.
    • Makeup mirrors and shaving mirrors are concave \u2014 they produce a larger image of a face.
    • For mirrors of both types, the focal length f is related to the radius of curvature r of the mirror by \\(f=r/2\\) where r is positive for a concave mirror and negative for a convex mirror.
    "},{"location":"GP/light/light/#focal-points-of-spherical-mirrors","title":"Focal Points of Spherical Mirrors","text":"

    \\(Proof\\)

    "},{"location":"GP/light/light/#images-from-spherical-mirrors","title":"Images from Spherical Mirrors","text":"

    \\(\\frac{1}{p}+\\frac{1}{i}=\\frac{1}{f}\\)

    \\(Proof\\)

    • We assume small angles (but for clarity the rays are drawn with exaggerated angles).

    • Clearly, When \\(p>f\\) \\(i\\) is positive, indictaing a real image.

    When \\(p<f\\) \\(i\\) is negative,indicating an imaginary image.

    • \\(-\\frac{i}{p}\\) -- scaling factor

    When \\(i\\) > 0 : an upsidedown real image

    When \\(i\\) <0 : an erect imaginary image

    \\(Proof\\)

    "},{"location":"GP/light/light/#spherical-refraction","title":"Spherical Refraction","text":"

    \\(Proof\\)

    • Quite the same when convex(only \\(i\\) & \\(r_0\\) Are negative)

    Thus \\(f\\) for convex lens is positive , for concave lens is negative

    \\(Proof\\)

    It can also be applied for any number of lenses.

    The overall (or net) lateral magnification M of a system of lenses (or lenses and a mirror) is the product of the individual lateral magnifications as given by \\(m = \u2212i/p\\).

    "},{"location":"GP/light/light/#application","title":"Application","text":"

    The normal human eye can focus a sharp image of an object on the retina if the object is located beyond the near point (\u223c 25 cm from the eye).

    To see better, we want to generate an magnified image of an object at the near point, instead of putting the object there.

    • Explain eg \\(p2\\) : \\(\\frac{1}{p_2}+\\frac{1}{i_2}=\\frac{1}{f}\\) but \\(i_2<0\\),Thus if we want \\(|i_2|\\)to be large ,\\(p_2\\) has to be relatively large, but also \\(p_2\\)has to be smaller than \\(f_{ey}\\) , thus \\(p2 <\\approx f_{ey}\\).

    • This leaves the distance between the two lenses \\(f_{ob} + s + f_{ey}\\) the only parameter to tune. The longer the distance, the larger the magnification

    \\(M = m_1m_2 \\approx -\\frac{f_{ob}+s}{f_{ob}}\\frac{25}{f_{ey}}\\)

    • We can make \\(s \u226b fob\\), so \\(M \u2248 \u2212(s/f_{ob})(25 cm/f_{ey})\\) (s still limited by the practical sizes of microscope)

    "},{"location":"GP/light/df/diffraction/","title":"Diffraction & Interference","text":""},{"location":"GP/light/df/diffraction/#plane-wave","title":"plane wave","text":"

    A plane wave is a type of wave whose wavefronts are flat, or nearly flat. This means that the wave crests and troughs are aligned along parallel lines. Plane waves are an important concept in physics and are often used to describe various types of waves, including electromagnetic waves and sound waves.

    Key characteristics of a plane wave include:

    1. Constant Phase Front: In a plane wave, all points on a wavefront have the same phase. The phase of a wave is a measure of the position of a point in its cycle relative to a reference point.

    2. Parallel Propagation: The wavefronts of a plane wave propagate in parallel lines. This is in contrast to spherical waves, where the wavefronts are spheres centered around the source.

    3. Mathematical Representation: Mathematically, a one-dimensional plane wave can be represented as a function of the form:

    \\(Acos\u2061(kx\u2212\u03c9t+\u03d5)\\)

    where:

    • A is the amplitude of the wave,
    • k is the wave number (related to the wavelength),
    • x is the spatial coordinate,
    • \u03c9 is the angular frequency,
    • t is time, and
    • \u03d5 is the phase angle.
    1. Infinite Extent: In theoretical discussions, plane waves are often assumed to have infinite extent, meaning they continue indefinitely in space.

    Plane waves are useful in physics because they simplify the mathematical description of wave phenomena, making it easier to analyze and solve problems. They are often used as a starting point for understanding more complex wave behavior. In the context of electromagnetic waves, for example, plane waves are fundamental to the study of optics and electromagnetic field theory.

    "},{"location":"GP/light/df/diffraction/#single-slit-diffraction","title":"Single-Slit Diffraction","text":""},{"location":"GP/light/df/diffraction/#electric-field-and-intensity","title":"Electric Field and Intensity","text":"

    To find an expression for the intensity at an arbitrary point P on the viewing screen, corresponding to a particular small angle \u03b8, we need to divide the slit into N zones of equal widths \\(\u2206x = a/N\\) small enough that we can assume each zone acts as a source of Huygens wavelets.

    We then add the phasors for the wavelets, which form a geometric series(notice. \\(r_{i+1}\u2212r_i =\u2206xsin\u03b8\\)):

    \\(\\widetilde{E}_\\theta =\\frac{E_0}{N}e^{-iwt}e^{ikr+1}\\times [1+e^{ik(r_2-r_1)}+e^{ik(r_3-r_1)}+\u2026+e^{ik(r_N-r_1)}]\\)

    note \\(\\Phi\\)=\\(\\frac{asin\\theta}{\\lambda}\\times2\\pi\\)

    Summary

    • When \\(\\alpha=0 (\\theta=0)\\),the intensity reaches the maximum
    • When \\(\\alpha =n\\pi(n\\ne0)\\),which is \\(asin\\theta=n\\lambda\\) the intensity is ZERO
    • When a is approximately large \\(\\theta\\) is rather small ,meaning that there is no diffraction

    "},{"location":"GP/light/df/diffraction/#from-sum-to-integral","title":"From Sum to Integral","text":"

    \\(\\begin{align*}\\widetilde{E}_\\theta &=\\frac{E_0}{N}e^{-iwt}e^{ikr+1}\\times [1+e^{ik(r_2-r_1)}+e^{ik(r_3-r_1)}+\u2026+e^{ik(r_N-r_1)}]\\\\&=\\frac{E_0 \\triangle x}{a}e^{-iwt}[e^{ikr_1}+e^{ikr_2}+\u2026+e^{ikr_N}]\\end{align*}\\)

    \\(\\Rightarrow_{N\\to+\\infty} \\widetilde{E}_\\theta = \\frac{E_0}{a} e^{-iwt}\\int_0^ae^{ik\uff08sin\\theta x+r_1\uff09}dx\\) ~ \\(\\int_{-a/2}^{a/2}e^{ik_xx}dx\\) \\((k_x=ksin\\theta)\\)

    "},{"location":"GP/light/df/diffraction/#fourier-transform","title":"Fourier Transform","text":"

    Thus \\(\\widetilde{E}_{sq}(k_x)= E_0a\\frac{2sin(k_xa/2)}{k_x}=E_0a\\frac{sin\\alpha}{\\alpha}(\\alpha=k_xa/2=\\frac{sin\\theta a}{2})\\)

    The key message is that the field distribution in the Fraunhofer diffraction pattern is the Fourier transform of the field distribution across the aperture.

    "},{"location":"GP/light/df/diffraction/#diffraction-by-a-circular-aperture","title":"Diffraction by a Circular Aperture","text":"

    We are essentially collecting only a fraction of the incident wavefront and therefore cannot hope to form a perfect image. The image is related to the Fourier transform of a disk and is known as the Airy pattern.

    The analysis of such patterns shows that the first minimum for the diffraction pattern of a circular aperture of diameter a is located by \\(sin\\theta = 1.22\\frac{\\lambda}{a}\\) in contrast to \\(sin \u03b8 = \u03bb/a\\) in the slit case.

    "},{"location":"GP/light/df/diffraction/#resolvability","title":"Resolvability","text":"

    Two objects cannot be distinguished from a single point object, if their diffraction patterns (mainly their central maxima) overlap. Rayleigh\u2019s criterion for resolvability states that the two point objects are barely resolved if their angular separation is such that the central maximum of the diffraction pattern of one source is centered on the first minimum of the diffraction pattern of the other, i.e.\\(\u03b8_R = sin^{\u22121} \\frac{1.22\u03bb}{a} \u2248 1.22\\frac{\\lambda}{a}\\)

    • Quesiton\uff1f QUIZ
    "},{"location":"GP/light/df/diffraction/#grating-and-spectra","title":"Grating and Spectra","text":""},{"location":"GP/light/df/diffraction/#diffraction-by-a-double-slit","title":"Diffraction by a Double Slit","text":"

    Formally, with diffraction effects taken into account, the intensity of a double-slit interference pattern (shown later with the Fourier method) is

    \\(I(\\theta)=I_{max}(\\frac{sin\\alpha}{\\alpha})^2cos^2\\beta\\) where \\(\\beta = \\frac{\\delta_2}{2}=\\frac{\\pi}{\\lambda}dsin\\theta\\) \\(\\alpha = \\frac{\\pi}{\\lambda}asin\\theta\\)

    • The first minimum occurs where the phase difference between the two slits (N = 2) is \\(\u03b4_2 =(2\u03c0/\u03bb)dsin\u03b8=\u03c0.\\)
    • The first minimum of the envelope occurs where the phase difference between one edge and the center of a single slit is \\(\u03b1 = (2\u03c0/\u03bb)(a/2) sin \u03b8 = \u03c0.\\)
    • One can, therefore, determine (d/a) by counting fringes.
    • In both cases, the larger the length (d or a) is, the smaller the \\(\u03b8\\) (or \\(k_x =ksin\u03b8\\) ) is.
    "},{"location":"GP/light/df/diffraction/#derivation","title":"Derivation","text":"

    The interference pattern can be understood by a convolution theorem for the Fourier transformation: The transform\uff08Fourier\uff09 of the convolution of two functions \\((f*g)\\) is the product of their transforms.

    \\(Proof\\)

    \\((f*g)(x)=\\int dx\\int dx'f(x')g(x-x')e^{ikx}\\\\=\\int f(x')e^{ikx'}d x'\\int dx\\ g(x-x')e^{ik(x-x')}\\)

    Thus

    • The single-slit aperture function :\\(F[E_{sq}(x)]=\\widetilde{E}_{sq}(k_x)=\\int_{-a/2}^{a/2}E_0e^{ikx}dx= E_0a\\frac{2sin(k_xa/2)}{k_x}=E_0a\\frac{sin\\alpha}{\\alpha}(\\alpha=k_xa/2=\\frac{sin\\theta a}{2})\\)

    • Young\u2019s double-slit interference result\uff1a

    Young's double-slit interference result is related to the interference pattern formed by two narrow slits. The function h(x) describes the distribution of intensity along the screen where the interference pattern is observed. In this case, h(x) is represented as a sum of two delta functions:

    \u200b \\(h(x) = \u03b4(x + d/2) + \u03b4(x \u2212 d/2)\\)

    Here, d is the separation between the two slits, and \u03b4(x) is the Dirac delta function. The Dirac delta function is a mathematical concept often used in physics to model idealized distributions. It is not a traditional function but rather a distribution that satisfies certain properties. In this context, \u03b4(x) can be thought of as an infinitely tall and narrow spike located at x=0.

    \u200b \\(F[h(x)]=\\int_{-\\infty}^{+\\infty} h(x)e^{ik_xx}dx= e^{-ik_xd/2}+e^{ik_xd/2}=2cos(k_xd/2)\\)

    "},{"location":"GP/light/df/diffraction/#interference-vs-diffraction","title":"Interference vs Diffraction","text":"

    If we let \\(a\u21920\\), then \\(\u03b1\u21920\\) and\\(\\frac{sin\\alpha}{\\alpha}\u21921\\). Our result then reduces, as it must, to an equation describing the interference pattern for a pair of vanishingly narrow slits with slit separation d.

    Similarly, putting \\(d \u2192 0\\) is equivalent physically to causing the two slits to merge into a single slit of width a. Then we have \\(\u03b2\u21920\\) and \\(cos2\u03b2\u21921\\). Our result reduces,as it must,to an equation describing the diffraction pattern for a single slit of width a.

    If the combining waves originate from a small number of elementary coherent sources \u2014 as in a double-slit experiment with a \u226a \u03bb \u2014 we call the process interference.

    If the combining waves originate in a single wavefront \u2014 as in a single-slit experiment \u2014 we call the process diffraction.

    Note that both are superposition effects and usually both are present simultaneously.

    "},{"location":"GP/light/df/diffraction/#diffraction-gratings","title":"Diffraction Gratings","text":"

    In double-slit interference with a \u226a \u03bb \\(I(\u03b8) = I_{max}cos^2 [\\frac{\u03c0d}{\\lambda} sin\u03b8]\\)

    The bright fringes due to different wavelengths overlap too much to be distinguished.

    A useful tool in the study of light and of objects that emit and absorb light is the diffraction grating, which has a much greater number N of slits, often called rulings, perhaps as many as several thousand per millimeter.

    "},{"location":"GP/light/df/diffraction/#multiple-slits-with-monochromatic-light","title":"Multiple Slits with Monochromatic Light","text":"
    • When N=3

    Figure below shows the simplest case of multiple-slit interference, with three slits, or \ud835\udc41=3. The spacing between slits is d, and the path length difference between adjacent slits is \ud835\udc51sin\ud835\udf03, same as the case for the double slit. What is new is that the path length difference for the first and the third slits is 2\ud835\udc51sin\ud835\udf03. The condition for constructive interference is the same as for the double slit, that is \\(dsin\\theta=m\\lambda\\)

    When this condition is met, 2\ud835\udc51sin\ud835\udf03 is automatically a multiple of \ud835\udf06, so all three rays combine constructively, and the bright fringes that occur here are called principal maxima. But what happens when the path length difference between adjacent slits is only \ud835\udf06/2? We can think of the first and second rays as interfering destructively, but the third ray remains unaltered. Instead of obtaining a dark fringe, or a minimum, as we did for the double slit, we see a secondary maximum with intensity lower than the principal maxima.

    • In general

    In general, for N slits, these secondary maxima occur whenever an unpaired ray is present that does not go away due to destructive interference. This occurs at (\ud835\udc41\u22122) evenly spaced positions between the principal maxima.

    The amplitude of the electromagnetic wave is correspondingly diminished to 1/\ud835\udc41 of the wave at the principal maxima, and the light intensity, being proportional to the square of the wave amplitude, is diminished to \\(\\frac{1}{N^2}\\) of the intensity compared to the principal maxima.

    As figure below shows, a dark fringe is located between every maximum (principal or secondary). As N grows larger and the number of bright and dark fringes increase, the widths of the maxima become narrower due to the closely located neighboring dark fringes. Because the total amount of light energy remains unaltered, narrower maxima require that each maximum reaches a correspondingly higher intensity.

    \\(Phase\\ difference\\)

    \\(\\delta_N=\\frac{2\\pi}{\\lambda}dsin\\theta\\)

    Consider the example below when N equals 4

    • With monochromatic (red) light incident on a diffraction grating (with a large number N), you would see on a viewing screen very narrow(and so are called lines) ,separated by relatively wide dark regions
    "},{"location":"GP/light/df/diffraction/#width-of-the-lines","title":"Width of the Lines","text":"

    A grating\u2019s ability to resolve (separate) lines of different wavelengths depends on the linewidth. The half-width of the central line \\(\u2206\u03b8_{hw}\\) is determined by the first minimum in intensity, at which the N rays from the N slits of the grating cancel one another.

    The first minimum occurs where the phase difference between the adjacent slits is (from the path length difference between the top and bottom rays)

    \\(\\delta_N=\\frac{2\\pi}{\\lambda}dsin\\triangle\\theta_{hw}=\\frac{2\\pi}{N}\\)

    Or \\(\\triangle\\theta_{hw}\\approx sin\\triangle\\theta_{hw}=\\frac{\\lambda}{Nd}\\)

    "},{"location":"GP/light/df/diffraction/#atomic-grating","title":"Atomic Grating","text":"

    A crystalline solid, which consists of a regular array of atoms, resembles a diffraction grating with separation d on the atomic scale (\u223c \\(10^{\u221210}\\) m).

    Waves can be diffracted as if they were reflected by a family of parallel planes, with angles measured relative to the planes (not to a normal as in optics).

    NOTE : The distance difference is now approximately \\(2dsin\\theta\\)

    Suppose we would like to use the visible light \\((\u03bb \u2243 5.5 \u00d7 10^{\u22127} m)\\) to study the diffraction. The first-order maximum (m = 1) would occur at \\(sin \u03b8 = \\frac{m\u03bb}{2d} = 2750 \u226b 1.\\)

    This means that we would not observe the first-order maxima. Therefore, we need waves with much shorter wavelength \\((\u03bb \u2248 d)\\), that is, X rays.

    "},{"location":"GP/light/df/diffraction/#x-ray-diffraction","title":"X-Ray Diffraction","text":"

    Wilhelm Roentgen discovered X rays in 1895. He realized that these rays could be used to pass through, e.g., his wife\u2019s hand and to create an image of internal bones.

    The invention of X rays helped revolutionize modern medicine, evolving into what we use today, called the digital X-ray.

    The maxima turns out to be in directions as if the x rays were reflected by a family of crystal planes that extend through the atoms within the crystal and that contain regular arrays of the atoms.

    Bragg\u2019s law states that the intensity maxima for X-ray diffraction is \\(2d sin\u03b8 = m\u03bb\\) where \\(m = 1,2,3,...\\) is the order number of an intensity maximum. A monochromatic X-ray beam can be used to determine the geometrical structure of a crystal.

    "},{"location":"GP/light/df/diffraction/#crystallography-miller-indices","title":"Crystallography: Miller Indices","text":"

    Miller Indices are a symbolic vector representation for the orientation of an atomic plane in a crystal lattice and are defined as the reciprocals of the fractional intercepts which the plane makes with the crystallographic axes.

    The method by which indices are determined is best shown by example. Recall, that there are three axes in crystallographic systems (except sometimes in the hexagonal system adopts a convention where there are four axes). Miller indices are represented by a set of 3 integer numbers.

    • Diffraction patterns are analyzed by a curve fitting procedure, with least-squares minimization between observed data and calculated pattern.

    (2,0,0) half of (1,0,0) Thus,\\(\\theta\\) is different

    "},{"location":"GP/light/df/diffraction/#applications","title":"Applications","text":"
    • The Discovery of the DNA Structure

    X-ray diffraction from fibrous DNA (by Rosalind Franklin and her student R. G. Gosling) tipped off Watson and Crick to double helix. Watson and Crick also knew from the work of Erwin Chargaff that adenine and thymine bases and guanine and cytosine bases were always present in approximately equal amounts.

    "},{"location":"GP/light/quantum%20light/quantum/","title":"The Quantum Nature of Light","text":""},{"location":"GP/light/quantum%20light/quantum/#the-photoelectric-effect","title":"The Photoelectric Effect","text":"

    Experiments show that if you direct a beam of light of short enough wavelength onto a clean metal surface, the light will eject the electrons from the surface.

    We adjust the potential difference V by moving the sliding contact so that the potential of collector C is slightly negative with respect to target T.

    At the stopping potential \\(V = V_{stop}\\), the reading of meter A has just dropped to zero, the most energetic ejected electrons are turned back just before reaching the collector.

    "},{"location":"GP/light/quantum%20light/quantum/#puzzle-1-for-classical-physics","title":"Puzzle 1 for Classical Physics","text":"

    Measurements show that for light of a given frequency, \\(K_{max}\\) does not depend on the intensity of the light source.

    However,in the classical theory, however, if we increase the amplitude of the wave and its oscillating electric field, the electron should get a more energetic \u201ckick\u201d.

    Why Strange?
    1. The incident light is a sinusoidally oscillating electromagnetic wave.

      An electron in the target should oscillate sinusoidally due to the oscillating electric force on it from the wave\u2019s electric field.

      If the amplitude of the electron\u2019s oscillation is great enough, the electron should break free of the target\u2019s surface \u2013 that is, be ejected from the target.

    "},{"location":"GP/light/quantum%20light/quantum/#puzzle-2-for-classical-physics","title":"Puzzle 2 for Classical Physics","text":"

    Experiments show that the photoelectric effect does not occur if the frequency is below a certain cutoff value \\(f_0\\) ,no matter how intense the incident light is.

    "},{"location":"GP/light/quantum%20light/quantum/#sum","title":"Sum","text":"

    In the classical theory, light is viewed as an electromagnetic wave.

    One expects that no matter how low the frequency, electrons can always be ejected by light if they are supplied with enough energy \u2014 that is, if one uses a light source that is bright enough.

    In experiments, however, electrons can escape only if the light frequency exceeds a certain value, and the escaping electron\u2019s kinetic energy is greater for a greater light frequency.

    Einstein proposed that electromagnetic radiation (or simply light) is quantized and exists in elementary amounts (quanta) that we now call photons. According to his proposal, the quantum of a light wave of frequency f has the energy \\(E = hf = \\bar{h}\u03c9\\), where \\(h = 2\u03c0\\bar{h} = 6.63 \u00d7 10^{\u221234} J\u00b7s\\) is the Planck constant, and \u03c9 is the angular frequency. The total energy of a light wave of frequency f must be an integer multiple of \\(hf\\) , with the smallest amount being \\(hf\\) ,the energy of a single photon.

    Einstein further proposed that when light is absorbed or emitted by an object (matter), the absorption or emission event occurs in the atoms of the object.

    In the absorption event, the energy \\(hf\\) of one photon is transferred from the light to the atom; the photon vanishes and the atom is said to absorb it.

    For an object consisting of many atoms, there can be many photon absorptions (such as with sunglasses) or photon emissions (such as with lamps).

    In classical physics, such events involve so much light that we had no need of quantum physics.

    "},{"location":"GP/light/quantum%20light/quantum/#photon-the-quantum-of-light","title":"Photon, the Quantum of Light","text":"

    Back to the Photoelectric Effect\uff0cthe electrons within the target are held by electric forces. To just escape from the target, an electron must pick up a certain minimum energy \\(W\\) , where \\(W\\) is a property of the target material called its work function.

    The energy that can be transferred from the incident light to an electron in the target is that of a single photon \\(hf\\) . According the conservation of energy, the kinetic energy K acquired by the electron satisfies. \\(hf = K + W\\) .

    In the most favorable circumstance, the electron can escape through the surface without losing any of this kinetic energy in the process. (i.e. \\(K_{max} = hf \u2212 W\\) ).

    Increasing the light intensity increases the number of photons in the light, not the photon energy, so the energy transferred to the kinetic energy of an electron is also unchanged. This solves puzzle #1.

    If the energy hf transferred to an electron by a photon exceeds the work function of the material (if \\(hf > W\\) ), the electron can escape the target. If the energy transferred does not exceed the work function (that is, if \\(hf < W\\) ), the electron cannot escape. This solves puzzle #2.

    "},{"location":"GP/light/quantum%20light/quantum/#photon-momentum-and-compton-scattering","title":"Photon Momentum and Compton Scattering","text":"

    A photon, or a light quantum, is a particle with energy \\(E = hf\\) . It has a velocity of the speed of light c, but no mass (m = 0). In 1916, Einstein extended his concept of photons by proposing that a quantum of light has linear momentum.

    According to the theory of relativity, \\(E^2 \u2212 c^2p^2 = m^2c^4 = 0\\) the magnitude of the photon momentum is. \\(p = \\frac{hf}{c} = \\frac{h}{\\lambda} = \\bar{h}k\\)

    "},{"location":"GP/light/quantum%20light/quantum/#compton-scattering","title":"Compton Scattering","text":"

    When a photon interacts with matter, energy and momentum are transferred, as if there were a collision between the photon and matter in the classical sense.

    To demonstrate, Arthur Compton measured the wavelengths and intensities of a beam of X rays that were scattered in various directions from a carbon target.

    Compton found that although there is only a single wavelength \\((\u03bb = 71.1 pm)\\) in the incident X-ray beam, the scattered X rays contain a range of wavelengths with two prominent intensity peaks.

    • One peak is centered about the incident wavelength \\(\u03bb\\).
    • The other is centered about a wavelength \\(\u03bb^\u2032\\) that is longer than \\(\u03bb\\) by an amount \\(\u2206\u03bb\\), the Compton shift.
    • The value of the Compton shift varies with the angle at which the scattered X rays are detected and is greater for a greater angle

    In classical physics, an electron in the carbon target undergoes forced oscillations in the sinusoidally oscillating electromagnetic wave. Hence, the electron should send out scattered waves at the same frequency.

    With quantum physics and relativity, the energy and momentum conservation becomes \u300cImportant\u300d

    \\(\\begin{align*} \\frac{hc}{\\lambda}+mc^2&=\\frac{hc}{\\lambda^{'}}+\\gamma mc^2 \\ (energy) \\\\ \\frac{h}{\\lambda}&=\\frac{h}{\\lambda'}cos\\phi+\\gamma mvcos\\theta\\ (momentun\\ in\\ x) \\\\ 0&=\\frac{h}{\\lambda'}sin\\phi-\\gamma mvcos\\theta\\ (momentun\\ in\\ y)\\end{align*}\\)

    where \\(\\gamma =\\sqrt{\\frac{1}{1-\\frac{v^2}{c^2}}}\\)

    The quantity \\(h/mc\\) is a constant called the Compton wavelength. Its value depends on the mass m of the particle from which the X rays scatter.

    • The Compton wavelength of a particle corresponds to the wavelength of a photon whose energy is the same as the rest mass energy of the particle.

    Strictly speaking, the particle can be a loosely boundelectron, or a carbon atom (with tightly bound electrons).

    • For an electron, the Compton wavelength is \\(\\frac{h}{mc}= \\frac{hc}{mc^2} =\\frac{12400eV\u00b7A\u030a}{511000eV}=2.426pm\\)

    • For a carbon atom, the Compton wavelength is \\(12 \u00d7 m_u /m_e \u2248 12 \u00d7 1836 \u2248 22, 000\\) times smaller and, hence, can be neglected. Therefore, there is a peak at the incident wavelength at any angle.

    "},{"location":"GP/light/quantum%20light/quantum/#appendix-ex","title":"Appendix ex","text":"
    • We can derive that \uff1a\\(tan\\theta=\\frac{sin\\phi}{\\frac{\\lambda}{\\lambda^{'}}-cos\\phi}\\) where \\(\\theta\\) is the scattering angle of the say, electrons.
    "},{"location":"GP/light/quantum%20light/quantum/#angular-momentum-of-photons-and-polarization","title":"Angular Momentum of Photons and Polarization","text":"

    According to the quantum-mechanical description, a photon also has an intrinsic spin angular momentum, which is either \\(\u2212\\bar{h}\\) or \\(+\\bar{h}\\), where the signs indicate right- or left-handedness, respectively.

    Whenever a charged particle emits or absorbs electromagnetic radiation, along with changes in its energy and linear momentum, it will undergo a change of \\(\u00b1\\bar{h}\\) in its angular momentum.

    The energy transferred to a target by an incident monochromatic electromagnetic wave can be envisaged as being transported in the form of a stream of identical photons.

    A beam of linearly polarized light will interact with matter as if it were composed, at that instant, of equal numbers of right- and left-handed photons. There is a subtle point. Strictly speaking, we cannot say that the beam is actually made up of precisely equal amounts of well-defined right- and left-handed photons; the photons are all identical.

    Rather, each individual photon exists in either spin state with equal likelihood.

    \\(|H\u27e9 =\\frac{|R\u27e9+|L\u27e9}{\\sqrt{2}} = \\frac{1}{\\sqrt{2}}[\\frac{1}{\\sqrt{2}}\\begin{pmatrix}1\\\\-i\\end{pmatrix} +\\frac{1}{\\sqrt{2}}\\begin{pmatrix}1\\\\i\\end{pmatrix}]\\)

    "},{"location":"GP/light/quantum%20light/quantum/#appendix-21a-quantum-key-distribution","title":"Appendix 21A: Quantum Key Distribution","text":"

    Goal: To send encrypted messages that cannot be understood by anyone but the designated recipient.

    Message is a whole number \\(m\\) (e.g., represented by the dots and dashes of Morse code as ones and zeros.)

    An encryption is a function \\(f : m \u2192 f (m)\\), agreed on between Alice (sender) and Bob (recipient) but unknown to Eve (a possible eavesdropper).

    Problem: If the same encryption is used many times, Eve can usually deduce the nature of the encryption and read the messages (by, e.g., frequency analysis).

    Classical solution: Let the encryption depend on a frequently changed key, which can be regarded as another whole number \\(k\\). The encrypted message is now \\(f (m, k)\\). New problem: Alice and Bob must frequently exchange messages to establish new keys, and these new messages too may be intercepted by Eve. Quantum solution: It is not possible to measure any quantity without changing an unknown state vector to one in which that quantity has some definite value.

    "},{"location":"GP/light/quantum%20light/quantum/#the-bb84-protocol-bennet-brassard-1984","title":"The BB84 Protocol (Bennet & Brassard, 1984)","text":"

    A protocol to establish a secured communication channel. More concretely, a scheme to enables us to detect the presence of an eavesdropper using polarized photons.

    • Alice sends the key to Bob as a sequence of linearly polarized photons with polarization vectors of the form \\(\\vec{e} = (cos \u03b6 , sin \u03b6 )\\), where \\(\u03b6\\) are various angles.
    • Alice represents ones and zeros by values of \u03b6 in either one of the two modes.
    • Finally, Alice and Bob communicate over a classical, possibly public channel to compare their choices of basis for each bit. The bits for which Alice and Bob have used different bases are discarded.

    What Can Eve Do?

    What Eve really wants is that Alice and Bob should establish a key that Eve knows, so that she can secretly read the messages sent from Alice to Bob.

    So Eve can intercept the photons sent by Alice, measure their polarizations, and then send substitute photons with these polarizations on to Bob.

    But Eve, like Bob, does not know the mode that Alice is using in choosing each photon polarization. So there is only a 50% chance that the substitute photon sent by Eve to Bob will have the same polarization that it had when it was sent by Alice.

    Can Alice and Bob Detect Eve?

    When Alice and Bob compare notes, they identity the photons that had been sent when Alice and Bob had by chance being used the same modes.

    Eve too may learn this information, but by then it is too late. There is only a 50% chance that Eve had used the same mode that Alice (and Bob) had used.\u300c\u6d4b\u4e0d\u51c6\u300d

    If Eve had used a different mode, there is still a 50% chance that Bob would have observed the same polarization that had been sent by Alice.

    Overall, Alice and Bob had 25% of the binary digits in the key that do not match; thus, they can detect Eve\u2019s intervention by comparing a part of the key.

    1. 25%\u7684\u4e0d\u5339\u914d\u6982\u7387\uff1a \u5f53Eve\u4f7f\u7528\u4e86\u4e0d\u540c\u7684\u6a21\u5f0f\u8fdb\u884c\u6d4b\u91cf\u65f6\uff0c\u670950%\u7684\u6982\u7387Bob\u4f1a\u89c2\u5bdf\u5230\u4e0eAlice\u53d1\u9001\u65f6\u76f8\u540c\u7684\u504f\u632f\u3002\u56e0\u6b64\uff0c\u603b\u4f53\u4e0a\uff0cAlice\u548cBob\u7684\u5bc6\u94a5\u4e2d\u670925%\u7684\u4e8c\u8fdb\u5236\u4f4d\u4e0d\u5339\u914d\uff0c\u56e0\u4e3a\u5728\u4e00\u534a\u7684\u60c5\u51b5\u4e0bEve\u53ef\u80fd\u622a\u83b7\u4e86\u76f8\u540c\u7684\u6a21\u5f0f\uff0c\u4f46\u53e6\u4e00\u534a\u7684\u60c5\u51b5\u4e0bBob\u89c2\u5bdf\u5230\u7684\u504f\u632f\u4e0eAlice\u53d1\u9001\u7684\u4e0d\u540c\u3002
    • Why do we call this scheme quantum key distribution?

    After all, polarization is a classical concept. Which part of the BB84 depends crucially on the quantum concept and can be defeated in the classical world?

    Quantum no-cloning theorem: It is impossible to create an identical copy of an arbitrary unknown quantum state. Where is it needed?

    • Take-home message: Eve will have success in preventing the construction of a key, but not in secretly learning a key that will be used by Alice and Bob.
    • \u6d4b\u91cf\u7684\u4e0d\u786e\u5b9a\u6027\u4f7f\u5f97Eve\u65e0\u6cd5\u83b7\u53d6\u5b8c\u6574\u7684\u5bc6\u94a5\u4fe1\u606f\uff0c\u800c\u4e14\u4efb\u4f55\u5979\u7684\u5e72\u6270\u90fd\u4f1a\u88abAlice\u548cBob\u5bdf\u89c9\u5230\u3002
    "},{"location":"GP/light/quantum%20light/quantum/#_1","title":"Quantum","text":""},{"location":"GP/mag/mag/","title":"The Magnetic Field","text":""},{"location":"GP/mag/mag/#the-magnetic-field","title":"The Magnetic Field","text":"
    • \\(\\vec{F}=q\\vec{v}\\times \\vec{B}\\)
    • Right-hand rule
    "},{"location":"GP/mag/mag/#circulating-charges","title":"Circulating Charges","text":"

    If the velocity of a charged particle has a component parallel to the uniform magnetic field, such that :

    \\(v_{||}=vcos\\phi\\)

    \\(v_{\u22a5}=vsin\\phi\\)

    • The perpendicular component \\(v_{\u22a5}\\) determines the radius of the helix \\(r=\\frac{mv_{\u22a5}}{|q|B}\\)
    • The parallel component \\(v_{||}\\)determines the pitch p of the helix ,that is,the distance between adjacent turns.
    "},{"location":"GP/mag/mag/#the-hall-effect","title":"The Hall Effect","text":""},{"location":"GP/mag/mag/#current-carrying-wire","title":"Current-Carrying Wire","text":"
    • If a wire is not straight or the field is not uniform, we can imagine the wire broken up into small straight segments and, in the differential limit, we can write \\(d\\vec{F}=id\\vec{L}\\times\\vec{B}\\)
    "},{"location":"GP/mag/mag/#torque-on-a-current-loop","title":"Torque on a Current Loop","text":""},{"location":"GP/mag/mag/#magnetic-field-of-a-current","title":"Magnetic Field of a Current","text":""},{"location":"GP/mag/mag/#biot-savart-law","title":"Biot-Savart-law","text":"

    \\(d\\vec{B}= \\frac{\\mu_0}{4\\pi}\\frac{id\\vec{s}\\times\\vec{r}}{r^3}\\)

    Where the constant \\(\\mu_0=4\\pi \\cdot 10^{-7(T\\cdot m/A)}\\)is called the permeability constant

    "},{"location":"GP/mag/mag/#example","title":"Example","text":""},{"location":"GP/mag/mag/#a-long-straight-wire","title":"A Long Straight Wire","text":"
    • Derivation

    \\(\\begin{align*}d\\vec{B}&=\\frac{\\mu_0}{4\\pi}\\frac{id\\vec{s}\\times\\vec{r}}{r^3}\\\\ &=\\frac{\\mu_0}{4\\pi}\\frac{id\\vec{s}\\times\\vec{R}}{r^3} \\\\B&=\\frac{\\mu_0i}{4\\pi R}\\int_{-\\infty}^{+\\infty}\\frac{R^2dS}{r^3} (sin\\theta=R/r \\ cos\\theta=-s/r \\ dr/ds=s/r)\\\\ &=\\frac{\\mu_0i}{4\\pi R}\\int_{0}^{\\pi}sin\\theta d\\theta \\ (cos\\theta d\\theta = d(sin\\theta)=-\\frac{R^2dr}{r^2ds}ds=-\\frac{R^2s}{r^2r}ds=cos\\theta \\frac{Rds}{r^2})\\\\ &= \\frac{\\mu_0 i}{2\\pi R}\\end{align*}\\)

    "},{"location":"GP/mag/mag/#force-between-two-parallel-wires","title":"Force Between Two Parallel Wires","text":""},{"location":"GP/mag/mag/#magnetic-field-circulation","title":"Magnetic Field Circulation","text":"

    \\(Circulation =\\oint \\vec{B}\\cdot d\\vec{s} = \\mu_0 i_{enc}\\) (Amperian Loop)

    • For a concentric Amperian loop inside the wire \\(i_{enc}=i\\frac{\\pi r^2}{\\pi R^2}\\) Thus, \\(B=\\frac{\\mu_0ir}{2\\pi R^2}\\)
    "},{"location":"GP/mag/mag/#a-sheet-of-moving-charge","title":"A Sheet of Moving Charge","text":""},{"location":"GP/mag/mag/#magnetic-field-of-a-solenoid","title":"Magnetic Field of a Solenoid","text":"

    In the limiting case of an ideal solenoid, which is infinitely long and consists of tightly packed (close-packed) turns of square wire, the field inside the coil is uniform and parallel to the solenoid axis. The magnetic field outside the solenoid is zero.

    The direction of the magnetic field along the solenoid axis is given by a curled-straight right-hand rule: Grasp the solenoid with your right hand so that your fingers follow the direction of the current in the windings; your extended right thumb then points in the direction of the axial magnetic field.

    • From Ampere's Law : \\(Bh=\\mu_0inh \\Rightarrow B=\\mu_0in\\)

    A solenoid thus provides a practical way to set up a known

    uniform magnetic field for experimentation, just as a parallel-plate capacitor provides a practical way to set up a known uniform electric field.

    "},{"location":"GP/mag/mag/#magnetic-field-of-a-toroid","title":"Magnetic Field of a Toroid","text":"

    In contrast to the situation for a solenoid, B is not constant over the cross section of a toroid.

    One can show, with Ampere\u2019s law, that B = 0 for points outside an ideal toroid (as if the toroid were made from an ideal solenoid).

    "},{"location":"GP/mag/mag/#the-curl-of-vecb","title":"The Curl of \\(\\vec{B}\\)","text":"
    • By Stokes's theorem : \\(\\oint\\vec{B}\\cdot d\\vec{s} = \\iint(\\triangledown \\times \\vec{B})\\cdot d\\vec{A}=\\mu_0i_{enc}=\\mu_0\\iint_S\\vec{J}\\cdot d\\vec{A}\\)
    • Thus \\(\\triangledown \\times \\vec{B}(\\vec{r}) = \\mu_0\\vec{J}(\\vec{r})\\)
    "},{"location":"GP/mag/mag/#the-divergence-of-vecb","title":"The Divergence of \\(\\vec{B}\\)","text":"

    For volume currents, the Biot-Savart law becomes

    \\(\\vec{B}(x,y,z)=\\frac{\\mu_0}{4\\pi}\\iiint\\frac{\\vec{J}(x',y',z')\\times \\vec{r}}{r^3}dx'dy'dz'\\)

    • The length element \\(id\\vec{s}\\) is replace by the volume element \\(JdV'= \\vec{J}(x',y',z')dx'dy'dz'\\) and \\(r =(x \u2212 x' ) \\hat{x} + ( y \u2212 y' )\\hat{y} + ( z \u2212 z') \\hat{z}\\)

    • Applying the divergence, we obtain:

    \\(\\triangledown \\cdot \\vec{B}=\\frac{\\mu_0}{4\\pi}\\int \\triangledown (\\frac{\\vec{J}\\times \\vec{r}}{r^3})dV'=-\\frac{\\mu_0}{4\\pi}\\int \\vec{J} (\\triangledown \\times \\frac{\\vec{r}}{r^3})dV'\\)

    • Note that \\(\\frac{\\vec{r}}{r^3}= \u2212\\triangledown(1/\\vec{r} )\\) is nothing but the electric field of a point charge (q = 4\u03c0\u03b50)
    • It does not twists around; it only spreads out. Its curl is zero (as known in electrostatics).

    • Thus \\(\\triangledown \\cdot \\vec{B} = 0\\)

    • Constructing a closed Gaussian surface,we have:

    \\(\\oint\\vec{B}\\cdot d\\vec{A}=\\int(\\triangledown\\cdot\\vec{B})dV=0\\)

    • The law asserts that the net magnetic flux \\(\\Phi _B\\) through any closed Gaussian surface is zero.

    • This is a formal way of saying that magnetic monopoles do not exist. The simplest magnetic structure that can exist is a magnetic dipole.

    "},{"location":"GP/mag/mag/#magnetic-properties-of-materials","title":"Magnetic Properties of Materials","text":""},{"location":"GP/mag/mag/#the-magnetic-dipole","title":"The Magnetic Dipole","text":"

    \\(\\vec{\\mu}=Ni\\vec{A}\\)

    \\(\\tau = \\vec{\\mu} \\times \\vec{B}=-\\mu Bsin\\theta=-\\frac{\\partial}{\\partial \\theta}(-\\mu Bcos\\theta)\\)

    \\(U_B=-\\vec{\\mu}\\cdot\\vec{B} = -\\mu Bcos\\theta\\)

    "},{"location":"GP/mag/mag/#magnetic-field-of-a-circular-arc-of-wire","title":"Magnetic Field of a Circular Arc of Wire","text":""},{"location":"GP/mag/mag/#at-the-center","title":"At the center","text":"
    • Thus , at the center of a single-loop coil, we have \\(B=\\frac{\\mu_0i}{2R}=\\frac{\\mu_0\\mu}{2\\pi R^3}\\)
    "},{"location":"GP/mag/mag/#at-axial-points-far-from-the-loopz-r","title":"at axial points far from the loop\\((z \u226b R)\\)","text":"

    Which means \\(B(z)=\\frac{\\mu_0}{2\\pi}\\frac{\\mu}{r^3}\\) Just like the electric dipole

    "},{"location":"GP/mag/mag/#magnetic-materials","title":"Magnetic Materials","text":""},{"location":"GP/mag/mag/#paramagnetism","title":"Paramagnetism","text":"

    Paramagnetism occurs in materials whose atoms have permanent magnetic dipole moments \\(\\vec{\\mu}\\)

    • Curie\u2019s law : \\(M=C\\frac{B_{ext}}{T}\\)
    • The law is actually an approximation that is valid only when the ratio \\(B_{ext}/T\\) is not too large.
    • With sufficient strong \\(\\vec{B}_{ext}\\) all dipoles in a sample of N atoms and a volume V line up with \\(\\vec{B}\\) hence M saturates at \\(M_{max}=N\\mu/V\\)

    Explain:

    "},{"location":"GP/mag/mag/#diamagnetism","title":"Diamagnetism","text":"

    Diamagnetism occurs in all materials, but the weak effect is only observable in materials having atomic dipole moments of zero.

    Such a material can be modeled by equal numbers of electrons orbiting counterclockwise or clockwise. An external magnetic field will either accelerate or decelerate these electrons, leading to a net magnetic dipole moment

    "},{"location":"GP/mag/mag/#ferromagnetism","title":"Ferromagnetism","text":"

    A ferromagnet has strong, permanent magnetism. What distinguishes ferromagnets from paramagnets is that there is a strong interaction between neighboring atoms.

    The interaction keeps the dipole moments of atoms aligned even when the magnetic field is removed.

    "},{"location":"GP/matter%20wave/matter/","title":"matter wave","text":""},{"location":"GP/matter%20wave/matter/#matter-waves","title":"Matter Waves","text":""},{"location":"GP/matter%20wave/matter/#two-versions-of-interference","title":"Two Versions of Interference","text":""},{"location":"GP/matter%20wave/matter/#standard-version-of-the-double-slit-experiment","title":"standard version of the double-slit experiment","text":"

    In the standard version of the double-slit experiment(Thomas Young, 1801), light shines on screen B, which contains two narrow parallel slits.

    The light waves emerging from the two slits spread out by diffraction and overlap on screen C where, by interference, they form a pattern of alternating intensity maxima and minima.

    • Let us place a tiny photon detector D at one point in the plane of screen C.
    • Let the detector be a photoelectric device that clicks when it absorbs a photon.
    • We would find that the detector produces a series of clicks, randomly spaced in time, each click signaling the transfer of energy from the light wave to the screen via a photon absorption.
    • If we moved the detector very slowly up or down as indicated by the black arrow, we would find that the click rate increases and decreases, passing through alternate maxima and minima that correspond exactly to the maxima and minima of the interference fringes.

    The point of this thought experiment is as follows.

    • We cannot predict when a photon will be detected at any particular point on screen C
    • photons are detected at individual points at random times.
    • We can, however, predict that the relative probability that a single photon will be detected at a particular point in a specified time interval is proportional to the light intensity at that point.

    We know that the intensity \\(I\\) of a light wave at any point is proportional to the square of \\(E_m\\). Thus, the probability(per unit time interval) that a photon will be detected in any small volume centered on a given point in a light wave is proportional to the square of the amplitude of the wave\u2019s electric field vector at that point.

    "},{"location":"GP/matter%20wave/matter/#single-photon-version","title":"single-photon version","text":"

    The light source is so extremely feeble that it emits only one photon at a time, at random intervals. Astonishingly, interference fringes still build up on screen C if the experiment runs long enough

    • If the photons move through the apparatus one at a time, through which of the two slits in screen B does a given photon pass?
    • How does a given photon even \u201cknow\u201d that there is another slit present so that interference is a possibility?
    • Can a single photon somehow pass through both slits and interfere with itself?

    Because an interference pattern eventually builds up on the screen, we can only speculate that each photon travels from source to screen as a wave that fills up the space between source and screen.

    We can predict the probability that an energy transfer will occur at any given point on the screen.

    • Transfers will tend to occur (and thus photons will tend to be absorbed) in the regions of the bright fringes in the interference pattern that builds up on the screen.
    • Transfers will tend not to occur (and thus photons will tend not to be absorbed) in the regions of the dark fringes in the pattern.

    Thus, we can say that the wave traveling from the source is a probability wave, which produces a pattern of \u201cprobability fringes\u201d on the screen.

    "},{"location":"GP/matter%20wave/matter/#light-as-a-probability-wave","title":"Light as a Probability wave","text":"

    We see that the double-slit experiments tell us that

    • light is generated in the source as photons
    • absorbed in the detector as photons
    • travels between source and detector as a probability wave.

    The probability density of detecting a photon at some point \\(P\\) in space depends on the irradiance \\(I \u221d E_0^2\\) at that point. Thus, the net \\(E_0\\) at \\(P\\) can be interpreted as the probability amplitude. (Probability amplitude is a quantity whose square gives the probability density.)

    To go further, one will need quantum electrodynamics (QED), the quantum theory of the interaction of light and matter.

    "},{"location":"GP/matter%20wave/matter/#extendtions-to-not-only-light","title":"Extendtions to not only light","text":""},{"location":"GP/matter%20wave/matter/#de-broglie-hypothesis","title":"De Broglie Hypothesis","text":"

    A beam of light is a wave, but it transfers energy and momentum to matter only at points, via photons. Electron is a particle with energy and momentum. Why can\u2019t we think of a beam of moving electron \u2014 or any other particle \u2014 as a matter wave?

    In 1924, Louis de Broglie proposed that one could assign a wavelength \\(\u03bb\\) to a particle with momentum of magnitude \\(p\\). Like that of photons, we define. \\(\u03bb = h/p\\), which is known as the de Broglie wavelength of the moving particle.

    "},{"location":"GP/matter%20wave/matter/#electron-diffraction","title":"Electron Diffraction","text":"

    Electron diffraction and neutron diffraction are used to study the atomic structures of solids and liquids, and electron diffraction is often used to study the atomic.

    "},{"location":"GP/matter%20wave/matter/#the-interference-of-electrons","title":"The Interference of Electrons","text":"

    In a more recent experiment, an interference pattern was built up when electrons were sent, one by one, through a double-slit apparatus. When an electron hit the viewing screen, it caused a flash of light whose position was recorded.

    • Similar interference has been demonstrated with protons, neutrons, and various atoms. It was further demonstrated with iodine molecules \\(I_2\\) in 1994 and with fullerenes (or buckyballs) \\(C_{60}\\) and \\(C_{70}\\) in 1999.

    Do particles interfere with each other?

    Perhaps they collide . . . .

    • Repeat at low intensity that at any given time there is only one particle in the inteference region.

    "},{"location":"GP/matter%20wave/matter/#matter-wave","title":"Matter Wave","text":"

    In Newtonian physics: a particle is only aware of the slit through which it goes, it has no idea how many other slits are open or closed or even exist. Therefore, when both slits are open, \\(P_{12} = P_1 + P_2\\).

    • Clearly, there is no fringes(Newtonian physics)

    Consider matter waves:The electrons arrive in lumps, like particles, and the probability of arrival of these lumps is distributed like the distribution of intensity of a wave.

    Introduce:

    • Add Amplitude \\(A\\)

    • Introduce the probability amplitude \\(\u03c8\\) which is a complex number.

    The probability of an event in an ideal experiment is then given by \\(|\u03c8|^2 = \u03c8^\u2217\\times\u03c8\\).

    When an event can occur in several alternative ways, the probability amplitude for the event is the sum of the probability amplitudes for each way considered separately

    • \\(\u03c8 = \u03c8_1 + \u03c8_2 + \u00b7 \u00b7 \u00b7\\).

    • The probability for the event is, then,\\(P=|\u03c8|^2 =|\u03c81|^2+|\u03c82|^2+2R(\u03c81^\u2217\u03c82)+\u00b7\u00b7\u00b7.\\)\uff08note:\u6a21\uff09

    • The interference term \\(2R(\u03c8_1^\u2217\u03c8_2)\\) is responsible for the rapid oscillations of \\(P\\) observed in the experiment.

    "},{"location":"GP/matter%20wave/matter/#the-which-way-experiment","title":"The Which-Way Experiment","text":"

    If an experiment is performed which is capable of determining whether one or another alternative is actually taken, the interference is lost.

    The experiment tells us that the probability of the event in the which-way experiment is the sum of the probabilities for each alternative, \\(P = |\u03c8|^2 = |\u03c8_1|^2 + |\u03c8_2|^2\\),just as what happens in the classical case.

    Thus an electron acts like it went through one particular slit if we see it doing that, and acts like it did not have a specific path (through a specific slit) when it is not seen.

    • Why seeing makes a difference?

    To see an electron with a resolution comparable to slit separation \\(d\\), (so we know which slit it took) requires light with \\(\u03bb < d\\), this is just standard wave theory.

    But, the light is made of photons each with momentum \\(p>\\frac{h}{d}\\). So, measuring the position of the electron has made us disturb its momentum.

    The amount of momentum transferred to the electron in the act of observation is indefinite.

    This is a manifestation of Heisenberg\u2019s uncertainty principle, which says you cannot measure the momentum and coordinate of a particle simultaneously to arbitrary accuracy.

    "},{"location":"GP/matter%20wave/matter/#heisenbergs-uncertainty-principle","title":"Heisenberg\u2019s Uncertainty Principle","text":"

    Heisenberg\u2019s uncertainty principle is not an effect caused by the measurement but a consequence of intrinsic wave nature of matter.

    The probabilistic nature of quantum physics places an important limitation on detecting a particle\u2019s position and momentum. That is, it is not possible to measure the position \\(\\vec{r}\\) and the momentum \\(\\vec{p}\\) of a particle simultaneously with unlimited precision.

    The uncertainties in the components of these quantities are given by (Werner Heisenberg, 1927)

    \\(\u2206x\u00b7\u2206p_x \u2265\\bar{h}\\)

    \\(\u2206y\u00b7\u2206p_y \u2265\\bar{h}\\)

    \\(\u2206z\u00b7\u2206p_z \u2265\\bar{h}\\)

    They are due to the fact that electrons and other particles are matter waves and that repeated measurements of their positions and momenta involve probabilities, not certainties.

    In the statistics of such measurements, we can view, say, \\(\u2206x\\) and \\(\u2206p_x\\) as the spread (actually, the standard deviations) in the measurements. Couldn\u2019t we very precisely measure \\(p_x\\) and then next very precisely measure x wherever the electron happens to show up?

    Doesn\u2019t that mean that we have measured both \\(p_x\\) and \\(x\\) simultaneously and very precisely?

    • No, the flaw is that although the first measurement can give us a precise value for \\(p_x\\) , the second measurement necessarily alters that value. Puzzled?

    • Consider an electron with a certain value of \\(k\\), which, by the de Broglie relationship, means a certain momentum \\(p_x = \\bar{h}k\\). Thus, \\(\u2206p_x = 0\\). By Heisenberg\u2019s uncertainty principle, that means that \\(\u2206x \u2192 \u221e\\).

    • What form does the electron wave function have? The naive guess could be \\(sinkx\\), or \\(coskx\\).

    But they have spatial variance that is inconsistent with our intuition.

    To represent the electron by a wave, we need a function, which is called wave function, with a wavelength \\(\u03bb = 2\u03c0/k\\), but its square should not show any variation in x\u300cNote: Definite Momentum\u300di.e. \\(\u03c8(x,t) = e^{i(kx\u2212\u03c9t)}\\).

    To calculate the square of the wave function \\(\u2223\u03c8\u2223^2\\), we obtain \\(\u2223\u03c8\u2223^2=e^{i(kx\u2212\u03c9t)}\u22c5e^{\u2212i(kx\u2212\u03c9t)}\\).

    we then have \\(\u2223\u03c8\u2223^2=1\\).

    This implies that at a given time t, the square of the wave function is a constant in the x direction, with no variation concerning x.

    Now, where is the electron? Why complex?

    • If we measure \\(p_x\\) now, we obtain \\(p_x = \\bar{h}k\\) without uncertainty

    but the particle exists anywhere with the same probability, so \\(\u2206x = \u221e\\). ?Question

    Heisenberg\u2019s uncertainty principle is not violated.

    • If we measure x then, we will find the electron somewhere at \\(x_0\\). Once we find it, it cannot be elsewhere. So the wave function suddenly collapses to \\(\u03c8(x) = \u03b4(x \u2212 x0)\\).

    Now, is the momentum still \\(p_x = \\bar{h}k\\)?

    The Fourier transform of the \u03b4-function tells us \\(\u03c8 \u0304(p) = F(\u03c8(x)) = constant\\).

    In this case, \\(\u2206x = 0\\) but \\(\u2206p = \u221e\\). Again, Heisenberg\u2019s uncertainty principle is not violated.

    "},{"location":"GP/matter%20wave/matter/#fourier-transform","title":"Fourier Transform","text":"

    https://www.youtube.com/watch?v=spUNpyF58BY&list=RDCMUCYO_jab_esuFRV4b17AJtAw&index=3

    https://youtube.com/watch?v=MBnnXbOM5S4

    "},{"location":"GP/sch/sch/","title":"Schroedinger's Equation","text":""},{"location":"GP/sch/sch/#motivation","title":"Motivation","text":"

    A classical wave \\(\u03c8(x, y, z, t)\\) satisfies the wave equation \\(\\frac{1}{v^2}\\frac{\\partial^2\u03c8}{\\partial^2t}=\\triangledown^2\u03c8\\) \\(v \\ is\\ speed\\)

    In the quantum theory, a microscopic particle is described by a probability amplitude \\(\u03c8(x, y, z, t)\\), and the probability of finding it is proportional to \\(P(x, y, z, t) = |\u03c8(x, y, z, t)|^2\\).

    • What is, then, the wave equation that governs the motion of the quantum particle?
    "},{"location":"GP/sch/sch/#schroedingers-equation","title":"Schroedinger\u2019s Equation","text":""},{"location":"GP/sch/sch/#classical-particle","title":"Classical Particle","text":"

    Find the equation that governs the quantum behavior of a free particle of mass \\(m\\) represented by a wave \\(\u03c8(x,t) = e^{i(kx\u2212\u03c9t)}\\).

    \\(E=\\frac{p^2}{2m}\\)

    According to the de Broglie\u2019s hypothesis

    \\(p=\\frac{h}{\\lambda}=\\bar{h}k=\u2212i\\bar{h}\\frac{1}{\u03c8(x,t)} \\frac{\u2202\u03c8(x,t)}{\\partial x}\\)

    d\\(p^2=\\bar{h}^2k^2=-\\bar{h}^2\\frac{1}{\u03c8(x,t)} \\frac{\u2202^2\u03c8(x,t)}{\\partial^2 x}\\)

    \\(E=hv=\\bar{h}w=\\frac{1}{\u03c8(x,t)} \\frac{\u2202\u03c8(x,t)}{\\partial t}\\)

    using wave function, the energy-momentum relation is

    In the presence of potential, e.g. a harmonic potential \\(U(x) = ax^2/2\\) , the classical relation is modified to \\(E=\\frac{p^2}{2m} +U(x)\\) where \\(E\\) is a constant of motion, but \\(p\\) is not. In other words, a plane wave is not a solution any more.

    In this expression, p is the momentum of the particle, m is the mass of the particle, \\(U(x)\\) is the potential energy associated with the position x, and E is the total energy of the system, which remains constant.

    In the conventional case where there is no potential energy in the system, momentum p would be a conserved quantity, implying the total momentum of the system remains constant. However, in the presence of potential energy, the interaction between kinetic and potential energy leads to a non-conservation of momentum. In such cases, simple waveforms like plane waves are no longer solutions, as the interaction between kinetic and potential energy requires a more complex description.

    Schroedinger's equation is both homogenous and linear!!!

    Linear Partial Differential Equation (PDE):

    A partial differential equation is termed linear if it is linear in terms of the unknown function and its partial derivatives. It can be expressed in the form:

    \\(L(u)=a_n(x,y)u_{xx}+a_{n\u22121}(x,y)u_x+\u2026+a_1(x,y)u_y+a_0(x,y)u+F(x,y)=0\\)

    Here, \\(u\\) is the unknown function, \\(u_x, u_y, u_{xx}\\), and so on represent the corresponding partial derivatives

    Crucially, all coefficients \\(a_n(x,y), a_{n\u22121}(x,y), \u2026\u2026, a_0(x,y)\\)as well as \\(F(x,y)\\), do not depend on the values of the unknown function \\(u\\) or its derivatives.

    Homogeneous Partial Differential Equation (PDE):

    A partial differential equation is considered homogeneous if all terms in the equation are homogeneous polynomials of the unknown function and its partial derivatives.

    NOTE\uff1ahomogeneous without \u201dconstant term\u201d

    "},{"location":"GP/sch/sch/#time-independent-schroedingers-equation","title":"time-independent Schroedinger\u2019s equation","text":"

    In most cases we discuss, the potential energy \\(U = U(x)\\) is independent of time.

    We can solve the stationary solution of the Schroedinger equation by an ansatz: \\(\u03c8(x, t) = \\Phi(x)e^{\\frac{-iEt}{\\bar{h}}}\\).

    Substituting the above ansatz of \\(\u03c8(x,t)\\), we obtain the following equation for \\(\u03c6(x)\\) \\(\\frac{\\partial^2\\phi(x)}{\\partial^2x}+\\frac{2m}{\\bar{h}^2}[E-U(x)]\\phi(x)=0\\)

    By solving this equation, we can obtain the stationary solution \u03c6\\((x)\\) under the time-independent external potential \\(U(x)\\).

    In free space, \\(U(x) = 0\\).

    • The general solution is \u03c6\\((x)=Ae^{ikx} +Be^{\u2212ikx}\\) where A and B are constants and k = \\(\\sqrt{2mE} /\\bar{h}\\).

    The general form of a second-order homogeneous linear ordinary differential equation (ODE) with constant coefficients is given by:

    \\(a\\frac{d^y}{dx^2}+b\\frac{dy}{dx}+cy=0\\)

    The general solution for such equations can be found by assuming the solution has the form \\(y=e^{rx}\\) where r is a constant to be determined. Substituting this form into the equation yields the characteristic equation:\\(ar^2+br+c=0\\)

    Solving this quadratic equation for rr determines the values for r, which in turn determine the form of the general solution. There are typically three cases:

    1. Two distinct real roots r1 and r2

    The general solution is: \\(y=C_1e^{r_1x}+C_2e^{r_2x}\\)

    1. One real root r repeated twice:

    The general solution is: \\(y=(C_1+C_2x)e^{rx}\\)

    1. Two complex conjugate roots r=\u03b1\u00b1\u03b2i:

    The general solution is: \\(y=e^{\u03b1x}(C_1cos\u2061(\u03b2x)+C_2sin\u2061(\u03b2x))\\)

    "},{"location":"GP/sch/sch/#the-complete-time-dependent-wave-function","title":"The complete time-dependent wave function","text":"

    \\(\u03c8(x,t)=Ae^{i(kx\u2212\u03c9t)} +Be^{\u2212i(kx+\u03c9t)}\\) where \\(w=\\frac{E}{\\bar{h}}\\)

    • The two terms correspond to right- and left-moving waves, respectively.

    Consider the right-moving wave \\(\u03c8(x,t) = Ae^{i(kx\u2212\u03c9t)}\\), the probability density is uniform:\\(|\u03c8(x, t)|^2 = \u03c8^\u2217(x, t)\u03c8(x, t) = |A|^2\\). That means that if we make a measurement to locate the particle, the location could turn out to be at any x value.

    "},{"location":"GP/sch/sch/#wave-packets","title":"Wave Packets","text":"

    What is the speed of a free quantum mechanical particle?

    \\(\u03c8(x,t)=Ae^{i(kx\u2212\\frac{\\bar{h}k^2}{2m}t)} +Be^{\u2212i(kx+\\frac{\\bar{h}k^2}{2m}t)}\\) where \\(w=\\frac{E}{\\bar{h}}\\) and \\(\\sqrt{2mE} /\\bar{h}\\)

    \\(\\Rightarrow v_{ph}=\\frac{\\bar{h}k}{2m}=\\sqrt{\\frac{E}{2m}}\\)

    On the other hand, the classical speed of a free particle with energy E is given by \\(v_{cl} = \\sqrt{\\frac{2E}{m}}= 2v_{ph}\\).

    Problem #1:

    The quantum mechanical wave function travels at half the speed of the particle it is supposed to represent!

    Problem #2:

    How to normalize the wave function of the free particle, say, represented by \\(Ae^{ikx}\\) ?

    \\(\\int_{-\\infty}^{+\\infty}|\u03c8(x)|^2dx=|A|^2\\int_{-\\infty}^{+\\infty}1dx=|A|^2\\infty\\)

    This wave function is not normalizable!

    In fact, the stationary (separable) solutions do not represent physically realizable states for a free particle; there is no such thing as a free particle with a definite energy.

    "},{"location":"GP/sch/sch/#the-realistic-solution-to-the-schroedinger-equation-for-a-free-particle","title":"the realistic solution to the Schroedinger equation for a free particle","text":"

    In quantum theory, a localized particle is modeled by a linear superposition of these stationary free-particle (or plane-wave) states.

    In general, we can construct a linear combination (integral over continuous \\(k\\))

    \\(\u03a8(x,t)=\\frac{1}{\\sqrt{2\\pi}}\\int_{-\\infty}^{+\\infty}\\)\u03c6\\((k)e^{i(kx\u2212\\frac{\\bar{h}k^2}{2m}t)}dk\\)

    This wave function can be normalized for appropriate \u03c6\\((k)\\), typically Gaussian. We call it a wave packet, which carries a range of k and, hence, a range of energies and speeds. In a general quantum problem, we are given \\(\u03a8(x, 0)\\) and needed to find \\(\u03a8(x, t)\\).

    The particle can be better localized (\u2206x can be decreased) if more plane-wave states of different wavelengths or momenta are added together in the right way (\u2206p is increased).

    According to Heisenberg, these uncertainties obey \\(\u2206x\u2206p \u2265 \\bar{h}/2\\).

    It turns out that the group velocity of the wave packet, not the phase velocity of the stationary states, matches the classical particle velocity.

    "},{"location":"GP/sch/sch/#some-exercises","title":"Some Exercises","text":""},{"location":"GP/sch/sch/#reflection-from-a-potential-step","title":"Reflection from a Potential Step","text":"

    Consider a beam of nonrelativistic electrons, each of total energy E, along an x axis through a narrow tube. They experience a negative electric potential step of height \\(V_b <0\\) at \\(x=0\\).(Note that the charge q of the electron is negative)

    "},{"location":"GP/sch/sch/#e-qv_b","title":"\\(E > qV_b\\).","text":"

    Classically, electrons should all pass through the boundary. Their total energy should be conserved, so their kinetic energy, hence speed, decreases when their potential energy increases.

    • What happens quantum mechanically?

    (at a given time?)

    • We can first set \\(D = 0\\), because there is no electron source off to the right, and there can be no electrons moving to the left in region 2.

    • We now consider boundary conditions at \\(x = 0\\):

    \\(A + B = C\\) (matching of values)

    \\(Ak \u2212 Bk = Ck_b\\) (matching of slopes) \u300cfirst derivation\u300d

    We should be able to solve \\(B/A\\) and \\(C/A\\), but not \\(A\\), \\(B\\), and \\(C\\).

    Note that the absolute values are not important for our purpose (it can be related to the beam intensities, though).

    • Indeed, to find the probability that electrons reflect from the step, we need to relate the probability density of the reflected wave \\(Be^{\u2212ikx}\\) to that of the incident wave \\(Ae^{ikx}\\). We thus define a reflection coefficient R:

    \\(R_{reflected}=\\frac{|A|^2}{|B|^2}=|\\frac{k-k_b}{k+k_b}|^2\\)

    \\(T_{transmition}=1-R=\\frac{4kR(k_b)}{|k+k_b|^2}\\)

    Quantum mechanically, electrons are reflected from the boundary, but only with a probability.

    What inspires us to define T in this way?

    Well, one can consider an alternative quantity \\(\\frac{|C|^2}{|A|^2}=\\frac{4k^2}{|k+k_b|^2}=\\frac{k}{R(k_b)}T=\\frac{k}{k_b}T for\\ real\\ k_b\\)(which means\\(E > qV_b\\). )

    Why coefficient?

    • Recall current density J = nqv. Not surprisingly, one finds

    \\(T = \\frac{|C|^2k_b}{|A|^2k} = \\frac{|C|^2q(\\bar{h}k_b/m)}{|A|^2q(\\bar{h}k/m)} =\\frac{n_1qv_1}{n_2qv_2}= \\frac{J_{transmitted}}{J_{incident}}\\).

    One can also write

    \\(R=\\frac{J_{reflected}}{J_{incident}}\\)

    Therefore, \\(T = 1 \u2212 R\\) is nothing but the conservation of current \\(J_{transmitted} = J_{incident} \u2212 J_{reflected}.\\)

    "},{"location":"GP/sch/sch/#e-qv_b_1","title":"\\(E < qV_b\\).","text":"
    • Just Reflection
    "},{"location":"GP/sch/sch/#tunneling-through-a-potential-barrier","title":"Tunneling through a Potential Barrier","text":"

    Now consider a potential energy barrier, which is a region of thickness L where the electric potential is \\(V_b(<0)\\) and the barrier height is \\(U_b=qV_b\\)

    • Consider \\(E < qV_b\\)

    Separate the space into three regions and solve Schroedinger's equation in each region \\((3\\times2-1=5\\ unknowns)\\)

    Apply boundary conditions at the two boundaries\\((2\\times2=4)\\)

    Calculate the tunneling coefficient.

    "},{"location":"GP/sch/sch/#general-results","title":"General Results","text":"
    • The oscillating curve to the left of the barrier (for x < 0) is a combination of the incident matter wave and the reflected matter wave (which has a smaller amplitude than the incident wave).

    The oscillations occur because these two waves, traveling in opposite directions, interfere with each other, setting up a standing wave pattern.

    • Within the barrier \\((for\\ 0 < x < L)\\) the probability density decreases exponentially with x. However, if L is small, the probability density is not quite zero at x = L..

    • To the right of the barrier (for x > L), the probability density plot describes a transmitted wave (through the barrier) with low but constant amplitude.

    We can assign a transmission coeffient T to the incident matter wave and the barrier. The transmission coefficient T is approximately \\(T\\approx e^{-2kL}\\) where \\(k=\\frac{\\sqrt{2m(qV_b-E)}}{\\bar{h}}\\) Try Derive (imaginary k' actually) \\(T\\) is sensitive to L,m and \\(U_b-E\\)

    "},{"location":"GP/sch/sch/#scanning-tunneling-microscope-stm","title":"Scanning Tunneling Microscope (STM)","text":"

    The size of details that can be seen in an optical microscope is limited by the wavelength of the light the microscope uses (about 300 nm for ultraviolet light). We use electron matter waves (tunneling through potential barriers) to create images on the atomic scale.

    The piezoelectric effect refers to the phenomenon where certain crystals exhibit charge separation when subjected to mechanical stress, resulting in the generation of voltage, or conversely, when an electric field is applied, causing the crystal to undergo mechanical deformation. This phenomenon is known as the piezoelectric effect, and the crystals that exhibit it are referred to as piezoelectric crystals.

    Specifically, the piezoelectric effect can be categorized into two main types:

    1. Direct Piezoelectric Effect: - When a piezoelectric crystal is subjected to external mechanical pressure, there is a redistribution of charges within the crystal, leading to charge separation on the crystal's surface and the generation of voltage. This effect finds widespread applications in devices such as piezoelectric sensors and transducers.
    2. Inverse Piezoelectric Effect: - The inverse piezoelectric effect occurs when a mechanical deformation is induced in a crystal by applying an electric field. In this case, the electric field can control the shape and size of the crystal, causing mechanical vibrations. This effect is utilized in applications like piezoelectric ceramics in drivers and Surface Acoustic Wave (SAW) devices.

    A fine metallic tip, mounted on quartz rods, is placed close to the surface to be examined. The space between the surface and the tip forms a potential energy barrier.

    • Quartz shows the piezoelectricity.

    • The position of the tip can be controlled by applying the electric field on the quartz. The horizontal location of the tip is controlled by the electric field in x- and y-directions. The vertical distance between the surface and the tip is controlled by the electric field in z-direction.

    • Transmission coefficient \\(T\\) ~ \\(e^{-2kL}\\) is sensitive to the barrier width.

    \\(\u2192\\) Tunneling current is sensitive to the distance between the surface and the tip.

    • The vertical position of the tip is adjusted to keep the tunneling current constant as the tip is scanned over the surface. Imaging of the atomic scale is possible.

    An STM not only can provide an image of a static surface, it can also be used to manipulate atoms and molecules on a surface.

    "},{"location":"GP/sch/sch/#s-matrix","title":"S-Matrix","text":"

    The expression \\(|r|^2+|t|^2=1\\) is a consequence of probability conservation in quantum mechanics. Let's break down the meaning of this expression in the context of quantum mechanics and scattering theory.

    In quantum mechanics, when a particle encounters a potential barrier or undergoes scattering, the probabilities of reflection\\(|r|^2\\) and transmission\\(t|^2\\)must add up to unity. Here's why:

    1. Probability Conservation: The total probability of finding the particle must be conserved. When a particle encounters a potential barrier, it can either be reflected back or transmitted through the barrier. The sum of the probabilities of these two outcomes must be equal to 1.

    Mathematically, this is expressed as \\(|r|^2+|t|^2=1\\)

    1. Normalization Condition: The probability amplitude is related to the wave function, and the square of the amplitude gives the probability density. For the wave function to represent a physically meaningful probability density, it must be normalized.

    The normalization condition for probability amplitudes requires that the sum of the probabilities over all possible outcomes is equal to 1.

    Mathematically, this normalization condition is expressed as \\(\u222b\u2223\u03a8(x)\u2223^2\u2009dx=1\\), where \\(\u03a8(x)\\) is the wave function.

    "},{"location":"GP/sch/sch/#example","title":"Example","text":"

    \\(Explain\\ for\\ the\\ below\\ Pic\\)

    • \\(t_1\\) and \\(t_2\\): These are the transmission coefficients at the first and second barriers, respectively. They represent the fraction of the wave that gets transmitted through the barriers.

    • \\(r_1\\) and \\(r_2\\): These are the reflection coefficients at the first and second barriers, respectively. They represent the fraction of the wave that gets reflected at the barriers.

    • \\(e^{i\u03b8}\\): This term introduces a phase shift (\u03b8) to the wave.

    The term is a complex exponential that represents a phase change in the wave. It's common in wave optics and quantum mechanics to introduce phase factors.

    Now, let's interpret the terms in the sum:

    1. The first term \\(t_1e^{i\u03b8}t_2\\) represents the wave being transmitted through the first barrier (\\(t_1\\)), undergoing a phase change (\\(e^{i\\theta}\\)), and then being transmitted through the second barrier \\((t_2)\\)

    2. The second term \\(t_1e^{i\\theta}r_2e^{i\\theta}r_1e^{i\\theta}t_2\\) represents a more complex scenario.

    The wave is transmitted through the first barrier (\\(t_1\\)), undergoes a phase change (\\(e^{i\\theta}\\)), gets partially reflected \\(r_2\\), undergoes another phase change\\(e^{i\\theta}\\), gets reflected again\\((r_1)\\), undergoes yet another phase change\\((e^{i\\theta})\\), and finally gets transmitted through the second barrier \\(t_2\\).

    • Question?

    \\(b_4b_4^\u2217=\\frac{t_{1}^2t_2^2}{1\u22122r_1r_2cos\u2061(2\u03b8)+r_1^2r_2^2}\\)

    "},{"location":"GP/sch/sch/#two-particle-system","title":"Two Particle System","text":"

    https://www.youtube.com/watch?v=M7VJa5eim5o

    https://phys.libretexts.org/Bookshelves/Quantum_Mechanics/Introductory_Quantum_Mechanics_(Fitzpatrick)/05%3A_Multi-Particle_Systems/5.03%3A_Two-Particle_Systems

    \\(i\\bar{h}\\frac{\\partial}{\\partial t}\u03c8(x_1,x_2,t)=[-\\frac{\\bar{h}^2}{2m_1}\\frac{\\partial^2}{\\partial x_1^2}-\\frac{\\bar{h}^2}{2m_2}\\frac{\\partial^2}{\\partial x_2^2}+V(x_1,x_2)]\u03c8(x_1,x_2,t)\\)

    "},{"location":"NA/Chap1/Chap1/","title":"Mathematical Preliminaries","text":""},{"location":"NA/Chap1/Chap1/#roundoff-errors-and-computer-arithmetic","title":"Roundoff Errors and Computer Arithmetic","text":"
    • Truncation Error: the error involved in using a truncated, or finite, summation to approximate the sum of an infinite series.

    • Roundoff Error: the error produced when performing real number calculations. It occurs because the arithmetic performed in a machine involves numbers with only a finite number of digits.

    If \\(p^*\\) is an approximation to p, the absolute error is | \\(p\\) \u2013 \\(p^*\\) |, and the relative error is | \\(p\\) \u2013 \\(p^*\\) | / | p |, provided that p \\(\\ne\\) 0.

    The number \\(p^*\\) is said to approximate \\(p\\) to t significant digits (or figures) if \\(t\\) is the largest nonnegative integer for which \\(\\frac{|p-p^*|}{|p|}<5\\times10^{-t}\\)

    To achieve \\(To\\ t\\ significant\\ digits\\) Both Chopping & Rounding has to approximate at \\(k = t\\)

    • How will roundoff error affect our results?

    Subtraction of nearly equal numbers will cause a cancellation of significant digits.

    "},{"location":"NA/Chap1/Chap1/#algorithms-and-convergence","title":"Algorithms and Convergence","text":"

    An algorithm that satisfies that small changes in the initial data produce correspondingly small changes in the final results is called stable; otherwise it is unstable.

    An algorithm is called conditionally stable if it is stable only for certain choices of initial data.

    Suppose that \\(E_0 > 0\\) denotes an initial error and \\(E_n\\) represents the magnitude of an error after n subsequent operations. If \\(E_n \\approx CnE_0\\), where C is a constant independent of n, then the growth of error is said to be linear. If \\(E_n \\approx C^n E_0\\), for some C > 1, then the growth of error is called exponential.

    "},{"location":"NA/Chap2/Chap2/","title":"Solutions of Equations in one variable","text":""},{"location":"NA/Chap2/Chap2/#the-bisection-method","title":"The Bisection Method","text":"
    Algorithm: Bisection\nTo find a solution to f (x) = 0 given the continuous function f on the interval [ a, b ], where f (a) and f (b) have opposite signs.\nInput: endpoints a, b; tolerance TOL; maximum number of iterations Nmax.\nOutput: approximate solution p or message of failure.\n\nStep 1  Set  i = 1;\n             FA = f (a) ;\nStep 2  While( i<=Nmax)  do  steps 3-6\n    Step 3  Set  p = a + ( b \u2013 a ) / 2 ; /* compute pi */\n               FP = f (p) ; \n    Step 4  If ( FP == 0 ) or ( b - a ) / 2 < TOL  then  Output (p); \n                 STOP; /* successful */\n    Step 5  Set  i ++;\n    Step 6  If  sign(FA) \u00b7 sign(FP) > 0 then set a = p ; FA = FP ;\n                           Else set b = p ; /* update ai, bi */  \nStep 7  Output (Method failed after Nmax iterations); /* unsuccessful */\n        STOP.\n

    Other Stopping Procedures

    \\(|p_N-p_{N-1}|<\\epsilon\\)

    \\(\\frac{|p_N-p_{N-1}|}{|p_N|}<\\epsilon\\)

    \\(|f(p_N)|<\\epsilon\\)

    "},{"location":"NA/Chap2/Chap2/#therom","title":"Therom","text":"

    Suppose that \\(f\\in C[a,b]\\) and \\(f(a)f(b)<0\\) The Bisection method generates a seqence \\(\\{p_n\\}_{n=1}^{\\infty}\\) approximating a zero p of f with \\(|p_n-p|\\le\\frac{b-a}{2^n}\\) when \\(n \\ge1\\)

    "},{"location":"NA/Chap2/Chap2/#fixed-point-iteration","title":"Fixed-Point Iteration","text":""},{"location":"NA/Chap2/Chap2/#theorem-fixed-point-theorem","title":"Theorem: (Fixed-Point Theorem)","text":"

    Let \\(g \\in C[a, b]\\) be such that \\(g(x) \\in [a, b]\\), for all x in \\([a, b]\\).

    • \\(g\\) has a fixed point in \\([a,b]\\)

    • Suppose, in addition, that \\(g\u2019\\) exists on \\((a, b)\\) and that a constant \\(0 < k < 1\\) exists with\\(|g\u2019(x)| \\le k\\) for all x in (a, b). Then:

    (1) The fixed point is unique \\(Proof \\ P57\\) (By Contradiction)

    (2)For any number \\(p_0\\) in [a, b], the sequence defined by \\(p_n = g( p_{n \u2013 1} )\\), \\(n \\ge 1\\), converges to the unique fixed point \\(p\\) in \\([a, b]\\). \\(Proof \\ P61-62\\)

    "},{"location":"NA/Chap2/Chap2/#corollary","title":"Corollary","text":"

    If \\(g\\) satisfies the hypotheses of the Fixed-Point Theorem, then bounds for the error involved in using \\(p_n\\) to approximate \\(p\\) are given by (for all n \\(\\ge\\) 1)

    \\(|p_n-p|\\le k^n max\\{p_0-a,b-p_0\\}\\)

    \\(|p_n-p|\\le\\frac{1}{1-k}|p_{n+1}-p_n|\\)

    \\(|p_n-p|\\le \\frac{k^n}{1-k}|p_1-p_0|\\)

    \\(Proof\\ P62\\)

    Algorithm: Fixed-Point Iteration\nFind a solution to p = g(p) given an initial approximation p0.\nInput: initial approximation p0; tolerance TOL; maximum number of iterations Nmax.\nOutput: approximate solution p or message of failure.\nStep 1  Set  i = 1;\nStep 2  While ( i <= Nmax)  do  steps 3-6\n        Step 3  Set  p = g(p0);  /* compute pi */\n        Step 4  If  | p - p0 | < TOL  then  Output (p);  /* successful */\n            STOP;\n        Step 5  Set  i ++;\n        Step 6  Set  p0 = p ;   /* update p0 */\nStep 7  Output (The method failed after Nmax iterations);  /* unsuccessful */\n                STOP.\n
    "},{"location":"NA/Chap2/Chap2/#newtons-problem","title":"Newton's Problem","text":"

    Linearize a nonlinear function using Taylor\u2019s expansion.

    "},{"location":"NA/Chap2/Chap2/#therom_1","title":"Therom","text":""},{"location":"NA/Chap2/Chap2/#secant-method","title":"Secant Method","text":""},{"location":"NA/Chap2/Chap2/#method-of-false-position","title":"Method of False Position","text":"

    P73 Just Modify to always bracket the root.

    "},{"location":"NA/Chap2/Chap2/#error-analysis-for-iterative-methods","title":"Error Analysis for Iterative Methods","text":""},{"location":"NA/Chap2/Chap2/#therom-27","title":"Therom 2.7","text":"

    Let \\(g \\in C[a,b]\\) be such that \\(g(x)\\in [a,b]\\) for all \\(x\\in [a,b]\\).Suppose, in addition,that is continuous on \\((a,b)\\) and a positive constant \\(k<1\\) exists with \\(|g'(x)|\\le k\\) for all \\(x\\in (a,b)\\)

    • If \\(g'(p)\\ne 0\\) then for any number \\(p_0\\) in \\([a,b]\\) ,the sequence \\(p_n=g(p_{n-1})\\) converges only linearly to the unique fixed point \\(p\\ in\\ [a,b]\\)

    \\(p_{n+1}-p=g(p_n)-g(p)=g'(\\epsilon_n)(p_n-p)\\)

    "},{"location":"NA/Chap2/Chap2/#therom_2","title":"Therom","text":"

    \\(f\\in C[a,b]\\) has a simple zero at \\(p\\) in \\((a,b)\\) if and only if \\(f(p)=0\\) but \\(f'(p)\\ne 0\\)

    \\(f\\in C^m[a,b]\\) has a zero of multiplicity m at \\(p\\) in \\((a,b)\\) if and only if \\(0=f(p)=f'(p)=\u2026\u2026=f^{m-1}(p)\\) but \\(f^m(p)\\ne 0\\)

    "},{"location":"NA/Chap2/Chap2/#accelarating-convergence","title":"Accelarating Convergence","text":"
    Algorithm: Steffensen\u2019s Acceleration\nFind a solution to x = g(x) given an initial approximation p0.\nInput: initial approximation p0; tolerance TOL; maximum number of iterations Nmax.\nOutput: approximate solution x or message of failure.\nStep 1  Set  i = 1;\nStep 2  While ( i <= Nmax)  do  steps 3-6\n    Step 3  Set  p1 = g(p0) ; \n          p2 = g(p1) ; \n          p = p0 -( p1 - p0 )2 / ( p2 -2 p1 + p0 ) ;\n    Step 4  If  | p - p0 | < TOL  then  Output (p);  /* successful */\n                    STOP;\n    Step 5  Set  i ++;\n    Step 6  Set  p0 = p ;   /* update p0 */\nStep 7  Output (The method failed after Nmax iterations);  /* unsuccessful */\n                STOP.\n
    "},{"location":"NA/Chap3/Chap3/","title":"Interpolation and Polynomial Approximation","text":""},{"location":"NA/Chap3/Chap3/#interpolation-and-the-lagrange-polynomial","title":"Interpolation and the Lagrange Polynomial","text":""},{"location":"NA/Chap3/Chap3/#therom-32","title":"Therom 3.2","text":"
    • Proof of Uniqueness
    "},{"location":"NA/Chap3/Chap3/#remainder","title":"Remainder","text":"

    \\(Specific\\ Proof\\ P112\\)

    "},{"location":"NA/Chap3/Chap3/#def","title":"Def","text":"

    Let \\(f\\) be a function defined at $x_0, x_1 \u2026\u2026 x_n $ and suppose that $m_0, m_1 \u2026\u2026 m_n $ are k distince integers . The Lagrange polynomial that agrees with \\(f(x)\\) at k points \\(x_{m1},x_{m2}\u2026\u2026 x_{m_k}\\) is denoted by \\(P_{m_1,m_2\u2026\u2026,m_n}(x)\\)

    "},{"location":"NA/Chap3/Chap3/#nevilles-method","title":"Neville\u2019s Method","text":""},{"location":"NA/Chap3/Chap3/#therom-35","title":"Therom 3.5","text":""},{"location":"NA/Chap3/Chap3/#peseudo-code","title":"Peseudo code","text":""},{"location":"NA/Chap3/Chap3/#divided-difference","title":"Divided Difference","text":""},{"location":"NA/Chap3/Chap3/#newtons-interpolation","title":"Newton\u2019s Interpolation","text":"

    \\(P_n(x)=f[x_0]+\\sum_{k=1}^nf[x_0,x_1,\u2026\u2026x_k](x-x_0)\u2026\u2026(x-x_{k-1})\\)

    • https://www.youtube.com/watch?v=S7QIU0i1qLE

    Newton's Forward Difference Interpolation and Newton's Backward Difference Interpolation are both methods for constructing polynomial interpolants, but they differ in terms of the direction in which they compute the differences.

    1. Newton's Forward Difference Interpolation: - Differences: Forward interpolation starts with the given data point closest to the beginning (usually the lowest x-value) and moves forward. - Formula: The forward difference formula is given by: \\(f[x_0]+f[x_0,x_1](x\u2212x_0)+f[x_0,x_1,x_2](x\u2212x_0)(x\u2212x_1)+\u2026\\)
    2. Newton's Backward Difference Interpolation: - Differences: Backward interpolation starts with the given data point closest to the end (usually the highest x-value) and moves backward. - Formula: The backward difference formula is given by: \\(f[x_n]+f[x_n,x_{n\u22121}](x\u2212x_n)+f[x_n,x_{n\u22121},x_{n\u22122}](x\u2212x_n)(x\u2212x_{n\u22121})+\u2026\\)

    In both cases, the differences \\(f[x_i,x_{i\u22121},\u2026,x_0]\\) are computed using the divided difference approach. The primary difference between the two methods lies in the direction in which these differences are calculated.

    Key Points:

    • Newton's Forward Difference Interpolation works from the initial data point towards the desired point.
    • Newton's Backward Difference Interpolation works from the final data point towards the desired point.
    • Both methods use divided differences to calculate the coefficients of the interpolation polynomial.
    • The choice between forward and backward interpolation may depend on the specific problem and the nature of the available data

    \\(Pseudocode\\ P124-125\\)

    • Refer to P126 - 128!
    "},{"location":"NA/Chap3/Chap3/#hermites-method","title":"Hermite's Method","text":"
    • Persuadocode
    "},{"location":"NA/Chap3/Chap3/#cubic-spline-interpolation","title":"Cubic Spline INterpolation","text":"

    How can we make a smooth interpolation without asking too much from \\(f\\) ?Headache \u2026

    "},{"location":"NA/Chap3/Chap3/#further","title":"Further","text":"

    Suppose \\(S_j(x)=a_j+b_j(x-x_j)+c_j(x-x_j)^2+d_j(x-x_j)^3\\)

    • \\(a_{j+1}=S_j(x_{j+1})S_j(x_{j+1})=a_j+b_j(x_{j+1}-x_j)+c_j(x_{j+1}-x_j)^2+d_j(x_{j+1-x_j})^3\\)

    For notation \\(h_j=x_{j+1}-x_j\\) \\(a_{j+1}=a_j+b_jh_j+c_jh_j^2+d_jh_j^3\\) \\((1)\\)

    • \\(S'_j(x_j)=b_j\\) Applying condition \uff08d\uff09

    \\(b_{j+1}=b_j+2c_jh_j+3d_jh_j^2\\) \\((2)\\)

    • \\(c_j=S''_j(x_j)/2\\) and applying condition (e).

    \\(c_{j+1}=c_j+3d_jh_j\\) \\((3)\\)

    \\(\\Rightarrow h_{j-1}c_{j-1}+2(h_{j-1}+h_j)c_j+h_jc_{j+1}=\\frac{3}{h_j}(a_{j+1}-a_j)-\\frac{3}{h_{j-1}}(a_{j+1}-a_j)\\)

    "},{"location":"NA/Chap3/Chap3/#natural-cubic-spline","title":"Natural Cubic Spline","text":""},{"location":"NA/Chap3/Chap3/#clamped-boundary","title":"Clamped Boundary","text":""},{"location":"NA/Chap4/Chap4/","title":"Numerical Differentiation and Integration","text":"

    Refer to the Book .\uff08This page LACKS many contents\uff09

    "},{"location":"NA/Chap4/Chap4/#numerical-differentiation","title":"Numerical Differentiation","text":""},{"location":"NA/Chap4/Chap4/#richardsons-extrapolation","title":"Richardson\u2019s Extrapolation","text":""},{"location":"NA/Chap4/Chap4/#elements-of-numerical-integration","title":"Elements of Numerical Integration","text":"

    Approximate \\(I=\\int_a^b f(x)dx\\)

    • Integrate the Lagrange interpolating polynomial of \\(f (x)\\) instead.
    "},{"location":"NA/Chap4/Chap4/#composite-numerical-integration","title":"Composite Numerical Integration","text":""},{"location":"NA/Chap4/Chap4/#composite-trapezoidal-rule","title":"Composite Trapezoidal Rule","text":""},{"location":"NA/Chap4/Chap4/#composite-simpsons-rule","title":"Composite Simpson\u2019s Rule","text":""},{"location":"NA/Chap4/Chap4/#romberg-integration","title":"Romberg Integration","text":""},{"location":"NA/Chap4/Chap4/#adaptive-quadrature-methods","title":"Adaptive Quadrature Methods","text":""},{"location":"NA/Chap4/Chap4/#gaussian-quadrature","title":"Gaussian Quadrature","text":"
    • Precision of degree 3(produces exact result for every polynomial of degree 3 or less)
    "},{"location":"NA/Chap5/Chap5/","title":"Chapter 5","text":""},{"location":"NA/Chap5/Chap5/#preknowledge","title":"Preknowledge","text":""},{"location":"NA/Chap5/Chap5/#eulers-method","title":"Euler's method\uff1a","text":"

    all step size, the accuracy of approximation increases.

    "},{"location":"NA/Chap5/Chap5/#error-analysis","title":"Error Analysis","text":"

    Refer to the BOOK

    "},{"location":"NA/Chap5/Chap5/#other-euler-methods","title":"Other Euler Methods","text":""},{"location":"NA/Chap5/Chap5/#implicit-euler-method","title":"Implicit Euler Method","text":"

    \\(y'(t_0)\\approx\\frac{t(t_0)-y(t_0-h)}{h}\\Rightarrow y(t_1)\\approx y(t_0)+hy'(t_1)=\\alpha+hf(t_1,y(t_1))\\)

    \\(w_0=\\alpha ; w_{i+1}=w_i+hf(t_{i+1},w_{i+1})(i=0,\u2026\u2026\uff0cn-1)\\)

    \\(\\tau_{i+1}=\\frac{y_{i+1}-w_{i+1}}{h}==\\frac{h}{2}y''(\\epsilon_i)=o(h)\\)

    "},{"location":"NA/Chap5/Chap5/#trapezoidal-method","title":"Trapezoidal Method","text":"

    \\(w_{i+1}=w_i+\\frac{h}{2}[f(t_i,w_i)+f(t_{i+1},w_{i+1})]\\)

    • Error \\(O(h^2)\\) but implict!! so has to be solved iteratively(LOW!)
    "},{"location":"NA/Chap5/Chap5/#double-step-method","title":"Double-step Method","text":"

    \\(y'(t_0)=\\frac{1}{2h}[y(t_0+h)-y(t_0-h)]-\\frac{h^2}{6}y^{(3)}(\\epsilon_1)\\)

    \\(\\Rightarrow y(t_2)\\approx y(t_0)+2hf(t_1,y(t_1))\\)

    \\(w_0=\\alpha\\\\ w_{i+1}=w_{i-1}+2hf(t_i,w_i)\\)

    • Two initial points are required to start moving forward .
    "},{"location":"NA/Chap5/Chap5/#modified-eulers-methodtrapezoidal-method","title":"modified Euler\u2019s method:Trapezoidal Method","text":"

    Modified Euler's method, also known as the Improved Euler method or Heun's method, is a numerical technique used for approximating solutions to ordinary differential equations (ODEs). It is an extension of the basic Euler's method and provides better accuracy by incorporating a simple correction.

    The standard Euler's method is a first-order numerical method that uses a linear approximation to update the solution from one time step to the next. However, it can have limited accuracy, especially for ODEs with rapidly changing behavior.

    The Modified Euler's method improves upon this by using a two-step process:

    1. Prediction Step:

    Use the current information to make a preliminary estimate of the solution at the next time step.

    Predicted Value \\((P)\\):\\(\\tilde{y}_{i+1}=y_{i}+h\u22c5f(t_i,y_i)\\)

    Here, \\(y_i\\) is the current approximation, h is the step size, and \\(f(t_i,y_i)\\)represents the derivative of yy with respect to \\(t\\) at the current point.

    1. Correction Step:

    Use the predicted value to compute a more accurate estimate by incorporating the derivative at the predicted point.

    Corrected Value \\((C)\\):\\(y_{i+1}=y_i+\\frac{h}{2}[f(t_i,y_i)+f(t_{i+1},\\tilde{y}_{i+1})]\\)

    In this step, \\(f(t_i,y_i)\\)represents the derivative at the initial point, and \\(f(t_{i+1},y_{i+1})\\) represents the derivative at the predicted point.

    Modified Euler's method has a local truncation error of \\(O(h^3)\\), which is an improvement over the \\(O(h^2)\\) local truncation error of the basic Euler method. This makes it more accurate for a wide range of ODEs, and it is still relatively simple to implement.

    "},{"location":"NA/Chap5/Chap5/#higher-order-taylor-methods","title":"Higher-order Taylor Methods","text":""},{"location":"NA/Chap5/Chap5/#runge-kutta-methods","title":"Runge-Kutta Methods","text":"

    Runge-Kutta methods are a family of iterative numerical techniques used for solving ordinary differential equations (ODEs) or systems of ODEs. These methods provide an approximation of the solution at discrete points in the domain by iteratively updating the solution from one point to the next.

    Single-Step Method:

    In a single-step method, the solution at the next time step \\((t_{i+1},w_{i+1})\\) is determined based on the information available at the current time step \\((t_{i},w_{i})\\). This implies that we calculate the next point of the solution through one iteration rather than computing the entire solution curve at once.

    We can improve the result by finding a better slope.

    Generalize the modified Euler\u2019s method

    "},{"location":"NA/Chap5/Chap5/#multistep-methods","title":"Multistep Methods","text":"

    Use a linear combination of y and y at several mesh points to better approximate \\(y(t_{i+1})\\)

    \\(w_{i+1}=a_{m-1}w_i+a_{m-2}w_{i-1}+\u2026\u2026+h[b_mf_{i+1}+b_{m-1}f_i+\u2026\u2026+b_0f_{i+1-m}]\\)

    Newton's Forward Difference Interpolation and Newton's Backward Difference Interpolation are both methods for constructing polynomial interpolants, but they differ in terms of the direction in which they compute the differences.

    1. Newton's Forward Difference Interpolation: - Differences: Forward interpolation starts with the given data point closest to the beginning (usually the lowest x-value) and moves forward. - Formula: The forward difference formula is given by: \\(f[x_0]+f[x_0,x_1](x\u2212x_0)+f[x_0,x_1,x_2](x\u2212x_0)(x\u2212x_1)+\u2026\\)
    2. Newton's Backward Difference Interpolation: - Differences: Backward interpolation starts with the given data point closest to the end (usually the highest x-value) and moves backward. - Formula: The backward difference formula is given by: \\(f[x_n]+f[x_n,x_{n\u22121}](x\u2212x_n)+f[x_n,x_{n\u22121},x_{n\u22122}](x\u2212x_n)(x\u2212x_{n\u22121})+\u2026\\)

    In both cases, the differences \\(f[x_i,x_{i\u22121},\u2026,x_0]\\) are computed using the divided difference approach. The primary difference between the two methods lies in the direction in which these differences are calculated.

    Key Points:

    • Newton's Forward Difference Interpolation works from the initial data point towards the desired point.
    • Newton's Backward Difference Interpolation works from the final data point towards the desired point.
    • Both methods use divided differences to calculate the coefficients of the interpolation polynomial.
    • The choice between forward and backward interpolation may depend on the specific problem and the nature of the available data.
    "},{"location":"NA/Chap5/Chap5/#adams-bashforth-explicit-m-step-technique","title":"Adams-Bashforth explicit m-step technique","text":"

    Derive from integration

    • Adams-Bashforth explicit m-step technique

    1.Use the Newton backward-difference formula to interpolate f on \\((t_i,f_i),(t_{i-1},f_{i-1})\u2026\u2026(t_{i+1-m},f_{i+1-m})\\) and obtain \\(P_{m-1}(t)\\)

    2.Or Let \\(t=t_i+sh\\ s\\in[0,1]\\) we have

    \\(\\int_{t_{i}}^{t_{i+1}}f(t,y(t))dt=h\\int_0^1P_{m-1}(t_i+sh)ds+h\\int_0^1R_{m-1(t_i+sh)}ds\\)

    \\(\\Rightarrow w_{i+1}=w_i+h\\int_0^1P_{m-1}(t_i+sh)ds\\)

    3. The local truncation error for a multistep method is \\(\\tau_{i+1}(h)=y_{i+1}-(a_{m-1}y_i+\u2026\u2026+a_0y_{i+1-m})/h-[b_mf_{i+1}+\u2026\u2026+b_0f_{i+1-m}]\\) for each \\(i=m-1,m\u2026\u2026,n-1\\)

    Example

    derive the Adams-Bashforth two-step explicit method.

    Note \uff1a \\(h\\) is step length \\(h=\\triangle x/n\\)

    • Use the Newton forward-difference formula to interpolate f
    • Note: Include\\((t_{i+1},f_{i+1})\\) to interpolate So it is implicit

    "},{"location":"NA/Chap5/Chap5/#adams-predictor-corrector-system","title":"Adams predictor-corrector system","text":"
    • Step 1 Compute the first m initial values by Runge-Kutta method.

    • Step 2 Predict by Adams-Bashforth explicit method.

    • Step 3 Correct by Adams-Moulton implicit method.

    "},{"location":"NA/Chap5/Chap5/#example","title":"EXAMPLE","text":"

    Consider a simple first-order ordinary differential equation given by:

    \\(dy/dt=\u2212y\\)

    We will use the Adams predictor-corrector method to numerically solve this equation.

    "},{"location":"NA/Chap5/Chap5/#step-1-compute-the-first-m-initial-values-by-runge-kutta-method","title":"Step 1: Compute the First m Initial Values by Runge-Kutta Method","text":"

    First, we use the Runge-Kutta method to calculate the initial values. For the given equation, the Runge-Kutta scheme is:

    \\(k_1=\u2212y_n\\)

    \\(k_2=\u2212(y_n+0.5hk_1)\\)

    \\(y_{n+1}=y_n+hk_2\\)

    Here, \\(h\\) is the time step.

    "},{"location":"NA/Chap5/Chap5/#step-2-predict-by-adams-bashforth-explicit-method","title":"Step 2: Predict by Adams-Bashforth Explicit Method","text":"

    The Adams-Bashforth method for a second-order equation is:

    \\(y_{n+1}^{(p)}=y_n+h(\u2212y_n+\\frac{3}{2}y_{n\u22121})\\)

    "},{"location":"NA/Chap5/Chap5/#step-3-correct-by-adams-moulton-implicit-method","title":"Step 3: Correct by Adams-Moulton Implicit Method","text":"

    The Adams-Moulton method for a second-order equation is:

    \\[y_{n+1}=y_n+h(\u2212\\frac{1}{2}y_{n+1}+\\frac{3}{2}y_{n})\\]

    This equation needs to be solved iteratively as \\(y_{n+1}\\) appears on both sides of the equation.

    This is a simple example, and in practice, the Adams predictor-corrector method can be applied to higher-order differential equations. The specific steps and coefficients will vary based on the chosen order. In real-world applications, computational tools or programming languages may be used to perform these calculations.

    • All the formulae used in the three steps must have the same order of local truncation error.

    The most popularly used system is based on the 4th-order Adams-Bashforth method as predictor and one iteration of the Adams-Moulton method as corrector, with the starting values obtained from the 4th-order Runge-Kutta method.

    "},{"location":"NA/Chap5/Chap5/#derive-from-taylor-expansion","title":"Derive from Taylor expansion","text":"
    • derive a formula of order 4 with the form
    "},{"location":"NA/Chap5/Chap5/#higher-order-equations-and-systems-of-differential-equations","title":"Higher-Order Equations and Systems of Differential Equations","text":""},{"location":"NA/Chap5/Chap5/#stability","title":"Stability","text":""},{"location":"NA/Chap5/Chap5/#def","title":"Def","text":"
    • Def one : A one-step difference equation method with local trucation error \\(\\tau_i(h)\\) is said to be consistent with the differential equation it approximates if \\(lim_{h\\rightarrow 0}|\\tau_i(h)|=0\\)

    For multistep methods it is also required that for \\(i=1,2,\u2026\u2026m-1\\)

    \u200b \\(lim_{h\\rightarrow 0}|w_i-y_i|=0\\)

    • A one-step difference equation method is said to be convergent with respect to the differential equation it approximates if \\(lim_{h\\rightarrow 0}max_{1\\le i\\le n}|w_i-y_i|=0\\)

    • Apply a particular method to a simple test equation,y\u2018 =\u03bby, y(0) =\u03b1, where Re(\u03bb ) < 0.Assume that roundoff error is introduced only at the initial point. If this initial error will decrease for a certain step size h, then this

    method is said to be absolutely stable with respect to H =\u03bbh. The set of all such H forms the region of absolute stability.

    Method A is said to be more stable than method B if the region of

    absolute stability of A is larger than that of B.

    "},{"location":"NA/Chap5/Chap5/#def_1","title":"Def","text":""},{"location":"NA/Chap6/1/","title":"1","text":"

    \u8ba2\u5a5a\u5f3a\u5978\u6848\u6848\u4f8b\u5206\u6790\uff08\u521d\u7248\uff09

    \u5468\u79c0\u654f 3220103565

    "},{"location":"NA/Chap6/1/#_1","title":"\u4e00\u3001\u6848\u4ef6\u6982\u8ff0","text":"

    \u200b 2023\u5e741\u670830\u65e5\uff0c\u88ab\u544a\u4eba\u5e2d\u67d0\u67d0\u4e0e\u88ab\u5bb3\u4eba\u7ecf\u5a5a\u4ecb\u673a\u6784\u4ecb\u7ecd\u76f8\u8bc6\u540e\u5f00\u59cb\u8c08\u604b\u7231\u3002\u4ea4\u5f80\u671f\u95f4\uff0c\u53cc\u65b9\u53e3\u5934\u7ea6\u5b9a\u8ba2\u5a5a\u5f69\u793c18.8\u4e07\u5143\u30025\u67081\u65e5\uff0c\u5e2d\u67d0\u67d0\u5bb6\u4e3a\u4e8c\u4eba\u4e3e\u529e\u8ba2\u5a5a\u4eea\u5f0f\uff0c\u5f53\u65e5\u4ea4\u4ed8\u5f69\u793c10\u4e07\u5143\u548c7.2\u514b\u6212\u6307\u3002\u540c\u65f6\uff0c\u5e2d\u67d0\u67d0\u53ca\u5176\u7236\u6bcd\u4e66\u9762\u627f\u8bfa\uff0c\u7ed3\u5a5a\u4e00\u5e74\u540e\u5728\u623f\u5c4b\u4ea7\u6743\u8bc1\u4e0a\u6dfb\u52a0\u88ab\u5bb3\u4eba\u7684\u540d\u5b57\u30025\u67082\u65e5\u4e2d\u5348\uff0c\u88ab\u5bb3\u4eba\u4e00\u65b9\u6309\u7167\u5f53\u5730\u4e60\u4fd7\u5bb4\u8bf7\u5e2d\u67d0\u67d0\u3002\u996d\u540e\uff0c\u5e2d\u67d0\u67d0\u548c\u88ab\u5bb3\u4eba\u4e00\u540c\u524d\u5f80\u5e2d\u67d0\u67d0\u4f4d\u4e8e\u9633\u9ad8\u53bf\u67d0\u5c0f\u533a\u67d0\u697c14\u5c42\u7684\u623f\u5185\uff0c\u5e2d\u67d0\u67d0\u5411\u88ab\u5bb3\u4eba\u63d0\u51fa\u53d1\u751f\u6027\u5173\u7cfb\uff0c\u906d\u5230\u88ab\u5bb3\u4eba\u62d2\u7edd\uff0c\u88ab\u5bb3\u4eba\u79f0\u7b49\u7ed3\u5a5a\u540e\u518d\u8bf4\u3002\u4e4b\u540e\uff0c\u5e2d\u67d0\u67d0\u4e0d\u987e\u88ab\u5bb3\u4eba\u53cd\u6297\uff0c\u5f3a\u884c\u4e0e\u88ab\u5bb3\u4eba\u53d1\u751f\u4e86\u6027\u5173\u7cfb\u3002\u4e8b\u540e\uff0c\u88ab\u5bb3\u4eba\u60c5\u7eea\u6fc0\u52a8\uff0c\u5b9e\u65bd\u4e86\u70b9\u706b\u70e7\u5367\u5ba4\u67dc\u5b50\u548c\u5ba2\u5385\u7a97\u5e18\u7b49\u884c\u4e3a\uff0c\u8fd8\u9003\u51fa\u623f\u95f4\u901a\u8fc7\u6b65\u68af\u4e0b\u81f313\u5c42\u547c\u558a\u201c\u6551\u547d\u201d\uff0c\u540e\u88ab\u5e2d\u67d0\u67d0\u5f3a\u884c\u62d6\u62fd\u56de\u623f\u5185\u3002\u8fd9\u671f\u95f4\uff0c\u88ab\u544a\u4eba\u62ff\u8d70\u4e86\u88ab\u5bb3\u4eba\u624b\u673a\uff0c\u76f4\u5230\u56de\u5bb6\u9014\u4e2d\uff0c\u88ab\u5bb3\u4eba\u6bcd\u4eb2\u6253\u6765\u7535\u8bdd\uff0c\u88ab\u544a\u4eba\u624d\u5c06\u624b\u673a\u5f52\u8fd8\u88ab\u5bb3\u4eba\u3002\u5f53\u665a\uff0c\u88ab\u5bb3\u4eba\u5411\u516c\u5b89\u673a\u5173\u62a5\u8b66\u3002\u7ecf\u4fa6\u67e5\u4eba\u5458\u5bf9\u88ab\u5bb3\u4eba\u8eab\u4f53\u68c0\u67e5\uff0c\u88ab\u5bb3\u4eba\u5de6\u53f3\u5927\u81c2\u3001\u53f3\u624b\u8155\u5747\u6709\u6de4\u9752\uff1b\u5bf9\u73b0\u573a\u8fdb\u884c\u52d8\u67e5\uff0c\u53d1\u73b0\u5367\u5ba4\u7684\u7a97\u5e18\u88ab\u62c9\u4e0b\u6389\u843d\uff0c\u5ba2\u5385\u7684\u7a97\u5e18\u6709\u88ab\u70e7\u8fc7\u7684\u75d5\u8ff9\u3002\u4fa6\u67e5\u4eba\u5458\u4e5f\u8c03\u53d6\u4e86\u5c0f\u533a\u76d1\u63a7\u5f55\u50cf\uff0c\u8be5\u5f55\u50cf\u663e\u793a\u88ab\u5bb3\u4eba\u5728\u9003\u51fa\u623f\u95f4\u901a\u8fc7\u6b65\u68af\u4e0b\u81f313\u5c42\u540e\u53c8\u88ab\u5e2d\u67d0\u67d0\u5f3a\u884c\u62d6\u62fd\u56de\u6848\u53d1\u73b0\u573a14\u5c42\u623f\u5185\u3002

    "},{"location":"NA/Chap6/1/#_2","title":"\u4e8c\u3001\u300a\u5211\u6cd5\u300b\u4e2d\u201c\u5f3a\u5978\u7f6a\u201d\u5728\u672c\u6848\u7684\u9002\u7528","text":"

    \u200b \u5f3a\u5978\u7f6a\u662f\u6307\u8fdd\u80cc\u5987\u5973\u7684\u610f\u5fd7\uff0c\u4ee5\u66b4\u529b\u3001\u80c1\u8feb\u6216\u8005\u5176\u4ed6\u624b\u6bb5\u5f3a\u884c\u4e0e\u5987\u5973\u53d1\u751f\u6027\u5173\u7cfb\u7684\u884c\u4e3a\u3002\u300a\u4e2d\u534e\u4eba\u6c11\u5171\u548c\u56fd\u5211\u6cd5\u300b\u7b2c\u4e8c\u767e\u4e09\u5341\u516d\u6761\u89c4\u5b9a\uff0c\u4ee5\u66b4\u529b\u3001\u80c1\u8feb\u6216\u8005\u5176\u4ed6\u624b\u6bb5\u5f3a\u5978\u5987\u5973\u7684\uff0c\u5904\u4e09\u5e74\u4ee5\u4e0a\u5341\u5e74\u4ee5\u4e0b\u6709\u671f\u5f92\u5211\uff1b\u540c\u65f6\u8fd8\u89c4\u5b9a\u82e5\u5e72\u4ece\u91cd\u5904\u7f5a\u7684\u60c5\u5f62\u3002

    \u200b \u5f3a\u5978\u7f6a\u4fb5\u72af\u7684\u5ba2\u4f53\u662f\u5987\u5973\u6027\u7684\u4e0d\u53ef\u4fb5\u72af\u7684\u6743\u5229(\u53c8\u79f0\u8d1e\u64cd\u6743)\uff0c\u5373\u5987\u5973\u6309\u7167\u81ea\u5df1\u7684\u610f\u5fd7\u51b3\u5b9a\u6b63\u5f53\u6027\u884c\u4e3a\u7684\u6743\u5229\uff0c\u5176\u72af\u7f6a\u5bf9\u8c61\u662f\u5973\u6027\u3002\u5ba2\u89c2\u8981\u4ef6\u4e0a\uff0c\u5f3a\u5978\u7f6a\u5ba2\u89c2\u4e0a\u987b\u8fdd\u80cc\u5987\u5973\u610f\u5fd7\uff0c\u5e76\u4e14\u5fc5\u987b\u5177\u6709\u4f7f\u7528\u66b4\u529b\u3001\u80c1\u8feb\u6216\u8005\u5176\u4ed6\u624b\u6bb5\uff0c\u4f7f\u5987\u5973\u5904\u4e8e\u4e0d\u80fd\u53cd\u6297\u3001\u4e0d\u6562\u53cd\u6297\u3001\u4e0d\u77e5\u53cd\u6297\u72b6\u6001\u6216\u5229\u7528\u5987\u5973\u5904\u4e8e\u4e0d\u77e5\u3001\u65e0\u6cd5\u53cd\u6297\u7684\u72b6\u6001\u800c\u4e58\u673a\u5b9e\u884c\u5978\u6deb\u7684\u884c\u4e3a\u3002\u4e3b\u4f53\u8981\u4ef6\u4e0a\uff0c\u5f3a\u5978\u7f6a\u7684\u4e3b\u4f53\u662f\u7279\u6b8a\u4e3b\u4f53\uff0c\u5373\u5e74\u6ee1\u5341\u56db\u5468\u5c81\u5177\u6709\u5211\u4e8b\u8d23\u4efb\u80fd\u529b\u7684\u7537\u5b50\u3002\u4e3b\u89c2\u8981\u4ef6\u4e0a\uff0c\u672c\u7f6a\u5728\u4e3b\u89c2\u65b9\u9762\u8868\u73b0\u4e3a\u6545\u610f\uff0c\u5e76\u4e14\u5177\u6709\u5978\u6deb\u7684\u76ee\u7684\u3002\u662f\u6307\u72af\u7f6a\u5206\u5b50\u610f\u56fe\u4e0e\u88ab\u5bb3\u5987\u5973\u53d1\u751f\u6027\u4ea4\u7684\u884c\u4e3a\u3002

    \u200b \u672c\u6848\u4e2d\uff0c\u5ba2\u89c2\u65b9\u9762\u4e0a\uff0c\u88ab\u5bb3\u4eba\u5728\u72af\u7f6a\u884c\u4e3a\u524d\u66fe\u660e\u786e\u5411\u5e2d\u67d0\u67d0\u8868\u793a\u8fc7\u81ea\u5df1\u53cd\u5bf9\u5a5a\u524d\u6027\u884c\u4e3a\uff0c\u5728\u5e2d\u67d0\u67d0\u5411\u88ab\u5bb3\u4eba\u63d0\u51fa\u53d1\u751f\u6027\u5173\u7cfb\u65f6\uff0c\u88ab\u5bb3\u4eba\u8868\u793a\u4e86\u62d2\u7edd\uff0c\u79f0\u7b49\u7ed3\u5a5a\u540e\u518d\u8bf4\u3002\u72af\u7f6a\u8fc7\u7a0b\u4e2d\uff0c\u88ab\u5bb3\u4eba\u8fdb\u884c\u4e86\u53cd\u6297\u3002\u8fd9\u4e00\u7cfb\u5217\u7684\u884c\u4e3a\u90fd\u8868\u660e\u5e2d\u67d0\u67d0\u7684\u884c\u4e3a\u8fdd\u80cc\u4e86\u88ab\u5bb3\u4eba\u5bf9\u6027\u7684\u81ea\u7531\u652f\u914d\u6743\uff0c\u88ab\u5bb3\u4eba\u5de6\u53f3\u5927\u81c2\u3001\u53f3\u624b\u8155\u6de4\u9752\u7684\u60c5\u51b5\u4e5f\u8bf4\u660e\u4e86\u5e2d\u67d0\u67d0\u4e0d\u987e\u88ab\u5bb3\u4eba\u53cd\u6297\uff0c\u4f7f\u7528\u4e86\u66b4\u529b\u624b\u6bb5\u3002\u4e3b\u89c2\u65b9\u9762\u4e0a\uff0c\u88ab\u5bb3\u4eba\u60c5\u7eea\u6fc0\u52a8\uff0c\u5b9e\u65bd\u4e86\u70b9\u706b\u70e7\u5367\u5ba4\u67dc\u5b50\u548c\u5ba2\u5385\u7a97\u5e18\u7b49\u884c\u4e3a\uff0c\u8fd8\u9003\u51fa\u623f\u95f4\u901a\u8fc7\u6b65\u68af\u4e0b\u81f313\u5c42\u547c\u558a\u201c\u6551\u547d\u201d\uff0c\u4e14\u88ab\u5bb3\u4eba\u5728\u9003\u51fa\u623f\u95f4\u901a\u8fc7\u6b65\u68af\u4e0b\u81f313\u5c42\u540e\u53c8\u88ab\u5e2d\u67d0\u67d0\u5f3a\u884c\u62d6\u62fd\u56de\u6848\u53d1\u73b0\u573a14\u5c42\u623f\u5185\u90fd\u8bf4\u660e\u5e2d\u67d0\u67d0\u4e3b\u89c2\u610f\u56fe\u4e0a\u5b9e\u65bd\u5978\u6deb\u7684\u6545\u610f\u548c\u88ab\u5bb3\u4eba\u660e\u786e\u8868\u793a\u7684\u62d2\u7edd\u4e0e\u53cd\u5bf9\u3002

    "},{"location":"NA/Chap6/1/#_3","title":"\u4e09\u3001\u9700\u7279\u522b\u5173\u6ce8\u7684\u60c5\u5f62","text":"

    \u200b \u5728\u6b64\u6848\u4e2d\uff0c\u5b58\u5728\u4e24\u4e2a\u7279\u6b8a\u60c5\u51b5\u9700\u8981\u8fdb\u884c\u5206\u6790\u3002\u9996\u5148\uff0c\u72af\u7f6a\u4eba\u4e0e\u88ab\u5bb3\u4eba\u53cc\u65b9\u5904\u4e8e\u8ba2\u5a5a\u5173\u7cfb\u3002\u5176\u6b21\uff0c\u4e8b\u540e\u53cc\u65b9\u8fdb\u884c\u4e86\u534f\u5546\u3002\u5bf9\u4e8e\u8ba2\u5a5a\u540e\u5f3a\u884c\u53d1\u751f\u6027\u884c\u4e3a\u662f\u5426\u6784\u6210\u5f3a\u5978\u7f6a\u7684\u95ee\u9898\uff0c\u7b54\u6848\u80af\u5b9a\u662f\u80af\u5b9a\u7684\u3002\u5c3d\u7ba1\u8ba2\u5a5a\u662f\u4e00\u79cd\u4f20\u7edf\u4e60\u4fd7\uff0c\u4f46\u5728\u6cd5\u5f8b\u4e0a\uff0c\u8ba2\u5a5a\u5e76\u4e0d\u7b49\u540c\u4e8e\u5df2\u7ecf\u7ed3\u5a5a\u3002\u5373\u4fbf\u5728\u4e00\u4e9b\u5730\u533a\u5f3a\u8c03\u8ba2\u5a5a\u4eea\u5f0f\u7684\u91cd\u8981\u6027\uff0c\u8ba4\u4e3a\u8ba2\u5a5a\u7b49\u540c\u4e8e\u7ed3\u5a5a\uff0c\u6839\u636e\u73b0\u884c\u6cd5\u5f8b\u89c4\u5b9a\uff0c\u5408\u6cd5\u5a5a\u59fb\u5e94\u4ee5\u5a5a\u59fb\u767b\u8bb0\u673a\u5173\u6838\u53d1\u7684\u7ed3\u5a5a\u767b\u8bb0\u8bc1\u4e3a\u51c6\u3002\u8ba2\u5a5a\u5e76\u4e0d\u8d4b\u4e88\u53cc\u65b9\u592b\u59bb\u4e4b\u95f4\u7684\u6743\u5229\u548c\u4e49\u52a1\u3002\u9000\u4e00\u6b65\u8bb2\uff0c\u5373\u4f7f\u662f\u5408\u6cd5\u5a5a\u59fb\u671f\u95f4\uff0c\u5982\u679c\u8fdd\u80cc\u5987\u5973\u610f\u5fd7\u5f3a\u884c\u53d1\u751f\u6027\u884c\u4e3a\uff0c\u4ecd\u7136\u6784\u6210\u5f3a\u5978\u7f6a\u3002

    \u200b \u5176\u6b21\uff0c\u4e8b\u540e\u8fbe\u6210\u534f\u8bae\u4e0d\u5f71\u54cd\u5bf9\u6b64\u884c\u4e3a\u7684\u8ba4\u5b9a\u3002\u6839\u636e\u201c\u884c\u4e3a\u4e0e\u6545\u610f\u540c\u65f6\u5b58\u5728\u539f\u5219\u201d\uff0c\u5bf9\u4e8e\u72af\u7f6a\u7684\u8ba4\u5b9a\u662f\u4ee5\u884c\u4e3a\u4eba\u5728\u72af\u7f6a\u65f6\u7684\u4e3b\u89c2\u5fc3\u6001\u4e3a\u51c6\u3002\u5728\u672c\u6848\u4e2d\uff0c\u4e8b\u53d1\u65f6\u88ab\u5bb3\u4eba\u660e\u786e\u8868\u8fbe\u4e86\u4e0d\u613f\u53d1\u751f\u6027\u884c\u4e3a\u7684\u610f\u613f\uff0c\u5e2d\u67d0\u67d0\u7684\u884c\u4e3a\u8fdd\u80cc\u4e86\u88ab\u5bb3\u4eba\u7684\u610f\u5fd7\uff0c\u4ee5\u66b4\u529b\u624b\u6bb5\u5f3a\u884c\u4e0e\u88ab\u5bb3\u4eba\u53d1\u751f\u6027\u884c\u4e3a\uff0c\u7b26\u5408\u5f3a\u5978\u7f6a\u7684\u6784\u6210\u8981\u4ef6\u3002\u4e8b\u540e\u7684\u534f\u8bae\u4e0d\u6539\u53d8\u5f53\u65f6\u7684\u72af\u7f6a\u6027\u8d28\uff0c\u800c\u662f\u5c5e\u4e8e\u4e8b\u540e\u7684\u5904\u7406\uff0c\u4e0d\u80fd\u5426\u5b9a\u5e2d\u67d0\u67d0\u6784\u6210\u5f3a\u5978\u7f6a\u7684\u4e8b\u5b9e\u3002

    \u200b \u5728\u91cf\u5211\u65b9\u9762\uff0c\u6cd5\u9662\u5145\u5206\u8003\u8651\u5230\u53cc\u65b9\u786e\u7cfb\u604b\u7231\u5173\u7cfb\uff0c\u5e76\u5728\u88ab\u5bb3\u4eba\u62a5\u8b66\u540e\uff0c\u5e2d\u67d0\u67d0\u81ea\u613f\u524d\u5f80\u516c\u5b89\u673a\u5173\u63a5\u53d7\u8c03\u67e5\u3002\u57fa\u4e8e\u7f6a\u8d23\u5211\u76f8\u9002\u5e94\u7684\u539f\u5219\uff0c\u5bf9\u5e2d\u67d0\u67d0\u4e88\u4ee5\u4ece\u8f7b\u5904\u7f5a\u3002\u56e0\u6b64\uff0c\u6cd5\u9662\u5224\u5904\u5e2d\u67d0\u67d0\u6709\u671f\u5f92\u5211\u4e09\u5e74\uff0c\u4f53\u73b0\u4e86\u5bf9\u6848\u4ef6\u7684\u516c\u6b63\u548c\u5408\u7406\u5224\u51b3\u3002

    "},{"location":"NA/Chap6/1/#_4","title":"\u56db\u3001\u5b9e\u65bd\u8005\u4e3b\u89c2\u8ba4\u8bc6\u4e0e\u88ab\u5bb3\u8005\u7684\u771f\u5b9e\u610f\u56fe\u7684\u8003\u91cf","text":"

    \u200b \u672c\u6848\u6700\u503c\u5f97\u8ba8\u8bba\u7684\u5728\u4e8e\u72af\u7f6a\u4eba\u5e2d\u67d0\u67d0\u7684\u4e3b\u89c2\u8ba4\u8bc6\u548c\u88ab\u5bb3\u4eba\u201c\u8fdd\u80cc\u5987\u5973\u610f\u5fd7\u201d\u7684\u4f53\u73b0\u3002

    \u200b \u88ab\u5bb3\u4eba\u7684\u4e3b\u89c2\u65b9\u9762\u4e0a\uff0c\u56fd\u5185\u6709\u90e8\u5206\u5b66\u8005\u8ba4\u4e3a\u201c\u7f3a\u4e4f\u88ab\u5bb3\u4eba\u540c\u610f\u201d\u548c\u201c\u8fdd\u80cc\u5987\u5973\u610f\u5fd7\u201d\u4e24\u4e2a\u6982\u5ff5\u65e0\u5b9e\u8d28\u5dee\u522b,\u56e0\u6b64\u7ecf\u5e38\u4e92\u6362\u4f7f\u7528,\u4f46\u8fd9\u5b9e\u9645\u4e0a\u662f\u5bf9\u4e8c\u8005\u5173\u7cfb\u7684\u8bef\u8bfb\u3002\u4e0e\u201c\u8fdd\u80cc\u5987\u5973\u610f\u5fd7\u201d\u76f8\u6bd4,\u5c06\u201c\u7f3a\u4e4f\u88ab\u5bb3\u4eba\u540c\u610f\u201d\u4f5c\u4e3a\u5f3a\u5978\u7f6a\u7684\u6838\u5fc3\u7279\u5f81\u5177\u6709\u660e\u663e\u7684\u4f18\u52bf\u3002

    \u200b \u9996\u5148\uff0c\u5728\u6cd5\u5f8b\u4e0a\uff0c\"\u7f3a\u4e4f\u88ab\u5bb3\u4eba\u540c\u610f\"\u4f5c\u4e3a\u4e00\u79cd\u5ba2\u89c2\u72b6\u6001\u62e5\u6709\u660e\u786e\u7684\u5f62\u6001\u4f18\u52bf\u3002\u8fd9\u4e00\u72b6\u6001\u5177\u6709\u6e05\u6670\u7684\u5916\u5728\u8868\u73b0\uff0c\u5373\u672a\u7ecf\u88ab\u5bb3\u4eba\u540c\u610f\u7684\u6027\u884c\u4e3a\u3002\u76f8\u5bf9\u800c\u8a00\uff0c\u201c\u8fdd\u80cc\u5987\u5973\u610f\u5fd7\u201d\u5219\u5c5e\u4e8e\u4e3b\u89c2\u5fc3\u7406\uff0c\u9700\u8981\u7ecf\u8fc7\u6df1\u5165\u7684\u4e3b\u89c2\u8003\u5bdf\u624d\u80fd\u786e\u5b9a\u3002\u56e0\u6b64\uff0c\u4e00\u4e2a\u5728\u5ba2\u89c2\u4e0a\u672a\u7ecf\u88ab\u5bb3\u4eba\u540c\u610f\u7684\u6027\u884c\u4e3a\u4e0d\u80fd\u76f4\u63a5\u88ab\u8ba4\u5b9a\u4e3a\u8fdd\u80cc\u88ab\u5bb3\u4eba\u610f\u5fd7\u7684\u884c\u4e3a\u3002\u5373\u4f7f\u88ab\u5bb3\u4eba\u901a\u8fc7\u8a00\u8bed\u62d2\u7edd\u548c\u8f7b\u5fae\u62b5\u6297\uff0c\u4e5f\u4e0d\u8db3\u4ee5\u8bc1\u660e\u8fdd\u80cc\u4e86\u88ab\u5bb3\u4eba\u7684\u771f\u5b9e\u610f\u613f\u3002\u8fd9\u7a81\u663e\u4e86\"\u7f3a\u4e4f\u540c\u610f\"\u8fd9\u4e00\u5ba2\u89c2\u72b6\u6001\u5728\u6cd5\u5f8b\u4e0a\u7684\u5f62\u6001\u660e\u6670\u548c\u5177\u4f53\u53ef\u8fa8\u6027\u3002

    \u200b \u5176\u6b21\uff0c\u6cd5\u76ca\u7ed3\u5408\u6027\u7684\u4f18\u52bf\u3002\"\u7f3a\u4e4f\u88ab\u5bb3\u4eba\u540c\u610f\"\u4e0e\u8bbe\u7acb\u5f3a\u5978\u7f6a\u7684\u6cd5\u76ca\u7d27\u5bc6\u76f8\u8fde\u3002\u540c\u610f\u662f\u4e00\u79cd\u5bf9\u6027\u81ea\u4e3b\u6743\u7684\u6388\u6743\u884c\u4e3a\uff0c\u76f4\u63a5\u4e0e\u8bbe\u7acb\u5f3a\u5978\u7f6a\u7684\u6cd5\u76ca\u76f8\u8054\u7cfb\uff1b\u800c\u201c\u8fdd\u80cc\u5987\u5973\u610f\u5fd7\u201d\u5219\u65e0\u6cd5\u76f4\u63a5\u4e0e\u4fdd\u62a4\u6cd5\u76ca\u76f4\u63a5\u8054\u7cfb\u3002\u56e0\u4e3a\u610f\u5fd7\u662f\u4e00\u79cd\u601d\u60f3\u72b6\u6001\uff0c\u800c\u601d\u60f3\u72b6\u6001\u5fc5\u987b\u901a\u8fc7\u5916\u5728\u8868\u73b0\u624d\u80fd\u8f6c\u5316\u4e3a\u5bf9\u6743\u5229\u7684\u5904\u7f6e\u3002

    \u200b \u7b2c\u4e09\uff0c\u6784\u6210\u8981\u4ef6\u5730\u4f4d\u7684\u4f18\u52bf\u3002\u5728\u6211\u56fd\uff0c\u5927\u591a\u6570\u5b66\u8005\u5c06\u5f3a\u5978\u7f6a\u4e2d\u88ab\u5bb3\u4eba\u7684\u540c\u610f\u89c6\u4e3a\u4e00\u79cd\u8fdd\u6cd5\u963b\u5374\u4e8b\u7531\u6216\u6b63\u5f53\u5316\u4e8b\u7531\u3002\u8fd9\u4f53\u73b0\u4e86\u5728\u6cd5\u5b66\u754c\u5bf9\u4e8e\u6784\u6210\u8981\u4ef6\u5730\u4f4d\u7684\u8ba4\u540c\u548c\u5f3a\u8c03\uff0c\u8fdb\u4e00\u6b65\u5f3a\u8c03\u4e86\u540c\u610f\u4e0e\u5f3a\u5978\u7f6a\u6784\u6210\u4e4b\u95f4\u7684\u7d27\u5bc6\u5173\u7cfb\u3002

    \u200b \u672c\u6848\u4e2d\uff0c\u5982\u679c\u88ab\u5bb3\u4eba\u867d\u7136\u5185\u5fc3\u5e76\u4e0d\u540c\u610f\u8fdb\u884c\u6027\u884c\u4e3a\uff0c\u4f46\u53d7\u5230\u5bf9\u604b\u7231\u5173\u7cfb\u3001\u8ba2\u5a5a\u5173\u7cfb\u7b49\u793e\u4f1a\u5916\u5728\u89c4\u8bad\u56e0\u7d20\u7684\u5f71\u54cd\uff0c\u56e0\u800c\u88ab\u8feb\u4e0e\u5e2d\u67d0\u67d0\u8fdb\u884c\u4e86\u6027\u884c\u4e3a\uff0c\u90a3\u4e48\u5176\u5b9e\u5728\u8fd9\u79cd\u60c5\u5f62\u4e0b\u867d\u8868\u73b0\u4e3a\u5e76\u672a\u8fdd\u53cd\u5987\u5973\u610f\u5fd7\uff0c\u4f46\u5176\u5185\u5fc3\u5b58\u5728\u5fc3\u7406\u5f3a\u5236\u54e6\uff0c\u4ecd\u9700\u8981\u88ab\u5f3a\u5978\u7f6a\u6240\u89c4\u5236\u3002\u4f46\u4e8b\u5b9e\u4e0a\uff0c\u88ab\u5bb3\u4eba\u4ee5\u660e\u786e\u8868\u793a\u4e86\u4e0d\u540c\u610f\uff0c\u901a\u8fc7\u8a00\u8bed\u7684\u62d2\u7edd\u3001\u884c\u4e3a\u7684\u53cd\u6297\u3001\u4e8b\u540e\u7684\u62a5\u8b66\u7b49\uff0c\u8fbe\u5230\u4e86\u6bd4\u201c\u5426\u5b9a\u6027\u540c\u610f\u201d\u8981\u6c42\u66f4\u9ad8\u7684\u201c\u80af\u5b9a\u6027\u540c\u610f\u201d\u6a21\u5f0f\u7684\u8981\u6c42\uff0c\u8db3\u4ee5\u8bf4\u660e\u72af\u7f6a\u4eba\u884c\u4e3a\u8fdd\u80cc\u4e86\u5987\u5973\u610f\u5fd7\uff0c\u4fb5\u5bb3\u4e86\u88ab\u5bb3\u4eba\u5bf9\u6027\u7684\u81ea\u4e3b\u6743\u3002

    \u200b \u5176\u6b21\uff0c\u5728\u72af\u7f6a\u4eba\u5e2d\u67d0\u67d0\u7684\u72af\u7f6a\u4e3b\u89c2\u8ba4\u8bc6\u4e0a\uff0c\u5176\u662f\u5426\u5b58\u5728\u5bf9\u6027\u884c\u4e3a\u4e0e\u5973\u65b9\u88ab\u5bb3\u4eba\u7684\u5dee\u5f02\u6027\u8ba4\u8bc6\u4e5f\u662f\u9700\u8981\u6ce8\u610f\u7684\u3002

    \u200b \u6211\u56fd\u5c06\u5f3a\u5978\u7f6a\u7684\u5b9e\u884c\u72af\u9650\u5b9a\u4e3a\u7537\u6027,\u800c\u57fa\u4e8e\u6027\u522b\u7684\u4e0d\u540c,\u7537\u6027\u4e0e\u5973\u6027\u5bf9\u5f85\u6027\u7684\u8868\u8fbe\u5f80\u5f80\u5b58\u5728\u5dee\u5f02\u3002\u56e0\u6b64,\u6027\u884c\u4e3a\u53d1\u751f\u65f6\u8bef\u4f1a\u5bf9\u65b9\u7684\u771f\u5b9e\u610f\u56fe\u5e76\u4e0d\u7f55\u89c1\u3002\u8fd9\u79cd\u8bef\u4f1a\u7684\u5ba2\u89c2\u5b58\u5728,\u4e5f\u4f7f\u5f3a\u5978\u7f6a\u4e2d\u7684\u8ba4\u8bc6\u9519\u8bef\u95ee\u9898\u6210\u4e3a\u6211\u56fd\u53f8\u6cd5\u5b9e\u8df5\u4e2d\u7684\u7591\u96be\u95ee\u9898\u4e4b\u4e00\u3002

    \u200b \u5728\u4ee5\u201c\u8fdd\u80cc\u5987\u5973\u610f\u5fd7\u201d\u4e3a\u5f3a\u5978\u7f6a\u6838\u5fc3\u7279\u5f81\u7684\u89c2\u70b9\u4e0b\uff0c\u89e3\u51b3\u8fd9\u4e00\u96be\u9898\u6709\u4e24\u79cd\u4e3b\u8981\u65b9\u5f0f\uff1a\u5176\u4e00\uff0c\u662f\u4e0d\u627f\u8ba4\u5f3a\u5978\u7f6a\u4e2d\u5b58\u5728\u884c\u4e3a\u4eba\u8ba4\u8bc6\u9519\u8bef\u7684\u95ee\u9898\u3002\u6309\u7167\u8fd9\u79cd\u65b9\u5f0f\uff0c\u88ab\u544a\u4eba\u8fa9\u89e3\u7684\u8ba4\u8bc6\u9519\u8bef\u88ab\u8ba4\u4e3a\u4e0d\u9700\u8981\u5426\u5b9a\u3002\u7136\u800c\uff0c\u8fd9\u79cd\u65b9\u5f0f\u65e0\u6cd5\u89e3\u91ca\u72af\u7f6a\u5206\u5b50\u4e3b\u89c2\u7f6a\u8fc7\u7684\u57fa\u7840\u662f\u4ec0\u4e48\uff0c\u5b58\u5728\u5ba2\u89c2\u5f52\u7f6a\u4e4b\u5acc\u3002\u5728\u4e00\u4e9b\u6848\u4f8b\u4e2d\uff0c\u751a\u81f3\u5b58\u5728\u88ab\u544a\u4eba\u4e0e\u88ab\u5bb3\u4eba\u8fbe\u6210\u6027\u4ea4\u6613\u7684\u5408\u610f\uff0c\u5230\u8fbe\u5bbe\u9986\u540e\uff0c\u88ab\u544a\u4eba\u540c\u9189\u9152\u4f46\u672a\u5931\u53bb\u610f\u8bc6\u7684\u88ab\u5bb3\u4eba\u53d1\u751f\u4e86\u6027\u884c\u4e3a\uff0c\u5374\u88ab\u8ba4\u5b9a\u4e3a\u6210\u7acb\u5f3a\u5978\u7f6a\u7684\u60c5\u51b5\u3002\u5176\u4e8c\uff0c\u662f\u627f\u8ba4\u5f3a\u5978\u7f6a\u4e2d\u5b58\u5728\u884c\u4e3a\u4eba\u8ba4\u8bc6\u9519\u8bef\u7684\u95ee\u9898\u3002\u6839\u636e\u6211\u56fd\u5211\u6cd5\u5b66\u7406\u8bba\u901a\u8bf4\uff0c\u6b64\u65f6\u9700\u8981\u8003\u5bdf\u8ba4\u8bc6\u9519\u8bef\u7684\u6027\u8d28\u3002\u5728\u4ee5\u201c\u8fdd\u80cc\u5987\u5973\u610f\u5fd7\u201d\u4e3a\u6838\u5fc3\u7279\u5f81\u7684\u89c6\u89d2\u4e0b\uff0c\u884c\u4e3a\u4eba\u5bf9\u4e8e\u8fdd\u80cc\u5987\u5973\u610f\u5fd7\u7684\u8ba4\u8bc6\u9519\u8bef\u5c5e\u4e8e\u4e8b\u5b9e\u8ba4\u8bc6\u9519\u8bef\u3002\u9274\u4e8e\u5f3a\u5978\u7f6a\u65e0\u8fc7\u5931\u5f62\u6001\uff0c\u5bf9\u4e8e\u8fd9\u79cd\u8ba4\u8bc6\u9519\u8bef\u53ea\u80fd\u505a\u51fa\u65e0\u7f6a\u5904\u7406\u3002\u7136\u800c\uff0c\u8fd9\u5bf9\u4e8e\u88ab\u5bb3\u4eba\u800c\u8a00\u663e\u7136\u6709\u5931\u516c\u5e73\uff0c\u5e76\u4e14\u5bb9\u6613\u653e\u7eb5\u72af\u7f6a\u5206\u5b50\u3002\u8fd9\u4e00\u65b9\u5f0f\u5e26\u6765\u7684\u95ee\u9898\u662f\u5982\u4f55\u5728\u6cd5\u5f8b\u4f53\u7cfb\u4e2d\u5e73\u8861\u8ba4\u8bc6\u9519\u8bef\u7684\u4e8b\u5b9e\u548c\u5bf9\u88ab\u5bb3\u4eba\u6743\u76ca\u7684\u4fdd\u62a4\uff0c\u9700\u8981\u66f4\u4e3a\u6df1\u5165\u7684\u601d\u8003\u548c\u7ec6\u81f4\u7684\u6743\u8861\u3002

    \u200b \u5728\u672c\u6848\u4e2d\uff0c\u72af\u7f6a\u4eba\u4e0e\u88ab\u5bb3\u4eba\u4e4b\u95f4\u7684\u604b\u7231\u5173\u7cfb\u3001\u8ba2\u5a5a\u5173\u7cfb\u53ef\u80fd\u5bfc\u81f4\u72af\u7f6a\u4eba\u5bf9\u4e8e\u6027\u884c\u4e3a\u7684\u6027\u8d28\u4ea7\u751f\u4e86\u9519\u8bef\u8ba4\u8bc6\uff0c\u4f7f\u5176\u8bef\u4ee5\u4e3a\u4e0e\u88ab\u5bb3\u4eba\u7684\u6027\u884c\u4e3a\u5e76\u4e0d\u6784\u6210\u5f3a\u5978\u3002\u8fd9\u79cd\u8ba4\u8bc6\u9519\u8bef\u6d89\u53ca\u5230\u5bf9\u6027\u884c\u4e3a\u7684\u4e0d\u6b63\u786e\u7406\u89e3\uff0c\u53ef\u80fd\u5c06\u88ab\u5bb3\u4eba\u7684\u53cd\u6297\u89e3\u91ca\u4e3a\u5bf9\u6027\u884c\u4e3a\u7684\u8bef\u89e3\u3002\u7136\u800c\uff0c\u8fd9\u79cd\u9519\u8bef\u8ba4\u8bc6\u65e2\u662f\u5bf9\u5973\u6027\u7684\u6b67\u89c6\uff0c\u4e5f\u662f\u5bf9\u5f3a\u5978\u7f6a\u88ab\u5bb3\u4eba\u7684\u4e8c\u6b21\u4f24\u5bb3\u3002\u7136\u800c\uff0c\u82e5\u4ece\u201c\u7f3a\u4e4f\u88ab\u5bb3\u4eba\u540c\u610f\u201d\u7684\u6838\u5fc3\u7279\u5f81\u51fa\u53d1\u8fdb\u884c\u5ba1\u89c6\uff0c\u4f1a\u53d1\u73b0\u4e0a\u8ff0\u8ba4\u8bc6\u9519\u8bef\u5728\u6cd5\u5f8b\u4e0a\u5c06\u5f97\u5230\u5408\u7406\u89e3\u51b3\u3002\u88ab\u5bb3\u4eba\u7684\u540c\u610f\u662f\u4e00\u79cd\u6cd5\u5b9a\u7684\u6388\u6743\u884c\u4e3a\uff0c\u5177\u6709\u9c9c\u660e\u7684\u89c4\u8303\u5316\u5c5e\u6027\u3002\u6b63\u5982\u884c\u4e3a\u4eba\u4e0d\u80fd\u5728\u62ff\u8d70\u719f\u7761\u88ab\u5bb3\u4eba\u7684\u8d22\u7269\u540e\u5ba3\u79f0\u81ea\u5df1\u672a\u7ecf\u540c\u610f\u62ff\u8d70\u88ab\u5bb3\u4eba\u7684\u8d22\u7269\u662f\u4e8b\u5b9e\u8ba4\u8bc6\u9519\u8bef\u4e00\u6837\uff0c\u5bf9\u4e8e\u6027\u81ea\u4e3b\u6743\u7684\u9519\u8bef\u8ba4\u8bc6\u4e5f\u5e94\u88ab\u89c6\u4e3a\u6cd5\u5f8b\u8ba4\u8bc6\u9519\u8bef\uff0c\u4e0d\u80fd\u6210\u4e3a\u5408\u7406\u7684\u8fa9\u62a4\u7406\u7531\u3002\u65e0\u8bba\u72af\u7f6a\u4eba\u5e2d\u67d0\u67d0\u7684\u9519\u8bef\u8ba4\u8bc6\u6765\u6e90\u4e8e\u4f55\u79cd\u539f\u56e0\uff0c\u5728\u7f3a\u4e4f\u88ab\u5bb3\u4eba\u540c\u610f\u7684\u60c5\u51b5\u4e0b\u5f3a\u884c\u53d1\u751f\u6027\u5173\u7cfb\uff0c\u90fd\u5e94\u5f53\u53d7\u5230\u5f3a\u5978\u7f6a\u7684\u6cd5\u5f8b\u89c4\u5236\u3002\u5728\u6cd5\u5f8b\u7684\u6846\u67b6\u4e0b\uff0c\u5f3a\u5978\u7f6a\u5bf9\u4e8e\u7f3a\u4e4f\u540c\u610f\u7684\u6027\u884c\u4e3a\u5177\u6709\u660e\u786e\u7684\u89c4\u5236\u548c\u5236\u7ea6\uff0c\u4ee5\u4fdd\u62a4\u88ab\u5bb3\u4eba\u7684\u6027\u81ea\u4e3b\u6743\u3002

    "},{"location":"NA/Chap6/1/#_5","title":"\u4e94\u3001\u601d\u8003\u89d2\u5ea6\u5ef6\u4f38","text":""},{"location":"NA/Chap6/1/#_6","title":"\u793e\u4f1a\u6587\u5316\u548c\u6cd5\u5f8b\u4e4b\u95f4\u7684\u51b2\u7a81","text":"

    \u200b \u5728\u6848\u4ef6\u4e2d\u63d0\u5230\u4e86\u8ba2\u5a5a\u5173\u7cfb\uff0c\u8fd9\u7275\u6d89\u5230\u793e\u4f1a\u6587\u5316\u548c\u6cd5\u5f8b\u4e4b\u95f4\u7684\u51b2\u7a81\u3002\u5728\u67d0\u4e9b\u5730\u533a\uff0c\u8ba2\u5a5a\u53ef\u80fd\u88ab\u89c6\u4e3a\u4e00\u79cd\u6cd5\u5f8b\u4e0a\u7684\u627f\u8bfa\uff0c\u4f46\u6839\u636e\u73b0\u884c\u6cd5\u5f8b\u89c4\u5b9a\uff0c\u5408\u6cd5\u7684\u5a5a\u59fb\u5e94\u5f53\u4ee5\u7ed3\u5a5a\u767b\u8bb0\u4e3a\u51c6\u3002\u8fd9\u79cd\u6587\u5316\u548c\u6cd5\u5f8b\u7684\u5dee\u5f02\u53ef\u80fd\u5bfc\u81f4\u72af\u7f6a\u4eba\u5bf9\u884c\u4e3a\u7684\u9519\u8bef\u8ba4\u8bc6\u3002\u53ef\u4ee5\u8fdb\u4e00\u6b65\u5206\u6790\u793e\u4f1a\u6587\u5316\u5bf9\u6cd5\u5f8b\u8ba4\u77e5\u7684\u5f71\u54cd\uff0c\u4ee5\u53ca\u5982\u4f55\u5728\u6cd5\u5f8b\u5236\u5ea6\u4e2d\u89e3\u51b3\u8fd9\u79cd\u51b2\u7a81\u3002

    "},{"location":"NA/Chap6/1/#_7","title":"\u4e3b\u89c2\u8ba4\u8bc6\u4e0e\u6cd5\u5f8b\u6559\u80b2\u7684\u5173\u7cfb","text":"

    \u200b \u6848\u4ef6\u4e2d\u63d0\u5230\u72af\u7f6a\u4eba\u53ef\u80fd\u56e0\u4e3a\u604b\u7231\u5173\u7cfb\u548c\u8ba2\u5a5a\u5173\u7cfb\u800c\u4ea7\u751f\u9519\u8bef\u8ba4\u8bc6\u3002\u8fd9\u6d89\u53ca\u5230\u5bf9\u6027\u884c\u4e3a\u3001\u540c\u610f\u548c\u5f3a\u5978\u7f6a\u7684\u6cd5\u5f8b\u6559\u80b2\u3002\u53ef\u4ee5\u8003\u8651\u5206\u6790\u793e\u4f1a\u5bf9\u6027\u6559\u80b2\u7684\u666e\u53ca\u7a0b\u5ea6\uff0c\u4ee5\u53ca\u6cd5\u5f8b\u5bf9\u516c\u6c11\u7684\u6cd5\u5f8b\u6559\u80b2\u63aa\u65bd\u3002\u63d0\u9ad8\u516c\u4f17\u5bf9\u6027\u884c\u4e3a\u6cd5\u5f8b\u89c4\u5b9a\u7684\u8ba4\u77e5\u5ea6\uff0c\u6709\u52a9\u4e8e\u51cf\u5c11\u56e0\u4e3a\u8bef\u89e3\u800c\u5bfc\u81f4\u7684\u72af\u7f6a\u884c\u4e3a\u3002

    "},{"location":"NA/Chap6/1/#_8","title":"\u6cd5\u5f8b\u5bf9\u5f3a\u5978\u7f6a\u8ba4\u5b9a\u6807\u51c6\u7684\u8ba8\u8bba","text":"

    \u200b \u5728\u672c\u6848\u4e2d\uff0c\u5f3a\u5978\u7f6a\u7684\u8ba4\u5b9a\u56f4\u7ed5\u7740\u662f\u5426\u201c\u8fdd\u80cc\u5987\u5973\u610f\u5fd7\u201d\u5c55\u5f00\u3002\u53ef\u4ee5\u5bf9\u6cd5\u5f8b\u5bf9\u4e8e\u5f3a\u5978\u7f6a\u8ba4\u5b9a\u6807\u51c6\u7684\u5408\u7406\u6027\u8fdb\u884c\u8ba8\u8bba\u3002\u662f\u5426\u5e94\u8be5\u8fdb\u4e00\u6b65\u660e\u786e\u6cd5\u5f8b\u4e2d\u540c\u610f\u548c\u8fdd\u80cc\u610f\u613f\u7684\u6807\u51c6\uff0c\u4ee5\u53ca\u5982\u4f55\u786e\u4fdd\u6cd5\u5f8b\u5bf9\u4e8e\u88ab\u5bb3\u4eba\u6743\u76ca\u7684\u6700\u5927\u4fdd\u62a4\u3002

    "},{"location":"NA/Chap6/1/#_9","title":"\u5bf9\u88ab\u5bb3\u4eba\u7684\u652f\u6301\u548c\u4fdd\u62a4\u673a\u5236","text":"

    \u200b \u5728\u6848\u4ef6\u4e2d\uff0c\u88ab\u5bb3\u4eba\u7ecf\u5386\u4e86\u8eab\u4f53\u4e0a\u548c\u5fc3\u7406\u4e0a\u7684\u53cc\u91cd\u4f24\u5bb3\u3002\u53ef\u4ee5\u8fdb\u4e00\u6b65\u8ba8\u8bba\u793e\u4f1a\u5bf9\u4e8e\u5f3a\u5978\u7f6a\u53d7\u5bb3\u8005\u7684\u652f\u6301\u548c\u4fdd\u62a4\u673a\u5236\uff0c\u5305\u62ec\u5fc3\u7406\u54a8\u8be2\u3001\u6cd5\u5f8b\u63f4\u52a9\u7b49\u65b9\u9762\u7684\u63aa\u65bd\u3002\u5982\u4f55\u63d0\u9ad8\u793e\u4f1a\u5bf9\u4e8e\u6027\u72af\u7f6a\u53d7\u5bb3\u8005\u7684\u5173\u6ce8\u5ea6\uff0c\u4ee5\u53ca\u5b8c\u5584\u76f8\u5173\u4fdd\u62a4\u673a\u5236\u662f\u503c\u5f97\u6df1\u5165\u601d\u8003\u7684\u95ee\u9898\u3002

    \u200b \u8fd9\u4e9b\u8865\u5145\u5206\u6790\u53ef\u4ee5\u4ece\u4e0d\u540c\u7ef4\u5ea6\u62d3\u5c55\u5bf9\u6848\u4ef6\u7684\u7406\u89e3\uff0c\u6df1\u5165\u63a2\u8ba8\u6cd5\u5f8b\u3001\u6587\u5316\u3001\u6559\u80b2\u7b49\u65b9\u9762\u7684\u5173\u7cfb\uff0c\u4e3a\u6848\u4ef6\u7684\u5168\u9762\u5206\u6790\u63d0\u4f9b\u66f4\u591a\u89d2\u5ea6\u3002

    "},{"location":"NA/Chap6/Chap6/","title":"Direct Methods for Solving Linear Systems","text":""},{"location":"NA/Chap6/Chap6/#pivoting-strategies","title":"Pivoting Strategies","text":"
    • Small pivot element may cause trouble.
    • Partial Pivoting (or maximal column pivoting)

    Place the element in the pivot position that is largest relative to the entries in its row.

    • Step 1: define a scale factor \\(s_i\\) for each row as \\(s_i=max_{1\\le j\\le n}|a_{ij}|\\)

    • Step 2:Determine the smallest \\(p\\ge k\\) such that \\(\\frac{|a_{pk}^{(k)}|}{s_p}=max_{k\\le i\\le n}\\frac{|a_{ik}^{(k)}|}{s_i}\\) (If already at the kth row)

    "},{"location":"NA/Chap6/Chap6/#lu-factorization","title":"LU Factorization","text":"
    • With forward substituion and then backward substitution easily solve the equation.
    "},{"location":"NA/Chap6/Chap6/#special-types-of-matrices","title":"Special Types of Matrices","text":"
    • A strictly diagonally dominant matrix A is nonsingular. Moreover, Gaussian elimination can be performed without row or column interchanges, and the computations will be stable with respect to the growth of roundoff errors.

    • A matrix A is positive definite if it is symmetric and if \\(\\vec{x^t}A\\vec{x}\\) > 0 for every n-dimensional vector\\(\\vec{x}\\ne 0\\).

    • Also \\(A^{-1}\\) is positive definite as well and \\(a_{ii}>0\\)
    • \\(max|a_{ij}|\\le max|a_{kk}|;(a_{ij}^2)<a_{ii}a_{jj}\\)
    • Each of A\u2019s leading principal submatrices Ak has a positive determinant.
    "},{"location":"NA/Chap6/Chap6/#lu-factorization-of-a-positive-definite-a","title":"LU factorization of a positive definite A","text":""},{"location":"NA/Chap6/Chap6/#crount-reduction-for-tridiagonal-linear-system","title":"Crount Reduction For Tridiagonal Linear System","text":""},{"location":"NA/Chap7/Chap7/","title":"Chapter 7","text":""},{"location":"NA/Chap7/Chap7/#vector-norms","title":"Vector Norms","text":""},{"location":"NA/Chap7/Chap7/#properties","title":"Properties","text":"
    • \\(||\\vec{x}||\\ge 0\\) (\\(||\\vec{x}||=0 \\Leftrightarrow \\vec{x}=0\\))
    • \\(||\\alpha \\vec{x}||=|\\alpha|\u00b7||\\vec{x}||\\)
    • \\(||\\vec{x}+\\vec{y}||\\le ||\\vec{x}||+||\\vec{y}||\\)

    Matrix Norms

    "},{"location":"NA/Chap7/Chap7/#eigenvalues-and-eigenvectors","title":"Eigenvalues and Eigenvectors","text":""},{"location":"NA/Chap8/Chap8/","title":"Chap8","text":"

    a

    "},{"location":"PT/PT/","title":"Probability Theory","text":""},{"location":"PT/PT/#_1","title":"\u968f\u673a\u53d8\u91cf\u4e0e\u5206\u5e03\u51fd\u6570","text":""},{"location":"PT/PT/#_2","title":"\u968f\u673a\u53d8\u91cf","text":""},{"location":"PT/PT/#_3","title":"\u5206\u5e03\u51fd\u6570","text":"

    \\(F (x) = P (\u03be \u2a7d x), \u2212\u221e < x < +\u221e\\)

    • Properties

    (1) \\(a < b, F (a) \u2a7d F (b)\\)

    (2). \\(lim_{x\\rightarrow-\\infty} F(x)=0\\\\ lim_{x\\rightarrow +\\infty} F(x)=1\\)

    (3) \\(\u2203F(x\u22120)= lim_{h\u21920+}F(x\u2212h)\\) -- \u5904\u5904\u5de6\u6781\u9650\u5b58\u5728 \\(F(x+0)= lim_{h\u21920+} F(x+h)=F(x)\\) -- \u53f3\u8fde\u7eed

    \u6ce8\u610f\uff0c\u5982\u679c\u4fee\u6539\u5206\u5e03\u51fd\u6570\u5b9a\u4e49\u4e3a\\(F (x) = P (\u03be < x), \u2212\u221e < x < +\u221e\\)\u90a3\u4e48 (3) \u5e94\u8be5\u4fee\u6539\u4e3a\u5904\u5904\u53f3\u6781\u9650\u5b58\u5728\uff0c\u5de6\u8fde\u7eed\u3002

    "},{"location":"PT/PT/#_4","title":"\u5bc6\u5ea6\u51fd\u6570","text":"

    \u82e5\u968f\u673a\u53d8\u91cf\\(\\epsilon\\)\u53ef\u53d6\u67d0\u4e2a\u533a\u95f4\u4e2d\u7684\u4e00\u5207\u503c\uff0c\u5e76\u4e14\u5b58\u5728\u67d0\u4e2a\u975e\u8d1f\u7684\u53ef\u79ef\u51fd\u6570\\(p(x)\\) , \u4f7f\u5206\u5e03\u51fd\u6570\\(F(x)\\)\u6ee1\u8db3\\(F(x)=\\int_{-\\infty}^xp(y)dy\\) \u5219\u79f0\\(\\epsilon\\) \u4e3a\u8fde\u7eed\u6027\u968f\u673a\u53d8\u91cf\uff0c\u79f0p(x)\u4e3a\\(\\epsilon\\)\u7684\u6982\u7387\u5bc6\u5ea6\u51fd\u6570

    • \\(F'(x)=p(x)\\)
    • \\(P(a\\le\\epsilon \\le b)=F(b)-F(a)=\\int_a^b p(y)dy\\)
    • \\(p(x)\\ge 0\\)
    • \\(\\int_{-\\infty}^{+\\infty} p(x)=1\\)
    "},{"location":"PT/PT/#_5","title":"\u968f\u673a\u5411\u91cf","text":"

    1.\u5206\u5e03\u51fd\u6570

    2.\u5bc6\u5ea6\u51fd\u6570

    • Properties

    \uff081\uff09\u57fa\u672c\u540c\u968f\u673a\u53d8\u91cf\u7684\u60c5\u51b5

    \uff082\uff09\\(\\frac{\\partial^nF(x_1,x_2,\u2026\u2026,X_n)}{\\partial x_1\u2026\u2026\\partial x_n}=p(x_1,x_2,\u2026\u2026,x_n)\\)

    3.\u8fb9\u9645\u5bc6\u5ea6

    "},{"location":"PT/PT/#_6","title":"\u72ec\u7acb\u6027","text":"

    \u5bf9\u4e8e\u79bb\u6563\u578b\u968f\u673a\u53d8\u91cf\uff0c\u7528\u5206\u5e03\u51fd\u6570\u5b9a\u4e49\u7684\u968f\u673a\u53d8\u91cf\u7684\u72ec\u7acb\u6027\u6761\u4ef6\\(F(x,y) = F_\u03be(x)F_\u03b7(y)\\) \u53ef\u4ee5\u901a\u8fc7\u6570\u5b66\u5f52\u7eb3\u63a8\u51fa\u5176\u7279\u6709\u72ec\u7acb\u6027\u6761\u4ef6\\(p_{ij} = p_i\u00b7 p_j\\) \u540c\u7406\uff0c\u5f88\u65b9\u4fbf\u5730\u53ef\u4ee5\u7528\u540e\u8005\u53cd\u63a8\u51fa\u524d\u8005\u3002\u56e0\u6b64\u5728\u79bb\u6563\u578b\u968f\u673a\u53d8\u91cf\u4e2d\uff0c\u8fd9\u4e24\u79cd\u5b9a\u4e49\u662f\u7b49\u4ef7\u7684

    \u8bbe \\(p(x, y)\\)\u4e0e \\(p_\u03be (x), p_\u03b7 (y)\\) \u5206\u522b\u4e3a\u8fde\u7eed\u578b\u968f\u673a\u5411\u91cf \\((\u03be, \u03b7)\\)\u7684\u8054\u5408\u5bc6\u5ea6\u548c\u8fb9\u9645\u5bc6\u5ea6, \u5219 \\(\u03be, \u03b7\\)\u76f8\u4e92\u72ec\u7acb\u7684\u5145\u8981\u6761\u4ef6\u662f\\(p(x, y) = p_\u03be (x)p_\u03b7 (y)\\)

    "},{"location":"PT/PT/#_7","title":"\u6761\u4ef6\u5206\u5e03","text":"
    • \u79bb\u6563\u578b

    • \u8fde\u7eed\u578b

    \u6761\u4ef6\u5206\u5e03\u51fd\u6570 \\(P(\\eta \\le y | \\epsilon =x)=\\int_{-\\infty}^{y}\\frac{p(x,v)}{p_\\epsilon(x)}dv\\)

    \u6761\u4ef6\u5bc6\u5ea6\u51fd\u6570 \\(p_{\\eta | \\epsilon}(y|x)=\\frac{p(x,y)}{p_\\epsilon(x)}\\)

    • \u7ed9\u5b9a\u968f\u673a\u53d8\u91cf\u4e0b\u7684\u6761\u4ef6\u6982\u7387

    \\(P(A)=P(A,-\\infty<x<+\\infty)=\\int_{-\\infty}^{+\\infty} P(A|X=x)p_X(x)dx=\\int_{-\\infty}^{+\\infty}g(x)P_X(x)dx\\)

    BOOK p79 2.24

    "},{"location":"PT/PT/#_8","title":"\u968f\u673a\u53d8\u91cf\u7684\u51fd\u6570\u53ca\u5176\u5206\u5e03","text":"
    • \u79bb\u6563\u5377\u79ef
    • \u4e00\u7ef4\u8fde\u7eed\u578b\u968f\u673a\u53d8\u91cf\u51fd\u6570\u7684\u5206\u5e03

    Therom 1

    \u5047\u8bbef(x)\u4e25\u683c\u5355\u8c03\uff0c\u53cd\u51fd\u6570\u6709\u8fde\u7eed\u5bfc\u6570\uff0c\u5219\\(\\eta = f(\\epsilon)\\)\u4e5f\u662f\u8fde\u7eed\u6027\u968f\u673a\u53d8\u91cf\uff0c\u5176\u5bc6\u5ea6\u51fd\u6570\u4e3a

    \\(g(y)=\\left\\{\\begin{array}{**lr**}p(f^{-1}(y)|f^{-1}|(y))'| y\\in f(x)\u7684\u503c\u57df\\\\0\\ \\ \\ \\ \u5176\u4ed6\\end{array}\\right.\\)

    note \u5728\u4e0d\u91cd\u53e0\u7684\u533a\u95f4\u4e0a\u9010\u6bb5\u4e25\u683c\u5355\u8c03\uff0c\u5404\u6bb5\u7684\u53cd\u51fd\u6570\u90fd\u6709\u8fde\u7eed\u5012\u6570

    \\(g(y)=\\left\\{\\begin{array}{**lr**}\\sum p(h_i(y)|h'_i|(y)|) y\\in \u5404h_i(y)\u7684\u5b9a\u4e49\u57df\\\\0\\ \\ \\ \\ \u5176\u4ed6\\end{array}\\right.\\)

    Therom 2

    \u8bbe\\(\\epsilon\\) \u6709\u8fde\u7eed\u7684\u5206\u5e03\u51fd\u6570\\(F(x)\\),\u6c42\\(\\theta=F(\\epsilon)\\)\u7684\u5206\u5e03 \\(P_{\\theta}(y)=y\\) \u670d\u4ece[0,1]\u4e0a\u7684\u5747\u5300\u5206\u5e03

    Therom 3

    \u82e5 \\(\\theta\\) \u670d\u4ece[0,1]\u4e0a\u7684\u5747\u5300\u5206\u5e03,F(x)\u6ee1\u8db3\u5206\u5e03\u51fd\u6570\u7684\u4e09\u4e2a\u6027\u8d28\uff0c\\(\\epsilon=F^{-1}(\\theta)\\) \u5219 \\(P_{\\epsilon}(x)=F(x)\\)

    • \u968f\u673a\u5411\u91cf\u51fd\u6570\u7684\u5206\u5e03\u5f8b

    Therom 1\u5377\u79ef\u516c\u5f0f

    Therom 2 \u82e5\\((\\epsilon_1 \\epsilon_2)\\)\u662f\u8fde\u7eed\u6027\u968f\u673a\u5411\u91cf\uff0c\u5219\\(\\eta=\\frac{\\epsilon_1}{\\epsilon_2}\\)\u662f\u8fde\u7eed\u578b\u968f\u673a\u53d8\u91cf\uff0c\u5176\u5bc6\u5ea6\u51fd\u6570\u4e3a

    \\(p_{\\eta}(z)=\\int_{-\\infty}^{+\\infty}p(zx,x)|x|dx\\)

    \\(F_{\\eta}(y)=\\int_{-\\infty}^yp_{\\eta}(z)dz\\)

    \u6b21\u5e8f\u7edf\u8ba1\u8ba1\u91cf\u5206\u5e03

    • \u968f\u673a\u5411\u91cf\u7684\u53d8\u6362

    P89-93

    \u8bbe\u968f\u673a\u53d8\u91cfX\u548cY\u76f8\u4e92\u72ec\u7acb\uff0c\u5e76\u4e14Z\u4ec5\u662fX\u7684\u51fd\u6570\uff0cW\u4ec5\u662fY\u7684\u51fd\u6570\uff1bZ=g(X) W=h(Y) \u5176\u4e2dg\u548ch\u90fd\u662f\u6ce2\u96f7\u5c14\u53ef\u6d4b\u51fd\u6570\uff0c\u90a3\u4e48Z\u548cW\u4f9d\u65e7\u72ec\u7acb

    "},{"location":"PT/PT/#_9","title":"\u5e38\u89c1\u79bb\u6563\u578b\u968f\u673a\u53d8\u91cf\u5206\u5e03","text":"

    1.\u9000\u5316\u5206\u5e03 \\(P(\\epsilon = c)=1\\)

    2.\u4e24\u70b9\u5206\u5e03 \\(\\begin{bmatrix}x1&x2\\\\p&q\\end{bmatrix}\\) \\(p+q=1 p,q>0\\)

    3.\u5e15\u65af\u5361\u5206\u5e03 \\(P(\\epsilon=k)=\\begin{pmatrix}k-1\\\\r-1\\end{pmatrix}p^rq^{k-r}\\)

    4.\u4e8c\u9879\u5206\u5e03

    • \\(b(k,n,p)=b(n-k,n,1-p)\\)
    • \\(\\frac{b(k,n,p)}{b(k-1,n,p)}=1+\\frac{(n+1)p-k}{kq}\\)
    • \\((n+1)p\\)\u662f\u6574\u6570 \uff1a \\((n+1)p \\ (n+1)p-1\\) \u4e3a\u6700\u6709\u53ef\u80fd\u7684\u6210\u529f\u6b21\u6570
    • \\((n+1)p\\)\u662f\u4e0d\u6574\u6570\uff1a \\(k=[(n+1)p]\\) \u6700\u6709\u53ef\u80fd\u7684\u6210\u529f\u6b21\u6570 \\([x]\\)\u8868\u793a\\(x\\)\u6700\u5927\u6574\u6570\u90e8\u5206
    • \u9012\u63a8\u516c\u5f0f \\(P(\\epsilon=k+1)=\\frac{p(n-k)}{(k+1)q}P(\\epsilon=k)\\)
    • \\(n \\rightarrow +\\infty\\) \u300c\u6cca\u677e\u5b9a\u7406\u300d

    \u82e5\u5b58\u5728\u6b63\u5e38\u6570\\(\\lambda\\) \u5f53\\(n \\rightarrow+\\infty\\)\u65f6\uff0c\u6709\\(bp_n \\rightarrow +\\lambda\\) ,\u5219

    \\(lim_{n \\rightarrow+\\infty} b(k,n,p)=\\frac{\\lambda^k}{k!}e^{-\\lambda}\\)

    \u901a\u5e38\uff0cn\u4e0ep\u65e0\u5173\uff0c\u4f46\u662fn\u5f88\u5927\uff0cp\u5f88\u5c0f\uff0cnp\u4e0d\u662f\u5f88\u5927\u7684\u65f6\u5019\uff0c\u53ef\u8fd1\u4f3c\u5730\u53d6\\(\\lambda=np\\)

    • \u5fb7\u83ab\u4f5b-\u62c9\u666e\u62c9\u65af\u5b9a\u7406 \\(npq \\rightarrow +\\infty\\)

    \\(P(\\epsilon_n=j)\\approx \\frac{1}{\\sqrt{2\\pi npq}}e^{-x^2/2} \\ \\ x=\\frac{j-np}{\\sqrt{npq}}\\)

    4.\u6cca\u677e\u5206\u5e03

    \\(P(\\epsilon=k)=\\frac{\\lambda^k}{k!}e^{-\\lambda}\\)

    5.\u51e0\u4f55\u5206\u5e03\u300c\u65e0\u8bb0\u5fc6\u6027\u300d

    \\(P(\\epsilon=k)=pq^{k-1}\\)

    6.\u8d85\u51e0\u4f55\u5206\u5e03

    • \\(P(\\epsilon=k)=\\frac{ \\begin{pmatrix}M\\\\k\\end{pmatrix} \\begin{pmatrix}N-M\\\\n-k\\end{pmatrix}}{\\begin{pmatrix}N\\\\n\\end{pmatrix}}\\) \\(k=0,1,2,\u2026\u2026\uff0cmin(n,M)\\)
    • \\(N\\rightarrow +\\infty\\ \\frac{M}{N}\\rightarrow p\\), \u8d85\u51e0\u4f55\u5206\u5e03\u53ef\u4ee5\u7528\u4e8c\u9879\u5206\u5e03\u8fd1\u4f3c\u8ba1\u7b97

    \u300c\u4fee\u6b63\uff1aM+N-n \u6709\u5927\u5c0f\u5199\u9519\u8bef\u300d

    "},{"location":"PT/PT/#_10","title":"\u5e38\u89c1\u8fde\u7eed\u578b\u968f\u673a\u53d8\u91cf\u5206\u5e03","text":"

    1.\u5747\u5300\u5206\u5e03

    2.\u6b63\u6001\u5206\u5e03

    • BASIC \\(p(x)=\\frac{1}{\\sqrt{2\\pi}\\sigma}e^{-\\frac{(x-a)^2}{2\\sigma^2}}\\)

    \\(Proof\\)

    \\(\\begin{align*}(\\frac{1}{\\sqrt{2\\pi}\\sigma}\\int_{-\\infty}^{+\\infty} e^{-\\frac{(t-a)^2}{2\\sigma^2}}dt)^2 &= (\\frac{1}{\\sqrt{2\\pi}}\\int_{-\\infty}^{+\\infty} e^{-\\frac{t^2}{2}}dt)^2\\\\&=\\frac{1}{2\\pi}\\int_{-\\infty}^{+\\infty} \\int_{-\\infty}^{+\\infty} e^{\\frac{t^2+s^2}{2}}dtds\\\\ &=\\frac{1}{2\\pi} \\int_{0}^{2\\pi}d\\theta\\int_{0}^{+\\infty} re^{-\\frac{r^2}{2}}dr\\\\ &=1\\end{align*}\\)

    • \\(a=0\\ \\sigma=1\\) \u6807\u51c6\u6b63\u6001\u5206\u5e03 \\(\\Phi(x)=\\frac{1}{\\sqrt{2\\pi}}e^{-\\frac{x^2}{2}}\\)
    • \\(\\Phi(-x)=1-\\Phi(x)\\)

    2.2 n\u7ef4\u6b63\u6001\u5206\u5e03

    \u8bbe \\(B = (b_{ij} )\\) \u4e3a n \u7ef4\u6b63\u5b9a\u5bf9\u79f0\u77e9\u9635, \\(|B|\\) \u4e3a\u5176\u884c\u5217\u5f0f, \\(B^{\u22121}\\) \u4e3a\u5176\u9006,

    \u53c8\u8bbe \\(x = (x1, x2, \u00b7 \u00b7 \u00b7 , xn)^T\\) , \\(a = (a1, a2, \u00b7 \u00b7 \u00b7 , an)^T\\) , \u5219\u79f0

    \\(p(\\vec{x})=\\frac{1}{(2\\pi)^{n/2}|B|^{1/2}} exp(-\\frac{1}{2}(x-a)^TB^{-1}(x-a))\\) \u4e3an\u7ef4\u6b63\u6001\u5bc6\u5ea6\u51fd\u6570

    2.3 \u4e8c\u7ef4\u7684\u60c5\u51b5

    \\(B=\\begin{pmatrix}\\sigma_1^2 & r\\sigma_1\\sigma_2\\\\ r\\sigma_1\\sigma_2&\\sigma_2^2\\end{pmatrix}. B^{-1}=\\begin{pmatrix}\\sigma_2^2 & -r\\sigma_1\\sigma_2\\\\ -r\\sigma_1\\sigma_2&\\sigma_1^2\\end{pmatrix}\\)

    \\(p(x,y)=\\frac{1}{2\\pi\\sigma_1\\sigma_2\\sqrt{1-r^2}}exp(-\\frac{1}{2(1-r^2)}\\times[\\frac{(x-a)^2}{\\sigma_1^2} - \\frac{2r(x-a)(y-b)}{\\sigma_1\\sigma_2} + \\frac{(y-b)^2}{\\sigma_2^2}])\\)

    \u7b80\u8bb0\u4f5c \\((\\epsilon,\\eta)\\) ~ \\(N(a,b,\\sigma_1^2,\\sigma_2^2,r)\\)

    • \u4e8c\u5143\u6b63\u6001\u5206\u5e03\u7684\u8fb9\u9645\u51fd\u6570\u4ecd\u662f\u6b63\u6001\u5206\u5e03 \\(\\eta\\)~\\(N(b,\\sigma_2^2)\\) [\u53cd\u8fc7\u6765\u5219\u4e0d\u4e00\u5b9a]
    • \\(\\epsilon\\ \\ \\eta\\) \u72ec\u7acb \u7b49\u4ef7\u4e8e \\(r=0\\)

    2.4 \u6761\u4ef6\u5206\u5e03

    2.5 \u6b63\u6001\u5206\u5e03\u7684\u51fd\u6570

    • \\(\\epsilon\\) ~ \\(N(0,\\sigma^2) \\ \\eta = k\\epsilon+b\\ \\eta\\)~ \\(N(ka+b,k^2\\sigma^2)\\)
    • \\(\\epsilon\\)~ \\(N(a_1,\\sigma_1^2)\\) \\(\\eta\\)~\\(N(a_2,\\sigma_2^2)\\) \\(\\eta + \\epsilon\\)~\\(N(a_1+a_2,\\sigma_1^2+\\sigma_2^2)\\)

    • \\(\\epsilon\\) ~ \\(N(0,\\ 1) \\ \\eta = \\epsilon^2\\)

    • \u82e5\\((X,Y)\\)~\\(N(\\mu_1,\\mu_2,\\sigma_1^2,\\sigma_2^2,r)\\) \u5219 \\(C_1X+C_2Y\\)~\\(N(C_1\\mu_1+C_2\\mu_2,C_1^2\\sigma_1^2+C_2^2\\sigma_2^2+2C_1C_2r\\sigma_1\\sigma_2)\\)

    2.6 \u591a\u7ef4\u6b63\u6001\u5206\u5e03 P93

    \\(\\vec{\\eta}=C\\vec{\\epsilon}+a\\) \u5219 \\(\\vec{\\eta}\\) ~ \\(N(C\\vec{\\mu}+a,C\\Sigma C^T)\\)

    3.\u6307\u6570\u5206\u5e03

    \\(p(x)=\\left\\{\\begin{array}{**lr**}\\lambda e^{-\\lambda x}\\ x\\ge 0 \\\\0 \\ \\ \\ \\ \\ \\ \\ \\ \\ x < 0\\end{array}\\right.\\)

    \\(F(x)=\\left\\{\\begin{array}{**lr**}1-e^{-\\lambda x}\\ x\\ge 0 \\\\0 \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ \\ x < 0\\end{array}\\right.\\)

    • \u65e0\u8bb0\u5fc6\u6027 \uff1a \\(P(\\epsilon > s+t | \\epsilon > s)=P(\\epsilon > t)\\)

    4.T\u5206\u5e03

    5.\u5a01\u5e03\u5c14\u5206\u5e03

    6.\u5e15\u7d2f\u6258\u5206\u5e03

    7.\\(\\beta\\)\u5206\u5e03

    8.\u67ef\u897f\u5206\u5e03

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/","title":"\u6570\u5b57\u7279\u5f81\u4e0e\u7279\u5f81\u51fd\u6570","text":""},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_1","title":"\u6570\u5b66\u671f\u671b","text":""},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_2","title":"\u79bb\u6563\u578b\u968f\u673a\u53d8\u91cf\u7684\u6570\u5b66\u671f\u671b","text":"

    \u8bbe\u7f6e\u79bb\u6563\u578b\u968f\u673a\u53d8\u91cf\\(\\epsilon\\) \u7684\u5206\u5e03\u5217\u4e3a

    \\(\\begin{bmatrix}x_1&x_2&\u2026\u2026&x_k&\u2026\u2026\\\\p_1&p_2&\u2026\u2026&p_k&\u2026\u2026\\end{bmatrix}\\)

    \u5982\u679c\u7ea7\u6570\\(\\sum_kx_kp_k\\)\u7edd\u5bf9\u6536\u655b\uff0c\u5219\u79f0\u6b64\u7ea7\u6570\u7684\u548c\u4e3a\\(\\epsilon\\) \u7684\u6570\u5b66\u671f\u671b\u6216\u5747\u503c\\((mean)\\)\uff0c\u8ba1\u4f5c\\(E\\epsilon=\\sum_kx_kp_k\\)

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_3","title":"\u8fde\u7eed\u578b\u968f\u673a\u53d8\u91cf\u7684\u6570\u5b66\u671f\u671b","text":"

    \u8bbe\\(\\epsilon\\)\u4e3a\u8fde\u7eed\u578b\u968f\u673a\u53d8\u91cf\uff0c\u6709\u5bc6\u5ea6\u51fd\u6570\\(p(x)\\)\u5f53\\(\\int_{-\\infty}^{+\\infty}|x|p(x)dx<\\infty\u65f6\\) \u79f0\\(E\\epsilon=\\int_{-\\infty}^{+\\infty}xp(x)dx\\)\u4e3a\\(\\epsilon\\)\u7684\u6570\u5b66\u671f\u671b

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_4","title":"\u4e00\u822c\u5b9a\u4e49","text":"

    \u8bbe\u968f\u673a\u53d8\u91cf\\(\\epsilon\\)\u6709\u5206\u5e03\u51fd\u6570\\(F(x)\\)\uff0c\u82e5\\(\\int_{-\\infty}^{+\\infty}|x|d F(x)<\\infty\\) \u79f0\\(E\\epsilon=\\int_{-\\infty}^{+\\infty}xd F(x)\\)\u4e3a\\(\\epsilon\\)\u7684\u6570\u5b66\u671f\u671b

    • \u65af\u63d0\u5c14\u5409\u65af(Stieltjes)\u79ef\u5206
    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_5","title":"\u968f\u673a\u53d8\u91cf\u51fd\u6570\u7684\u6570\u5b66\u671f\u671b","text":"
    • \u8bbe\\(\\epsilon\\ \\eta\\)\u4e3a\u968f\u673a\u53d8\u91cf\u5206\u5e03\u51fd\u6570\u5206\u522b\u4e3a\\(F_{\\epsilon}(x)\\ F_{\\eta}(x)\\) \uff1b\\(f(x)\\)\u662f\u4e00\u5143\u6ce2\u96f7\u5c14\u51fd\u6570\uff0c\u8ba1\\(\\eta=f(\\epsilon)\\) \u5219 \\(E_{\\eta}=\\int_{-\\infty}^{+\\infty}xdF_{\\eta}(x)=\\int_{-\\infty}^{+\\infty}f(x)dF_{\\epsilon}(x)\\)

    • (Stein \u5f15\u7406) \\(P119\\)

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_6","title":"\u6570\u5b66\u671f\u671b\u7684\u57fa\u672c\u6027\u8d28","text":""},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#1","title":"\u6027\u8d281","text":"

    \u82e5\\(a\\le \\epsilon \\le b\\)\u5219 \\(E\\epsilon\\) \u5b58\u5728\u4e14\\(a\\le E\\epsilon\\le b\\)

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#1_1","title":"\u6027\u8d281\u2018","text":"

    \u82e5\\(|\\epsilon| < \\eta\\) \u4e14\\(E\\eta\\) \u5b58\u5728 \u5219\\(E\\epsilon\\)\u5b58\u5728 \u4e14\\(|E\\epsilon|\\le E|\\epsilon|\\le E\\eta\\)

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#2","title":"\u6027\u8d282","text":"

    \\(E_{\\epsilon_1},E_{\\epsilon_2},E_{\\epsilon_3}\u2026\u2026 E_{\\epsilon_n}\\)\u5b58\u5728\uff0c\u5219\u5bf9\u4efb\u610f\u5e38\u6570\\(c_1,c_2,\u2026\u2026c_n\\)\u548cb \\(E(\\sum_{i=1}^nc_i\\epsilon_i+b)\\)\u5b58\u5728\uff0c\u4e14\\(E(\\sum_{i=1}^nc_i\\epsilon_i+b)=\\sum_{i=1}^nc_iE\\epsilon_i+b\\)

    \u7279\u522b\u5730\uff1a\\(E(\\sum_{i=1}^n\\epsilon_i)=\\sum_{i=1}^nE\\epsilon_i\\) \\(E(c\\epsilon)=cE\\epsilon\\)

    • Exercise :\\(p121\\)
    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#3","title":"\u6027\u8d283","text":"

    \u82e5\\(\\epsilon_1,\\epsilon_2\u2026\u2026\\epsilon_n\\)\u76f8\u4e92\u72ec\u7acb\uff0c\u5404\\(E_{\\epsilon_i}\\)\u5b58\u5728\uff0c\u5219\\(E(\\epsilon_1,\\epsilon_2\u2026\u2026,\\epsilon_n)=E\\epsilon_1E\\epsilon_2\u2026\u2026E\\epsilon_n\\)

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#4","title":"\u6027\u8d284(\u6709\u754c\u6536\u655b\u5b9a\u7406)","text":"

    \u5047\u8bbe\u5bf9\u4efb\u610f\\(\\omega\\in\\Omega\\) \u6709\\(\\lim_{n\\rightarrow\\infty}\\epsilon(\\omega)=\\epsilon(\\omega)\\)\u5e76\u4e14\uff0c\u5bf9\u4e00\u5207\u7684\\(n >=1\\) \\(|\\epsilon_n|\\le M\\) M\u4e3a\u5e38\u6570\uff0c\u5219\\(\\lim_{n\\rightarrow\\infty}E\\epsilon_n=E\\epsilon\\)

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_7","title":"\u6761\u4ef6\u671f\u671b","text":""},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_8","title":"\u6761\u4ef6\u671f\u671b","text":"

    \\(E(\\eta|\\epsilon=x)=\\int_{-\\infty}^{+\\infty}ydF_{\\eta|\\epsilon}(y|x)\\)

    \\(E(\\eta|\\epsilon=x)=\\int_{-\\infty}^{+\\infty}yp_{\\eta|\\epsilon}(y|x)dy\\)

    \\(E(\\eta|\\epsilon=x)=\\sum yp_{\\eta|\\epsilon}(y|x)dy\\)

    \u518d\u5bf9\\(E(\\eta|\\epsilon=x)\\)\u6c42\u671f\u671b\uff0c\u4f1a\u5f97\u5230\\(E[E(\\eta|\\epsilon=x)]=E\\eta\\)

    \u8fde\u7eed\u578b

    \u79bb\u6563\u578b

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_9","title":"\u5168\u671f\u671b\u516c\u5f0f","text":"

    \\(\\epsilon\\) \u662f\u79bb\u6563\u578b\u968f\u673a\u53d8\u91cf\u65f6\uff0c\u8ba1\\(p_i=P(\\epsilon=x_i) \\Rightarrow E\\eta=\\sum_i p_iE(\\eta|\\epsilon=x_i)=\\sum_iE(\\eta|\\epsilon=x_i)P(\\epsilon=x_i)\\)

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_10","title":"\u6761\u4ef6\u671f\u671b\u7684\u6027\u8d28","text":"
    • P125
    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_11","title":"\u65b9\u5dee\uff0c\u534f\u65b9\u5dee\u4e0e\u76f8\u5173\u7cfb\u6570","text":""},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_12","title":"\u65b9\u5dee","text":"

    \\(Var\\epsilon=E(\\epsilon-E\\epsilon)^2=E\\epsilon^2-(E\\epsilon)^2\\)

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#chebyshev","title":"Chebyshev \u4e0d\u7b49\u5f0f","text":"

    \\(P(|\u03be\u2212E\u03be|\u2265\u03b5)\u2264 Var\u03be\\)

    \\(P(|\u03be \u2212 E\u03be| \u2265 \u03b5) =\\int_{|x-E\u03be|>=\\epsilon}dF(x)\\le \\int_{|x-E\u03be|>=\\epsilon}\\frac{(x-E\u03be)^2}{\\epsilon^2}dF(x)\\\\ \\le \\frac{1}{\\epsilon^2}\\int_ {-\\infty}^{+\\infty}(x-E\u03be)^2dF(x) =\\frac{Var\u03be}{\\epsilon^2}\\)

    • \u6027\u8d281

    \\(Var\u03be=0 \\Leftrightarrow P(\u03be=c)=1\\) (c\u662f\u5e38\u6570)

    • \u6027\u8d282

    \\(Var(c\u03be+b)=c^2Var\u03be\\)

    • \u6027\u8d283

    \u82e5 \\(c \\ne E\u03be\\ \\ \\ var\u03be<E(\u03be-c)^2\\)

    \\(p130\\)\u6700\u4f73\u9884\u6d4b\u95ee\u9898

    • \u6027\u8d284

    \\(Var (\\sum\u03be_i )= \\sum Var\u03be_i +2\\sum_{1\\le i<j\\le n} E(\u03be_i \u2212E\u03be_i)(\u03be_j \u2212E\u03be_j)\\)

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_13","title":"\u534f\u65b9\u5dee","text":"

    \u8bbe\\(\\epsilon_i \\epsilon_j\\)\u7684\u8054\u5408\u5206\u5e03\u51fd\u6570\u4e3a\\(F_{ij}(x,y)\\)\u82e5\\(E|(\\epsilon_i-E\\epsilon_i)(\\epsilon_j-E\\epsilon_j)|<\\infty\\) \u79f0 \\(E(\\epsilon_i-E\\epsilon_i)(\\epsilon_j-E\\epsilon_j)=\\int_{-\\infty}^{+\\infty}\\int_{-\\infty}^{+\\infty}(x-E\\epsilon_i)(y-E\\epsilon_j)dF_{ij}(x,y)\\)\u4e3a\\(\\epsilon_i\\)\u548c\\(\\epsilon_j\\)\u7684\u534f\u65b9\u5dee\uff0c\u8ba1\u4f5c\\(Cov(\\epsilon_i\\ \\epsilon_j)\\)

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_14","title":"\u6027\u8d28","text":"
    • 1.\\(Cov(\\epsilon\\ \\eta)=Cov(\\eta\\ \\epsilon)=E\\epsilon\\eta-E\\epsilon E\\eta\\)
    • 2.a b are constant \\(Cov(a\\epsilon,b\\eta)=abCov(\\epsilon.\\eta)\\)
    • 3.\\(Cov(\\sum_{i=1}^n\\epsilon_i,\\eta)=\\sum_{i=1}^nCov(\\epsilon_i,\\eta)\\)
    • 4.\\(CBC^{T}\\)
    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_15","title":"\u76f8\u5173\u7cfb\u6570","text":"

    \u4ee4\\(\\epsilon^*=(\\epsilon-E\\epsilon)/\\sqrt{Var\\epsilon} \\\\ \\eta^*=(\\eta-E\\eta)/\\sqrt{Var\\eta}\\)

    \u79f0\\(r_{\\epsilon\\eta}=Cov(\\epsilon^*,\\eta^*)=\\frac{E(\\epsilon-E\\epsilon)(\\eta-E\\eta)}{\\sqrt{Var\\epsilon Var\\eta}}\\) \u4e3a\\(\\epsilon \\ \\eta\\)\u7684\u76f8\u5173\u7cfb\u6570 \\(E\\epsilon^* \\eta^*\\) instead of \\(Cov(\\epsilon^*,\\eta^*)\\)?

    • Cauchy-Schwar \u4e0d\u7b49\u5f0f \\(|E\\epsilon\\eta|^2\\le E\\epsilon^2 E\\eta^2\\) \u7b49\u5f0f\u6210\u7acb\u5f53\u4e14\u4ec5\u5f53\\(\\exist t_o \\ st. P(\\eta=t_0\\epsilon)=1\\) \\(Proof\\ P134\\)
    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_16","title":"\u6027\u8d28","text":"
    • \u5bf9\u76f8\u5173\u7cfb\u6570\\(r_{\\epsilon\\eta}\\)\u6709 \\(|r_{\\epsilon\\eta}|\\le 1\\)

    \\(r_{\\epsilon\\eta}=1\\)\u6210\u7acb\\(iff\\ P(\\frac{\\epsilon-E\\epsilon}{\\sqrt{Var\\epsilon}}=\\frac{\\eta-E\\eta}{\\sqrt{Var\\eta}})=1\\)

    \\(r_{\\epsilon\\eta}=-1\\)\u6210\u7acb\\(iff\\ P(\\frac{\\epsilon-E\\epsilon}{\\sqrt{Var\\epsilon}}=-\\frac{\\eta-E\\eta}{\\sqrt{Var\\eta}})=1\\)

    • All the below are equavilant

    \\((1) Cov(\\epsilon,\\eta)=0\\)

    \\((2) \\epsilon \\ \\eta\\)\u4e0d\u76f8\u5173

    \\((3) E\\epsilon\\eta=E\\epsilon E\\eta\\)

    \\((4)Var{\\epsilon+\\eta}=Var\\epsilon+Var\\eta\\)

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_17","title":"\u77e9","text":""},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_18","title":"\u7279\u5f81\u51fd\u6570","text":"

    \\(f(t)=Ee^{it\\epsilon}\\)

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#example","title":"Example","text":"
    • \\(P(\\epsilon=c)=1--f(t)=e^{ict}\\)
    • \\(B(n,p)-- f(t)=\\sum_{k=0}^nC_n^kp^kq^{n-k}e^{itk}=\\sum_{k=0}^nC_n^k(pe^{it})^kq^{n-k}=(pe^{it}+q)^n\\)
    • \\(Poisson P(\\lambda)--f(t)=\\sum_{k=0}^{\\infty}\\frac{\\lambda^k}{k!}e^{-\\lambda}e^{ikt}=\\sum_{k=0}^{\\infty}\\frac{(\\lambda e^{it})^k}{k!}e^{-\\lambda}=e^{\\lambda e^{it}}e^{-\\lambda}=e^{\\lambda(e^{it}-1)}\\)
    • \\(Uniform\\ U(a,b)--f(t)=\\int_a^b\\frac{1}{b-a}e^{itx}dx=\\frac{e^{itb}-e^{ita}}{i(b-a)t}\\)
    • \\(N(a,\\sigma^2)--f(t)=\\frac{1}{\\sqrt{2\\pi\\sigma}}\\int_{-\\infty}^{+\\infty}e^{itx-(x-a)^2/2\\sigma^2}dx=e^{ita-\\frac{\\sigma^2t^2}{2}}\\)
    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#properties","title":"Properties","text":"
    • \\(|f(t)|\\le f(0)=1\\\\f(-t)=\\bar{f(t)}\\)
    • \\(f(t)\\)\u5728\\((-\\infty,+\\infty)\\)\u4e0a\u4e00\u81f4\u8fde\u7eed
    • \\(f(t)\\)\u975e\u8d1f\u5b9a

    \\(f(t)\\)\u4e3a\u7279\u5f81\u51fd\u6570\\(\\Leftrightarrow f(t)\\)\u975e\u8d1f\u5b9a\uff0c\u8fde\u7eed\u4e14\\(f(0)=1\\) * \\(\\epsilon_1\u2026\u2026\\epsilon_n\\)\u76f8\u4e92\u72ec\u7acb\uff0c\u7279\u5f81\u51fd\u6570\u5206\u522b\u4e3a\\(f_1(t)\u2026\u2026f_n(t)\\) \u8bb0\\(\\eta=\\epsilon_1+\u2026\u2026+\\epsilon_n\\) \u5219\\(\\eta\\)\u7684\u7279\u5f81\u51fd\u6570\\(f_\\eta(t)=f_1(t)f_2(t)\u2026\u2026f_n(t)\\) * \u82e5\\(E\\epsilon^n\\)\u5b58\u5728\uff0c\u5219\\(f(t)\\)n\u6b21\u53ef\u5fae\uff0c\u8fdb\u800c \\(k\\le n\\)\u65f6\uff0c\\(f^{k}(t)=i^k\\int_{-\\infty}^{+\\infty}x^ke^{itx}dF(x),f^{(k)}(0)=i^kE\\epsilon^k\\)\u7279\u522b\u5730 \\(E\\epsilon^2\\)\u5b58\u5728\u65f6 \\(E\\epsilon=-if'(0),E\\epsilon^2=-f''(0),Var\\epsilon=-f''(0)+[f'(0)]^2\\)

    \u53cd\u8fc7\u6765\uff0c\u82e5n\u4e3a\u5076\u6570\uff0c\u4e14\\(f^{(n)}(0)\\)\u5b58\u5728\uff0c\u5219\\(E\\epsilon^n\\)\u5b58\u5728 * \\(\\eta=a\\epsilon+b, f_\\eta(t)=e^{ibt}f(at)\\)

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_19","title":"\u9006\u8f6c\u516c\u5f0f","text":"

    \u8bbe\u5206\u5e03\u51fd\u6570\\(F(x)\\)\u7684\u7279\u5f81\u51fd\u6570\u4e3a\\(f(t)\\) \u53e6x1\uff0cx2\u4e3a\\(F(x)\\)\u7684\u8fde\u7eed\u70b9\uff0c\u5219\\(F(x_2)-F(x_1)=lim_{T\\rightarrow \\infty}\\frac{e^{-itx_1}=e^{-itx^2}}{it}f(t)dt\\)

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_20","title":"\u552f\u4e00\u6027\u5b9a\u7406","text":"

    \u5206\u5e03\u51fd\u6570\u53ef\u7531\u7279\u5f81\u51fd\u6570\u552f\u4e00\u786e\u5b9a

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_21","title":"\u9006\u5085\u7acb\u53f6\u53d8\u6362","text":"

    \u8bbe\\(f(t)\\)\u662f\u7279\u5f81\u51fd\u6570\u4e14\\(\\int_{=\\infty}^{+\\infty}|f(t)|dt<\\infty\\)\u5219\u5206\u5e03\u51fd\u6570F(x)\u8fde\u7eed\uff0c\u6b64\u65f6 \\(F'(x)=\\frac{1}{2\\pi}\\int_{-\\infty}^{+\\infty}e^{-itx}f(t)dt\\) * \u82e5f(t)\u662f\u67d0\u968f\u673a\u53d8\u91cf\u7684\u7279\u5f81\u51fd\u6570\uff0c\u5219\\(\\bar{f(t)},|f(t)|^2\\)\u4e5f\u662f\u7279\u5f81\u51fd\u6570 \\(f(-t)=\\bar{f(t)}\\)\u662f\\(-\\epsilon\\)\u7684\u7279\u5f81\u51fd\u6570 \\(\\epsilon_1-\\epsilon_2\\)\uff08\u72ec\u7acb\u540c\u5206\u5e03\uff09\u7684\u7279\u5f81\u51fd\u6570\u4e3a\\(f(t)\\bar{f(t)}=|f(t)|^2\\)

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_22","title":"\u5206\u5e03\u51fd\u6570\u7684\u53ef\u52a0\u6027","text":""},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_23","title":"\u591a\u5143\u7279\u5f81\u51fd\u6570","text":"

    \u8bbe\u968f\u673a\u5411\u91cf\\(\\vec{\\epsilon}=(\\epsilon_1,\u2026\u2026,\\epsilon_n)'\\)\u7684\u5206\u5e03\u51fd\u6570\u4e3a\\(F(x_1\u2026\u2026,x_n)\\)\u79f0\\(f(t_1,\u2026\u2026t_n)=\\int_{-\\infty}^{+\\infty}\u2026\u2026\\int_{-\\infty}^{+\\infty}e^{i(t_1x_1+\u2026\u2026+t_nx_n)}dF(x_1\u2026\u2026\uff0cx_n)\\)\u4e3a\u4ed6\u7684\u7279\u5f81\u51fd\u6570 * \\(\\eta=a_1\\epsilon_1\u2026\u2026+a_n\\epsilon_n\\\\f_\\eta(t)=Ee^{it\\sum_{k=1}^na_k\\epsilon_k}=f(a_1t,\u2026\u2026a_nt)\\) \u5176\u4ed6\u8be6\u7ec6\u89c1P48

    "},{"location":"PT/%E6%95%B0%E5%AD%97%E7%89%B9%E5%BE%81%E4%B8%8E%E7%89%B9%E5%BE%81%E5%87%BD%E6%95%B0/#_24","title":"\u591a\u5143\u6b63\u6001\u5206\u5e03","text":"

    P149-P154

    "},{"location":"PT/%E6%9E%81%E9%99%90%E5%AE%9A%E7%90%86/","title":"\u6781\u9650\u5b9a\u7406","text":""},{"location":"PT/%E6%9E%81%E9%99%90%E5%AE%9A%E7%90%86/#_1","title":"\u4f9d\u5206\u5e03\u6536\u655b\u4e0e\u4e2d\u5fc3\u6781\u9650\u5b9a\u7406","text":""},{"location":"assembly/%E4%B8%AD%E6%96%AD/","title":"\u4e2d\u65ad","text":""},{"location":"assembly/%E4%B8%AD%E6%96%AD/#int16","title":"int16","text":"
    • int 16h/ah=00h \u5c5e\u4e8ebios\u4e2d\u65ad

      int 16h ax=\u6240\u6572\u952e\u7684\u7f16\u7801

      again:  [\u5237\u65b0\u6e38\u620f\u7684\u753b\u9762]\nmov ah,1\nint 16h \u68c0\u67e5\u952e\u76d8\u7f13\u51b2\u533a\u662f\u5426\u4e3a\u7a7a\uff0c\u82e5\u4e3a\u7a7a\uff0c\u5219\u8fd4\u56dezf=1,\u5426\u5219\u8fd4\u56dezf=0  (ZF=1 jz\u8df3\u8f6c)\njz no_key\nhas_key:\n    mov ah,0\n    int 16h  \u4ece\u952e\u76d8\u7684\u7f13\u51b2\u533a\u8bfb\u53d6\u4e00\u4e2a\u952e\uff0c\u6839\u636e\u6240\u6572\u7684\u952e\u6267\u884c\u4e0d\u540c\u5206\u652f\nno_key:\n    jmp again\n

    \u4f8b\u5b50\uff1a

    data segment\nx dw 0\ny dw 0\ndata ends\ncode segment\nassume cs:code,ds:data\nmain:\n  mov ax,data\n  mov ds,ax\n  mov ah,0\n  mov al,3\n  mov ax,0B800h\n  mov es,ax\ndraw:\n  ;bx=(y*80+x)*2\n  mov ax,[y]\n  mov bp,80\n  mul bp \n;  dx(\u9ad816\u4f4d):ax\uff08\u4f4e16\u4f4d\uff09=ax*bp \n;  \u5176\u4e2ddx=0 mul\u7684\u4e58\u6570\u5bbd\u5ea616 \u5219\u88ab\u4e58\u6570\u4e3aax\n;  24x79\u603b\u4e4b\u4e0d\u8d85\u8fc716\u4f4d      \n  add ax,[x]\n  add ax,ax\n  mov bx,ax\n  mov es:[bx],1720h\n check_key:\n  mov ah,1\n  int 16h\n  jnz has_key\n  jmp check_key\n has_key:\n  mov ah,0\n  int 16h\n  cmp ax,4800h\n  je is_up\n  cmp ax,5000h\n  je is_down\n  cmp ax,4B00h\n  je is_left\n  cmp ax,4D00h\n  je is_right\n  jmp exit\nis_up:\n  cmp [y],0\n  je check_key\n  dec [y]\n  jmp draw\nis_down:\n  cmp [y],24\n  je check_key\n  inc [y]\n  jmp draw\nis_left:\n  cmp [x],0\n  je check_key\n  dec [x]\n  jmp draw\nis_right:\n  cmp [x],79\n  je check_key\n  inc [x]\n  jmp draw\nexit:\n  mov ah,4Ch\n  int 21h\ncode ends\nend main\n

    "},{"location":"assembly/%E4%B8%AD%E6%96%AD/#int-21h","title":"int 21h","text":"
    • int21h\u5bf9\u5e94\u7684\u51fd\u6570\u9996\u5730\u5740\u4fdd\u5b58\u57280:84h\u5904, \u8be5\u5730\u5740\u662f\u4e00\u4e2a\u8fdc\u6307\u9488\u3002
      0:84 78h\n0:85 56h\n0:86 34h\n0:87 12h\nxor ax,ax\nmov es,ax\nmov bx,84h\nlds si,es:[bx]\n;ds=1234h si=5678h\n
    • dword ptr 0:[84h]\u79f0\u4e3aint 21h\u7684\u4e2d\u65ad\u5411\u91cf(\u5176\u5b9e\u662f\u5b83\u7684\u51fd\u6570\u9996\u5730\u5740)
      • int n\u5bf9\u5e94\u7684\u4e2d\u65ad\u5411\u91cf\u7684\u5b58\u50a8\u4f4d\u7f6e\u4e00\u5b9a\u662f0:n*4
      • n\u7684\u53d6\u503c\u8303\u56f4\u662f[00, FF], \u6240\u4ee5256\u4e2a\u4e2d\u65ad\u5411\u91cf\u4f1a\u5360\u75280:0~0:3FF\u4e4b\u95f4\u5171400h\u4e2a\u5b57\u8282\u7684\u5185\u5b58\uff0c\u8fd9\u5757\u533a\u57df\u79f0\u4e3a \u4e2d\u65ad\u5411\u91cf\u8868\u3002

    \u663e\u7136, int 00h\u7684\u4e2d\u65ad\u5411\u91cf\u4fdd\u5b58\u5728dword ptr 0:[0];\nint 01h\u7684\u4e2d\u65ad\u5411\u91cf\u4fdd\u5b58\u5728dword ptr 0:[4];\nint 03h\u7684\u4e2d\u65ad\u5411\u91cf\u4fdd\u5b58\u5728dword ptr 0:[0Ch];\nint 08h\u7684\u4e2d\u65ad\u5411\u91cf\u4fdd\u5b58\u5728dword ptr 0:[20h];\nint 0FFh\u7684\u4e2d\u65ad\u5411\u91cf\u4fdd\u5b58\u5728dword ptr 0:[3FCh];\n
    * BIOS\u4f1a\u5b8c\u6210\u90e8\u5206\u4e2d\u65ad\u5411\u91cf\u7684\u586b\u5199, \u5982int 10h\u3001int 16h\u3001int 13h\u8fd9\u51e0\u4e2aBIOS\u4e2d\u65ad\u7684\u5411\u91cf\u5728DOS\u542f\u52a8\u524d\u5c31\u5df2\u7ecf\u586b\u597d\u4e86 * DOS\u542f\u52a8\u5b8c\u6210\u540e\uff0c\u4f1a\u586b\u5165int 21h\u7684\u4e2d\u65ad\u5411\u91cf\u3002

    1000:2000 mov ah, 2\n1000:2002 mov dl, 'A'\n1000:2004 int 21h\n1000:2006 mov ah,4Ch\n
    * \u4e0a\u9762\u8fd9\u6761int 21h\u6307\u4ee4\u6267\u884c\u65f6, cpu\u505a\u4e86\u4ee5\u4e0b4\u4ef6\u4e8b:
    IF=0\nTF=0  -\u9632\u6b62\u4e2d\u65ad\u91cc\u518d\u6b21\u4ea7\u751f\u4e2d\u65ad\npushf\npush cs\u53731000h\npush \u4e0b\u6761\u6307\u4ee4\u7684\u504f\u79fb\u5730\u5740\u53732006h\njmp dword ptr 0:[84h]; jmp 1234h:5678h\n\n\u4e0a\u9762\u8fd9\u6761jmp\u4f1a\u8df3\u8f6c\u5230int 21h\u7684\u4e2d\u65ad\u670d\u52a1\u51fd\u6570\u5185\u90e8:\n1234:5678  ...\n             ...\n1234:56FF  iret; \u4e2d\u65ad\u8fd4\u56de\niret\u5728\u6267\u884c\u65f6, cpu\u505a\u4e86\u4ee5\u4e0b3\u4ef6\u4e8b\u60c5:\npop ip\u5373ip=2006h\npop cs\u5373cs=1000h\npopf\n\n1000:2000 call 1234:5678; \u8fdc\u8c03\u7528\n;\u6b64\u65f6\u4f1apush 1000h \u518d push 2005h\n;\u6700\u540ejmp 1234:5678\n1000:2005 mov ah, 4Ch\n1000:2007 int 21h\n...\n1234:5678 ...\n            retf; \u6b64\u65f6\u6267\u884cpop ip\u518dpop cs\n

    \u4e2d\u65ad\u7a0b\u5e8f\u4f8b\u5b50

    code segment\nassume cs:code\nold_80h dw 0, 0\nmain:\n   xor ax, ax\n   mov es, ax\n   mov bx, 80h*4; mov bx, 200h\n   mov ax, es:[bx]\n   mov old_80h[0], ax\n   mov ax, es:[bx+2]\n   mov old_80h[2], ax\n\n   mov word ptr es:[bx], offset int_80h\n   mov es:[bx+2], cs\n\n   mov ah, 1\n   int 80h; AL=\u952e\u76d8\u8f93\u5165\u7684ASCII\u7801\nnext:\n   mov ah, 2\n   mov dl, al\n   int 80h\n\n   mov ax, old_80h[0]\n   mov es:[bx], ax\n   mov ax, old_80h[2]\n   mov es:[bx+2], ax\n\n   mov ah, 4Ch\n   int 21h\nint_80h: ; ISR(Interrupt Service Routine)\n         ; \u4e2d\u65ad\u670d\u52a1\u51fd\u6570\n   cmp ah, 1\n   je is_1\nis_2:\n   push es\n   push bx\n   push ax\n   mov bx, 0B800h\n   mov es, bx\n   mov byte ptr es:[160], dl\n   mov byte ptr es:[161], 17h\n   pop ax\n   pop bx\n   pop es\n   jmp done\nis_1:\n   int 21h\ndone:\n   iret\n   ;\u5982\u679c\u60f3\u63a5\u8fde\u6267\u884cold int80\uff1ajmp dword ptr cs:[old_80h]\n\ncode ends\nend main\n

    "},{"location":"assembly/%E5%87%BD%E6%95%B0/","title":"\u51fd\u6570","text":""},{"location":"assembly/%E5%87%BD%E6%95%B0/#_1","title":"\u6c47\u7f16\u8bed\u8a00\u4e2d\u7684\u4e09\u79cd\u53c2\u6570\u4f20\u9012\u65b9\u5f0f","text":""},{"location":"assembly/%E5%87%BD%E6%95%B0/#_2","title":"\u5bc4\u5b58\u5668\u4f20\u9012","text":"
    f:\n   add ax, ax; ax=2*ax\n   ret        ; \u8fd4\u56de\u65f6ax\u5c31\u662f\u51fd\u6570\u503c\nmain:\n   mov ax, 3; ax\u5c31\u662ff()\u7684\u53c2\u6570\n   call f\nnext:\n   mov ah, 4Ch\n   int 21h\n
    "},{"location":"assembly/%E5%87%BD%E6%95%B0/#_3","title":"\u53d8\u91cf\u4f20\u9012","text":"

    f:\n   mov ax, var\n   add ax, ax; ax\u5c31\u662f\u51fd\u6570\u503c\n   ret\nmain:\n   mov var, 3\n   ; var\u662f\u4e00\u4e2a16\u4f4d\u7684\u53d8\u91cf, \u7528\u4f5c\u53c2\u6570\uff0cvar\u5fc5\u987b\u662f\u5168\u5c40\u53d8\u91cf\n   call f\n
    * \u5728\u6c47\u7f16\u8bed\u8a00\u4e2d\uff0c\u7528\u00a0db\u3001dw\u7b49\u5173\u952e\u8bcd\u5b9a\u4e49\u7684\u53d8\u91cf\u5747\u4e3a\u5168\u5c40\u53d8\u91cf\u00a0\u3002\u5728\u5806\u6808\u4e2d\u5b9a\u4e49\u7684\u53d8\u91cf\u624d\u662f\u5c40\u90e8\u53d8\u91cf\u3002 * var\u4e0d\u80fd\u7528\u4e8e\u9012\u5f52\u51fd\u6570\u5185--\u6bcf\u4e00\u5c42\u53d8\u91cf\u5730\u5740\u5404\u4e0d\u76f8\u540c\uff0c\u5168\u5c40\u53d8\u91cf\u7684\u8bdd\u6c38\u8fdc\u662f\u540c\u4e00\u4e2a\u5730\u5740\uff0c\u6240\u4ee5\u4e0d\u80fd\u7528\u6765\u4f20\u9012\u9012\u5f52\u51fd\u6570\u7684\u53c2\u6570

    "},{"location":"assembly/%E5%87%BD%E6%95%B0/#_4","title":"\u5806\u6808\u4f20\u9012","text":"

    f:\n   push bp\n   mov bp, sp\n   mov ax, [bp+4]; \u4ece\u5806\u6808\u4e2d\u53d6\u5f97\u53c2\u6570\n   add ax, ax\n   pop bp\n   ret\nmain:\n   mov ax, 3\n   push ax; \u53c2\u6570\u538b\u5165\u5230\u5806\u6808\n   call f\n   add sp, 2\n
    * C\u8bed\u8a00\u51fd\u6570\u8c03\u7528y=f(2,3)\u6c42\u4e24\u6570\u4e4b\u548c\u8f6c\u5316\u6210\u6c47\u7f16\u8bed\u8a00 * \u8bbess=1000h sp=2000h
    f:\n   push bp;(4)\n   mov bp, sp\n   mov ax, [bp+4]\n   add ax, [bp+6]\n   pop bp; (5)\n   ret; (6)  pop ip\nmain:\n   mov ax, 3\n   push ax; (1)\n   mov ax, 2\n   push ax; (2)\n   call f; (3) \n   ;call\u4f1a\u628af\u6307\u4ee4\u7684\u4e0b\u4e00\u6761\u7684\u5730\u5740\uff08here\uff09\u538b\u5165\u5806\u6808 \u7136\u540e\u518djmpf\nhere:\n   add sp, 4;(7);\u5806\u6808\u6062\u590d\u5e73\u8861\n
    * \u4e0a\u8ff0\u7a0b\u5e8f\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u7684\u5806\u6808\u5e03\u5c40\u5982\u4e0b:stack frame
    ss:1FF8 old bp <- bp (4)\nss:1FFA here <- (3)(5)\nss:1FFC 02   <- (2)(6)\nss:1FFE 03   <- (1)\nss:2000 ??   <- (7)\n
    * printf\u51fd\u6570\u539f\u578b
    #include <stdio.h>\ndouble f(char *s, ...)\n{  double y=0;\n   char *p = (char *)&s; /* p = bp+4 */\n   p += sizeof(s); /* p = bp+6 */\n   while(*s != '\\0')\n   {\n      if(*s == 'i')\n      {\n         y += *(int *)p;\n         p += sizeof(int);\n      }\n      else if(*s == 'l')\n      {\n         y += *(long*)p;\n         p += sizeof(long);\n      }\n      else if(*s == 'd')\n      {\n         y += *(double *)p;\n         p += sizeof(double);\n      }\n      s++;\n   }\n   return y;\n}\nmain()\n{\n   double y;\n   y = f(\"ild\", 10, 20L, 3.14);\n   printf(\"y=%lf\\n\", y);\n}\n
    * call far ptr dest retf
    1000:2000 call 1234:5678  ;\u8de8\u6bb5\u8df3\u8fdc\ncpu\u4f1a\u505a\u4e00\u4e0b\u52a8\u4f5c\uff1a\n[1]push cs\n[2]push 2005h\n[3]jmp 1234:5678h\n;\u4e00\u5b9a\u5148\u538b\u5165\u6bb5\u5730\u5740\uff0c\u518d\u538b\u5165\u504f\u79fb\u5730\u5740  WHY?5.18\u6700\u540e\u4e00\u6bb5\n1000:2005 mov ah,4Ch\n1234:5678 ...\n1234:5688 retf\ncpu \u5728retf\u65f6\u4f1a\u505a\u4ee5\u4e0b\u52a8\u4f5c\n[1]pop ip;\n[2]pop cs;\n

    "},{"location":"assembly/%E5%87%BD%E6%95%B0/#3","title":"\u7528\u5806\u6808\u4f20\u9012\u53c2\u6570\u67093\u79cd\u65b9\u5f0f:","text":""},{"location":"assembly/%E5%87%BD%E6%95%B0/#__cdecl","title":"__cdecl","text":"
    • \u53c2\u6570\u4ece\u53f3\u5230\u5de6\u987a\u5e8f\u538b\u5165\u5806\u6808\uff0c\u7531\u8c03\u7528\u8005\u6e05\u7406\u5806\u6808\u662fC\u8bed\u8a00\u53c2\u6570\u4f20\u9012\u89c4\u8303\u3002

      __cdecl\u7684\u4f8b\u5b50:

      f:\npush bp; (4)\nmov bp, sp\nmov ax, [bp+4]; arg0\nadd ax, [bp+6]; arg1\npop bp; (5)\nret; (6)\nmain:\nmov ax, 20; arg1\npush ax; (1)\nmov ax, 10; arg0\npush ax; (2)\ncall f; (3)\nhere:\nadd sp, 4; (7)\n

    • __cdecl\u5806\u6808\u5e03\u5c40:
      ss:1FF8 old bp -> bp (4)\nss:1FFA here -> (3)(5)\nss:1FFC 10 -> (2)(6)\nss:1FFE 20 -> (1)\nss:2000    -> (7)\n
    "},{"location":"assembly/%E5%87%BD%E6%95%B0/#__pascal","title":"__pascal","text":"
    • \u53c2\u6570\u4ece\u5de6\u5230\u53f3\u987a\u5e8f\u538b\u5165\u5806\u6808\uff0c\u7531\u88ab\u8c03\u7528\u8005\u6e05\u7406\u5806\u6808\u662fPascal\u8bed\u8a00\u53c2\u6570\u4f20\u9012\u89c4\u8303\u3002

      __pascal\u7684\u4f8b\u5b50\uff1a

      f:\npush bp; (4)\nmov bp, sp\nmov ax, [bp+6]; arg0\nadd ax, [bp+4]; arg1\npop bp; (5)\nret 4; (6)\nmain: \nmov ax, 10\npush ax; (1) arg0\nmov ax, 20\npush ax; (2) arg1\ncall f; (3)\nhere: \n

    • __pascal\u7684\u5806\u6808\u5e03\u5c40:
      ss:1FF8 old bp<- bp (4)\nss:1FFA here <- (3)(5)\nss:1FFC 20 <- (2)\nss:1FFE 10 <- (1)\nss:2000    <-(6)\n

      ret 4: [1]pop ip [2]sp=sp+4

    "},{"location":"assembly/%E5%87%BD%E6%95%B0/#__stdcall","title":"__stdcall","text":"
    • \u53c2\u6570\u4ece\u53f3\u5230\u5de6\u987a\u5e8f\u538b\u5165\u5806\u6808\uff0c\u7531\u88ab\u8c03\u7528\u8005\u6e05\u7406\u5806\u6808\u662fWindows API\u51fd\u6570\u7684\u53c2\u6570\u4f20\u9012\u89c4\u8303\u3002

      __stdcall\u7684\u4f8b\u5b50\uff1a

      f:\npush bp; (4)\nmov bp, sp\nmov ax, [bp+4]; arg0\nadd ax, [bp+6]; arg1\npop bp; (5)\nret 4; (6)\nmain:\nmov ax, 20\npush ax; (1) arg1\nmov ax, 10\npush ax; (2) arg0\ncall f; (3)\nhere: \n

    __stdcall\u7684\u5806\u6808\u5e03\u5c40:

    ss:1FF8 old bp<- bp (4)\nss:1FFA here <- (3)(5)\nss:1FFC 10 <- (2)\nss:1FFE 20 <- (1)\nss:2000    <-(6)\n
    * 32\u4f4d__stdcall\u7684\u4f8b\u5b50:
    f:\npush ebp;(4)\nmov ebp, esp\nmov eax,[ebp+8];arg0\nadd eax,[ebp+0Ch];arg1\npop ebp;(5)\nret 8;(6)\nmain:\npush 20;(1) arg1\npush 10;(2) arg0\ncall f;(3)\nhere:\n
    * 32\u4f4d__stdcall\u7684\u5806\u6808\u5e03\u5c40:
    ss:1FF0 old ebp<- ebp (4)\nss:1FF4 here <- (3)(5)\nss:1FF8 10 <- (2)\nss:1FFC 20 <- (1)\nss:2000    <-(6)\n

    "},{"location":"assembly/%E5%87%BD%E6%95%B0/#_5","title":"\u52a8\u6001\u53d8\u91cf","text":"
    int f(int a, int b)\n{\n   int c; /* c\u662f\u5c40\u90e8\u52a8\u6001\u53d8\u91cf */\n   c = a+b;\n   return c;\n}\n

    \u4e0a\u8ff0C\u8bed\u8a00\u51fd\u6570\u53ef\u7ffb\u8bd1\u6210\u4ee5\u4e0b\u6c47\u7f16\u4ee3\u7801:

    f:\npush bp; (4)\nmov bp, sp\nsub sp, 2; (5) \u8fd9\u91cc\u6316\u7684\u5751\u5c31\u662f\u7ed9\u53d8\u91cfc\u7684\nmov ax, [bp+4]\nadd ax, [bp+6]\nmov [bp-2], ax\nmov ax, [bp-2]\nmov sp, bp; (6)\u6b64\u65f6\u53d8\u91cfc\u6b7b\u4ea1\npop bp; (7)\nret; (8)\nmain:\nmov ax, 20\npush ax; (1)\nmov ax, 10\npush ax; (2)\ncall f; (3)\nhere:\nadd sp, 4;(9)\u6b64\u65f6\u53c2\u6570a,b\u6b7b\u4ea1\n
    \u6267\u884c\u4e0a\u8ff0\u4ee3\u7801\u65f6, \u5806\u6808\u5e03\u5c40\u5982\u4e0b:
    ss:1FF6 [30] (5) \u53d8\u91cfc\nss:1FF8 old bp<- bp(4)(6)\nss:1FFA here <- (3)(7)\nss:1FFC 10 <- (2)(8)\nss:1FFE 20 <- (1)\nss:2000    <-(9)\n

    "},{"location":"assembly/%E5%87%BD%E6%95%B0/#cbp-bx-si-di","title":"C\u8bed\u8a00\u51fd\u6570\u4e2d\u9700\u8981\u4fdd\u62a4bp, bx, si, di","text":"
    • C\u8bed\u8a00\u7684\u51fd\u6570\u91cc\u9762\u9664\u4e86\u4e0d\u80fd\u7834\u574fbp\u5916\uff0c\u8fd8\u8981\u4fdd\u62a4bx,si,di\u7684\u503c:
      f:\npush bp\nmov bp, sp\nsub sp, n; \u5176\u4e2dn\u4e00\u4e2a\u5e38\u6570,\u7528\u6765\u4e3a\u52a8\u6001\u53d8\u91cf\u5206\u914d\u7a7a\u95f4\n           \u5148\u6316\u5751\u518dpush\npush bx\npush si\npush di\n...\npop di\npop si\npop bx\nmov sp, bp\npop bp\nret\n
    • \u5982\u679c\u6ca1\u6709push bp --- \u591a\u5c42\u8c03\u7528\u4f1a\u51fa\u95ee\u9898\uff1amain\u8c03\u7528f f\u8c03\u7528g \u8fd9\u65f6g->f->main\u56de\u4e0d\u53bb
    "},{"location":"assembly/%E5%87%BD%E6%95%B0/#_6","title":"\u9012\u5f52","text":"
    int f(int n)\n{\n   if(n==1)\n      return 1;\n   return n+f(n-1);\n}\n

    \u4e0a\u8ff0C\u8bed\u8a00\u9012\u5f52\u51fd\u6570\u53ef\u7ffb\u8bd1\u6210\u4ee5\u4e0b\u6c47\u7f16\u4ee3\u7801:

    f:\n    push bp;(3)(6)(9)\n    mov bp, sp\n    mov ax, [bp+4]\n    cmp ax, 1\n    je done\n    dec ax\n    push ax;(4)(7)\n    call f;(5)(8)\nthere:\n    add sp, 2;(12)(15)\n    add ax, [bp+4]\ndone:\n    pop bp;(10)(13)(16)\n    ret;(11)(14)(17)\nmain:\n    mov ax, 3\n    push ax;(1)\n    call f;(2)\n    here:\n    add sp, 2;(18)\n
    \u6267\u884c\u4e0a\u8ff0\u4ee3\u7801\u65f6\u7684\u5806\u6808\u5e03\u5c40\u5982\u4e0b:
    ss:1FEE oldbp<-bp(9)\nss:1FF0 there<-(8)(10)\nss:1FF2 1<-(7)(11)\nss:1FF4 oldbp<-bp(6)12\nss:1FF6 there<-(5)(13)\nss:1FF8 2<-(4)(14)\nss:1FFA oldbp<-bp(3)(15)\nss:1FFC here <-(2)(16)\nss:1FFE 3 <-(1)(17)\nss:2000   <-(18)\n

    "},{"location":"assembly/%E5%9F%BA%E7%A1%80%E6%8C%87%E4%BB%A4/","title":"\u57fa\u7840\u6307\u4ee4","text":""},{"location":"assembly/%E5%9F%BA%E7%A1%80%E6%8C%87%E4%BB%A4/#_1","title":"\u903b\u8f91\u8fd0\u7b97\u548c\u79fb\u4f4d\u6307\u4ee4","text":""},{"location":"assembly/%E5%9F%BA%E7%A1%80%E6%8C%87%E4%BB%A4/#andorxornottest","title":"\u903b\u8f91\u8fd0\u7b97\u6307\u4ee4\uff1aAND\uff0cOR\uff0cXOR\uff0cNOT\uff0cTEST","text":"
    • not:\u5355\u76ee\u8fd0\u7b97\u7b26 not ax =~ax
    • test:\u00a0\u4e22\u5f03\u8fd0\u7b97\u7ed3\u679c\u00a0\uff0c\u4fdd\u7559\u6807\u5fd7\u4f4d\u72b6\u6001\uff1b\u672c\u8d28\u4e0a\u662fand\u6307\u4ee4
      mov ax, 9234h\ntest ax, 8000h; ZF=0, AX=9234h\njnz msb_is_one; most significant bit\u6700\u9ad8\u4f4d\n;test\u548cand\u7684\u5173\u7cfb\u76f8\u5f53\u4e8ecmp\u548csub\u7684\u5173\u7cfb\u3002\n
    • \u5224\u65ad\u67d0\u4e2a\u5bc4\u5b58\u5668\u662f\u5426\u4e3a0\u7684\u51e0\u79cd\u65b9\u6cd5:
      test cl, cl\nor cl, cl\nand cl, cl\nor cl, 0\ncmp cl, 0\n
    "},{"location":"assembly/%E5%9F%BA%E7%A1%80%E6%8C%87%E4%BB%A4/#_2","title":"\u79fb\u4f4d\u6307\u4ee4","text":"
    • shl shr \u903b\u8f91\u5de6\u79fb\u3001\u903b\u8f91\u53f3\u79fb[\u9488\u5bf9\u975e\u7b26\u53f7\u6570]
    • sal sar \u7b97\u672f\u5de6\u79fb\u3001\u7b97\u672f\u53f3\u79fb[\u9488\u5bf9\u7b26\u53f7\u6570]
    • sal=shl \u5747\u53f3\u8fb9\u8865\u96f6
    • shr\u53f3\u79fb\u65f6\u5de6\u8fb9\u6c38\u8fdc\u8865\u96f6\uff0c\u00a0sar\u53f3\u79fb\u65f6\u5de6\u8fb9\u8865\u4e0a\u5143\u7d20\u7684\u6700\u9ad8\u4f4d\u00a0
      mov ah, 1011 0110B\nrol ah, 1;  AH=0110 1101, CF=1\n;sal: shift arithmetic left \u7b97\u672f\u5de6\u79fb\nmov ah,11111100B;AH=-4\nsar ah,2;AH=11111111 AH=-2\n
    • sar\u5bf9\u8d1f\u6570\u53f3\u79fb\u65f6\u5de6\u8fb9\u8981\u88651
    • rcl: rotate through carry left \u5e26\u8fdb\u4f4d\u5faa\u73af\u5de6\u79fb
    • rcr: rotate through carry right\u5e26\u8fdb\u4f4d\u5faa\u73af\u53f3\u79fb
      mov ah,0B6h\nclc       ;CF=0\nrcl ah,1  ;CF=\u539f\u6765\u6700\u9ad8\u4f4d\u7684\u503c ah\u6700\u5730\u4f4d\u4f1a\u53d8\u6210\u539fCF\u7684\u503c\n          ;ah=01101100 CF=1\n\nmov ah, 0B6h\nstc         ; CF=1\nrcl ah, 1   ; CF=1 AH=1011 0110 \u79fb\u4f4d\u524d\n            ; CF=1 AH=0110 1101 \u79fb\u4f4d\u540e\n\nmov ah, 0B6h\nstc         ; CF=1\nrcr ah, 1   ; AH=1011 0110  CF=1\u79fb\u4f4d\u524d\n            ; AH=1101 1011  CF=0\u79fb\u4f4d\u540e\n\nmov ah,0B6h\nstc\nrcl ah, 1;  CF=1 AH=0110 1101\n           ;dx   ax\n
    • shl, shr, rol, ror, rcl, rcr\u00a0\u6700\u540e\u79fb\u51fa\u53bb\u7684\u90a3\u4e00\u4f4d\u4e00\u5b9a\u5728CF\u4e2d\u3002\u00a0

    \u5047\u5b9a\u8981\u628aAX\u4e2d\u768416\u4f4d\u503c\u8f6c\u5316\u6210\u4e8c\u8fdb\u5236\u8f93\u51fa: * \u89e3\u6cd51:

    mov cx, 16\nnext:\n    shl ax, 1\n    jc is_1\n\nis_0:\n    mov dl, '0'\n    jmp output\n\nis_1:\n    mov dl, '1'\n\noutput:\npush ax\nmov ah, 2\nint 21h\npop ax\ndec cx\njnz next\n
    * \u89e3\u6cd52:
    mov cx, 16\nnext:\nshl ax, 1\nmov dl, '0'\nadc dl, 0\noutput:\npush ax\nmov ah, 2\nint 21h\npop ax\ndec cx\njnz next\n

    "},{"location":"assembly/%E5%9F%BA%E7%A1%80%E6%8C%87%E4%BB%A4/#_3","title":"\u5b57\u7b26\u4e32\u64cd\u4f5c\u6307\u4ee4","text":""},{"location":"assembly/%E5%9F%BA%E7%A1%80%E6%8C%87%E4%BB%A4/#movsbmovswmovsd","title":"\u5b57\u7b26\u4e32\u4f20\u9001\u6307\u4ee4\uff1aMOVSB\uff0cMOVSW\uff0cMOVSD","text":"
    • rep movsb : \u5176\u4e2drep\u8868\u793arepeat\uff0cs\u8868\u793astring\uff0cb\u8868\u793abyte

    • \u5728\u6267\u884c\u6b64\u6307\u4ee4\u524d\u8981\u505a\u4ee5\u4e0b\u51c6\u5907\u5de5\u4f5c\uff1a

    • \u2460ds:si->\u6e90\u5b57\u7b26\u4e32(si\u5c31\u662fsource index)
    • \u2461es:di->\u76ee\u6807\u5b57\u7b26\u4e32(di\u5c31\u662fdestination index)
    • \u2462cx=\u79fb\u52a8\u6b21\u6570
    • \u2463DF=0\u5373\u65b9\u5411\u6807\u5fd7\u8bbe\u6210\u6b63\u65b9\u5411(\u7528\u6307\u4ee4cld)
    • rep movsb\u6240\u505a\u7684\u64cd\u4f5c\u5982\u4e0b:

      again:\nif(cx == 0)\n   goto done;\nbyte ptr es:[di] = byte ptr ds:[si]\nif(df==0)\n{si++; di++;}\nelse\n{si--; di--;}\ncx--\ngoto again\ndone:\n

    • \u4f8b\u5b50: \u8981\u628a\u4ee5\u4e0b\u5de6\u4fa74\u4e2a\u5b57\u8282\u590d\u5236\u5230\u53f3\u4fa7

    1000:0000 'A'        2000:0000  'A'\n1000:0001 'B'        2000:0001  'B'\n1000:0002 'C'        2000:0002  'C'\n1000:0003 00         2000:0003  00\n
    mov ax, 1000h\nmov ds, ax\nmov si, 0      ; mov si, 3\nmov ax, 2000h\nmov es, ax\nmov di, 0      ; mov di, 3\nmov cx, 4\ncld             ; std\nrep movsb\n

    • rep movsw\u7684\u64cd\u4f5c\u8fc7\u7a0b:[word]
      again:\nif(cx == 0)\n   goto done;\nword ptr es:[di] = word ptr ds:[si]\nif(df==0)\n{si+=2; di+=2;}\nelse\n{si-=2; di-=2;}\ncx--\ngoto again\ndone:\n
    • rep movsd\u7684\u64cd\u4f5c\u8fc7\u7a0b:[dword]

      again:\nif(cx == 0)\n   goto done;\ndword ptr es:[di] = dword ptr ds:[si]\nif(df==0)\n{si+=4; di+=4;}\nelse\n{si-=4; di-=4;}\ncx--\ngoto again\ndone:\n

    • \u572832\u4f4d\u7cfb\u7edf\u4e0b, \u5047\u5b9ads:esi->\u6e90\u5185\u5b58\u5757, es:edi->\u76ee\u6807\u5757, DF=0, \u5219\u5f53\u8981\u590d\u5236\u7684\u5b57\u8282\u6570ecx\u4e0d\u662f4\u7684\u500d\u6570\u65f6\uff0c\u53ef\u4ee5\u505a\u5982\u4e0b\u5904\u7406:

      push ecx\nshr ecx, 2\nrep movsd\npop ecx\nand ecx, 3; \u76f8\u5f53\u4e8eecx = ecx % 4\nrep movsb\n

    "},{"location":"assembly/%E5%9F%BA%E7%A1%80%E6%8C%87%E4%BB%A4/#cmpsbcmpswcmpsd","title":"\u5b57\u7b26\u4e32\u6bd4\u8f83\u6307\u4ee4\uff1aCMPSB\uff0cCMPSW\uff0cCMPSD","text":"
    • cmpsb [jz je]

      • \u6bd4\u8f83byte ptr ds:[si]\u4e0ebyte ptr es:[di]
      • \u5f53DF=0\u65f6\uff0csi++\uff0cdi++
      • \u5f53DF=1\u65f6\uff0csi--\uff0cdi--
      • \u81ea\u52a8\u5bf9si di\u66f4\u65b0[\u4e3a\u4e0b\u4e00\u6b21\u79fb\u52a8\u51c6\u5907]
    • repe cmpsb

    • \u82e5\u672c\u6b21\u6bd4\u8f83\u76f8\u7b49\u5219\u7ee7\u7eed\u6bd4\u8f83\u4e0b\u4e00\u4e2a(repeat if equal)

    again:\nif(cx == 0) goto done;\ntemp=byte ptr ds:[si]-byte ptr es:[di]\nold_fl=FL\n\u5f53DF=0\u65f6\uff0csi++\uff0cdi++\n\u5f53DF=1\u65f6\uff0csi--\uff0cdi--\ncx--\nFL=old_fl\nif (ZF==1) goto again\ndone:\n
    * cx!=0 \u4e5f\u53ef\u80fd\u63d0\u524d\u7ed3\u675f\u5faa\u73af * repne cmpsb * \u82e5\u672c\u6b21\u6bd4\u8f83\u4e0d\u7b49\u5219\u7ee7\u7eed\u6bd4\u8f83\u4e0b\u4e00\u4e2a(repeat if not equal)
    again:\nif(cx == 0) goto done;\ntemp=byte ptr ds:[si]-byte ptr es:[di]\nold_fl=FL\n\u5f53DF=0\u65f6\uff0csi++\uff0cdi++\n\u5f53DF=1\u65f6\uff0csi--\uff0cdi--\ncx--\nFL=old_fl\nif (ZF==0) goto again\ndone:\n

    "},{"location":"assembly/%E5%9F%BA%E7%A1%80%E6%8C%87%E4%BB%A4/#scasbscasw-scasd","title":"\u5b57\u7b26\u4e32\u626b\u63cf\u6307\u4ee4\uff1ascasb\uff0cscasw, scasd","text":"
    • scasb:
      cmp al, es:[di]\ndi++; (\u5f53DF=1\u65f6\uff0c\u4e3adi--)\n
    • repne scasb:

      next:\n  if(cx == 0) goto done;\n  cmp al, es:[di]\n      di++; \u5f53DF=1\u65f6\uff0c\u4e3adi--\n      cx--\n  je done\n  goto next\ndone:\n

    • \u4f8b\u5b50: \u5047\u5b9a\u4ece\u5730\u57401000:2000\u5f00\u59cb\u5b58\u653e\u4e00\u4e2a\u5b57\u7b26\u4e32\uff0c\u8bf7\u8ba1\u7b97\u8be5\u5b57\u7b26\u4e32\u7684\u957f\u5ea6\u5e76\u5b58\u653e\u5230CX\u4e2d\u3002\u5047\u5b9a\u5b57\u7b26\u4e32\u4ee5ASCII\u78010\u7ed3\u675f\uff0c\u5b57\u7b26\u4e32\u957f\u5ea6\u4e0d\u5305\u62ec0\u3002

      mov ax, 1000h\nmov es, ax\nmov di, 2000h; ES:DI->\u76ee\u6807\u4e32\nmov cx, 0FFFFh; CX=\u6700\u591a\u627eFFFF\u6b21\nmov al, 0; AL=\u5f85\u627e\u7684\u5b57\u7b26\ncld       ; DF=0\uff0c\u8868\u793a\u6b63\u65b9\u5411\nrepne scasb; again:\nnot cx      ; \u76f8\u5f53\u4e8ecx=FFFF-cx\ndec cx\n;\u4e0a\u8ff0\u4e24\u6761\u6307\u4ee4\u4e5f\u53ef\u4ee5\u66ff\u6362\u6210\u4ee5\u4e0b\u4e24\u6761\u6307\u4ee4:\n;inc cx\n;not cx\n;not cx\u76f8\u5f53\u4e8ecx=FFFF-cx\u00a0\n

    • repe scasb
      • \u5047\u5b9a\u4ece\u5730\u57401000:0000\u8d77\u5b58\u653e\u4ee5\u4e0b\u5b57\u7b26\u4e32\"###ABC\"\uff0c\u73b0\u8981\u6c42\u8df3\u8fc7\u524d\u9762\u7684#\uff0c\u628a\u540e\u9762\u5269\u4f59\u7684\u5168\u90e8\u5b57\u7b26\u590d\u5236\u52302000:0000\u4e2d
      • \u5047\u5b9aes=1000h, di=0, cx=7, \u5219
    mov al, '#'\ncld\nrepe scasb\ndec di; ES:DI->\"ABC\"\ninc cx; CX=4\npush es\npop ds; DS=ES\npush di\npop si; SI=DI\nmov ax, 2000h\nmov es, ax\nmov di, 0\nrep movsb\n
    "},{"location":"assembly/%E5%9F%BA%E7%A1%80%E6%8C%87%E4%BB%A4/#_4","title":"\u5b57\u7b26\u4e32\u64cd\u4f5c\u6307\u4ee4","text":"
    • stosb:
      es:[di] = AL\ndi++; DF=1\u65f6\u4e3adi--\n
    • rep stosb: \u5faa\u73afCX\u6b21stosb
      again:\nif(cx == 0) goto done;\nes:[di] = al\ndi++; \u5f53DF=1\u65f6, \u4e3aDI--\ncx--\ngoto again;\ndone:\n
    memset(void *t,int value,int n);\ndouble x[100];\nmemset(&x,0,sizeof(x))\n
    • lodsb
      al=ds:[si]\nSI++;\u5f53DF=1\u65f6, \u4e3aSI--\n
    • Exercise:
    • \u8bbeds:si-> \"##AB#12#XY\"
    • es:di\u6307\u5411\u4e00\u4e2a\u7a7a\u7684\u6570\u7ec4,
    • CX=11
    • \u901a\u8fc7\u7f16\u7a0b\u8fc7\u6ee4#\u6700\u540e\u4f7f\u5f97es:di ->\"AB12XY\"
    cld\nagain:\n   lodsb ; AL=DS:[SI], SI++\n         ; mov al, ds:[si]\n         ; inc si\n   cmp al, '#'\n   je   next\n   stosb ; ES:[DI]=AL, DI++\n         ; mov es:[di], al\n         ; inc di\nnext:\n   dec cx\n   jnz again\n
    "},{"location":"assembly/%E5%9F%BA%E7%A1%80%E6%8C%87%E4%BB%A4/#c","title":"C\u8bed\u8a00\u5b57\u7b26\u4e32\u51fd\u6570\u8f6c\u6362","text":"
    strlen:\n    push bp\n    mov bp,sp\n    push di\n    push ds\n\n\n    mov di,[bp+4]\n    mov ax,data\n    mov ds,ax\n    mov es,ax\n    mov cx,0FFFFh\n    xor al,al\n    cld\n    repne scasb\n    inc cx\n    not cx\n    mov ax,cx\n\n    pop ds\n    pop di\n    mov sp,bp\n    pop bp\n    ret\n_memcpy:\n    push bp\n    mov bp,sp\n    push es\n    push ds\n    push si\n    push di\n    mov ax,data\n    mov es,ax\n    mov ds,ax\n    mov si,word ptr [bp+6]\n    mov di,word ptr [bp+4]\n    mov cx,word ptr [bp+8]\n    cld\n    rep movsb\n    pop di\n    pop si\n    pop ds\n    pop es\n    mov sp,bp\n    pop bp\n    ret\n_strncpy:\n    push bp\n    mov bp,sp\n    push es\n    push ds\n    push si\n    push di\n    mov si, word ptr [bp+6]\n    mov di,word ptr [bp+4]\n    push si\n    call _strlen\n    pop cx\n    cmp ax,[bp+8]\n    jl tricky_form\n    mov cx,word ptr [bp+8]\n    cld\n    rep movsb\n    tricky_form:\n    mov dx,[bp+8]\n    sub dx,ax\n    mov cx,ax\n    cld\n    rep movsb\n    mov cx,dx\n    mov ax,0\n    cld\n    rep stosb\n    pop di\n    pop si\n    pop ds\n    pop es\n    mov sp,bp\n    pop bp\n    ret\n_memset:\n    push bp\n    mov bp,sp\n    push es\n    push di\n    mov ax,data\n    mov es,ax\n    mov di,[bp+4]\n    mov ax,[bp+6]\n    mov cx,[bp+8]\n    cld\n    rep stosb\n    pop di\n    pop es\n    mov sp,bp\n    pop bp\n    ret\n\n_clrscr:\n    push es\n    push di\n    mov ax,0B800h\n    mov es,ax\n    mov di,0\n    mov ax,0000h\n    mov cx,2000\nagain:\n    mov es:[di],ax\n    add di,2\n    sub cx,1\n    jnz again\n    pop di\n    pop es\n    ret\n
    "},{"location":"assembly/%E5%9F%BA%E7%A1%80%E6%8C%87%E4%BB%A4/#_5","title":"\u63a7\u5236\u8f6c\u79fb\u6307\u4ee4","text":"
    • jmp\u76843\u79cd\u7c7b\u578b \u2460jmp short target ; \u77ed\u8df3 \u2461jmp near ptr target ; \u8fd1\u8df3 \u2462jmp far ptr target ; \u8fdc\u8df3
    • \u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u7f16\u8bd1\u5668\u4f1a\u81ea\u52a8\u5ea6\u91cf\u8df3\u8dc3\u7684\u8ddd\u79bb\uff0c\u56e0\u6b64\u6211\u4eec\u5728 \u5199\u6e90\u7a0b\u5e8f\u7684\u65f6\u5019\u4e0d\u9700\u8981\u52a0\u4e0ashort\u3001near ptr\u3001far ptr\u7b49\u7c7b\u578b\u4fee\u9970\u5373\u4e0a\u8ff0\u4e09\u79cd\u5199\u6cd5\u4e00\u5f8b\u53ef\u4ee5\u7b80\u5316\u4e3ajmp target\u3002
    • \u77ed\u8df3\u6307\u4ee4[only one byte]
    • \u683c\u5f0f jmp + \u504f\u79fb\u5730\u5740\u6216\u6807\u53f7
    • \u4ee5\u4e0b\u6761\u4ef6\u8df3\u8f6c\u6307\u4ee4\u4e5f\u90fd\u5c5e\u4e8e\u77ed\u8df3: jc jnc jo jno js jns jz jnz ja jb jae jbe jg jge jl jle jp jnp
    • \u77ed\u8df3\u6307\u4ee4\u7684\u673a\u5668\u7801
           \u5730\u5740            \u673a\u5668\u7801   \u6c47\u7f16\u6307\u4ee4  \n    1D3E:0090     ...\n    1D3E:00F0\n    1D3E:0100     EB06     jmp  0108h\n    1D3E:0102     B402     mov  ah\uff0c2\n    1D3E:0104     B241     mov  dl, 41h\n    1D3E:0106     CD21     int  21h\n    1D3E:0108     B44C     mov  ah\uff0c4Ch\n    1D3E:010A     CD21     int  21h\n
    • \u77ed\u8df3\u592a\u8fdc\u8df3\u4e0d\u8fc7\u53bb\u7684\u89e3\u51b3\u529e\u6cd5
      cmp ax, bx\n\uff08je  equal; jump out of range\uff09\njne not_equal\njmp equal; \u8fd1\u8df3\nnot_equal:\n...; \u5047\u5b9a\u8fd9\u91cc\u7701\u7565\u6307\u4ee4\u7684\u673a\u5668\u7801\u603b\u957f\u5ea6\u8d85\u8fc77Fh\u5b57\u8282\nequal:\n...\n
    • \u8fd1\u8df3\u6307\u4ee4[two bytes]
    • \u8fd1\u8df3\u6307\u4ee4\u76843\u79cd\u683c\u5f0f
      jmp \u504f\u79fb\u5730\u5740\u6216\u6807\u53f7        ; \u5982jmp 1000h\njmp 16\u4f4d\u5bc4\u5b58\u5668      ; \u5982jmp bx\njmp 16\u4f4d\u53d8\u91cf       ; \u5982jmp word ptr [addr]\n
    • \u8fdc\u8df3\u6307\u4ee4[\u8de8\u6bb5\u8df3\u8dc3]
    • \u8fdc\u8df3\u6307\u4ee4\u76842\u79cd\u683c\u5f0f
      • jmp \u6bb5\u5730\u5740:\u504f\u79fb\u5730\u5740
      • jmp dword ptr 32\u4f4d\u53d8\u91cf
    • \u8fdc\u8df3\u6307\u4ee4\u7684\u673a\u5668\u7801
      • jmp 1234h:5678h; \u673a\u5668\u7801\u4e3a0EAh,78h,56h,34h,12h
    • \u8fdc\u8df3\u6ca1\u6709\u7528\u25b3\uff0c\u800c\u662f\u76f4\u63a5\u5730\u5740.\u8fdc\u8df3\u5230\u67d0\u4e2a\u5e38\u6570\u5730\u5740\u65f6,\u5728\u6e90\u7a0b\u5e8f\u4e2d\u4e0d\u80fd\u76f4\u63a5\u7528jmp\u6307\u4ee4\uff0c\u800c\u5e94\u8be5\u6539\u7528\u673a\u5668\u78010EAh\u5b9a\u4e49\uff0c\u5982:
      db 0EAh\ndw 5678h\ndw 1234h\ndb 0EAh\ndd 0FFFF0000h\n;\u6216 dw 0000h\n;dw 0FFFFh\n;\u4e0a\u8ff03\u884c\u5b9a\u4e49\u5408\u5728\u4e00\u8d77\u8868\u793ajmp 1234h:5678h\n
    • jmp dword ptr 32\u4f4d\u53d8\u91cf\u7684\u7528\u6cd5
      mov word ptr ds:[bx],1234h\nmov word ptr ds:[bx+2],5678h\njmp dword ptr ds:[bx] ;jmp 5678h:1234h\n
      data segment\naddr dw 0000h, 0FFFFh \n;\u6216\u5199\u6210addr dd 0FFFF0000h\ndata ends\ncode segment\nassume cs:code, ds:data\nmain:\nmov ax, data\nmov ds, ax\njmp dword ptr [addr] \n;\u76f8\u5f53\u4e8ejmp FFFF:0000\ncode ends\nend main\n
    "},{"location":"assembly/%E5%9F%BA%E7%A1%80%E6%8C%87%E4%BB%A4/#loop","title":"\u5faa\u73af\u6307\u4ee4\uff1aLOOP","text":"
    • loop dest\u7684\u64cd\u4f5c\u8fc7\u7a0b:
      CX = CX - 1     ; \u5faa\u73af\u6b21\u6570\u51cf1\nif(CX != 0)     ; \u82e5CX\u4e0d\u7b49\u4e8e0\uff0c\u5219\n    goto  dest  ; \u8df3\u8f6c\u81f3dest\n
    • \u4f8b: \u6c421+2+3\u7684\u548c
      mov cx, 3\nnext:\nadd ax, cx; ax +3, +2, +1\nloop next; cx=2, 1, 0\n           ; dec cx\n           ; jnz next  \u5148-1\u518d\u5224\u65ad\n           ;--cx\u521d\u59cb\u503c=0\u65f6\u80fd\u8fbe\u5230\u6700\u5927\u5faa\u73af\u6b21\u6570 10000h\u6b21\n\nmov ax, 0\nmov cx, 0\njcxz done  \u8fd9\u6761\u6307\u4ee4\u53ef\u4ee5\u9632\u6b62cx\u4e3a0\u65f6\u8fdb\u5165\u5faa\u73af\nnext:\nadd ax, cx\nloop next; \u5faa\u73af10000h\u6b21\ndone:\n
    • jecxz \u8868\u793ajump if ecx is zero
    "},{"location":"assembly/%E5%9F%BA%E7%A1%80%E6%8C%87%E4%BB%A4/#call-ret","title":"call, ret\u6307\u4ee4","text":"
    \u8fd1\u8fd4\u56de\uff1aretn\uff0c\u5728\u591a\u6570\u60c5\u51b5\u4e0b\u53ef\u5199\u6210ret\n\u8fdc\u8c03\u7528\uff1acall far ptr dest\n\u8fdc\u8fd4\u56de\uff1aretf\n
    "},{"location":"assembly/%E5%9F%BA%E7%A1%80%E6%8C%87%E4%BB%A4/#movpushpopxchg","title":"\u901a\u7528\u6570\u636e\u4f20\u9001\u6307\u4ee4\uff1aMOV\uff0cPUSH\uff0cPOP\uff0cXCHG","text":"
    • mov byte ptr ds:[bx], byte ptr es:[di]
    • \u9519\u8bef\u539f\u56e0:\u4e24\u4e2a\u64cd\u4f5c\u6570\u4e0d\u80fd\u540c\u65f6\u4e3a\u5185\u5b58\u53d8\u91cf\u4ee5\u4e0b\u4e3a\u6b63\u786e\u5199\u6cd5:
    mov al, es:[di]\nmov ds:[bx], al\n
    eax=12345678h\nebx=89ABCDEFh\nss=1000h\nsp=2000h\n\u73b0\u6267\u884c\u4ee5\u4e0b\u6307\u4ee4:\npush eax;(1)\npush ebx;(2)\npop ebx;(3)\npop eax;(4)\n
    • exchange \u6307\u4ee4
      mov ax,1\nmov bx,2\nxchg ax,bx\nxchg ax,ds:[bx] \u53ef\u4ee5\u4ea4\u6362\u5bc4\u5b58\u5668\u548c\u53d8\u91cf \u4e0d\u5141\u8bb8\u5bf9\u4e24\u4e2a\u53d8\u91cf\u8fdb\u884c\u4ea4\u6362\n
    "},{"location":"assembly/%E5%A0%86%E6%A0%88/","title":"\u5806\u6808","text":""},{"location":"assembly/%E5%A0%86%E6%A0%88/#_1","title":"\u5806\u6808\u6bb5\u7684\u5b9a\u4e49","text":"

    stk segment stack    \u5806\u6808\u53ea\u80fd\u5b9a\u4e49\u4e00\u4e2a\ns db 200h dup ('S');\u4e5f\u53ef\u4ee5\u4e0d\u5b9a\u4e49\u6570\u7ec4\u540d\ndb 200h dup('S')\nstk ends\n
    * assume cs:code,ds:data,ss:stk * \\(mov\\ ah,s[1]\\) \u7f16\u8bd1\u540e\u53d8\u6210 \\(mov\\ ah,stk:[s+1]\\)\u518d\u8f6c\u5316\u6210$mov ah,ss:[1] $ * \u5982\u679c\u5f15\u7528\u6570\u7ec4s\u5fc5\u987b\u52a0\u4e0aassume ss\uff1astk

    "},{"location":"assembly/%E5%A0%86%E6%A0%88/#dos","title":"\u7a0b\u5e8f\u8f7d\u5165\u5185\u5b58\u540e\uff0c\u64cd\u4f5c\u7cfb\u7edfdos\u4f1a\u5bf9\u4e00\u4e0b\u5bc4\u5b58\u5668\u4f5c\u521d\u59cb\u5316\u8d4b\u503c\uff1a","text":"
    • cs=code \u5373\u4e0d\u7528\u624b\u5de5\u7ed9cs\u8d4b\u503c
    • ip=offset main
    • ss=stk
    • sp=200h
    • ds=es=psp\u6bb5\u5740\uff1bpsp\u7a0b\u5e8f\u6bb5\u524d\u7f00\uff08program segment prefix)

      psp\u662f\u4e00\u4e2a\u957f\u5ea6\u4e3a100h\u5b57\u8282\u7684\u5185\u5b58\u5757\uff0c\u4f4d\u4e8e\u5f53\u524d\u7a0b\u5e8f\u9996\u6bb5\u7684\u524d\u9762 psp\u7531\u64cd\u4f5c\u7cfb\u7edf\u5206\u914d\u7ed9\u5f53\u524d\u7a0b\u5e8f\uff0c\u91cc\u9762\u5b58\u653e\u4e86\u4e0e\u8be5exe\u76f8\u5173\u7684\u4e00\u4e9b\u4fe1\u606f\u5982\u547d\u4ee4\u884c\u53c2\u6570\u5373main\uff08\uff09\u7684\u53c2\u6570

      int main(int argc,char *argv[]){  }\nmain.exe  123  xyz\nargv[0]   [1]  [2] \n

    "},{"location":"assembly/%E5%A0%86%E6%A0%88/#sssp","title":"\u5982\u679c\u672a\u5b9a\u4e49\u5806\u6808\uff0c\u90a3\u4e48ss\u548csp\uff1f","text":"

    \u6e90\u7a0b\u5e8f\u4e2d\u6ca1\u6709\u5b9a\u4e49\u5806\u6808\u6bb5\u65f6 ss=\u9996\u6bb5\u7684\u6bb5\u5730\u5740=1000h sp=0 sp-2=FFFE\uff081000\uff1aFFFE\uff09\u2014\u2014\u8fbe\u5230\u6700\u5927\u5806\u6808 \u5c0f\u7aef \u5373push a[0] (1234h)\u5728\u5806\u6808\u91cc\u4ec0\u4e48\u6837\u5b50 34 12 * 9000\uff1aFFFF\u662f\u7528\u6237\u53ef\u7528\u7684last \u5982\u679cpush\u592a\u591a\u4e86 \u53ef\u80fd\u8fdb\u5165code\u6bb5\u672b\u5c3e\uff0c\u5806\u6808\u6ea2\u51fa

    "},{"location":"assembly/%E5%AF%84%E5%AD%98%E5%99%A8/","title":"\u5bc4\u5b58\u5668","text":""},{"location":"assembly/%E5%AF%84%E5%AD%98%E5%99%A8/#_1","title":"\u5bc4\u5b58\u5668\u8be6\u89e3","text":"
    • \u5982\u679c\u672a\u5b9a\u4e49\u5806\u6808\uff0c\u90a3\u4e48ss\u548csp\uff1f

      • \u6e90\u7a0b\u5e8f\u4e2d\u6ca1\u6709\u5b9a\u4e49\u5806\u6808\u6bb5\u65f6
      ss=\u9996\u6bb5\u7684\u6bb5\u5730\u5740=1000h \nsp=0 \nsp-2=FFFE\uff081000\uff1aFFFE\uff09\u2014\u2014\u8fbe\u5230\u6700\u5927\u5806\u6808 \n9000\uff1aFFFF\u662f\u7528\u6237\u53ef\u7528\u7684last \n\u5982\u679cpush\u592a\u591a\u4e86 \u53ef\u80fd\u8fdb\u5165code\u6bb5\u672b\u5c3e\uff0c\u5806\u6808\u6ea2\u51fa\n
    "},{"location":"assembly/%E5%AF%84%E5%AD%98%E5%99%A8/#fl16-9963","title":"FL\u517116\u4f4d, \u4f46\u53ea\u7528\u5176\u4e2d9\u4f4d\uff0c\u8fd99\u4f4d\u5305\u62ec6\u4e2a\u72b6\u6001\u6807\u5fd7\u548c3\u4e2a\u63a7\u5236\u6807\u5fd7\uff0c\u5982\u4e0b\u6240\u793a\uff1a","text":"

    11 10 9 8 7 6 4 2 0

    O DF IF TF SF ZF AF PF CF

    "},{"location":"assembly/%E5%AF%84%E5%AD%98%E5%99%A8/#cf-zf-sf-of-af-pf","title":"CF ZF SF OF AF PF: \u72b6\u6001\u6807\u5fd7","text":"
    • CF: \u8fdb\u4f4d\u6807\u5fd7(carry flag)

      mov ah, 0FFh ;\nadd ah, 1; ah=0, CF=1\u4ea7\u751f\u4e86\u8fdb\u4f4d \nadd ah, 2; ah=2, CF=0 \nsub ah, 3; ah=0FFh, CF=1\u4ea7\u751f\u4e86\u8fdb\u4f4d \n
      • \u79fb\u4f4d\u6307\u4ee4\u4e5f\u4f1a\u5f71\u54cdcf\u503c\uff0c\u6700\u540e\u4e00\u51fa\u53bb\u7684\u90a3\u4e00\u4f4d\u4f1a\u4fdd\u5b58\u5728cf\u5f53\u4e2d
      mov cl,2 shr ah,cl;\u53f3\u79fb\u4e24\u4f4d\uff0ccf=1 \n
      • \u4e0eCF\u76f8\u5173\u7684\u8df3\u8f6c\u6307\u4ee4:

        • jc\u2014\u2014\u6709\u8fdb\u4f4d\u5219\u8df3\u8f6c
        • jnc\u2014\u2014\u65e0\u8fdb\u4f4d\u5219\u8df3\u8f6c
        • adc\u2014\u2014\u5e26\u8fdb\u4f4d\u52a0
        • clc : cf=0
        • stc : cf=1
        • adc ax,bx;ax=ax+bx+cf
        data segment\nabc dw 32767\ndata ends\ncode segment\nassume cs:code,ds:data\nmain:\n    mov ax,data\n    mov ds,ax\n    mov ax,[abc]\n    mov cx,16\nagain:\n    shl ax,1\n    jc is_one\nis_zero:\n    mov dl,'0'\n    jmp out_put\nis_one:\n    mov dl,'1'\nout_put:\n    push ax\n    mov ah,2\n    int 21h\n    pop ax\n    sub cx,1\n    jnz again\nmov ah,4Ch\nint 21h\ncode ends\nend main\n
    • ZF: \u96f6\u6807\u5fd7(zero flag)

      sub ax, ax; AX=0, ZF=1 \nadd ax, 1; AX=1, ZF=0 \nadd ax, 0FFFFh; AX=0, ZF=1, CF=1\n
      • jz is_zero \u4f1a\u53d1\u751f\u8df3\u8f6c, \u56e0\u4e3a\u5f53\u524dZF==1
      • jnz\u6839\u636eZF==0\u4f5c\u51fa\u8df3\u8f6c
      • jz\u7b49\u4ef7je jnz\u7b49\u4ef7jne
      • cmp ax,ax ;ax-ax \u5dee\u503c\u6ca1\u6709\u4fdd\u7559\uff0c\u800c\u662f\u4fdd\u7559\u4e86zf \u5373\u5224\u65ad\u662f\u5426\u60f3\u7b49\u5c31\u662f\u5224\u65ad\u662f\u5426zf=1
    • SF: \u7b26\u53f7\u6807\u5fd7(sign flag)\u8fd0\u7b97\u7ed3\u679c\u7684\u6700\u9ad8\u4f4d

      mov ah, 7Fh add ah, 1; AH=80h=1000 0000B, SF=1\u2014\u2014\u8fd0\u7b97\u7ed3\u679c\u8d1f\u6570 \nsub ah, 1; AH=7Fh=0111 1111B, SF=0\u2014\u2014\u8fd0\u7b97\u7ed3\u679c\u6b63\u6570\n
      • jns \u2014positive;\u4f1a\u53d1\u751f\u8df3\u8f6c, \u56e0\u4e3aSF==0
      • js\u662f\u6839\u636eSF==1\u4f5c\u51fa\u8df3\u8f6c
    • OF: \u6ea2\u51fa\u6807\u5fd7(overflow flag)

      mov ah, 7Fh \nadd ah, 1 ;AH=80h, OF=1, ZF=0, CF=0, SF=1 \nmov ah, 80h add ah, 0FFh; AH=7Fh, OF=1, ZF=0, CF=1, SF=0 \nmov ah, 80h sub ah, 1; AH=7Fh, OF=1, ZF=0, CF=0, SF=0 \n
      • OF\u4e5f\u6709\u4e24\u6761\u76f8\u5173\u7684\u6307\u4ee4: jo, jno
      mov ab,81h ;ah=10000001B \nshl ah,1 ah=00000010B;0F=1,CF=1 \nonly one-bit shift\u4f1a\u5f71\u54cdOF\n
    • PF(Parity Flag)\u5947\u5076\u6807\u5fd7

      mov ah, 4 add ah, 1; AH=0000 0101B, PF=1\u8868\u793a\u6709\u5076\u6570\u4e2a1 \nmov ax, 0101h add ax, 0004h; AX=0105h=0000 0001 0000 0101B \n; PF=1\u53ea\u7edf\u8ba1\u4f4e8\u4f4d\u4e2d1\u7684\u4e2a\u6570 \u8981\u662f\u4f4e8\u4f4d\u4e2d1\u7684\u4e2a\u6570\u662f\u5947\u6570\u65f6\uff0cPF=0 \n
      • jp(\u5f53PF==1\u65f6\u5219\u8df3)
      • jnp(\u5f53PF==0\u65f6\u5219\u8df3)
      • jp\u4e5f\u53ef\u4ee5\u5199\u6210jpe(jump if parity even)
      • jnp\u4e5f\u53ef\u4ee5\u5199\u6210jpo(jump if parity odd)

      \u5047\u5b9a\u8981\u53d1\u9001\u5b57\u7b26\u2019C\u2019=0100 0011B, \u73b0\u5047\u5b9a\u4f4e7\u4f4d\u4e3a\u6570\u636e\u4f4d \u6700\u9ad8\u4f4d\u4e3a\u6821\u9a8c\u4f4d\u3002\u90a3\u4e48\u6821\u9a8c\u4f4d\u7684\u8ba1\u7b97\u65b9\u6cd5\u67092\u79cd:

      (1) \u5947\u6821\u9a8c: \u6570\u636e\u4f4d+\u6821\u9a8c\u4f4d\u5408\u8d77\u6765\uff0c1\u7684\u4e2a\u6570\u5fc5\u987b\u662f\u5947\u6570

      (2) \u5076\u6821\u9a8c: \u6570\u636e\u4f4d+\u6821\u9a8c\u4f4d\u5408\u8d77\u6765\uff0c1\u7684\u4e2a\u6570\u5fc5\u987b\u662f\u5076\u6570

      \u73b0\u5728\u6211\u4eec\u91c7\u7528\u5076\u6821\u9a8c\u6765\u53d1\u9001\u2019C\u2019,\u90a3\u4e48\u6821\u9a8c\u4f4d\u5fc5\u987b\u7b49\u4e8e1,\u5373\u5b9e\u9645\u8981\u53d1\u9001\u76848\u4f4d\u4e8c\u8fdb\u5236\u503c\u4e3a1100 0011B \u5bf9\u65b9\u63a5\u6536\u8fd98\u4f4d\u503c\u5e76\u4fdd\u5b58\u5728\u5bc4\u5b58\u5668AL\u4e2d, \u63a5\u4e0b\u53bb\u53ef\u4ee5\u6267\u884c\u5982\u4e0b\u4ee3\u7801\u6765\u9a8c\u8bc1AL\u4e2d\u7684\u503c\u662f\u5426\u6709\u9519:

      or al, al\njnp error; if(PF==0) goto error\n good:\n ...\n error:\n ...\n
    • AF(Auxiliary Flag) \u8f85\u52a9\u8fdb\u4f4d\u6807\u5fd7

      • \u4f4e4\u4f4d\u5411\u9ad84\u4f4d\u4ea7\u751f\u8fdb\u4f4d\u6216\u501f\u4f4d

        mov ah, 1Fh ; 0001 1111\nadd ah, 1 ; ah=20h, AF=1\n
      • AF\u8ddfBCD(Binary Coded Decimal)\u7801\u6709\u5173

    "},{"location":"assembly/%E5%AF%84%E5%AD%98%E5%99%A8/#df-tf-if","title":"DF TF IF: \u63a7\u5236\u6807\u5fd7","text":"
    • DF:direction flag

    • TF:trace/trap flag

    • IF:interrupt flag

    • DF(Direction Flag)\u65b9\u5411\u6807\u5fd7: \u63a7\u5236\u5b57\u7b26\u4e32\u7684\u64cd\u4f5c\u65b9\u5411

      • \u5f53DF=0\u65f6\u4e3a\u6b63\u65b9\u5411(\u4f4e\u5730\u5740\u5230\u9ad8\u5730\u5740)\uff0c\u5f53DF=1\u662f\u53cd\u65b9\u5411\u3002
      • \u82e5\u6e90\u6570\u636e\u9996\u5730\u5740>\u76ee\u6807\u6570\u636e\u9996\u5730\u5740\uff0c\u5219\u590d\u5236\u65f6\u8981\u6309\u6b63\u65b9\u5411(\u4ece\u4f4e\u5730\u5740\u5230\u9ad8\u5730\u5740)\uff1b
      • \u82e5\u6e90\u6570\u636e\u9996\u5730\u5740<\u76ee\u6807\u6570\u636e\u9996\u5730\u5740\uff0c\u5219\u590d\u5236\u65f6\u8981\u6309\u53cd\u65b9\u5411(\u4ece\u9ad8\u5730\u5740\u5230\u4f4e\u5730\u5740)\uff1b
      • strcpy(target, source); \u6c38\u8fdc\u6309\u6b63\u65b9\u5411\u590d\u5236
      • memcpy(target, source, n);\u6c38\u8fdc\u6309\u6b63\u65b9\u5411\u590d\u5236
      • memmove(target, source, n); \u80fd\u6b63\u786e\u5904\u7406\u90e8\u5206\u91cd\u53e0
      • \u67092\u6761\u6307\u4ee4\u53ef\u4ee5\u8bbe\u7f6eDF\u7684\u503c: cld\u4f7fDF=0, \u5b57\u7b26\u4e32\u590d\u5236\u6309\u6b63\u65b9\u5411 std\u4f7fDF=1, \u5b57\u7b26\u4e32\u590d\u5236\u6309\u53cd\u65b9\u5411
        data segment:\ns db \"ABC123xyz\",0\nt db 10 dup(0)\ndata ends\ncode segment:\nassume cs:code,ds:data\nmain:\n    mov ax,data\n    mov ds,ax\n    mov es,ax\n    mov si,offset s+9\n    mov di,offset t+9\n    mov cx,10\n    std\n    rep movsb ;memcpy(es:di,ds:si,cx)\ndone:\n    mov ah,4Ch\n    int 21h\ncode ends\nend main\n\n\u6ce8\uff1arep movsb\nagain:\n    cmp cx,0\n    je done\n    mov al,ds[si]\n    mov es:[di],al\n    inc si/dec si\n    inc di/dec di\n    dec cx\n    jmp again\n
    • IF\uff08Interrupt Flag\uff09\u4e2d\u65ad\u6807\u5fd7

      • \u5f53IF=1\u65f6,\u5141\u8bb8\u4e2d\u65ad;\u5426\u5219\u7981\u6b62\u4e2d\u65ad
      • cli\u6307\u4ee4\u4f7fIF=0\u8868\u793a\u5173/\u7981\u6b62\u786c\u4ef6\u4e2d\u65ad
      • sti\u6307\u4ee4\u4f7fIF=1\u8868\u793a\u5f00/\u5141\u8bb8\u786c\u4ef6\u4e2d\u65ad
      • int nh \u4fdd\u5b58\u57284xn
      mov ax, 0 \nmov bx, 1 \nadd ax, bx \n
      • \u6b64\u65f6\u82e5\u7528\u6237\u6572\u952e,\u5219CPU\u4f1a\u5728\u6b64\u5904\u63d2\u5165\u4e00\u6761int 9h\u6307\u4ee4\u5e76\u6267\u884c\u5b83
      • int 9h\u7684\u529f\u80fd\u662f\u8bfb\u952e\u76d8\u7f16\u7801\u5e76\u4fdd\u5b58\u5230\u952e\u76d8\u7f13\u51b2\u533a\u4e2d(\u9690\u85cf)\u786c\u4ef6\u4e2d\u65ad
      • \u53d1\u8d77\u8005\u662f\u4e8b\u4ef6\uff0c\u533a\u522b\u4e8e\u7a0b\u5e8f\u5458\u4e3b\u52a8\u7684\u8f6f\u4ef6\u4e2d\u65ad

      \u65f6\u949f\u6bcf\u96941/18\u5999\u4f1a\u4ea7\u751f\u4e00\u4e2a\u4e2d\u65ad\u8bf7\u6c42 \u82e5\u7a0b\u5e8f\u5df2\u8fd0\u884c\u4e861/18\u79d2,\u5219cpu\u4f1a\u5728\u6b64\u5904\u63d2\u5165\u4e00\u6761int 8h\u6307\u4ee4\u5e76\u6267\u884c\uff08count++\uff09

      • \u7528cli\u548csti\u628a\u4e00\u6bb5\u4ee3\u7801\u5305\u56f4\u8d77\u6765\u53ef\u4ee5\u8fbe\u5230\u8be5\u6bb5\u4ee3\u7801\u5728 \u6267\u884c\u8fc7\u7a0b\u4e2d\u4e0d\u4f1a\u88ab\u6253\u65ad\u7684\u6548\u679c:
        • cli clear interrupt\u7981\u6b62\u786c\u4ef6\u4e2d\u65ad
        • \u91cd\u8981\u4ee3\u7801
        • sti set interrupt\u5141\u8bb8\u786c\u4ef6\u4e2d\u65ad
    • TF\uff08Trace/Trap Flag\uff09\u8ddf\u8e2a/\u9677\u9631\u6807\u5fd7

      • \u5f53TF=1\u65f6,CPU\u4f1a\u8fdb\u5165\u5355\u6b65\u6a21\u5f0f(single-step mode)\u3002
      • \u5f53TF=1\u65f6,CPU\u5728\u6bcf\u6267\u884c\u5b8c\u4e00\u6761\u6307\u4ee4\u540e,\u4f1a\u81ea\u52a8\u5728\u8be5\u6761\u6307\u4ee4\u4e0e\u4e0b\u6761\u6307\u4ee4\u4e4b\u95f4\u63d2\u5165\u4e00\u6761int 1h\u6307\u4ee4\u5e76\u6267\u884c\u5b83\u3002
      • \u5229\u7528\u5355\u6b65\u6a21\u5f0f\u53ef\u4ee5\u5b9e\u73b0\u53cd\u8c03\u8bd5,\u6f14\u793a\u4ee3\u7801\u89c1\u4ee5\u4e0b\u94fe\u63a5: http://cc.zju.edu.cn/bhh/antidbg.zip

      • bp\u7684\u9690\u542b\u6bb5\u5730\u5740\u662fss\u300c\u7528\u4ee5\u4ee3\u66ffsp\uff0c\u53ef\u83b7\u5f97\u5806\u6808\u4e2d\u7684\u5185\u5bb9\u300f

      • anti-debug \u4f8b\u5b50\uff1a
    code segment\nassume cs:code,ds:data\nmain:\n    jmp begin\nold1h dw 0,0\nprev_addr dw offset first,code  \n[\u6bb5\u5730\u5740+\u504f\u79fb\u5730\u5740\uff1a2x16\u4f4d]\n[\u5982\uff1aA0 00:00 01 \u662f\u4e00\u4e2a\u5730\u5740]\nbegin:\n    push cs\n    pop ds\n    xor ax,ax\n    mov es,ax  ;es=0\n    mov bx,4   ;bx=4 es:[bx]->int1h \u7684\u4e2d\u65ad\u5411\u91cf(\u8be5\u51fd\u6570\u7684\u9996\u5730\u5740) \u5176\u4e2d\u524d16\u4f4d\u5b58\u653e\u504f\u79fb\u5730\u57400:[4]\uff0c\u540e16\u4f4d\u5b58\u653e\u6bb5\u5730\u57400:[6]\n    push es:[bx]\n    pop old1h[0]\n    push es:[bx+2]\n    pop old1h[2]\n    mov word ptr es:[bx],offset int1h\n    mov word ptr es:[bx+2],cs\n    pushf   [save old FL \u628aflag\u538b\u5165\u5806\u6808]\n    pushf   [\u4e3a\u4e86\u4e4b\u540e\u518d\u628aTF\u6539\u62100][and ax,0FEFFh]\n    pop ax  [\u4e0d\u53ef\u7528mov ax,fl \u5373fl\u548cip\u552f\u4e8c\u4e0d\u80fd\u88ab\u5f15\u7528\u7684\u5bc4\u5b58\u5668]\n    or ax,100h [\u5c06TF\u6539\u62101]\uff01TF=1\n    push ax\n    popf    [FL=AX]\nfirst:\n    nop  \n    \u5f53\u67d0\u6307\u4ee4\u6267\u884c\u524dTF=1 \u5219\u8be5\u6307\u4ee4\u6267\u884c\u4e4b\u540e\u624d\u4f1a\u81ea\u52a8\u6267\u884cint01h\u5355\u6b65\u4e2d\u65ad\nsingle\u2014\u2014step_begin:\n\n[first int 1h] \nint1h\u53d1\u751f\u7684\u65f6\u5019 cpu\u4f1a\u505a\u4ee5\u4e0b\u7684\u52a8\u4f5c\uff1a\npushf      \u5c06flag\u538b\u5165\u5806\u6808\npush cs    \u5c06\u4e0b\u4e00\u6761\u6307\u4ee4\u7684\u6bb5\u5730\u5740\u538b\u5165\u5806\u6808\npush offset back \u5c06\u4e0b\u4e00\u6761\u6307\u4ee4\u7684\u504f\u79fb\u5730\u5740\u538b\u5165\u5806\u6808 <- ss:sp\njmp dword ptr 0:[4]\u8fdb\u5165\u51fd\u6570int1h\n\nback:\n    xor ax,ax\n    mov cx,3\nnext\uff1a\n    add ax,cx  ;\u5df2\u89e3\u5bc6\n    nop\n    loop next\n    popf\n    nop\nsingle_step_end:\n    push old1h[0]\n    pop es:[bx]\n    push old1h[2]\n    pop es:[bx+2]\n    mov ah,4Ch\n    int 21h\nint1h:\n    push bp\n    mov bp,sp\n    push bx\n    push es\n    mov bx,cs:prev_addr[0]\n    mov es,cs:prev_addr[2]\n    inc byte ptr es:[bx]\n    mov bx,[bp+2]\n    mov es,[bp+4]\n    dec byte ptr es:[bx]\n    mov cs:prev_addr[0],bx\n    mov cs:prev_addr[2],es \n    pop es\n    pop bx\n    pop bp\n    iret[\u4e2d\u65ad\u8fd4\u56de cpu\u4f1a\u6267\u884cpop ip \uff0cpop cs\uff0cpopf]\ncode ends\nend main\n
    "},{"location":"assembly/%E6%98%BE%E5%8D%A1%E8%BE%93%E5%87%BA/","title":"\u663e\u5361\u8f93\u51fa","text":""},{"location":"assembly/%E6%98%BE%E5%8D%A1%E8%BE%93%E5%87%BA/#_1","title":"\u663e\u5361\u8f93\u51fa","text":"
    • 7\u2014white 4-red
    0000\u2014\u2014black\n0001-blue\n0010-green\n0100-red\n0011(BLue and green)\n
    • \u6700\u53f3\u8fb9\u4e00\u4f4d\u8868\u793a\u52a0\u5f3a\u8272
    • (x,y)\u5750\u6807\u5bf9\u5e94\u7684\u663e\u5361\u504f\u79fb\u5730\u5740=\uff08y*80+x\uff09\u00d72 \uff0880\u00d725\u7684\u5c4f\u5e55\u5c3a\u5bf8\uff09
    • \u6ce8\u660e\uff1a\u4e5f\u5c31\u662f\u8bf4\u663e\u5361\uff0c\u4e00\u884c160\u4e2a\u5b57\u8282\uff1a
    • \u4e00\u822c\u4e00\u4e2a\u663e\u793a\u4f7f\u7528\u4e24\u4e2a\u5b57\u8282
    • \u7b2c\u4e00\u4e2a\u50a8\u5b58\u8f93\u51fa\uff0c\u7b2c\u4e8c\u4e2a\u50a8\u5b58\u989c\u8272
    code segment\nassume cs:code\nmain:\n  mov ax,0B800h\n  mov ds,ax\n  mov di,0\n  mov al,'A'\n  mov ah,17h\n  mov cx,2000\nagain:\n  mov ds:[di],ax\n  mov bx,800h\n\nwait_wait:\n  mov dx,0\nwait_a_while:\n  sub dx,1\n  jnz wait_a_while\n  sub bx,1\n  jnz wait_a_while;1000h\u4e58\u4ee5800h\n\n  mov word ptr ds:[di],0020h ;00\u9ed1\u8272\n  add di,2\n  sub cx,1\n  jnz again\n\n  mov ah,1\n  int 21h   (\u7528\u6237\u6572\u952e\u76d8\u518d\u7ed3\u675f)\n  mov ah ,4Ch\n  int 21h\n\ncode ends\nend main\n
    "},{"location":"assembly/%E6%98%BE%E5%8D%A1%E8%BE%93%E5%87%BA/#_2","title":"\u5185\u5b58\u6620\u5c04","text":"
    • B800:0000
    • \u6587\u672c\u6a21\u5f0f\u4e0b\u7684\u663e\u5361\u5730\u5740 A000:0000\u662f\u56fe\u5f62\u6a21\u5f0f\u4e0b\u7684\u663e\u5361\u5730\u5740
    • dos\u53ca\u7528\u6237\u7a0b\u5e8f\u5360\u7528\u8fd9\u5757\u5185\u5b58\uff0c\u603b\u957f\u4e3a640KB

      1000:0000~1000:FFFF\n\u2026\u2026\n9000:0000~9000:FFFF\n

    • A000:0000~A000:FFFF

    • (x,y)\u5750\u6807\u5bf9\u5e94\u7684\u663e\u5361\u504f\u79fb\u5730\u5740=y*320+x
    • B000:0000~B000:7FFF
      mov ah,0  set video mode\nmov al,13h  13\u53f7 320*200\nint 10h\n
    • int10h \u5207\u6362\u5230320 * 200 * 256\u8272\u56fe\u5f62\u6a21\u5f0f\uff08\u4e5f\u53ef\u4ee5\u8f93\u51fa\u6587\u672c 40x25 \uff09\uff080\u884c0\u5217\uff09
    • al=12h \u5207\u6362\u5230640 * 480 16 \u8272\u56fe\u5f62\u6a21\u5f0f > 640 480 \u8de8\u6bb5\uff0c\u8fd9\u4e2a\u65f6\u5019\u4e0d\u662f\u7528\u4e00\u4e2a\u5b57\u8282\u63a7\u5236\u4e00\u4e2a\u70b9\uff0c\u800c\u662f\u4e00\u4e2abit\u63a7\u5236\u4e00\u4e2a\u70b9 \uff0c\u7528\u56db\u4e2a\u5e73\u9762\u53e0\u8d77\u6765\uff0c\u63a7\u523616\u79cd\u989c\u8272

      code segment\nassume cs:code\nmain:\n  jmp begin\ni dw 0\nbegin:\n  mov ah,00h\n  mov al,13h\n  int 10h\n  mov ax,0A000h\n  mov es,ax\n  mov di,(100-20)*320+(160-20)\n  mov [i],41  \u4e00\u517141\u884c\nnext_row:\n  ;push cx\n  push di\n  mov al,4 ;color=red\n  mov cx,41\nnext_dot:\n  mov es:[di],al\n  add di,1\n  sub cx,1\n  jnz next_dot\n  pop di\n  add di,320\n  sub [i],1\n  jnz next_row\n  mov ah,1\n  int 21h\n\n  mov ah,00h\n  mov al,03h;80*25\u7684\u6587\u672c\u6a21\u5f0f\n  int 10h\n  mov ah ,4Ch\n  int 21h\ncode ends\nend main\n
    • Applications

      \u7a0b\u5e8f \u753b\u6c49\u5b57\n\ndata segment:\nhz db 04h,08h,0Eh,0A0h,78h,80h,08h,90h,\u2026\u202610h,0Ch\ndata ends\ncode segment:\nassume cs:code,ds:data\nmain:\n    mov ax,data\n    mov ds,ax\n    mov ax,0A000h\n    mov es,ax\n    mov di,0\n    mov ax,0013h\n    int 10h\n    mov dx,16\n    mov si,0\nnext_row:\n    mov ah,hz[si]\n    mov al,hz[si+1]\n    add si,2\n    mov cx,16\ncheck_next_dot:\n    shl ax,1\n    jnc no_dot\nis_dot:\n    mov byte ptr es:[di],0Ch\nno_dot:\n    add di,1\n    sub cx,1\n    jnz check_next_dot\n    sub di,16\n    add di,320\n    sub dx,1\n    jnz next_row\n    mov ah,1\n    int 21h\n    mov ax,0003h\n    int 10h;\u56de\u523080*25\u6587\u672c\u6a21\u5f0f\n    mov ah,4Ch\n    int 21h\ncode ends\nend main\n

    • \u5185\u5b58\u6620\u5c04
    • A000:0000-A000\uff1aFFFF B000:0000-B700:FFFF B800:0000~B800:7FFF \u6620\u5c04\u5230\u663e\u5361\u5185\u5b58
    • C000:0000C000:FFFF \u2026\u2026 F000:0000F000:FFFF \u6620\u5c04\u5230ROM
    • \u6620\u5c04\u65f6\u5728\u7535\u8111\u6267\u884cROM\u4e2dPOST\u4ee3\u7801\u8fc7\u7a0b\u4e2d\u5b8c\u6210\u7684;ROM\u4e2d\u8fd8\u5305\u62ecBIOS\u4ee3\u7801
    • \u5982int10h\u4ee5\u53caint16h\u51fd\u6570\u96c6\u5c31\u5b9a\u4e49\u5728BIOS\u4e2d
    "},{"location":"assembly/%E7%AB%AF%E5%8F%A3/","title":"\u7aef\u53e3","text":""},{"location":"assembly/%E7%AB%AF%E5%8F%A3/#_1","title":"\u7aef\u53e3","text":"
    • CPU <\u2014> \u7aef\u53e3(port) <\u2014> I/O\u8bbe\u5907

    • \u7aef\u53e3\u7f16\u53f7\u5c31\u662f\u7aef\u53e3\u5730\u5740\u3002\u7aef\u53e3\u5730\u5740\u7684\u8303\u56f4\u662f\uff1a[0000h, 0FFFFh]\uff0c\u517165536\u4e2a\u7aef\u53e3

    • \u5bf9\u7aef\u53e3\u64cd\u4f5c\u4f7f\u7528\u6307\u4ee4in\u4e0eout\u5b9e\u73b0\u3002

    "},{"location":"assembly/%E7%AB%AF%E5%8F%A3/#_2","title":"\u952e\u76d8\u901a\u4fe1","text":"
    • \u901a\u8fc760h\u53f7\u7aef\u53e3\uff0cCPU\u4e0e\u952e\u76d8\u4e4b\u95f4\u53ef\u4ee5\u5efa\u7acb\u901a\u8baf\u3002
    • in al, 60h\u4ece\u7aef\u53e360h\u8bfb\u53d6\u4e00\u4e2a\u5b57\u8282\u5e76\u5b58\u653e\u5230AL\u4e2d
    "},{"location":"assembly/%E7%AB%AF%E5%8F%A3/#_3","title":"\u65f6\u949f","text":"
    • 70h\u53ca71h\u7aef\u53e3\u4e0ecmos\u5185\u90e8\u7684\u65f6\u949f\u6709\u5173\u3002
    • 70h\u00a0\u5730\u5740\u7aef\u53e3\u00a0 71h\u00a0\u6570\u636e\u7aef\u53e3
    • \u5176\u4e2dcmos\u4e2d\u7684\u5730\u57404\u30012\u30010\u4e2d\u5206\u522b\u4fdd\u5b58\u4e86\u5f53\u524d\u7684\u65f6\u3001\u5206\u3001\u79d2\uff0c\u5e76\u4e14\u683c\u5f0f\u5747\u4e3aBCD\u7801\u3002
    mov al,2\nout 70h,al \u544a\u8bc9cmos\u63a5\u4e0b\u6765\u8981\u53bb\u8bbf\u95ee\u5b83\u76842\u53f7\u5185\u5b58\u5355\u5143\nin al,71h  \u8bfb\u53d6cmos\u4e2d2\u53f7\u5355\u5143\u7684\u503c\uff08\u5206\u949f\uff09\nmov al, 4\nout 70h, al\nmov al, 23h\nout 71h, al; \u628acmos4\u53f7\u5355\u5143\u5373\u5c0f\u65f6\u7684\u503c\u6539\u621023\u70b9\n
    "},{"location":"note/basicII/","title":"Basic data Structures II","text":""},{"location":"note/basicII/#graphs","title":"Graphs","text":""},{"location":"note/basicII/#some-defs","title":"Some defs","text":"
    • Complete graphs

    \\(Undirected \\ V=n \\ \\ \\ \\ E=C_n^2=\\frac{n(n-1)}{2}\\)

    \\(Directed \\ V=n \\ \\ \\ \\ E=2*C_n^2=n(n-1)\\)

    • Adjacent

    \\(Undirected \\ : (v_i,v_j)\\ is \\ incident \\ on\\ v_i\\ and\\ v_j\\)

    \\(Directed \\ : v_i \\ is\\ adjacent\\ to \\ v_j \\ \\ \\ \\ \\ v_j \\ is\\ adjacent\\ from \\ v_i\\)

    • Subgraph

    • Simple Path

    • Connected

    \\(Undirected:\\) An undirected graph G is connected if every pair of distinct \\(v_i\\) and \\(v_j\\) are connected

    • A tree = a graph that is connected and acyclic.

    \\(Directed:\\)

    Strongly connected directed graph G = for every pair of \\(v_i\\) and \\(v_j\\) in V( G ), there exist directed paths from \\(v_i\\) to \\(v_j\\) and from \\(v_j\\) to \\(v_i\\).

    If the graph is connected without direction to the edges, then it is said to be weakly connected

    Strongly connected component : the maximal subgraph that is strongly connected

    • A DAG = a directed acyclic graph.
    • Degree: Number of edges incident to v.
    • For a directed G, we have in-degree and out-degree.

    • \\(r=v-e+2\\)

    "},{"location":"note/basicII/#representation-of-graphs","title":"Representation of Graphs","text":""},{"location":"note/basicII/#adjacency-matrix","title":"Adjacency Matrix","text":"

    \\(adj_- mat[i][j]=\\left\\{\\begin{array}{l} 1 \\ if (v_i,v_j) \\ or <v_i,v_j> \\in E(G)\\\\0\\ \\ otherwise \\end{array}\\right.\\)

    If G is undirected the matrix is symmetric,thus sorting only half of the matrix

    The trick is to store the matrix as a 1-D array: adj_mat [ $n(n+1)/2 $] = \\({ a_{11}, a_{21}, a_{22}, ..., a_{n1}, ..., a_{nn} }\\)

    The index for \\(a_{ij}\\) is \\(i( i - 1 )/2+j\\).

    \\(\\begin{align*}degree(i) &= \\sum_{j=0}^{n-1}adj_-mat[i][j] \\ (If\\ G\\ is\\ undirected)\\\\ & \\ \\ +\\sum_{j=0}^{n-1}adj_-mat[j][i]\\ (If\\ G\\ is\\ directed)\\end{align*}\\)

    "},{"location":"note/basicII/#adjacency-lists","title":"Adjacency Lists","text":"
    • Undirected

    Degree( \\(i\\) ) = number of nodes in graph[ \\(i\\) ] (if \\(G\\) is undirected).

    T of examine (whether complete) E(G) = O( n + e )

    • Directed

    A. Add inverse adjacency lists

    B.Multilists

    "},{"location":"note/basicII/#adjacency-multilist","title":"Adjacency Multilist","text":"
    • The space taken :\\((n+2e)\\) ptrs + \\(2e\\) ints and \u201cmark\u201d is not counted.
    • Sometimes we need to mark the edge after examine it,and then find the next edge.This representation makesit easy to do so.
    "},{"location":"note/basicII/#topological-sort","title":"Topological Sort","text":""},{"location":"note/basicII/#aov-network","title":"AOV Network","text":"

    Digraph G in which V( G ) represents activities ( e.g. the courses ) and E( G ) represents precedence relations

    • i is a predecessor of j \\(:\\) there is a path from i to j.
    • i is an immediate predecessor of j \\(:\\) \\(< i, j >\\in E( G )\\) then \\(j\\) is called a successor ( immediate successor ) of i.
    • Partial order \\(:\\) a precedence relation which is both transitive and irreflexive.

    If the precedence relation is reflexive, then there must be an i such that i is a predecessor of i.

    That is, i must be done before i is started. Therefore if a project is feasible, it must be irreflexive.

    • Feasible AOV network must be a dag (directed acyclic graph).
    "},{"location":"note/basicII/#topological-order","title":"topological order","text":"

    A topological order is a linear ordering of the vertices of a graph such that, for any two vertices, i, j, if i is a predecessor of j in the network then i precedes j in the linear ordering.

    • Test an AOV for feasibility, and generate a topological order if possible.

    • Method One \\(T=O(|V|^2)\\)

    void Topsort( Graph G )\n{   int  Counter;\n    Vertex  V, W;\n    for ( Counter = 0; Counter < NumVertex; Counter ++ ) {\n        V = FindNewVertexOfDegreeZero( );\n        if ( V == NotAVertex ) {\n        Error ( \u201cGraph has a cycle\u201d );   break;  }\n        TopNum[ V ] = Counter; /* or output V */\n        for ( each W adjacent to V )\n            Indegree[ W ] \u2013 \u2013 ;\n    }\n}\n
    • Method Two. \\(T = O( |V| + |E| )\\)
    void Topsort( Graph G )\n{   Queue  Q;\n    int  Counter = 0;\n    Vertex  V, W;\n    Q = CreateQueue( NumVertex );  MakeEmpty( Q );\n    for ( each vertex V )\n    if ( Indegree[ V ] == 0 )   Enqueue( V, Q );\n    while ( !IsEmpty( Q ) ) {\n    V = Dequeue( Q );\n    TopNum[ V ] = ++ Counter; /* assign next */\n    for ( each W adjacent to V )\n        if ( \u2013 \u2013 Indegree[ W ] == 0 )  Enqueue( W, Q );\n    }  /* end-while */\n    if ( Counter != NumVertex )\n    Error( \u201cGraph has a cycle\u201d );\n    DisposeQueue( Q ); /* free memory */\n}\n
    "},{"location":"note/basicII/#midterm-review","title":"Midterm Review","text":"

    Which of the following statements is TRUE about topological sorting? (5\u5206)

    • If a graph has a topological sequence, then its adjacency matrix must be triangular.
    • If the adjacency matrix is triangular, then the corresponding directed graph must have a unique topological sequence.
    • In a DAG, if for any pair of distinct vertices Vi and Vj, there is a path either from Vi to Vj or from Vj to Vi, then the DAG must have a unique topological sequence.
    • If Vi precedes Vj in a topological sequence, then there must be a path from Vi to Vj.

    3 is true

    "},{"location":"note/basicII/#shortest-path-problem","title":"Shortest Path Problem","text":""},{"location":"note/basicII/#1single-source-shortest-path-problem","title":"1.Single-Source Shortest Path Problem","text":"
    • Unweighted Shortest Path
    void unweighted(Table T){\n    int CurrDist;\n    Vertex V,W;\n     for(CurrDist=0;CurrDist<NumVertex;CurrDist++){\n      for(each vertex V){      \n        if(!T[V].Known&&T[V].Dust==CurrDist){\n          R[V].Known=true;\n          for(each W adjacent to V){\n            if(T[W].Dist==infinity){\n              T[W].Dist=CurrDist+1;\n                T[E].Path=V;\n            }\n          }\n        }\n      }\n    }\n}\n

    But the time complexity is \\(O(|V|^2)\\)

    • Note: If V is unknown yet has \\(Dist < Infinity\\),then Dist is either \\(CurrDist\\) or \\(CurrDist +1\\)(Remember Tree?)

    Improvement

    void unweighted (Table T){\n  Queue Q;\n  Vertex V,W;\n  Q=CreateQueue(NumVertex);MakeEmpty(Q);\n  Enqueue(S,Q);\n  while(!isEmpty(Q)){\n    V=Dequeue(Q);\n    T[V].known=true;//not really necessary\n    for(each W adjacent to V){\n      if(T[W].Dist==Infinity){\n        T[W].Dist=T[V].Dist+1;\n        T[W].Path=V;\n        ENqueue(W,Q)\n      }\n    }\n  }\n  DisposeQueue(Q);\n}\n
    • \\(T=O(|V|+|E|)\\)
    "},{"location":"note/basicII/#dijkstras-algorithmfor-weighted-shortest-paths","title":"Dijkstra's Algorithm(for weighted shortest paths)","text":"
    void Dijkstra(Table T){\n  //T is initialized by Figure 9.30 on p 303\n  Vertex V,W;\n  for(;;){\n    V=smallest unknown distance vertex;\n    if(V==NotAVertex){break;}\n    T[V].known=true;\n    for(each W adjacent to V){\n      if(!T[W].Known){\n        if(T[V].Dist+Cvw<T[W].Dist){\n          Decrease(T[W].Dist to T[V].Dist+Cvw);\n          T[W].Path=V\n        }\n      }\n    }\n  }\n}\n
    • Implementation 1

    \\(T = O( |V|^2 + |E| )\\)

    • Initialization: The initialization phase involves traversing all vertices, setting their distances to infinity, and setting the initial vertex's distance to 0. The time complexity of this step is O(V), where V is the number of vertices.

    • Main Loop: The number of iterations in the main loop depends on the number of vertices. In each iteration, the algorithm selects the smallest unknown distance vertex V and then traverses all vertices W adjacent to V. For each W, it checks if there is a shorter path through V to W, and if so, it updates the distance of W.

      The time complexity of this step is \\(O(V^2)\\), as, for each vertex V, all vertices adjacent to V are considered.

    • Finding the Minimum Distance Vertex: In the main loop, the algorithm needs to find the smallest unknown distance vertex V. The time complexity of this step is O(V^2), as it needs to check the distance of each vertex.

    In summary, the time complexity of the Dijkstra algorithm is \\(O(V^2)\\).

    • Implementation 2

    • V = smallest unknown distance vertex: Keep distances in a priority queue and call DeleteMin \u2013 \\(O(log|V|)\\)

    • Decrease( T[ W ].Dist to T[ V ].Dist + Cvw )

      • Method 1: DecreaseKey \u2013 \\(O(log|V|)\\)

      \\(T = O( |V|log|V|+|E|log|V|)=O(|E|log|V|)\\) ----Good if the graph is sparse

      • Method 2: insert \\(W\\) with updated Dist into the priority queue.

      Must keep doing DeleteMin until an unknown vertex emerges

      \\(T = O(|E| log|V| )\\) but requires \\(|E|\\) DeleteMin with \\(|E|\\) space

    "},{"location":"note/basicII/#graphs-with-negative-edge-costs","title":"Graphs with Negative Edge Costs","text":"
    • Why don\u2019t we simply add a constant to each edge and thus remove negative edges? --Path with different count of PATHS!
    void  WeightedNegative( Table T )\n{   Queue  Q;\n    Vertex  V, W;\n    Q = CreateQueue (NumVertex );  MakeEmpty( Q );\n    Enqueue( S, Q ); /* Enqueue the source vertex */\n    while (!IsEmpty(Q)){\n      V=Dequeue(Q);/* each vertex can dequeue at most |V| times */\n      for(each W adjacent to V){\n        if ( T[ V ].Dist + Cvw < T[ W ].Dist ){/* no longer once per edge */\n            T[ W ].Dist = T[ V ].Dist + Cvw;\n            T[ W ].Path = V;\n            if(W is not already in Q){Enqueue(W,Q)}\n        }/* end-if update */                                              \n      }\n    }/* end-while */\n    DisposeQueue( Q ); /* free memory */\n}\n
    "},{"location":"note/basicII/#acyclic-graphs","title":"Acyclic Graphs","text":"

    If the graph is acyclic, vertices may be selected in topological order since when a vertex is selected, its distance can no longer be lowered without any incoming edges from unknown nodes.

    \\(T=O(|E| + |V|)\\) and no priority queue is needed.

    Application: AOE ( Activity On Edge ) Networks \u2014\u2014 scheduling a project

    "},{"location":"note/basicII/#all-pairs-shortest-path-problem","title":"All-pairs Shortest path problem","text":""},{"location":"note/basicII/#network-flow-problem","title":"Network Flow Problem","text":""},{"location":"note/basicII/#ford-fulkerson-algorithm","title":"Ford-Fulkerson Algorithm","text":"
    • If the edge capabilities are rational numbers, this algorithm always terminate with a maximum flow.

    • The algorithm works for G with cycles as well.

    Analysis

    "},{"location":"note/basicII/#1an-augmenting-path-can-be-found-by-an-unweighted-shortest-path-algorithm","title":"1.An augmenting path can be found by an unweighted shortest path algorithm.","text":"

    \\(T = O( f\\cdot|E| )\\) where f is the maximum flow.

    "},{"location":"note/basicII/#2always-choose-the-augmenting-path-that-allows-the-largest-increase-in-flow","title":"2.always choose the augmenting path that allows the largest increase in flow.","text":"

    \\(\u300cmodify\\ Dijkstra\u2019s\\ algorithm\\ \u300d\\)

    \\(\\begin{align*}T&=T_{argmentation}*T_{find\\ a\\ path}\\\\ &=O(E)log(cap_{max})*O(|E|log|V|)\\\\ &= O( |E|^2log|V|).\\end{align*}\\) if capmax is a small integer

    "},{"location":"note/basicII/#3always-choose-the-augmenting-path-that-has-the-least-number-of-edges","title":"3.Always choose the augmenting path that has the least number of edges.","text":"

    Simple \\(BSF\\) Unweighted shortest path algorithm

    \\(\\begin{align*}T&=T_{argmentation}*T_{find\\ a\\ path}\\\\ &=O(E)*O(|E||V|)\\\\ &= O( |E|^2|V|).\\end{align*}\\)

    • If every v \\(\\notin\\) { s, t } has either a single incoming edge of capacity 1 or a single outgoing edge of capacity 1, then time bound is reduced to \\(O( |E| |V|^{1/2} )\\).
    • The min-cost flow problem is to find, among all maximum flows, the one flow of minimum cost provided that each edge has a cost per unit of flow.
    "},{"location":"note/basicII/#minimum-spanning-tree","title":"Minimum Spanning Tree","text":"
    • A spanning tree of a graph G is a tree which consists of \\(V( G )\\) and a subset of \\(E( G )\\)
    • The minimum spanning tree is a tree since it is acyclic -- the number of edges is |V| \u2013 1.
    • It is minimum for the total cost of edges is minimized.
    • It is spanning because it covers every vertex.
    • A minimum spanning tree exists iff G is connected.
    • Adding a non-tree edge to a spanning tree, we obtain a cycle.
    "},{"location":"note/basicII/#algorithm","title":"Algorithm","text":"

    (1) we must use only edges within the graph

    (2) we must use exactly |V| -1 edges

    (3) we may not use edges that would produce a cycle.

    "},{"location":"note/basicII/#1prims-algorithm-grow-a-tree","title":"1.Prim\u2019s Algorithm \u2013 grow a tree","text":""},{"location":"note/basicII/#2krukals-algorithm-grow-a-tree","title":"2.Krukal\u2019s Algorithm \u2013 grow a tree","text":"
    void Kruskal ( Graph G )\n{   T = { } ;\n    while  ( T contains less than |V| - 1 edges \n                   && E is not empty ) {\n        choose a least cost edge (v, w) from E ; /* Delete Min */\n        delete (v, w) from E ;\n        if  ( (v, w) does not create a cycle in T )     /Union Find/\n    add (v, w) to T ;*\n        else     \n    discard (v, w) ;\n    }\n    if  ( T contains fewer than |V| - 1 edges )\n        Error ( \u201cNo spanning tree\u201d ) ;\n}\n
    "},{"location":"note/basicII/#applications-of-depth-first-search","title":"Applications of Depth-First Search","text":"
    void DFS ( Vertex V )  /* this is only a template */\n{   visited[ V ] = true;  /* mark this vertex to avoid cycles */\n    for ( each W adjacent to V )\n        if ( !visited[ W ] )\n    DFS( W );\n} \n/* T = O( |E| + |V| ) as long as adjacency lists are used */\n
    "},{"location":"note/basicII/#biconnectivity","title":"Biconnectivity","text":"
    • v is an articulation point if G\u2019 = DeleteVertex( G, v ) has at least 2 connected components.
    • G is a biconnected graph if G is connected and has no articulation points.
    • A biconnected component is a maximal biconnected subgraph.
    "},{"location":"note/basicII/#find-the-biconected-components-of-a-connected-undirected-graph-g","title":"find the biconected components of a connected undirected graph G","text":""},{"location":"note/basicII/#directed-case","title":"Directed case","text":"

    Refert to https://www.baeldung.com/cs/scc-tarjans-algorithm

    A directed graph is strongly connected if there is a path between all pairs of vertices. A strongly connected component (SCC) of a directed graph is a maximal strongly connected subgraph.

    • DFS search produces a DFS tree/forest
    • Strongly Connected Components form subtrees of the DFS tree.
    • If we can find the head of such subtrees, we can print/store all the nodes in that subtree (including the head) and that will be one SCC.
    • There is no back edge from one SCC to another (There can be cross edges, but cross edges will not be used while processing the graph).

    • Case1 (Tree Edge): If node v is not visited already, then after the DFS of v is complete, a minimum of low[u] and low[v] will be updated to low[u]. low[u] = min(low[u], low[v])

    • Case 2 (Back Edge): When child v is already visited, then a minimum of low[u] and Disc[v] will be updated to low[u]. low[u] = min(low[u], disc[v]);
    "},{"location":"note/basicII/#euler-circuit","title":"Euler Circuit","text":"
    • \u6b27\u62c9\u56de\u8def\uff08Euler circuit\uff09\u4e3a\u5305\u542b\u6240\u6709\u8fb9\u7684\u7b80\u5355\u73af\uff0c\u6b27\u62c9\u8def\u5f84\uff08Euler path\uff09\u4e3a\u5305\u542b\u6240\u6709\u8fb9\u7684\u7b80\u5355\u8def\u5f84
    • \u65e0\u5411\u56fe
    • \u65e0\u5411\u56fe G \u6709\u6b27\u62c9\u56de\u8def\u5f53\u4e14\u4ec5\u5f53 G \u662f\u8fde\u901a\u7684\u4e14\u6bcf\u4e2a\u9876\u70b9\u7684\u5ea6\u6570\u90fd\u662f\u5076\u6570
    • \u65e0\u5411\u56fe G \u6709\u6b27\u62c9\u8def\u5f84\u5f53\u4e14\u4ec5\u5f53 G \u662f\u8fde\u901a\u7684\u4e14\u6709\u4e14\u4ec5\u6709\u4e24\u4e2a\u9876\u70b9\u7684\u5ea6\u6570\u662f\u5947\u6570
    • \u6709\u5411\u56fe
    • \u6709\u5411\u56fe G \u6709\u6b27\u62c9\u56de\u8def\u5f53\u4e14\u4ec5\u5f53 G \u662f\u5f31\u8fde\u901a\u7684\u4e14\u6bcf\u4e2a\u9876\u70b9\u7684\u51fa\u5ea6\u7b49\u4e8e\u5165\u5ea6
    • \u6709\u5411\u56fe G \u6709\u6b27\u62c9\u8def\u5f84\u5f53\u4e14\u4ec5\u5f53 G \u662f\u5f31\u8fde\u901a\u7684\u4e14\u6709\u4e14\u4ec5\u6709\u4e00\u4e2a\u9876\u70b9\u7684\u51fa\u5ea6\u6bd4\u5165\u5ea6\u5927 1\uff0c\u6709\u4e14\u4ec5\u6709\u4e00\u4e2a\u9876\u70b9\u7684\u5165\u5ea6\u6bd4\u51fa\u5ea6\u5927 1\uff0c\u5176\u4f59\u9876\u70b9\u7684\u51fa\u5ea6\u7b49\u4e8e\u5165\u5ea6
    "},{"location":"note/basicII/#dfs","title":"DFS","text":"
    • The path should be maintained as a linked list.
    • For each adjacency list, maintain a pointer to the last edge scanned.
    • T = \\(O( |E| + |V| )\\)
    #include <iostream>\n#include <cstring>\nusing namespace std;\nconst int maxn = 1005;  // \u5047\u8bbe\u6700\u5927\u8282\u70b9\u6570\u4e3a1005\nint G[maxn][maxn];      // \u90bb\u63a5\u77e9\u9635\u8868\u793a\u56fe\nint deg[maxn];          // \u8282\u70b9\u7684\u5ea6\nint ans[maxn];          // \u5b58\u50a8\u7ed3\u679c\u7684\u6570\u7ec4\nint ansi = 0;           // \u7ed3\u679c\u6570\u7ec4\u7684\u7d22\u5f15\nbool visited[maxn];     // \u6807\u8bb0\u8282\u70b9\u662f\u5426\u88ab\u8bbf\u95ee\u8fc7\nvoid dfs(int x) {\n    for (int y = 1; y <= maxn; ++y) {\n        if (G[x][y]) {\n            G[x][y] = G[y][x] = 0;\n            dfs(y);\n        }\n    }\n    ans[++ansi] = x;\n}\nint main() {\n    // ... \u8bfb\u53d6\u8f93\u5165\uff0c\u521d\u59cb\u5316 G \u548c deg\n    int cnt = 0, root = 0;\n    for (int i = 1; i <= maxn; ++i) {\n        if (deg[i] % 2) {\n            cnt++;\n            if (!root) root = i;\n        }\n    }\n    if (!root) {\n        for (int i = 1; i <= maxn; ++i) {\n            if (deg[i]) {\n                root = i; break;\n            }\n        }\n    }\n    if (cnt && cnt != 2) {\n        cout << \"No Solution\\n\";\n        return 0;\n    }\n    dfs(root);\n    // \u8f93\u51fa\u7ed3\u679c\n    for (int i = ansi; i > 0; --i) {\n        cout << ans[i] << ' ';}\n    cout << '\\n';\n    return 0;\n}\n
    "},{"location":"note/basicII/#hamilton-cycle","title":"Hamilton cycle","text":""},{"location":"note/hash/","title":"HASHING","text":""},{"location":"note/hash/#interpolation-search","title":"Interpolation Search","text":"

    Interpolation Search is a searching algorithm used to find a specific element in a sorted array. Similar to binary search, it employs a divide-and-conquer strategy, but it differs by estimating the probable position of the target value based on the distribution of the search key and array elements at each step.

    The algorithm proceeds as follows:

    1. Assume the array is sorted.

    2. Calculate the interpolation position using the formula:

    \\(position=low+\u230a\\frac{(high\u2212low)\u00d7(key\u2212arr[low])}{arr[high]\u2212arr[low]\u230b}\\)

    Here, \\(arr\\) is the array, and \\(low\\) and \\(high\\) are the array indices, while \\(key\\) is the element to be searched.

    1. If \\(arr[position]=key\\), the target element is found, and the position positionposition is returned.

    2. If \\(arr[position]<key\\), continue the search in the right half by updating \\(low=position+1\\)

    3. If \\(arr[position]>key\\), continue the search in the left half by updating \\(high=position\u22121\\)

    4. Repeat steps 2 to 5 until the target element is found or \\(low>high\\).

    Interpolation Search excels when dealing with uniformly distributed sorted arrays, as it efficiently estimates the target element's position, reducing the number of search iterations. However, its effectiveness relies on the assumption of a roughly uniform distribution of array elements. In cases of uneven data distribution, other search algorithms may outperform Interpolation Search. Binary search, for instance, could be more stable as it is less sensitive to the distribution of array elements.

    "},{"location":"note/hash/#hash-tables","title":"Hash Tables","text":"

    https://www.geeksforgeeks.org/hashing-data-structure/#introduction

    • Without overflow,\\(T_{search} = T_{insert} = T_{delete} = O( 1 )\\)
    "},{"location":"note/hash/#hash-functions","title":"Hash Functions","text":"

    For numbers\uff1a

    \uff081\uff09\u6c42\u4f59\u6cd5

    \uff082\uff09\u5e73\u65b9\u53d6\u4e2d

    \uff083\uff09\u6298\u53e0\u6cd5

    \uff084\uff09\u6570\u5b57\u5206\u6790\u6cd5

    • Eg. To Hash \"Strings\"

    \\(f(x)=(\\sum x[N-i-1]*32^i)\\%TableSize\\)

    Index Hash3( const char *x, int TableSize ) {\n    unsigned  int  HashVal = 0; \n/* 1*/  while( *x != '\\0' ) \n/* 2*/       HashVal = ( HashVal << 5 ) + *x++; \n/* 3*/  return HashVal % TableSize; \n} \n
    • If x is too long (e.g. street address), the early characters will be left-shifted out of place.
    "},{"location":"note/hash/#separate-chaining","title":"Separate Chaining","text":"
    struct  ListNode; \ntypedef  struct  ListNode  *Position; \nstruct  HashTbl; \ntypedef  struct  HashTbl  *HashTable; \nstruct  ListNode { \n    ElementType  Element; \n    Position  Next; \n}; \ntypedef  Position  List; \n/* List *TheList will be an array of lists, allocated later */ \n/* The lists use headers (for simplicity), */ \n/* though this wastes space */ \nstruct  HashTbl { \n    int  TableSize; \n    List  *TheLists; \n};\n
    "},{"location":"note/hash/#create-an-empty-table","title":"Create an empty table","text":"
    HashTable  InitializeTable( int TableSize ) \n{   HashTable  H; \n    int  i; \n    if ( TableSize < MinTableSize ) { \n        Error( \"Table size too small\" );  return NULL;  \n    } \n    H = malloc( sizeof( struct HashTbl ) );  /* Allocate table */\n    if ( H == NULL )    FatalError( \"Out of space!!!\" ); \n    H->TableSize = NextPrime( TableSize );  /* Better be prime */\n    H->TheLists = malloc( sizeof( List ) * H->TableSize );  /*Array of lists*/\n    if ( H->TheLists == NULL )   FatalError( \"Out of space!!!\" ); \n    for( i = 0; i < H->TableSize; i++ ) {   /* Allocate list headers */\n                H->TheLists[ i ] = malloc( sizeof( struct ListNode ) ); /* Slow! */\n                if ( H->TheLists[ i ] == NULL )  FatalError( \"Out of space!!!\" ); \n                else    H->TheLists[ i ]->Next = NULL;\n    } \n    return  H; \n} \n
    "},{"location":"note/hash/#find-a-key-from-a-hash-table","title":"Find a key from a hash table","text":"
    Position  Find ( ElementType Key, HashTable H ) \n{ \n    Position P; \n    List L; \n    L = H->TheLists[ Hash( Key, H->TableSize ) ]; \n\n    P = L->Next; \n    while( P != NULL && P->Element != Key )  /* Probably need strcmp */ \n    P = P->Next; \n    return P; \n} \n
    "},{"location":"note/hash/#insert-a-key-into-a-hash-table","title":"Insert a key into a hash table","text":"
    void  Insert ( ElementType Key, HashTable H ) \n{ \n    Position  Pos, NewCell; \n    List  L; \n    Pos = Find( Key, H ); \n    if ( Pos == NULL ) {   /* Key is not found, then insert */\n            NewCell = malloc( sizeof( struct ListNode ) ); \n            if ( NewCell == NULL )     FatalError( \"Out of space!!!\" ); \n            else { \n                L = H->TheLists[ Hash( Key, H->TableSize ) ]; \n                NewCell->Next = L->Next; \n                NewCell->Element = Key; /* Probably need strcpy! */ \n              L->Next = NewCell; \n                        } \n        } \n} \n
    "},{"location":"note/hash/#open-addressing","title":"Open Addressing","text":"

    Solve Collision

    Algorithm: insert key into an array of hash table\n{\n    index = hash(key);\n    initialize i = 0 ------ the counter of probing;\n    while ( collision at index ) {\n            index = ( hash(key) + f(i) ) % TableSize;\n            if ( table is full )    break;\n            else    i ++;\n    }\n    if ( table is full )  ERROR (\u201cNo space left\u201d);\n    else  insert key at index;\n}\n
    "},{"location":"note/hash/#linear-probing","title":"Linear Probing","text":"

    \\(f(i)=i\\)

    • Although p is small,the worst case can beLARGE.
    • Cause primary clustering: any key that hashes into the cluster will add to the cluster after several attempts to resolve the collision.
    "},{"location":"note/hash/#quadratic-probing","title":"Quadratic Probing","text":"

    \\(f(i)=i^2\\)

    • If the table size is a prime of the form 4k + 3, then the quadratic probing \\(f(i)=i^2\\) can probe the entire table.
    • Read Figures \\(7.15 - 7.16\\) for detailed representations and implementations of initialization.
    Position  Find ( ElementType Key, HashTable H ) \n{   Position  CurrentPos; \n    int  CollisionNum; \n    CollisionNum = 0; \n    CurrentPos = Hash( Key, H->TableSize ); \n    while( H->TheCells[ CurrentPos ].Info != Empty && \n    H->TheCells[ CurrentPos ].Element != Key ) { \n    CurrentPos += 2 * ++CollisionNum \uf02d 1; \n    if ( CurrentPos >= H->TableSize )  CurrentPos \uf02d = H->TableSize; \n    } \n    return CurrentPos; \n} \n
    • Insert
    void  Insert ( ElementType Key, HashTable H ) \n{ \n    Position  Pos; \n    Pos = Find( Key, H ); \n    if ( H->TheCells[ Pos ].Info != Legitimate ) { /* OK to insert here */ \n    H->TheCells[ Pos ].Info = Legitimate; \n    H->TheCells[ Pos ].Element = Key; /* Probably need strcpy */ \n    } \n} \n
    • Delete

    Insertion will be seriously slowed down if there are too many deletions intermixed with insertions.

    Although primary clustering is solved, secondary clustering occurs \u2013 that is, keys that hash to the same position will probe the same alternative cells.

    "},{"location":"note/hash/#double-hashing","title":"Double Hashing","text":"

    \\(f ( i ) = i * hash_2( x )\\) hash2( x ) is the 2nd hash function

    "},{"location":"note/hash/#rehashing","title":"Rehashing","text":""},{"location":"note/list/","title":"List","text":""},{"location":"note/list/#linked-list","title":"linked list","text":"

    // Reverse a linked list\nq=h;\np=NUll;\nwhile(q){\n    t = q->next;\n    q->next = p;\n    p=q;\n    q=t;\n}\nh = p;\n\nLNode *reverse( LNode *head ){\n    LNode *p0,*head1;\n    head1=NULL;\n    for(p0=head->next;p0;){\n       LNode *temp=p0->next;//important!!!\n       p0->next =head1;\n       head1=p0;\n       p0=temp;\n    }\n    return head1;\n}\n
    * multilist * sparse matrix representation

    "},{"location":"note/sort/","title":"Sort","text":""},{"location":"note/sort/#simple-sort","title":"Simple Sort","text":""},{"location":"note/sort/#algorithm","title":"Algorithm","text":""},{"location":"note/sort/#bubble-sort","title":"Bubble sort","text":"

    Basic

    void bubbleSort(int arr[], int n) {\n    for (int i = 0; i < n - 1; i++) {\n        for (int j = 0; j < n - i - 1; j++) {\n            if (arr[j] > arr[j + 1]) {\n                int temp = arr[j];\n                arr[j] = arr[j + 1];\n                arr[j + 1] = temp;\n            }\n        }\n    }\n}\n

    Improvement

    void bubbleSort_recursive(int a[],int begin,int end,int n){\n    if(end>begin){\n        int lastswap=-1;\n        for(int i=begin;i<end;i++){\n        if(a[i]>a[i+1]){\n          int m=a[i];\n          a[i]=a[i+1];\n          a[i+1]=m; \n          lastswap=i;\n        }\n    }\n    end=lastswap;\n    sort(a,begin,end,n);\n}\n\nvoid bubbleSort_iter (int a[], int n){\n    int lastswap, end;\n    for (int i=0;i<n-1;i++) {\n        lastswap = -1;\n        for (int j=0;j<end;j++) {\n            if (a[j] > a[j + 1]) {\n                exchange(&a[j], &a[j + 1]);\n                lastswap = j;\n            }\n        }\n        end = lastswap;\n    }\n}\n
    "},{"location":"note/sort/#selection-sort","title":"Selection sort","text":"
    void selectionSort(int arr[], int n) {\n    int i, j, min_idx;\n    // \u5916\u5c42\u5faa\u73af\u904d\u5386\u672a\u6392\u5e8f\u90e8\u5206\n    for (i = 0; i <n-1;i++) {\n        // \u5047\u8bbe\u5f53\u524d\u672a\u6392\u5e8f\u90e8\u5206\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\u4e3a\u6700\u5c0f\n        min_idx = i;\n        // \u5185\u5c42\u5faa\u73af\u5728\u672a\u6392\u5e8f\u90e8\u5206\u4e2d\u627e\u5230\u6700\u5c0f\u5143\u7d20\u7684\u7d22\u5f15\n        for (j=i+1;j<n;j++) {\n            if (arr[j] < arr[min_idx]) {\n                min_idx = j;\n            }\n        }\n        // \u5c06\u627e\u5230\u7684\u6700\u5c0f\u5143\u7d20\u4e0e\u672a\u6392\u5e8f\u90e8\u5206\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\u4ea4\u6362\u4f4d\u7f6e\n        swap(&arr[min_idx], &arr[i]);\n    }\n}\n
    "},{"location":"note/sort/#insertion-sort","title":"Insertion Sort","text":"
    void InsertionSort ( ElementType A[ ], int N ){\n  int j,P;\n  ElementType Tmp;\n  for(P=1;P<N;P++){\n    Tmp=A[p];\n    for(j=P;j>0&&A[j-1]>Tmp;j--){\n      A[j]=A[j-1];\n    }\n    A[j]=Tmp;\n  }\n}\n

    The worst case:Input \\(A[ \\ \\ ]\\) is in reverse order. \\(T( N ) = O( N^2 )\\)

    "},{"location":"note/sort/#analysis","title":"Analysis","text":"
    • A Lower Bound for Simple Sorting Algorithms
    • An inversion in an array of numbers is any ordered pair \\(( i, j )\\) having the property that \\(i < j\\) but \\(A[i] > A[j]\\).
    • Swapping two adjacent elements that are out of place removes exactly one inversion.
    • \\(T ( N, I )\\) = \\(O( I+N )\\) where \\(I\\) is the number of inversions in the original array.

    • The average number of inversions in an array of N distinct numbers is \\(N ( N +1 ) / 4\\).

    • Any algorithm that sorts by exchanging adjacent elements requires \\(\\Omega( N^2 )\\) time on average.
    "},{"location":"note/sort/#shell-sort","title":"Shell sort","text":"

    Original Shell Sequence: The original sequence suggested by Donald Shell was to use gaps of n/2, n/4, n/8, ..., 1. This is a simple and effective sequence, often called the \"original Shell sequence.\" It is easy to implement and works well in practice.

    for (int gap = n/2; gap > 0; gap /= 2) {\n    // Shell sort logic\n}\n

    Knuth's Sequence: Donald Knuth suggested a formula for computing gaps, which is 3^k - 1 for k = 0, 1, 2, .... This sequence often performs well in practice.

    for (int gap = 1; gap < n/3; gap = 3 * gap + 1) {\n    // Shell sort logic\n}\n

    Sedgewick's Sequence: Robert Sedgewick proposed a sequence that interleaves powers of 2 and 3: 1, 5, 19, 41, 109, 209, 505, .... It combines the simplicity of the original Shell sequence with the effectiveness of the Knuth sequence.

    int sedgewick[] = {1, 5, 19, 41, 109, 209, 505, ...};  // Extend as needed\nint sedgewickIndex = 0;\nfor (int gap = sedgewick[sedgewickIndex]; gap > 0; gap = sedgewick[++sedgewickIndex]) {\n    // Shell sort logic\n}\n
    the terms are either of the form \\(9\\times 4^i -9\\times 2^i + 1\\) or \\(4^i -3\\times 2^i + 1\\). \\(T_{avg} ( N ) = O ( N^{7/6} )\\) and \\(T_{worst} ( N ) = O ( N^{4/3} )\\).

    void shellSort(int arr[], int n) {\n    // ps:we can choose any ideal sequence suitable for given cases\n    for (int gap = n/2; gap > 0; gap /= 2) {\n        for (int i = gap; i < n; i++) {\n            int temp = arr[i];\n            int j;\n            for (j = i; j >= gap && arr[j - gap] > temp; j -= gap) {\n                arr[j] = arr[j - gap];\n            }\n            arr[j] = temp;\n        }\n    }\n}\n
    "},{"location":"note/sort/#worst-case-analysis","title":"Worst-Case Analysis:","text":"

    The worst-case running time of Shellsort, using Shell's increments, is \\(O(N^2)\\). * example : 1 9 2 10 3 11 4 12 5 13 6 14

    "},{"location":"note/sort/#hibbards-increment-sequence","title":"Hibbard's Increment Sequence:","text":"

    \\(h_k = 2^k -1\\) ---- consecutive increments have no common factors. The worst-case running time of Shellsort, using Hibbard's increments, is \\(O( N^{3/2})\\).

    "},{"location":"note/sort/#heap-sort","title":"Heap Sort","text":""},{"location":"note/sort/#algorithm-1","title":"Algorithm 1:","text":"

    Algorithm 1:\n{\n  BuildHeap( H ); //O(N)\n  for (int i=0; i<N; i++ ){\n        TmpH[ i ] = DeleteMin( H );O(logN)\n  }\n  for ( i=0; i<N; i++ ){\n        H[ i ] = TmpH[ i ];\n  }\n}\n
    \\(T ( N ) = O ( N log N )\\) but space needed is doubled.

    "},{"location":"note/sort/#algorithm-2","title":"Algorithm 2:","text":"

    Review

    void PercolateDown( int p, PriorityQueue H ){   \n    int temp=H->Elements[p];\n    int parent,son;\n    for(parent=p;parent*2<=H->Size;parent=son){\n        son=parent*2;\n        if(son<H->Size&&H->Elements[son]<H->Elements[son+1]){\n            son++;      \n        }\n        if(temp>=H->Elements[son]){break;}      \n        else{H->Elements[parent]=H->Elements[son];}\n    }\n    H->Elements[parent]=temp;\n}\n

    void Heapsort( ElementType A[ ], int N ) \n{   int i; \n    for ( i = N / 2; i >= 0; i - - ) /* BuildHeap */ {PercDown( A, i, N ); }\n    for ( i = N - 1; i > 0; i - - ) { \n        Swap( &A[ 0 ], &A[ i ] ); /* DeleteMax */ \n        PercDown( A, 0, i ); \n    } \n}\n
    The average number of comparisons used to heapsort a random permutation of N distinct items is \\(2N log N - O( N log log N )\\).

    Although Heapsort gives the best average time, in practice it is slower than a version of Shellsort that uses Sedgewick's increment sequence.

    "},{"location":"note/sort/#mergesort","title":"Mergesort","text":"
    void Mergesort( ElementType A[ ], int N );\nvoid MSort( ElementType A[ ], ElementType TmpArray[ ],int Left,int Right);\nvoid Merge( ElementType A[ ], ElementType TmpArray[ ],int Lpos,int Rpos, int RightEnd);\n\nvoid Mergesort( ElementType A[ ], int N ) {\n    ElementType  *TmpArray;  /* need O(N) extra space */\n    TmpArray = malloc( N * sizeof( ElementType ) ); \n    if ( TmpArray != NULL ) { \n            MSort( A, TmpArray, 0, N - 1 ); \n            free( TmpArray ); \n    } \n    else  FatalError( \"No space for tmp array!!!\" ); \n}\n\nvoid MSort( ElementType A[ ], ElementType TmpArray[ ],int Left, int Right){\n    int  Center; \n    if ( Left < Right ) {  /* if there are elements to be sorted */\n        Center = ( Left + Right ) / 2; \n        MSort( A, TmpArray, Left, Center );     /* T( N / 2 ) */\n        MSort( A, TmpArray, Center + 1, Right );    /* T( N / 2 ) */\n        Merge( A, TmpArray, Left, Center + 1, Right );  /* O( N ) */\n    } \n} \n\n/* Lpos = start of left half, Rpos = start of right half */ \nvoid Merge( ElementType A[ ], ElementType TmpArray[ ], int Lpos, int Rpos, int RightEnd ) {\n    int  i, LeftEnd, NumElements, TmpPos; \n    LeftEnd = Rpos - 1; \n    TmpPos = Lpos; \n    NumElements = RightEnd - Lpos + 1; \n    while(Lpos<=LeftEnd && Rpos<=RightEnd){\n        if(A[Lpos]<=A[Rpos]){TmpArray[TmpPos++]=A[Lpos++];}\n        else{TmpArray[TmpPos++]=A[Rpos++];}\n    }\n    while(Lpos<=LeftEnd){TmpArray[ TmpPos++ ] = A[ Lpos++ ];}\n    while(Rpos<=RightEnd){TmpArray[ TmpPos++ ] = A[ Rpos++ ];}\n    for( i = 0; i < NumElements; i++, RightEnd - - ) \n         /* Copy TmpArray back */ \n        A[ RightEnd ] = TmpArray[ RightEnd ]; \n}\n/** version2 **/\nvoid Merge2( ElementType A[ ], ElementType TmpArray[ ], int Lpos, int Rpos, int RightEnd ) {\n    int  i, LeftEnd, NumElements, TmpPos; \n    LeftEnd = Rpos - 1; \n    TmpPos = Lpos; \n    NumElements = RightEnd - Lpos + 1; \n    for(int i=0;i<NumElements;i++){\n        if((Lpos<=LeftEnd)&&(Rpos>RightEnd||A[Lpos]<=A[Rpos])){TmpArray[i]=A[Lpos++];}\n        else{TmpArray[TmpPos++]=A[Rpos++];}\n    }\n}\n/** version3 **/\nvoid CopyArray(int B[],int iBegin,int iEnd,int A[]);\nvoid Merge (int A[],int ileft,int iright,int iend,int B[]);\nvoid BottomupMergeSort(int A[],int B[],int n){\n   for(int width=1;width<n;width=width*2){\n           for(int i=0;i<n;i=i+2*width){\n            Merge(A,i,min(i+width,n),min(i+2*width,n),B);\n           }\n           CopyArray(B,0,n,A);\n   }\n}\n// (iBegin,iEnd]\nvoid Merge (int A[],int ileft,int iright,int iend,int B[]){\n     int i=ileft,j=iright;\n     for(int k=ileft;k<iend;k++){\n         if(i<iright&&(j>=iend||A[i]<=A[j])){\n            B[k]=A[i++];\n         }\n         else{B[k]=A[j++];}\n    }\n}\n
    "},{"location":"note/sort/#complexity","title":"Complexity","text":"

    \\(T(n)=2T(n/2)+O(n)\\) \u2192 \\(O(nlogn)\\) Note: Mergesort requires linear extra memory, and copying an array is slow. It is hardly ever used for internal sorting, but is quite useful for external sorting.

    "},{"location":"note/sort/#quick-sort","title":"Quick Sort","text":""},{"location":"note/sort/#picking-the-pivot","title":"Picking the Pivot","text":"

    A Safe Maneuver: \\(Pivot = random\\ select\\ from\\ A[\\ \\ ]\\)

    Median-of-Three Partitioning : \\(Pivot\\ = median ( left, center, right )\\)

    1. Select the elements at the leftmost, center, and rightmost positions of the array.
    2. Calculate the median among these three elements, i.e., identify the element that is the middle value.
    3. Set the median as the pivot element.

    Eliminates the bad case for sorted input and actually reduces the running time by about 5%.

    "},{"location":"note/sort/#small-arrays","title":"Small Arrays","text":"

    Problem: Quicksort is slower than insertion sort for small N ( \\(\\le\\)20 ).

    Solution : Cutoff when N gets small ( e.g. N = 10 ) and use other efficient algorithms (such as insertion sort).

    "},{"location":"note/sort/#implementation","title":"Implementation","text":"
    • \u53cc\u6307\u9488
    void  Quicksort( ElementType A[ ], int N ) \n{ \n    Qsort( A, 0, N - 1 ); \n    /* A:   the array   */\n    /* 0:   Left index  */\n    /* N \u2013 1: Right index   */\n}\n\n/* Return median of Left, Center, and Right */ \n/* Order these and hide the pivot */ \nElementType Median3( ElementType A[ ], int Left, int Right ) \n{ \n    int  Center = ( Left + Right ) / 2; \n    if ( A[ Left ] > A[ Center ] ) \n        Swap( &A[ Left ], &A[ Center ] ); \n    if ( A[ Left ] > A[ Right ] ) \n        Swap( &A[ Left ], &A[ Right ] ); \n    if ( A[ Center ] > A[ Right ] ) \n        Swap( &A[ Center ], &A[ Right ] ); \n    /* Invariant: A[ Left ] <= A[ Center ] <= A[ Right ] */ \n    Swap( &A[ Center ], &A[ Right - 1 ] ); /* Hide pivot */ \n    /* only need to sort A[ Left + 1 ] \u2026 A[ Right \u2013 2 ] */\n    return  A[ Right - 1 ];  /* Return pivot */ \n}\n\nvoid  Qsort( ElementType A[ ], int Left, int Right ) \n{   int  i,  j; \n    ElementType  Pivot; \n    if( Left + Cutoff <= Right ){  /* if the sequence is not too short */\n        Pivot = Median3( A, Left, Right );  /* select pivot */\n        i = Left;     \n        j = Right \u2013 1;  /* why not set Left+1 and Right-2? */\n        for( ; ; ) { \n                    while ( A[ ++i ] < Pivot ) { }  /* scan from left */\n                    while ( A[ \u2013\u2013j ] > Pivot ) { }  /* scan from right */\n                    if ( i < j ) {Swap( &A[ i ], &A[ j ] ); } /* adjust partition */\n                    else {break; } /* partition done */\n        } \n        Swap( &A[ i ], &A[ Right - 1 ] ); /* restore pivot */ \n        Qsort( A, Left, i - 1 );      /* recursively sort left part */\n        Qsort( A, i + 1, Right );   /* recursively sort right part */\n    }  /* end if - the sequence is long */\n\n    else /* do an insertion sort on the short subarray */ \n    {InsertionSort( A + Left, Right - Left + 1 );}\n}\n
    "},{"location":"note/sort/#sorting-large-structures","title":"Sorting Large Structures","text":"

    Swapping large structures can be very much expensive.

    • Add a pointer field to the structure and swap pointers instead \u2013 indirect sorting.

    • Physically rearrange the structures at last if it is really necessary. In the worst case there are \\([N/2]\\)(down) cycles and requires \\([3N/2]\\) (down) record moves. \\(T = O( m N )\\) where m is the size of a structure
    "},{"location":"note/sort/#a-general-lower-bound-for-sorting","title":"A General Lower Bound for Sorting","text":"

    Any algorithm that sorts by comparisons only must have a worst case computing time of \\(\\Omega( N log N )\\).

    When sorting N distinct elements, there are \\(N!\\) (N factorial) different possible sorting outcomes. This arises from the numerous ways of arranging the elements, with \\(N\\) choices for the first element, \\(N-1\\) choices for the second, and so forth, yielding a total of \\(N!\\).

    In the context of decision trees representing the decision-making process of comparison-based sorting algorithms, the number of leaves in the tree is at least \\(N!\\). Each leaf node signifies a distinct sorting outcome.

    The relationship between the height of the decision tree \\((k)\\) and complete binary trees is emphasized. For a complete binary tree with \\(k\\) levels, it can have at most \\(2^{k-1}\\) leaves. Combining this with the earlier discussion, the inequality \\(N! \u2264 2^{k-1}\\) is established, where k is the height of the decision tree.

    Expressing the relationship between height and N! using logarithms, we find that \\(k \u2265 log(N!) + 1\\).

    • Logarithms are preferred due to their intuitive representation of exponential growth in tree height.

    These insights delineate theoretical limits for comparison-based sorting algorithms and underscore the significance of N log N as the theoretical lower bound for their time complexity.

    "},{"location":"note/sort/#bucket-sort-and-radix-sort","title":"Bucket Sort and Radix Sort","text":""},{"location":"note/sort/#bucket-sort-tnmomn","title":"Bucket Sort \\(T(N,M)=O(M+N)\\)","text":"

    Algorithm{\n    initialize count[ ];\n    while (read in a student\u2019s record)\n        insert to list count[stdnt.grade];\n    for (i=0; i<M; i++) {\n        if (count[i])\n            output list count[i];\n    }\n}\n
    * What if \\(M >> N\\) ?

    "},{"location":"note/sort/#radix-sort","title":"Radix Sort","text":""},{"location":"note/sort/#stableness","title":"Stableness","text":"
    • \u7a33\u5b9a\u6392\u5e8f\uff1a\u5192\u6ce1\u3001\u5f52\u5e76\u3001\u63d2\u5165\u3001\u57fa\u6570
    • \u4e0d\u7a33\u5b9a\u6392\u5e8f\uff1a\u5feb\u6392\u3001\u5e0c\u5c14\u3001\u5806\u6392\u3001\u9009\u62e9
    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/","title":"Basic data Structures I","text":""},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#sparse-matrix","title":"SPARSE MATRIX","text":"

    Representing a sparse matrix by a 2D array leads to wastage of lots of memory as zeroes in the matrix are of no use in most of the cases. So, instead of storing zeroes with non-zero elements, we only store non-zero elements. This means storing non-zero elements with triples- (Row, Column, value).

    • Using Array
    #include <iostream>\nusing namespace std;\n\nint main()\n{\n    // Assume 4x5 sparse matrix\n    int sparseMatrix[4][5] =\n    {\n        {0 , 0 , 3 , 0 , 4 },\n        {0 , 0 , 5 , 7 , 0 },\n        {0 , 0 , 0 , 0 , 0 },\n        {0 , 2 , 6 , 0 , 0 }\n    };\n\n    int size = 0;\n    for (int i = 0; i < 4; i++)\n        for (int j = 0; j < 5; j++)\n            if (sparseMatrix[i][j] != 0)\n                size++;\n\n    // number of columns in compactMatrix (size) must be\n    // equal to number of non - zero elements in\n    // sparseMatrix\n    int compactMatrix[3][size];\n\n    // Making of new matrix\n    int k = 0;\n    for (int i = 0; i < 4; i++)\n        for (int j = 0; j < 5; j++)\n            if (sparseMatrix[i][j] != 0)\n            {\n                compactMatrix[0][k] = i;\n                compactMatrix[1][k] = j;\n                compactMatrix[2][k] = sparseMatrix[i][j];\n                k++;\n            } \n\n    for (int i=0; i<3; i++)\n    {\n        for (int j=0; j<size; j++)\n            cout <<\" \"<< compactMatrix[i][j];\n        cout <<\"\\n\";\n    }\n    return 0;\n}\n
    • Using Linked Lists
    #include<stdio.h>\n#include<stdlib.h>\n\n// Node to represent sparse matrix\nstruct Node\n{\n    int value;\n    int row_position;\n    int column_postion;\n    struct Node *next;\n};\n\n// Function to create new node\nvoid create_new_node(struct Node** start, int non_zero_element,int row_index, int column_index )\n{\n    struct Node *temp, *r;\n    temp = *start;\n    if (temp == NULL)\n    {\n        // Create new node dynamically\n        temp = (struct Node *) malloc (sizeof(struct Node));\n        temp->value = non_zero_element;\n        temp->row_position = row_index;\n        temp->column_postion = column_index;\n        temp->next = NULL;\n        *start = temp;\n    }\n    else\n    {\n        while (temp->next != NULL)\n            temp = temp->next;\n        // Create new node dynamically\n        r = (struct Node *) malloc (sizeof(struct Node));\n        r->value = non_zero_element;\n        r->row_position = row_index;\n        r->column_postion = column_index;\n        r->next = NULL;\n        temp->next = r;\n    }\n}\n// This function prints contents of linked list\n// starting from start\nvoid PrintList(struct Node* start)\n{\n    struct Node *temp, *r, *s;\n    temp = r = s = start;\n\n    printf(\"row_position: \");\n    while(temp != NULL){\n        printf(\"%d \", temp->row_position);\n        temp = temp->next;\n    }\n    printf(\"\\n\");\n    printf(\"column_postion: \");\n    while(r != NULL){\n        printf(\"%d \", r->column_postion);\n        r = r->next;\n    }\n    printf(\"\\n\");\n    printf(\"Value: \");\n    while(s != NULL){\n        printf(\"%d \", s->value);\n        s = s->next;\n    }\n    printf(\"\\n\");\n}\n// Driver of the program\nint main(){\n// Assume 4x5 sparse matrix\n    int sparseMatric[4][5] =\n    {\n        {0 , 0 , 3 , 0 , 4 },\n        {0 , 0 , 5 , 7 , 0 },\n        {0 , 0 , 0 , 0 , 0 },\n        {0 , 2 , 6 , 0 , 0 }\n    };\n    /* Start with the empty list */\n    struct Node* start = NULL;\n    for (int i = 0; i < 4; i++)\n        for (int j = 0; j < 5; j++)\n            // Pass only those values which are non - zero\n            if (sparseMatric[i][j] != 0)\n                create_new_node(&start, sparseMatric[i][j], i, j);\n    PrintList(start);\n    return 0;\n}\n
    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#stack","title":"STACK","text":""},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#1adt","title":"1.ADT","text":""},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#2implementations","title":"2.Implementations","text":"
    • Linked List
    • Array : The stack model must be well encapsulated.
    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#3applications","title":"3.Applications","text":"
    • Balancing Symbols
    • Pseudo Code
    Algorithm  {\n    Make an empty stack S;\n    while (read in a character c) {\n        if (c is an opening symbol)\n            Push(c, S);\n        else if (c is a closing symbol) {\n            if (S is empty)  { ERROR; exit; }\n            else  {  /* stack is okay */\n                if  (Top(S) doesn\u2019t match c)  { ERROR, exit; }\n                else  Pop(S);\n            }  /* end else-stack is okay */\n        }  /* end else-if-closing symbol */\n    } /* end while-loop */ \n    if (S is not empty)  ERROR;\n}\n
    #include <stdio.h>\n#include <stdbool.h>\n#include <string.h>\n\n#define STACKSIZE 30 \nchar stack[STACKSIZE]; // Global, but let's go with it\nint top = 0;\n\nvoid push(char x) {\n    if (top == STACKSIZE)\n        puts(\"Stack Full\");\n    else\n        stack[top++] = x;\n}\n\nbool popExpect(char c) { // compare expected char on top with passed char\n    return top && c == stack[--top];\n}\n\nbool chk(const char *str) {\n    char *cp, pairs[] = \"(){}[]\"; // three important pairs\n    bool isGood = true; // optimism\n\n    for (int i = 0; isGood && str[i]; i++)\n        // is this char one of the \"special\" ones?\n        if ((cp = strchr(pairs, str[i])) != NULL) {\n            int off = cp - pairs;\n            // because \"paired\" 0,2,4 are open, 1,3,5 are close\n            if (off % 2 == 0) // opening\n                push(cp[1]); // push the close that matches this open\n            else // special closing\n                isGood = popExpect(str[i]); // does this close match?\n        }\n\n    return isGood && top == 0;\n}\n\nint main() {\n    const char *s1 = \"(foobar)({}){bar}[[[(foo)]]]\"; // balanced\n    const char *s2 = \"(foobar)({}){ { bar}[[[(foo)]]]\"; // unbalanced open\n    const char *s3 = \"(foobar)({}){ ] bar}[[[(foo)]]]\"; // unbalanced close\n\n    puts(chk(s1) ? \"Balanced\" : \"Unbalanced\");\n    puts(chk(s2) ? \"Balanced\" : \"Unbalanced\");\n    puts(chk(s3) ? \"Balanced\" : \"Unbalanced\");\n\n    return 0;\n}\n
    • Calculation

    • Prefix

    • Infix\u300cConvert To Postfix\u300d

    #include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n// Function to return precedence of operators\nint prec(char c) {\n    if (c == '^')\n        return 3;\n    else if (c == '/' || c == '*')\n        return 2;\n    else if (c == '+' || c == '-')\n        return 1;\n    else\n        return -1;\n}\n\n// Function to return associativity of operators\nchar associativity(char c) {\n    if (c == '^')\n        return 'R';\n    return 'L'; // Default to left-associative\n}\n\n// Structure to represent stack\nstruct Stack {\n    int top;\n    unsigned capacity;\n    char* array;\n};\n\n// Function to initialize a stack\nstruct Stack* createStack(unsigned capacity) {\n    struct Stack* stack = (struct Stack*)malloc(sizeof(struct Stack));\n    stack->capacity = capacity;\n    stack->top = -1;\n    stack->array = (char*)malloc(stack->capacity * sizeof(char));\n    return stack;\n}\n\n// Function to check if the stack is full\nint isFull(struct Stack* stack) {\n    return stack->top == stack->capacity - 1;\n}\n\n// Function to check if the stack is empty\nint isEmpty(struct Stack* stack) {\n    return stack->top == -1;\n}\n\n// Function to push an element to the stack\nvoid push(struct Stack* stack, char item) {\n    if (isFull(stack)) {\n        printf(\"Stack Full\\n\");\n        return;\n    }\n    stack->array[++stack->top] = item;\n}\n\n// Function to pop an element from the stack\nchar pop(struct Stack* stack) {\n    if (isEmpty(stack)) {\n        return '$'; // Assuming '$' as an invalid character\n    }\n    return stack->array[stack->top--];\n}\n\n// The main function to convert infix expression\n// to postfix expression\nvoid infixToPostfix(char* exp) {\n    struct Stack* stack = createStack(strlen(exp));\n    char result[strlen(exp)];\n    int resultIndex = 0;\n\n    for (int i = 0; exp[i] != '\\0'; i++) {\n        char c = exp[i];\n\n        // If the scanned character is\n        // an operand, add it to the output string.\n        if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9'))\n            result[resultIndex++] = c;\n\n        // If the scanned character is an\n        // \u2018(\u2018, push it to the stack.\n        else if (c == '(')\n            push(stack, '(');\n\n        // If the scanned character is an \u2018)\u2019,\n        // pop and add to the output string from the stack\n        // until an \u2018(\u2018 is encountered.\n        else if (c == ')') {\n            while (stack->top != -1 && stack->array[stack->top] != '(') {\n                result[resultIndex++] = pop(stack);\n            }\n            pop(stack); // Pop '('\n        }\n\n        // If an operator is scanned\n        else {\n            while (!isEmpty(stack) && prec(exp[i]) < prec(stack->array[stack->top]) ||\n                !isEmpty(stack) && prec(exp[i]) == prec(stack->array[stack->top]) &&\n                associativity(exp[i]) == 'L') {\n                result[resultIndex++] = pop(stack);\n            }\n            push(stack, c);\n        }\n    }\n\n    // Pop all the remaining elements from the stack\n    while (!isEmpty(stack)) {\n        result[resultIndex++] = pop(stack);\n    }\n\n    result[resultIndex] = '\\0'; // Null-terminate the result string\n\n    printf(\"%s\\n\", result);\n}\n\n// Driver code\nint main() {\n    char exp[] = \"a+b*(c^d-e)^(f+g*h)-i\";\n    // Function call\n    infixToPostfix(exp);\n    return 0;\n}\n
    • Never pop a '(' from the stack except when processing a ')' .
    • Observe that when ' ( ' is not in the stack, its precedence is the highest; but when it is in the stack, its precedence is the lowest. Define in-stack precedence and incoming precedence for symbols, and each time use the corresponding precedence for comparison.
    • Note: a \u2013 b \u2013 c will be converted to a b \u2013 c \u2013. However, \\(2^{2^{3}}\\)must be converted to 2 2 3 ^ ^ , not 2 2 ^ 3 ^ since exponentiation associates right to left.

      • Observe that when ' ( ' is not in the stack, its precedence is the highest; but when it is in the stack, its precedence is the lowest. Define in-stack precedence and incoming precedence for symbols, and each time use the corresponding precedence for comparison.

      • Note: a \u2013 b \u2013 c will be converted to a b \u2013 c \u2013. However, \\(2^{2^{3}}\\)must be converted to 2 2 3 ^ ^ , not 2 2 ^ 3 ^ since exponentiation associates right to left.

    • Postfix \u300cEasier To Calculate\u300d

    ps:Tail Recursion! -- compliler will remove the recursion.

    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#the-queue-adt","title":"The Queue ADT","text":"
    • A queue is a First-In-First-Out (FIFO) list, that is, an ordered list in which insertions take place at one end and deletions take place at the opposite end.

    • Linked list implementation

    • Array Implementation

    struct  QueueRecord {\n    int     Capacity ;   /* max size of queue */\n    int     Front;          /* the front pointer */\n    int     Rear;           /* the rear pointer */\n    int     Size;  /* Optional - the current size of queue */\n    ElementType  *Array;    /* array for queue elements */\n } ; \n
    • A circular Queue
    • Rear[0] Font[1]
    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#tree","title":"TREE","text":""},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#basic-properties","title":"Basic Properties","text":"
    • N nodes and N-1 edges
    • node without any son is called \\(leaf\\)
    • \u4e00\u68f5\u6811\u7684\u5ea6\u662f\u8fd9\u68f5\u6811\u91cc\u6240\u6709\u8282\u70b9\u5ea6\u7684\u6700\u5927\u503c
    • \u4ece\u8282\u70b9 \\(n1\\) \u5230 \\(nk\\) \u7684\u8def\u5f84\u662f\u552f\u4e00\u7684\uff0c\u5176\u957f\u5ea6\u662f\u8def\u5f84\u4e0a\u8fb9\u7684\u6570\u91cf.
    • \u5bf9\u4e8e\u8282\u70b9 \\(ni\\)\uff0c\u5176\u6df1\u5ea6\u4e3a\u4ece\u6839\u5230 \\(ni\\) \u7684\u552f\u4e00\u8def\u5f84\u7684\u957f\u5ea6\\([Depth\\) \\(root = 0]\\)
    • \u5bf9\u4e8e\u8282\u70b9 \\(ni\\)\uff0c\u5176\u9ad8\u5ea6\u4e3a\u4ece \\(ni\\) \u5230\u4e00\u4e2a\u53f6\u8282\u70b9\u7684\u6700\u957f\u957f\u5ea6\\([Height\\) \\(leaf = 0]\\)
    • \u6839\u7684\u9ad8\u5ea6\u79f0\u4e3a\u8fd9\u68f5\u6811\u7684\u9ad8\u5ea6 / \u6df1\u5ea6
    • \u4e00\u4e2a\u8282\u70b9\u7684\u7956\u5148\uff08ancestors\uff09\u662f\u4ece\u6839\u5230\u8fd9\u4e2a\u8282\u70b9\u7684\u8def\u5f84\u4e0a\u7684\u6240\u6709\u8282\u70b9
    • \u4e00\u4e2a\u8282\u70b9\u7684\u540e\u88d4\uff08descendants\uff09\u662f\u8fd9\u4e2a\u8282\u70b9\u5b50\u6811\u4e2d\u7684\u6240\u6709\u8282\u70b9
    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#implementation","title":"Implementation","text":"
    • FirstChild-NextSibling \u8868\u793a\u6cd5

    • \u8bb0\u5f55\u7b2c\u4e00\u4e2a\u5b50\u8282\u70b9\u548c\u4e0b\u4e00\u4e2a\u5144\u5f1f\u8282\u70b9

    • \u56e0\u4e3a\u4e00\u68f5\u6811\u7684\u513f\u5b50\u987a\u5e8f\u4e0d\u5b9a\uff0c\u6240\u4ee5\u4e00\u68f5\u6811\u7684\u8868\u793a\u65b9\u5f0f\u4e0d\u552f\u4e00

      struct TreeNode {\n    ElementType Element;\n    PtrToNode FirstChild;\n    PtrToNode NextSibling;FirstChildFirfsads\n};\ntypedef struct TreeNode *PtrToNode;\n
    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#binary-tree","title":"Binary Tree","text":""},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#basic-properties_1","title":"Basic Properties","text":"
    • \u7b2c i \u5c42\u7684\u8282\u70b9\u6570\u6700\u591a\u4e3a \\(2^{i-1}\\)
    • \u6df1\u5ea6\u4e3a k \u7684\u4e8c\u53c9\u6811\u6700\u591a\u6709\\(2^{k}-1\\) \u4e2a\u8282\u70b9
    • \\(n0\\) \u8868\u793a\u53f6\u8282\u70b9\u6570\uff0c\\(n2\\) \u8868\u793a\u5ea6\u4e3a 2 \u7684\u8282\u70b9\u6570\uff0c\u5219 \\(n0 = n2 +1\\)
    • \u4e8c\u53c9\u6811\u53ef\u4ee5\u901a\u8fc7\u6570\u7ec4\u6765\u8868\u793a
    • \u6839\u4e3a tree[1]
    • \u8282\u70b9 tree[i] \u7684\u5de6\u513f\u5b50\u4e3a tree[2i]\uff0c\u53f3\u513f\u5b50\u4e3a tree[2i+1]
    • \u5b8c\u5168\u4e8c\u53c9\u6811\u7684\u6570\u7ec4\u4e2d\u5143\u7d20\u5168\u90e8\u5206\u5e03\u5728 1 ~ n \u4e2d
    • \u8868\u8fbe\u5f0f\u6811\uff08expression tree\uff09
    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#_1","title":"\u904d\u5386","text":"
    • Preorder\uff1aroot-left-right

    • Postorder\uff1aleft-right-root

    • inorder:left-root-right

    • level order:

    void levelorder(tree_ptr tree) {\n    enqueue(tree);\n    while (queue is not empty) {\n        visit(T = dequeue());\n        for (each child C of T) \n            enqueue(C);\n    }\n}\n
    //    \u4e8c\u53c9\u6811\u7684\u5b9e\u73b0\uff08C\u8bed\u8a00\uff09\n//    \u94fe\u8868\uff0c\u9012\u5f52\u5b9e\u73b0\ntypedef char Elementtype;    //    \u5b9a\u4e49\u6570\u636e\u7c7b\u578b\uff0c\u53ef\u6839\u636e\u9700\u8981\u81ea\u884c\u5b9a\u5236\ntypedef struct TreeNode * Node;    //    Node\u76f8\u5f53\u4e8estruct treeNode *\n//    \u5b9a\u4e49\u6570\u8282\u70b9\u7ed3\u6784\ntypedef struct TreeNode {\n    Elementtype Element;\n    Node left;    //    \u6811\u8282\u70b9\u7684\u5de6\u5b50\u8282\u70b9\n    Node right;    //    \u6811\u8282\u70b9\u7684\u53f3\u5b50\u8282\u70b9\n}TREE,*PTREE;\n\nvoid CreatTree(PTREE *);    //    \u6811\u7684\u5148\u5e8f\u521b\u5efa\u51fd\u6570\nvoid PreOrderTree(PTREE );    //    \u6811\u7684\u524d\u5e8f\u904d\u5386\u51fd\u6570\nvoid InOrderTree(PTREE );    //    \u6811\u7684\u4e2d\u5e8f\u904d\u5386\nvoid PostOrderTree(PTREE );    //    \u6811\u7684\u540e\u5e8f\u904d\u5386\nvoid LeafOfTree(PTREE );    //    \u6253\u5370\u6811\u7684\u53f6\u5b50\u8282\u70b9\u51fd\u6570\nint  Get_Leaf_Num(PTREE );    //    \u83b7\u53d6\u6811\u53f6\u5b50\u8282\u70b9\u4e2a\u6570\nint Get_Height(PTREE );    //    \u83b7\u53d6\u6811\u7684\u9ad8\u5ea6\n\nint main() {\n    PTREE Root;    \n    printf(\"\u8bf7\u5148\u5e8f\u8f93\u5165\u4e8c\u53c9\u6811\u7684\u8282\u70b9\u6570\u636e\uff1a \");\n    CreatTree(&Root);    \n    printf(\"\\n\u524d\u5e8f\u904d\u5386\u7ed3\u679c\u4e3a\uff1a\");\n    PreOrderTree(Root);    \n    printf(\"\\n\u4e2d\u5e8f\u904d\u5386\u7ed3\u679c\u4e3a\uff1a\");\n    InOrderTree(Root);\n    printf(\"\\n\u540e\u5e8f\u904d\u5386\u7ed3\u679c\u4e3a\uff1a\");\n    PostOrderTree(Root);\n    printf(\"\\n\u6253\u5370\u53f6\u5b50\u8282\u70b9\u4e3a\uff1a\");\n    LeafOfTree(Root);\n    printf(\"\\n\u53f6\u5b50\u8282\u70b9\u4e2a\u6570\u4e3a\uff1a%d\", Get_Leaf_Num(Root));\n    printf(\"\\n\u4e8c\u53c9\u6811\u7684\u9ad8\u5ea6\u4e3a\uff1a%d\", Get_Height(Root));\n    printf(\"\\n\");\n    return 0;\n}\n//    \u5b9a\u4e49\u6811\u5148\u5e8f\u521b\u5efa\u51fd\u6570\nvoid CreatTree(PTREE *ROOT){\n  char val = 0;\n  val = getchar();\n  if(wal=='*'){*ROOT=NULL;}\n  else{\n    (*Root)=(PTREE)malloc(sizeof(TREE));\n        if ((*Root) == NULL) {\n            printf(\"\u521b\u5efa\u8282\u70b9\u5931\u8d25\uff0c\u65e0\u6cd5\u5206\u914d\u53ef\u7528\u5185\u5b58...\");\n            exit(-1);\n        }\n            else{\n          (*Root)->Element =val;\n          CreatTree(&(*Root)->left);\n          CreatTree(&(*Root)->right); \n        }\n  }\n\n}\n\n//    \u6811\u7684\u524d\u5e8f\u904d\u5386\u51fd\u6570\u5b9a\u4e49\nvoid PreOrderTree(PTREE Root) {\n    if (Root == NULL)\n        return;\n    else {\n        putchar(Root->Element);\n        PreOrderTree(Root->left);\n        PreOrderTree(Root->right);\n    }\n}\n\n//    \u6811\u7684\u4e2d\u5e8f\u904d\u5386\u51fd\u6570\u5b9a\u4e49\nvoid InOrderTree(PTREE Root) {\n    if (Root == NULL)\n        return;\n    else {\n        InOrderTree(Root->left);\n        putchar(Root->Element);\n        InOrderTree(Root->right);\n    }\n}\n//    \u6811\u7684\u540e\u5e8f\u904d\u5386\u51fd\u6570\u5b9a\u4e49\nvoid PostOrderTree(PTREE Root) {\n    if (Root==NULL) \n        return ;\n    else{\n        PostOrderTree(Root->left);\n        PostOrderTree(Root->right);\n        putchar( Root->Element);\n    }\n}\n//\u6811\u7684\u540e\u5e8f\u904d\u5386\u7684\u5faa\u73af\u5f62\u5f0f\nIterative Program \nvoid iter_postorder\uff08tree_ptr_tree\uff09{\n  stack S = CreateStack(MAX_SIZE);\n  for(;;){\n\n  }\n}\n//    \u6253\u5370\u6811\u7684\u53f6\u5b50\u8282\u70b9\u51fd\u6570\u5b9a\u4e49\nvoid LeafOfTree(PTREE Tree) {\n    if (Tree == NULL)    \n        return ;\n    else {\n        if (Tree->left == NULL&&Tree->right == NULL)\n            putchar(Tree->Element);\n        else {\n            LeafOfTree(Tree->left);\n            LeafOfTree(Tree->right);\n        }\n    }  \n}\n//    \u83b7\u53d6\u6811\u7684\u53f6\u5b50\u8282\u70b9\u4e2a\u6570\u51fd\u6570\u5b9a\u4e49\nint Get_Leaf_Num(PTREE Tree) {\n    if (Tree == NULL)\n        return 0;\n    if (Tree->left == NULL&&Tree->right == NULL)\n        return 1;\n    //\u9012\u5f52\u6574\u4e2a\u6811\u7684\u53f6\u5b50\u8282\u70b9\u4e2a\u6570 = \u5de6\u5b50\u6811\u53f6\u5b50\u8282\u70b9\u7684\u4e2a\u6570 + \u53f3\u5b50\u6811\u53f6\u5b50\u8282\u70b9\u7684\u4e2a\u6570\n    return Get_Leaf_Num(Tree->left) + Get_Leaf_Num(Tree->right);\n}\n//    \u83b7\u53d6\u6811\u9ad8\u7684\u51fd\u6570\u5b9a\u4e49\nint Get_Height(PTREE Tree) {\n    int Height = 0;\n    if (Tree == NULL)\n        return 0;\n    //\u6811\u7684\u9ad8\u5ea6 = max(\u5de6\u5b50\u6811\u7684\u9ad8\u5ea6\uff0c\u53f3\u5b50\u6811\u7684\u9ad8\u5ea6) + 1\n    else\n    {\n        int L_Height = Get_Height(Tree->left);\n        int R_Height = Get_Height(Tree->right);\n        Height = L_Height >= R_Height ? L_Height + 1 : R_Height + 1;\n    }\n    return Height;\n}\n
    • inorder iterative
    #include <stdio.h>\n#include <stdlib.h>\n#include <stdbool.h>\n\n// \u5b9a\u4e49\u4e8c\u53c9\u6811\u7ed3\u70b9\nstruct TreeNode {\n    int val;\n    struct TreeNode* left;\n    struct TreeNode* right;\n};\n\n// \u521b\u5efa\u4e00\u4e2a\u4e8c\u53c9\u6811\u7ed3\u70b9\nstruct TreeNode* createNode(int val) {\n    struct TreeNode* newNode = (struct TreeNode*)malloc(sizeof(struct TreeNode));\n    newNode->val = val;\n    newNode->left = NULL;\n    newNode->right = NULL;\n    return newNode;\n}\n// \u7ed3\u6784\u4f53\u6a21\u62df\u6808\nstruct TreeNodeStack {\n    struct TreeNode* data;\n    struct TreeNodeStack* next;\n};\n\nstruct TreeNodeStack* createStackNode(struct TreeNode* node) {\n    struct TreeNodeStack* stackNode = (struct TreeNodeStack*)malloc(sizeof(struct TreeNodeStack));\n    stackNode->data = node;\n    stackNode->next = NULL;\n    return stackNode;\n}\n\nvoid push(struct TreeNodeStack** stack, struct TreeNode* node) {\n    struct TreeNodeStack* stackNode = createStackNode(node);\n    stackNode->next = *stack;\n    *stack = stackNode;\n}\n\nstruct TreeNode* pop(struct TreeNodeStack** stack) {\n    if (*stack == NULL) {\n        return NULL;\n    }\n    struct TreeNodeStack* temp = *stack;\n    *stack = (*stack)->next;\n    struct TreeNode* node = temp->data;\n    free(temp);\n    return node;\n}\n\nbool isEmpty(struct TreeNodeStack* stack) {\n    return stack == NULL;\n}\n\n// \u4e2d\u5e8f\u904d\u5386\u4e8c\u53c9\u6811\u5e76\u8fd4\u56de\u7ed3\u679c\u4f5c\u4e3a\u6570\u7ec4\nint* inorderTraversal(struct TreeNode* root, int* returnSize) {\n    struct TreeNodeStack* stack = NULL;\n    int* result = (int*)malloc(sizeof(int));\n    int resultSize = 0;\n    struct TreeNode* current = root;\n    while (current != NULL || !isEmpty(stack)) {\n        while (current != NULL) {\n            push(&stack, current);\n            current = current->left;\n        }\n        current = pop(&stack);\n        result = (int*)realloc(result, (resultSize + 1) * sizeof(int));\n        result[resultSize] = current->val;\n        resultSize++;\n        current = current->right;\n    }\n\n    *returnSize = resultSize;\n    return result;\n}\n\n// \u4e3b\u51fd\u6570\nint main() {\n    struct TreeNode* root = createNode(1);\n    root->right = createNode(2);\n    root->right->left = createNode(3);\n\n    printf(\"Inorder Traversal: \");\n    int resultSize;\n    int* result = inorderTraversal(root, &resultSize);\n    for (int i = 0; i < resultSize; i++) {\n        printf(\"%d \", result[i]);\n    }\n    free(result);\n    return 0;\n}\n
    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#tree_1","title":"\u521b\u5efaTREE","text":"
    • 1.Postorder & Inorder \u540e\u5e8f&\u4e2d\u5e8f
    BiTree* postInTree(int post[],int in[],int n)  {\n    if (n<=0)   return nullptr;\n    int i=0;\n    while (post[n-1]!=in[i])    i++;    //i\u4e5f\u6b63\u597d\u662f\u5de6\u5b50\u6811\u8282\u70b9\u6570\n    BiTree* nw=new BiTree;\n    nw->data=in[i];\n    nw->lc=postInTree(post,in,i);       //\u5efa\u5de6\u5b50\u6811\n    nw->rc=postInTree(post+i,in+i+1,n-i-1);     //\u5efa\u53f3\u5b50\u6811\n    return nw;\n}\n
    • 2.preorder & inorder \u524d\u5e8f&\u4e2d\u5e8f
    BiTree* preInTree2(int pre[],int in[],int n)  { //\u8fd9\u662f\u7b14\u8bb0\u4e0a\u7684\u6211\u7684\u65b9\u6cd5,n\u662f\u5f53\u524d\u4e8c\u53c9\u6811\u7684\u8282\u70b9\u6570\n    if (n<=0)   return nullptr;\n    int i=0;\n    while (in[i]!=pre[0])   i++;        //\u6b64\u65f6i\u6b63\u597d\u662f\u5de6\u5b50\u6811\u8282\u70b9\u6570\u3002\u5148\u5e8f\u904d\u5386\u7684\u9996\u5143\u7d20\u4e00\u5b9a\u662f\u6839\u8282\u70b9\n    BiTree* nw=new BiTree;\n    nw->data=in[i];\n    nw->lc=preInTree2(pre+1,in,i);      //\u5efa\u5de6\u5b50\u6811\uff0c\u5de6\u5b50\u6811\u8282\u70b9i\u4e2a\n    nw->rc=preInTree2(pre+i+1,in+i+1,n-i-1);        //\u5efa\u53f3\u5b50\u6811\uff0c\u53f3\u5b50\u6811\u8282\u70b9n-i-1\u4e2a\n    return nw;\n}\n
    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#application","title":"Application","text":"
    • Linux dir\u300cTypical Preoder Traversal\u300d
    static void  ListDir ( DirOrFile D, int Depth )\n{\n    if  ( D is a legitimate entry )   {\n        PrintName (D, Depth );\n        if ( D is a directory )\n            for (each child C of D )\n                ListDir ( C, Depth + 1 );\n    }\n}\n
    • Calculating the size of the directory\u300cTypical Postorder Traversal\u300d

    • \u7ebf\u7d22\u4e8c\u53c9\u6811 Threader Binary Tree Inorder

    Rule 1: If Tree->Left is null, replace it with a pointer to the inorder predecessor of Tree.

    Rule 2: If Tree->Right is null, replace it with a pointer to the inorder successor of Tree.

    Rule 3: There must not be any loose threads. Therefore a threaded binary tree must have a head node of which the left child points to the first node.

    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#binary-search-tree","title":"Binary Search Tree","text":"
    • Delete
    SearchTree Delete(ElementType X, SearchTree T) {\n    Position TmpCell;\n    if (T == NULL) Error(\"not found\");\n    else if (X < T->Element) T->Left = Delete(X, T->Left);\n    else if (x > T->Element) T->Right = Delete(X, T->Right);\n    else {\n        if (T->Left && T->Right) {\n            TmpCell = FindMin(T->Right);\n            T->Element = TmpCell->Element;\n            T->Right = Delete(T->Element, T->Right);\n        } else {\n            TmpCell = T;\n            if (T->Left == NULL) T = T->Right;\n            else if (T->Right == NULL) T = T->Left;\n            free(TmpCell);\n        }\n    }\n    return T;\n}\n
    • All binary trees: Equals n nodes pop sequence!!

    \\(C_{n}=\\sum_{i=1}^{n} C_{i}C{n-i-1}\\)

    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#complete-binary-tree","title":"\u5b8c\u5168\u4e8c\u53c9\u6811\uff08complete binary tree\uff09","text":""},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#basic-properties_2","title":"Basic Properties","text":"
    • \u6240\u6709\u53f6\u8282\u70b9\u90fd\u5728\u76f8\u90bb\u7684\u4e24\u5c42\u4e0a\u7684\u4e8c\u53c9\u6811

    • Basic Properties:

    • \u9664\u4e86\u6700\u540e\u4e00\u5c42\uff0c\u6bcf\u4e00\u5c42\u90fd\u662f\u6ee1\u7684

    • \u6700\u540e\u4e00\u5c42\u7684\u8282\u70b9\u90fd\u9760\u5de6\u6392\u5217

    • \\(2^{h}\\) ~ \\(2^{h+1}-1\\) nodes\\((0,1,2,3- height = 3)\\)

    • \\(h=O(log(n))\\)

    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#insert","title":"INSERT","text":"
    void Insert(ElementType X, MaxHeap H) {\n    if (IsFull(H)) {\n        Error(\"Full Heap\");\n        return;\n    }\n    int i = ++H->Size;\n    for (; H->Elements[i/2] < X; i /= 2) {\n        H->Elements[i] = H->Elements[i/2];\n    }\n    H->Elements[i] = X;\n}\n
    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#delete","title":"DELETE","text":"
    ElementType DeleteMax(MaxHeap H) {\n    if (IsEmpty(H)) {\n        Error(\"Empty Heap\");\n        return H->Elements[0];\n    }\n    int i, Child;\n    ElementType MaxElement, LastElement;\n    MaxElement = H->Elements[1];\n    LastElement = H->Elements[H->Size--];\n    for (i = 1; i * 2 <= H->size; i = Child) {\n        Child = i * 2;\n        if (Child != H->Size && H->Elements[Child + 1] > H->Elements[Child]) {\n            Child++;\n        }\n        if (LastElement < H->Elements[Child]) {\n            H->Elements[i] = H->Elements[Child];\n        } else {\n            break;\n        }\n    }\n    H->Elements[i] = LastElement;\n    return MaxElement;\n}\n

    Question: how to make it a natural stop without using \\(Child != H->size\\)

    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#buildheap-h","title":"BuildHeap ( H )","text":"

    For the perfect binary tree of height h containing \\(2^{h+1}-1\\) nodes, the sum of the heights of the nodes is \\(2^{h+1}-1 -(h + 1)\\).

    \\(T ( N ) = O ( N )\\)

    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#the-dynamic-equivalence-problem","title":"The Dynamic Equivalence Problem","text":"

    A dynamic graph generally refers to a graph that keeps on changing its configuration. Let\u2019s deep dive into it using an example:

    • Let\u2019s consider the edge information for the given graph as: {{1,2}, {2,3}, {4,5}, {6,7}, {5,6}, {3,7}}. Now if we start adding the edges one by one, in each step the structure of the graph will change. So, after each step, if we perform the same operation on the graph while updating the edges, the result might be different. In this case, the graph will be considered a dynamic graph.
    • For example, after adding the first 4 edges if we look at the graph, we will find that node 4 and node 1 belong to different components but after adding all 6 edges if we search for the same we will figure out that node 4 and node 1 belong to the same component.
    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#the-disjoint-set-adt","title":"THE DISJOINT SET ADT","text":"
    • UNION

    NOTE:UNION is the union of the head of one head to another(thus for a random element x,always find the \"head\" element Find(x) and modify s[Find(x)]

    void  SetUnion ( DisjSet S, \n                 SetType Rt1, \n                 SetType Rt2 )\n{    S [ Rt2 ] = Rt1 ;     }\n
    • Find
    SetType  Find ( ElementType X, DisjSet S )\n{   for ( ; S[X] > 0; X = S[X] )   ;\n    return  X ;\n}\n
    • Analysis for the Given problem
    Algorithm using union-find operations\n{  Initialize  Si = { i }  for  i = 1, ..., 12 ;\n   for  ( k = 1; k <= 9; k++ )  {  /* for each pair  i \u7b49\u4ef7j  \u5373\u5982\u679c\u7ed9\u51fa\u4e5d\u7ec4\u7b49\u4ef7\u5173\u7cfb*/\n      if  ( Find( i ) != Find( j ) )\n          SetUnion( Find( i ), Find( j ) );\n   }\n}\n
    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#smart-union-algorithms","title":"Smart Union Algorithms","text":"
    • \uff01\uff01\u5176\u5b9e\u53ef\u4ee5\u4e0d\u5f00\u65b0\u6570\u7ec4\uff0c\u53ea\u8bb0\u5f55\u5728\u6839\u7684\u6570\u636e\u4e2d
    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#union-by-rank","title":"Union by rank","text":"
    • Rank:

    The rank of a node generally refers to the distance (the number of nodes including the leaf node) between the furthest leaf node and the current node. Basically rank includes all the nodes beneath the current node.

    • Algorithm:
    • Initial configuration:
    • rank array: This array is initialized with zero.
    • parent array: The array is initialized with the value of nodes i.e. parent[i] =i.
    • The algorithm steps are as follows:
    • Firstly, the Union function requires two nodes(let\u2019s say u and v) as arguments. Then we will find the ultimate parent (using the findPar() function that is discussed later) of u and v. Let\u2019s consider the ultimate parent of u is pu and the ultimate parent of v is pv.
    • After that, we will find the rank of pu and pv.
    • Finally, we will connect the ultimate parent with a smaller rank to the other ultimate parent with a larger rank. But if the ranks are equal, we can connect any parent to the other parent and we will increase the rank by one for the parent node to whom we have connected the other one.
    void make_set(int v) {\n    parent[v] = v;\n    rank[v] = 0;\n}\nvoid union_sets(int a, int b) {\n    a = find_set(a);\n    b = find_set(b);\n    if (a != b) {\n        if (rank[a] < rank[b])\n            swap(a, b);\n        parent[b] = a;\n        if (rank[a] == rank[b])\n            rank[a]++;\n    }\n}\n
    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#union-by-size","title":"Union by size","text":"
    • Quite similar as Union by rank.
    void make_set(int v) {\n    parent[v] = v;\n    size[v] = 1;\n}\nvoid union_sets(int a, int b) {\n    a = find_set(a);\n    b = find_set(b);\n    if (a != b) {\n        if (size[a] < size[b])\n            swap(a, b);\n        parent[b] = a;\n        size[a] += size[b];\n    }\n}\n
    • Let T be a tree created by union-by-size with N nodes, then \\((Height(T) \\le \\lfloor log_2N \\rfloor + 1)\\)

    • Proof: By induction. (Each element can have its set name changed at most. \\(log_2N\\)

    times.\uff09\u300cUnion by size\u300d

    First , all note are at depth 0 at the very beginning

    Every time,we do Union:the node was set on a new tree whose size is at least twice its size

    So a node from either set can only incrase the depth by \\(1\\)

    For n nodes ,every node can have its set name changed at most \\(log_2N\\) times.

    Thus,Time complexity for Find is \\(O (l o g N )\\)

    • Here is a proof by induction on the tree height k. \u300cUnion By Size\u300d

    The base case K=0 is easy, since a tree of height 0 always has just 1 node

    Suppose the claim is true for h=k. Now consider a union-by-height tree of height k+1.

    There must have been a union that brought two trees together and increased the height of one of them from k to k+1.

    Let those two trees (at the time of that union) be T1 and T2. We know that both T1 and T2 were of height k before the union.

    • If one of them were of height less than k, then union-by-height would have changed the root of that shorter one to make it point to the root of the taller one, and the height of the unioned tree would still be k.
    • Now we can apply the induction hypothesis: the trees T1 and T2 each have at least \\(2^k\\) nodes. Thus, the unioned tree has at least \\(2^k + 2^k = 2^{k+1}\\)nodes.

    • Time complexity of \\(N\\) Union and \\(M\\) Find operations is now. \\(O( N + M log_2N)\\)

    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#note","title":"Note:","text":"

    We can set \\(S [ Root ] = \u2013 size\\), thus we don't need the array size[ ]

    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#path-compression","title":"Path Compression","text":"

    Basically, connecting each node in a particular path to its ultimate parent refers to path compression. Let\u2019s understand it using the following illustration

    1. Base case: If the node and the parent of the node become the same, it will return the node.
    2. We will call the findPar() function for a node until it hits the base case and while backtracking we will update the parent of the current node with the returned value.
    SetType  Find ( ElementType  X, DisjSet  S )\n{\n    if ( S[ X ] <= 0 )    return  X;\n    else  return  S[ X ] = Find( S[ X ], S );//IMPORTANT\uff01\uff01\uff01\n}\n//The simple implementation does what was intended: first find the representative of the set (root vertex), and then in the process of stack unwinding the visited nodes are attached directly to the representative.\nSetType  Find ( ElementType  X, DisjSet  S )\n{   ElementType  root,  trail,  lead;\n    for ( root = X; S[ root ] > 0; root = S[ root ] )\n        ;  /* find the root */\n    for ( trail = X; trail != root; trail = lead ) {\n       lead = S[ trail ] ;   \n       S[ trail ] = root ;   \n    }  /* collapsing */\n    return  root ;\n}\n

    NOTE

    • Though using the path compression technique it seems like the rank of the node is also changing, we cannot be sure about it. So, we will not make any changes to the rank array while applying path compression.
    • Just take \u201cheight\u201d as an estimated rank.
    "},{"location":"note/%E5%9F%BA%E7%A1%80%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84/#worst-case-for-union-by-rank-and-path-compression","title":"Worst Case for Union-by-Rank and Path Compression","text":"
    #include <stdio.h>\n#include <stdlib.h>\nstruct DisjointSet {\n    int *rank, *parent, *size;\n    int n;\n};\nstruct DisjointSet* createDisjointSet(int n) {\n    struct DisjointSet* ds = (struct DisjointSet*)malloc(sizeof(struct DisjointSet));\n    ds->n = n;\n    ds->rank = (int*)malloc((n + 1) * sizeof(int));\n    ds->parent = (int*)malloc((n + 1) * sizeof(int));\n    ds->size = (int*)malloc((n + 1) * sizeof(int));\n    for (int i = 0; i <= n; i++) {\n        ds->rank[i] = 0;\n        ds->parent[i] = i;\n        ds->size[i] = 1;\n    }\n    return ds;\n}\nint findUPar(struct DisjointSet* ds, int node) {\n    if (node == ds->parent[node])\n        return node;\n    ds->parent[node] = findUPar(ds, ds->parent[node]);//PATH COMPRESSION\n    return ds->parent[node];\n}\nvoid unionByRank(struct DisjointSet* ds, int u, int v) {\n    int ulp_u = findUPar(ds, u);\n    int ulp_v = findUPar(ds, v);\n    if (ulp_u == ulp_v)\n        return;\n    if (ds->rank[ulp_u] < ds->rank[ulp_v]) {\n        ds->parent[ulp_u] = ulp_v;\n    } else if (ds->rank[ulp_v] < ds->rank[ulp_u]) {\n        ds->parent[ulp_v] = ulp_u;\n    } else {\n        ds->parent[ulp_v] = ulp_u;\n        ds->rank[ulp_u]++;\n    }\n}\nvoid unionBySize(struct DisjointSet* ds, int u, int v) {\n    int ulp_u = findUPar(ds, u);\n    int ulp_v = findUPar(ds, v);\n    if (ulp_u == ulp_v)\n        return;\n    if (ds->size[ulp_u] < ds->size[ulp_v]) {\n        ds->parent[ulp_u] = ulp_v;\n        ds->size[ulp_v] += ds->size[ulp_u];\n    } else {\n        ds->parent[ulp_v] = ulp_u;\n        ds->size[ulp_u] += ds->size[ulp_v];\n    }\n}\nint main() {\n    struct DisjointSet* ds = createDisjointSet(7);\n    unionBySize(ds, 1, 2);\n    unionBySize(ds, 2, 3);\n    unionBySize(ds, 4, 5);\n    unionBySize(ds, 6, 7);\n    unionBySize(ds, 5, 6);\n    if (findUPar(ds, 3) == findUPar(ds, 7)) {\n        printf(\"Same\\n\");\n    } else {\n        printf(\"Not same\\n\");\n    }\n    unionBySize(ds, 3, 7);\n    if (findUPar(ds, 3) == findUPar(ds, 7)) {\n        printf(\"Same\\n\");\n    } else {\n        printf(\"Not same\\n\");\n    }\n    free(ds->rank);\n    free(ds->parent);\n    free(ds->size);\n    free(ds);\n    return 0;\n}\n
    "},{"location":"note/%E6%9C%80%E5%A4%A7%E5%AD%90%E5%88%97%E5%92%8C/","title":"Maximum Subsequence Sum Problem","text":"
    • O(\\(N^3\\)) \u300c\u57fa\u672c\u601d\u8def\uff0c\u9010\u4e2a\u5217\u4e3e\uff0c\u7565\u300d

    • O(\\(N^2\\)) \u300c\u4f18\u5316\u4e00\u4e0b\u5217\u4e3e\uff0c\u7565\u300d

    • divide & conquer O(N logN)

    static int\nMaxSubSum(const int A[],int left,int right){\n    int MaxLeftSum, MaxRightSum;\n    int MaxLeftBorderSum, MaxRightBorderSum; \n    int LeftBorderSum, RightBorderSum;\n    int Center, i;\n\n    if( left == right ){\n        if(A[left]>0){\n            return A[left];\n        }\n        else{\n            return 0;\n        }\n    }\n    Center = ( Left +Right ) / 2;\n    MaxLeftSum = MaxSubSum( A, Left, Center ) \n    MaxRightSum = MaxSubSum( A, Center + 1, Right );\n\n    MaxLeftBorderSum = 0; LeftBorderSum = 0;\n\n    for(i=Cente+1;i>=left;i--){\n        LeftBorderSum += A[i];\n        if(leftBorderSum>MaxleftBorderSum){\n            MaxleftBorderSum = LeftBorderSum;\n        }\n    }\n\n    MaxRightBorderSum = 0; \n    RightBorderSum = 0;\n    for(i=Center;i<=Right;i++){\n        RightBorderSum += A[i];\n        if(RightBorderSum > MaxRightBorderSum){\n            MaxRightBOrderSum = RightBorderSum\n        }\n    }\n    return Max(MaxLeftSum,MaxRightSum,MaxLeftBorderSum+MaxRightBorderSum);\n\n}\nint MaxsubsequenceSum( const int A[],intN) {\n    return MaxSubSum( A, 0, N - 1 );\n    }\n

    • \u52a8\u6001\u89c4\u5212 O(N)
    int MaxSubsequenceSum( const int  A[ ],  int  N ) \n{ \n    int  ThisSum, MaxSum, j; \n    ThisSum = MaxSum = 0; \n    for ( j = 0; j < N; j++ ){ \n        ThisSum += A[ j ]; \n        if( ThisSum > MaxSum ){\n            MaxSum = ThisSum; \n        }\n        else if( ThisSum < 0 ){\n            ThisSum = 0;\n        }\n    } \n    return MaxSum; \n} \n
    • If counts negative paths
    int maxSubArray(int* nums, int numsSize) {\n    int pre = 0, maxAns = nums[0];\n    for (int i = 0; i < numsSize; i++) {\n        pre = fmax(pre + nums[i], nums[i]);\n        maxAns = fmax(maxAns, pre);\n    }\n    return maxAns;\n}\n
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/","title":"Chapter 1 Digital Systems and Information","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#breif-intro","title":"Breif Intro","text":"
    • \u505a\u5b58\u50a8\u7684\u65f6\u5019\uff0c\u8bbf\u95ee\u9700\u8981\u5b57\u5bf9\u9f50\uff0c\u6309\u7167\u5b57\u53bb\u53d6
    • Cache \u5c40\u90e8\u6027\u539f\u7406
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#signal","title":"Signal","text":"

    The most commonly used two-valued information is an electrical signal - voltage or current typically two discrete values represented by the voltage range of values.

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#digital-systems","title":"Digital Systems","text":"

    Takes a set of discrete information inputs and discrete internal information (system state) and generates a set of discrete information outputs.

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#types-of-digital-systems","title":"Types of Digital Systems","text":"
    • Combinational Logic System:No state present , one input just decide one output(one to one , no state)

    • Sequential System

    State present

    State updated at discrete times -- Synchronous Sequential System [Periodic]

    State updated att any time -- Asychronous Sequential System

    State function : \\(f_{state}=Function(State,Input)\\)

    Output function : \\(f_{output}=Function(State)\\) or \\(f_{output}=Function(State,Input)\\)

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#organization-of-computer","title":"Organization of Computer","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#embedded-systems","title":"Embedded Systems","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#number-systems-codes","title":"Number Systems & Codes","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#covert","title":"Covert","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#decimal-to-binary","title":"Decimal To Binary","text":"
    • \u6574\u6570\u2014\u2014\u6743\u5c55\u5f00\u5f0f\u96642\uff0c\u4f59\u6570\u6784\u6210\u6700\u4f4e\u4f4d\u2014\u2014\u96642\u53d6\u4f59

    • \u5c0f\u6570\u2014\u2014\u6743\u5c55\u5f00\u5f0f\u4e582\uff0c\u6574\u6570\u6784\u6210\u6700\u9ad8\u4f4d\u2014\u2014\u4e582\u53d6\u6574

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#binary-numbers-and-binary-coding","title":"Binary Numbers and Binary Coding","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#non-numeric-binary-codes","title":"Non-numeric Binary Codes","text":"

    Given n binary digits (called bits), a binary code is a mapping from a set of represented elements to a subset of the \\(2^n\\) binary numbers.

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#number-of-elements-represented","title":"Number of Elements Represented","text":"
    • You can represent 4 elements in radix r = 2 with n = 2 digits: (00, 01, 10, 11).

    • You can represent 4 elements in radix \\(r=2\\) with \\(n=4\\) digits (0001,0010,0100,1000) \\(One\\ Hot\\ Code\\)

    • Other Examples

    • For \\(8\\ 4\\ -2\\ -1\\) \\(\\&\\) \\(Excess\\ 3\\) code -- \"Symmetric\"(complement) Same Probability for \\(0\\) and \\(1\\)
    • \\(Excess\\ 3\\) code -- (real binary value plus 3)
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#binary-coded-decimal-bcd","title":"Binary Coded Decimal (BCD)","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#arithmetic","title":"Arithmetic","text":"

    Add Six

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#ascii","title":"ASCII","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#parity-bit-error-detection-codes","title":"Parity Bit Error-Detection Codes","text":"

    Redundancy (e.g. extra information), in the form of extra bits, can be incorporated into binary code words to detect and correct errors.

    A simple form of redundancy is parity, an extra bit appended onto the code word to make the number of 1\u2019s odd or even.

    Parity can detect all single-bit errors and some multiple-bit errors.

    • A code word has even parity if the number of 1\u2019s in the code word is even.

    • A code word has odd parity if the number of 1\u2019s in the code word is odd.

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#gray-code","title":"Gray Code","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap1/chap1/#optical-shaft-encoder","title":"Optical Shaft Encoder","text":"

    Suppose we want to know the angle shifted by the machine.

    If Use Binary Code-- \u5982\u679c\u4e09\u4e2a\u4f20\u611f\u5668\u4f4d\u7f6e\u4e0d\u7edf\u4e00\uff0c\u5728\u4ece000-111\u8fc7\u7a0b\u4e2d\u53ef\u80fd\u4f1a\u51fa\u73b0\uff1a000-100-110-111 -- \u4e2d\u95f4\u8fc7\u7a0b\u7578\u53d8

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/","title":"Chapter 2 Combinational Logic","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#binary-logic-and-gates","title":"Binary Logic and Gates","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#gate-delay","title":"Gate Delay","text":"
    • In actual physical gates, if one or more input changes causes the output to change, the output change does not occur instantaneously.
    • The delay between an input change(s) and the resulting output change is the gate delay denoted by \\(t_{G}\\)
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#t_pd-propagation-delay","title":"\\(t_{pd}\\) [Propagation Delay]","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#inertial-delay","title":"Inertial Delay","text":"
    • Rejection Time [\"Thin\" Pulse cannot take place in real-time circumstances]
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#nmos-and-pmos","title":"NMOS and PMOS","text":"
    • When an \\(NMOS\\) transistor receives a non-negligible voltage, the connection from the source to the drain acts as a wire. Electricity will flow from the source to the drain uninhibited. This is referred to as a closed circuit.

    On the other hand, when an nMOS transistor receives a voltage at around 0 volts, the connection from the source to the drain will be broken, which is referred to as an open circuit.

    • The p-type transistor works counter to the n-type transistor.

    Whereas the nMOS will form a closed circuit with the source when the voltage is non-negligible, the pMOS will form an open circuit with the source when the voltage is non-negligible.

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#tristate-gate","title":"Tristate gate","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#common-logic-gate-circuit","title":"Common logic gate circuit","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#nand-operation","title":"NAND operation","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#nor-operation","title":"NOR operation","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#and-or-invert-operation","title":"AND-OR-INVERT operation","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#exclusive-or","title":"Exclusive OR","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#exclusive-nor","title":"Exclusive NOR","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#basic-concepts-of-boolean-algebra","title":"Basic concepts of Boolean algebra","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#the-xor-identities","title":"The XOR identities","text":"
    • \\(X\\oplus0=X\\ X\\oplus1=\\bar{X}\\)
    • \\(X\\oplus X=0\\ X\\oplus\\bar{X}=1\\)
    • \\(X\\oplus\\bar{Y}=\\bar{X}\\oplus Y=\\overline{X\\oplus Y}\\)
    • \\(X\\oplus Y=Y\\oplus X=X\\bar{Y}+\\bar{X}Y\\)
    • \\(\\overline{X\\oplus Y}=XY+\\bar{X}\\bar{Y}\\)
    • \\((X\\oplus Y)\\oplus Z=X\\oplus(Y\\oplus Z)=X\\oplus Y\\oplus Z\\)
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#basic-properties-of-boolean-algebra","title":"Basic properties of Boolean algebra","text":"
    • \\((X+Y)(X+Z)=X+YZ\\)
    • \\(\\overline{X+Y}=\\bar{X}\u00b7\\bar{Y}\\)
    • \\(\\overline{X\u00b7Y}=\\bar{X}+\\bar{Y}\\)
    • \\(A(A+B)=A\\)
    • \\(A+AB=A\\)
    • \\(A(\\bar{A}+B)=AB\\)
    • \\(A+\\bar{A}B=A+B\\)
    • \\((A+B)(\\bar{A}+C)(B+C)=(A+B)(\\bar{A}+C)\\)
    • \\(AB+\\bar{A}C+BC=AB+\\bar{A}C\\)
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#complementing-and-duality-rules","title":"Complementing and Duality rules","text":"
    • For logic function F, interchange AND and OR operators ;complement each constant value and literal, then obtained the new function is the inverse function of the original function is referred to as: \\(\\bar{F}\\)

    Note the following two points:

    The holding operation priority unchanged, if necessary, add brackets indicate.

    Within converting, public non-operation remains unchanged for several variables

    • Duality rules: For logic function F ,AND \\(\\Leftrightarrow\\) OR 0 \\(\\Leftrightarrow\\) 1

    If F\u2018 is the F Duality, then F is also F\u2019 of Duality. F and F\u2018 is mutually Duality formula .

    If the two logical functions F and G are equal, then the Duality formula F' and G' are also equal.

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#substitution-rules","title":"Substitution rules","text":"

    Any logical equation that contains a variable A, and if all occurrences of A's position** are replaced with a logical function F, the equation still holds.

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#shannon-formula","title":"Shannon formula","text":"

    \u2013 Assuming: Function F contained variables \\(x\\)\u3001\\(\\bar{x}\\), at \"x AND F\" operation, variable \\(x\\) may be replaced by 1 , variable \\(\\bar{x}\\) can be replaced by 0.

    \u2013 At \"x AND F\" operation, \\(x\\) can be \"0\", \\(\\bar{x}\\) can be replaced with \"1\" .

    \\(xf(x,\\overline{x},y...)=xf(1,0,y\u2026)\\)

    \\(\\overline{x}f(x,\\overline{x},y...)=\\overline{x} f(0,1,y...)\\)

    Similarly

    \\(x+f(x,\\bar{x},y\u2026\u2026z)=x+f(0,1,y\u2026\u2026z)\\)

    \\(\\bar{x}+f(x,\\bar{x},y\u2026\u2026z)=\\bar{x}+f(1,0,y\u2026\u2026,z)\\)

    If the function F contains the both of the variables \\(x,\\bar{x}\\) may be follow:

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#simplification","title":"Simplification","text":"
    • Example
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#or-and-style-simplification","title":"OR-AND style simplification","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#standard-forms","title":"Standard Forms","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#canonical-forms","title":"Canonical Forms","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#miniterms","title":"Miniterms","text":"

    Minterms are AND terms with every variable present in either true or complemented form.

    Given that each binary variable may appear normal (e.g., x) or complemented (e.g., x ), there are \\(2^n\\) minterms for n variables. denoted as \\(m_i\\)

    • only one set of variables value make to 1 for any one minterm .
    • any two minterms multiplied equal to 0
    • Sum of all minterms equal to 1
    • Any one minterm is not contained in the original function F,it can be seen as inAnti-function \\(\\bar{F}\\) \u3002

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#maxterms","title":"Maxterms","text":"

    Maxterms are OR terms with every variable in true or complemented form.

    Given that each binary variable may appear normal (e.g., x) or complemented (e.g., x), there are \\(2^n\\) maxterms for n variables. denoted as \\(M_i\\)

    • only one set of variables value make to 0 for any one Maxterm
    • sum of any two Maxterms equal to \\(M_i+M_j=1 \\ i\\ne j\\)
    • Product of all Maxterms equal to 0
    • Any one Maxterm is not contained in the original function F,it can be seen as inAnti-function \\(\\bar{F}\\)

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#minterm-and-maxterm-relationship","title":"Minterm and Maxterm Relationship","text":"
    • \\(M_i\\) and \\(m_i\\) is complement \\(\\overline{M_i}=m_i\\)
    • \\(F=\\sum m_i = \\overline{\\Pi M_i}\\)
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#function-of-the-canonical-forms","title":"Function of the canonical forms","text":"
    • Sum of Minterms(SOM)
    • Product of Maxterms (POM)
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#standard-forms_1","title":"Standard Forms","text":"
    • Standard Sum-of-Products (SOP) : Equations are written as OR of AND terms
    • Standard Product-of-Sums (POS) : Equations are written as AND of OR terms

    For a logical function SOP or POS is the optimized\uff08\u4e24\u7ea7\u95e8\uff0c\u95e8\u7ea7\u6570\u6700\u5c0f\uff09

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#karnaugh-map-of-functio","title":"Karnaugh map of Functio","text":"

    \u7565.

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#multi-level-circuit-optimization","title":"Multi-level circuit optimization","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#cost","title":"COST","text":"
    • Literal Cost : Just Literal Appearances

    • Gate Input Cost \\(G\\) : Add AND OR term but exclude one-literal term

    AB+CD+E -- 7

    BD+ABC+ACD --11

    • \\(GN\\) Add inverters [For the same variable only count once]

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#other-gate-types","title":"Other Gate Types","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#primitive-gates","title":"Primitive Gates","text":"

    A gate that can be described using a single primitive operation type (AND or OR) plus an optional inversions.

    • BUFFER

    The same as a connection -- improve circuit voltage levels and increase the speed of circuit operation.(decrease propagation delay)

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#complex-gates","title":"Complex Gates","text":"

    Requires more than one primitive operation type for its description.

    • XOR Impletations

    • Odd Functions and Even Functions

    XOR -- Odd Functions

    Use inversions -- Even Functions

    • P -- Generate the Parity bit

    • E--Decide whether the translated inf is Error

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#high-resistance-output-tristate-gate","title":"High-Resistance output (tristate gate)","text":"

    Three-state logic adds a third logic value, Hi-Impedance (\\(Hi-Z\\)), giving three states: \\(0, 1, and\\ Hi-Z\\) on the outputs.

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#the-3-state-buffer","title":"The 3-State Buffer","text":"
    • Resolving 3-State Values on a Connection

    Connection of two 3-state buffer outputs, B1 and B0, to a wire, OUT:

    • Data Selection Function with 3-state buffers

    • Last Row of the table will never occur
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap2/chap2/#transmission-3-state-gate","title":"Transmission 3-state gate","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/","title":"Chapter 3 Combinational Logic Design","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#design-procedure","title":"Design Procedure","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#design-example","title":"Design Example","text":"
    • BCD to Excess 3 --Refer to PPT
    • NOTE: The '1' comes from -- \\(\\bar{T_1}\\)

    We can neglect the inversion of input iterals ; but the intermediate varaible\u2019s inversions cannot be neglected

    • For the first -- 3\u7ea7 but high cost

    • For the latter-- 4\u7ea7 but low cost

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#technology-mapping","title":"Technology Mapping","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#decoder","title":"Decoder","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#3-to-8-line-decoder","title":"3-to-8 line decoder","text":"
    • Basic Form : \\((2^3)\\) 8-3-input AND gates.

    • Split to 2-to-4-line decoder and 1-to-2-line decoder. [Simplify]

    Another Example

    • Basic \\(128*7\\)

    • 3-to-8 & 4-to-16. -- \\(128*2 + 8*3+16*4\\)

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#decoder-with-enable","title":"Decoder with Enable","text":"
    • Or to interpret in this way : Use \\(A_1\\) and \\(A_0\\) to decide \\(EN\\) was allocated to which output (\\(D_0\\ D_1\\ D_2\\ D_3\\))
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#decoder-and-or-gate","title":"Decoder and OR gate","text":"

    Theoratically realize all logic functions \\((SOM)\\)

    • Example Refer to PPT
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#display-decoder","title":"Display Decoder","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#7-segment-displayer","title":"7-segment Displayer","text":"

    To decrease count of the pins

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#encoding","title":"Encoding","text":"
    • Example Decimal to BCD

    If two signals are high simultaneously ? -- Meaningless

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#priority-encoder","title":"Priority Encoder","text":"

    If more than one input value is \\(1\\), then the encoder just designed does not work.

    One encoder that can accept all possible combinations of input values and produce a meaningful result is a priority encoder

    • Among the \\(1s\\) that appear, it selects the most significant input position (or the least significant input position)containing a 1 and responds with the corresponding binary code for that position.

    To process \u4e2d\u65ad\u4e8b\u4ef6

    • Could use a K-map to get equations

    • Also can be read directly from table and manually optimized if careful

    \\(A_2=D_4\\)

    \\(A_1=\\bar{D_4}D_3+\\bar{D}_4\\bar{D}_3D_2=\\bar{D_4}F_1. F_1=(D_3+D_2)\\)

    \\(A_0=\\bar{D}_4D_3+\\bar{D_4}\\bar{D_3}\\bar{D_2}D_1=\\bar{D_4(D_3+\\bar{D_2}D_1)}\\)

    \\(V=D_4+F_1+D_1+D_0\\)

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#multiplexers","title":"Multiplexers","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#multiplexer-width-expansion","title":"Multiplexer Width Expansion","text":"
    • GN(22)

    • Three State can connect all output to one line. --GN=18 (a)

    • GN=14 (b)

    Disadvantages : Takes much time .

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#example","title":"Example","text":"
    • Gray to Binary Code
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#approach-1","title":"Approach 1","text":"

    Refer to \\(PPT\\)

    Note that the multiplexer with fixed inputs is identical to a ROM with 3-bit addresses and 2-bit data!

    • Full adder

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#approach-2","title":"Approach 2","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#arithmetic-functions","title":"Arithmetic Functions","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#half-adder","title":"Half-Adder","text":"

    The most COMMON:

    • \\(S=X\\oplus Y\\ C=XY\\)
    • \\(S=(X+Y)\\bar{C}\\ C=\\overline{(\\overline{XY})}\\)
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#full-adder","title":"Full-Adder","text":"

    \\(X\\oplus Y\\) only different from \\(X+Y\\) when \\(XY=1\\)

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#binary-adders","title":"Binary Adders","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#carry-lookhead","title":"Carry Lookhead","text":"
    • To get \\(C_n\\) not dependent on \\(C_{n-1}\\)

    \\(P_i=A_i\\oplus B_i\\ \\ \\ G_i=A_iB_i\\\\S_i=P_i\\oplus C_i\\ \\ \\ C_{i+1}=G_i+P_iC_i\\)

    Thus,we have

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#group-carry-lookahead-logic","title":"Group Carry Lookahead Logic","text":"

    Disadvantages :

    • Too many Fan-Outs(propagation delay increase)
    • High Cost

    So Simple copy the CLA to more bits is not practical.

    • \u4f7f\u7528\u7b2c\u4e8c\u5c42CLA \u51cf\u5c11\u4f20\u8f93\u5ef6\u8fdf

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#unsigned-subtraction","title":"Unsigned Subtraction","text":"
    • TOO Complicated!
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#complements","title":"Complements","text":"
    • 1's Complement
    • 2's Complement
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#subtraction-with-2s-complement","title":"Subtraction with 2\u2019s Complement","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#signed-integers","title":"Signed Integers","text":"
    • Signed-Magnitude
    • Signed-Complement
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#2s-complement-addersubtractor","title":"2\u2019s Complement Adder/Subtractor","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#overflow-detection","title":"Overflow Detection","text":"

    Overflow V = \\(C_n\\oplus C_{n-1}\\)

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#incrementing-decrementing","title":"Incrementing & Decrementing","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#incrementing","title":"Incrementing","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#multiplicationdivision-by-2n","title":"Multiplication/Division by \\(2^n\\)","text":"
    • Zero Fill
    • Filling usually is applied to the MSB end of the operand, but can also be done on the LSB end
    • Extension- increase in the number of bits at the MSB end of an operand by using a complement representation

    Copies the MSB of the operand into the new positions

    Positive operand example - 01110101 extended to 16 bits:0000000001110101

    Negative operand example - 11110101 extended to 16 bits:1111111111110101

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#arithmetic-logic-unitalu-implementation","title":"Arithmetic Logic Unit(ALU) implementation","text":"

    \\(Y_i=B_iS_0+\\bar{B_i}S_1\\)

    The Above Part -- (Basic ALU like above)

    The below Part -- AND OR XOR NOT (one bit)

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap3/chap3/#combinational-shifter-parameters","title":"Combinational Shifter Parameters","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/","title":"Chapter 4 Sequential Logic","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#storage-elements-and-sequential-circuit-analysis","title":"Storage Elements and Sequential Circuit Analysis","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#types-of-sequential-circuits","title":"Types of Sequential Circuits","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#synchronous","title":"Synchronous","text":"
    • Behavior defined from knowledge of its signals at discrete instances of time
    • Storage elements observe inputs and can change state only in relation to a timing signal (clock pulses from a clock)
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#asynchronous","title":"Asynchronous","text":"
    • Behavior defined from knowledge of inputs an any instant of time and the order in continuous time in which inputs change

    • If clock just regarded as another input, all circuits are asynchronous!

    • Nevertheless, the synchronous abstraction makes complex designs tractable!

    Circuit Delay Model"},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#latches","title":"Latches","text":"
    • Long term maintaining a given stable state
    • There are two stable states, \"0\", \"1\"
    • Under certain conditions, can change state at anytime
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#basicnand-bars-barr-latch","title":"Basic(NAND) \\(\\bar{S}-\\bar{R}\\) Latch","text":"
    • So RS state 00 is forbidden!
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#basicnor-s-r-latch","title":"Basic(NOR) \\(S-R\\) Latch","text":"
    • So RS state 11 is forbidden!
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#clocked-s-r-latch","title":"Clocked S-R Latch","text":"
    • Adding two NAND gates to the basic S - R NAND latch gives the clocked S \u2013 R latch
    • Has a time sequence behavior similar to the basic S-R latch except that the S and R inputs are only observed when the line C is high.
    Details"},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#d-latch","title":"D Latch","text":"
    • Adding an inverter to the S-R Latch, gives the D Latch -- No indeterminate states
    Q D Q(t+1) Comment 0 0 0 No Change 0 1 1 Set Q 1 0 0 Clear Q 1 1 1 No Change"},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#the-latch-timing-problem","title":"The Latch Timing Problem","text":"
    • We CANNOT be sure what value will Y output when C=0
    • This is the Latch Timing Problem.
    • In one Clock Pulse, Y can change many times if the Input Changes.
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#flip-flops","title":"Flip-Flops","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#s-r-master-slave-flip-flop","title":"S-R Master-Slave Flip-Flop","text":"
    • The Problem of 1s Catching

    While \\(C=1\\) \\(S\\) \\(and/or\\) \\(R\\) are permited to change.

    • Suppose \\(Q\\) =\\(0\\) and \\(S\\) goes to \\(1\\) and then back to \\(0\\) with \\(R\\) remaining at \\(0\\)

    The master latch sets to \\(1\\)

    A \\(1\\) is transferred to the slave

    • Suppose \\(Q\\) = \\(0\\) and \\(S\\) goes to \\(1\\) and back to \\(0\\) and \\(R\\) goes to \\(1\\) and back to \\(0\\)

    The master latch sets and then resets

    A \\(0\\) is transferred to the slave

    • Personally main problem: The hold state when \\(S=R=0\\)
    Details"},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#edge-triggered-d-flip-flop","title":"Edge-Triggered D Flip-Flop","text":"
    • The delay of the S-R master-slave flip-flop can be avoided since the 1s-catching behavior is not present with D replacing S and R inputs
    • The change of the D flip-flop output is associated with the negative edge at the end of the pulse
    • It is called a negative-edge triggered flip-flop
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#flip-flop-timing-parameters","title":"Flip-Flop Timing Parameters","text":"
    • \\(t_s\\) -- Setup Time

    Master-slave - Equal to the width of the triggering pulse (Because of the 1's Catching the triggering pulse once arrives is forbidden to change)

    Edge-triggered - Equal to a time interval that is generally much less than the width of the the triggering pulse

    • \\(t_h\\) Hold Time -- often equal to zero

    • \\(t_w\\) Clock Pulse Width

    • \\(t_{px}\\)

    Same parameters as for gates except that measured from clock edge that triggers the output change to the output change.

    More Specifically

    • \u8fd9\u51e0\u4e2a\u65f6\u95f4\u70b9\u8d77\u70b9/\u7ec8\u70b9\u90fd\u662f\u89e6\u53d1\u8fb9\u7f18\uff1b
    • Propagation Time \u4e00\u5b9a\u957f\u4e8e Hold Time\uff0c\u56e0\u6b64\u5728\u8ba1\u7b97\u7535\u8def\u5ef6\u8fdf\u65f6\u53ea\u8003\u8651 Propagation Time\uff1b
    • Pulse-trigger \u548c Edge-trigger \u5728\u8868\u73b0\u4e0a\u7684\u533a\u522b\u5728\u4e8e Setup Time\uff0c\u524d\u8005\u9700\u8981\u8986\u76d6\u6574\u4e2a pulse(pos or neg)\uff1b

    Summary"},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#sequential-circuit-design","title":"Sequential Circuit Design","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#state-table","title":"State Table","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#state-diagrams","title":"State Diagrams","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#moore-models","title":"Moore Models","text":"

    Outputs are a function ONLY of states

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#mealy-models","title":"Mealy Models","text":"

    Outputs are a function of inputs AND states

    Details"},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#equivalent-state","title":"Equivalent State","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#circuit-and-system-level-timing","title":"Circuit and System Level Timing","text":"
    • \\(t_p\\) clock period --The interval between occurrences of a specific clock edge in a

    periodic clock

    • \\(t_{pd,COMB}\\) -- total delay of combinational logic along the path from flip-flop output to

    flip-flop input

    • \\(t_{slack}\\) -- extra time in the clock period in addition to the sum of the delays and

    setup time on a path : Must be greater than or equal to zero on all paths for correct operation

    • \\(t_{pd,FF}\\) -- Flip-Flop's delay

    • Timing Equations

    \\(t_p=t_{slack}+(t_{pd,FF}+t_{pd,COMB}+t_s)\\)

    \\(t_{stack}\\) must be greater than or equal to zero so \\(t_{p} \\ge max(t_{pd,FF}+t_{pd,COMB}+t_s)\\)

    from all paths from flip-flop output to flip-flop input

    • Can be calculated more precisely by using \\(t_{PHL}\\) and \\(t_{PLH}\\) values instead of \\(t_{pd}\\) values, but requires consideration of inversions on paths

    • Calculation[Refer to PPT]

    Example Recognize 1101 Milley Model Moore Model

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#state-assignment","title":"State Assignment","text":"
    • Each of the m states must be assigned a unique code
    • Minimum member of bits required is n such that \\(n\\ge[log_2m]\\)

    The task of state assignment involves determining the encoding length and finding an optimal (often challenging) or near-optimal state assignment scheme, leading to different expressions for output functions and activation functions, and consequently varying circuit complexities. The basic principles of state assignment are:

    1. Determine the length of the encoding.
    2. Seek an optimal (difficult to find) or near-optimal state assignment scheme.

    The fundamental principles of assignment are as follows:

    • Under the same input conditions, states with the same next states should preferably be assigned adjacent binary codes.
    • Under adjacent input conditions, the next states of the same current state should preferably be assigned adjacent binary codes.
    • Current states with identical outputs should preferably be assigned adjacent binary codes.
    • Minimize the occurrence of the most frequently appearing states in the state table, or assign logic 0 to initial states.

    Generally, the first principle is of greater importance and should be prioritized. Subsequently, consideration should be given to the frequency of occurrence of state pairs resulting from the first three principles, with a preference for assigning adjacent binary codes to state pairs with higher frequencies.

    • EXAMPLE -- Refer to the PPT

    • Design a sequential modulo 3 accumulator for 2-bit operands

    Details"},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#other-flip-flop-types","title":"Other Flip-Flop Types","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#j-k-flip-flop","title":"J-K Flip-Flop","text":"

    Same as S-R flip-flop with J analogous to S and K analogous to R

    • J=K=1 is allowed ; the flip-flop changes to opposite state
    • As a master-slave, has same \u201c1s catching\u201d behavior as S-R flip-flop
    • To avoid 1s catching behavior,one solution used is to use an edge-triggered D as the core of the flip-flop

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#t-flip-flop","title":"T Flip-flop","text":"

    Has a single input T

    • For T = 0, no change to state
    • For T = 1, changes to opposite state

    Same as a J-K flip-flop with J = K = T

    • As a master-slave, has same \u201c1s catching\u201d behavior as J-K flip-flop
    • Cannot be initialized to a known state using the T input

    • To avoid 1s catching behavior,one solution used is to use an edge-triggered D as the core of the flip-flop

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#basic-flip-flop-descriptors","title":"Basic Flip-Flop Descriptors","text":"
    • Characteristic Table
    • Excitation Table

    Eg.

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Chap4/chap4/#flip-flop-behavior-example","title":"Flip-Flop Behavior Example","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/DHI/Digital%20Hardware%20Implementation/","title":"Chapter 5 Digital Hardware Implementation","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/DHI/Digital%20Hardware%20Implementation/#programmable-logic","title":"Programmable Logic","text":"
    1. Economies of Large-Scale Production: Large-scale production of integrated circuits reduces the cost per chip as production costs can be spread across a greater number of chips. Initial setup and tooling expenses incurred during the production process can be amortized over a larger quantity, resulting in lower costs per chip.
    2. Small-Scale Design Requirements: While large-scale production is generally more economical, some designs may require only a relatively small number of chips. This could be due to the customized nature of specific applications or limitations in market size.
    3. Need for ICs that can be Produced in Large Volumes and Handle Small-Scale Designs: This indicates a requirement for integrated circuits that can be both mass-produced efficiently and effectively accommodate multiple designs.
    4. Programmable Logic Devices: These are a specialized category of integrated circuits that can be programmed after manufacturing. They can be divided into two types: field-programmable logic devices (FPLDs), which can be programmed outside the manufacturing environment, and erasable/reprogrammable logic devices.
    5. Erasable and Reprogrammable Nature: Most programmable logic devices possess the ability to be erased and reprogrammed. This feature allows for updating devices, correcting errors, and reusing the device for different designs, showcasing a high level of reusability.
    6. Used for Prototyping and Laboratory Teaching: Programmable logic devices are well-suited for prototyping as they enable engineers to make adjustments and modifications after the initial design is completed. Additionally, they serve as ideal tools in laboratory settings for demonstrating various designs and concepts.
    7. Utilized in Prototype Verification for Design: Programmable logic devices are often employed to verify design prototypes, allowing for debugging and testing before the final manufacturing of regular integrated circuits. For instance, complete Intel Pentium designs were prototyped using specialized systems based on a large number of VLSI programmable devices.
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/DHI/Digital%20Hardware%20Implementation/#programming-technologies","title":"programming technologies","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/DHI/Digital%20Hardware%20Implementation/#permanent","title":"Permanent","text":"
    • Mask Programming
    • Fuse
    • Antiques
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/DHI/Digital%20Hardware%20Implementation/#not-permanent","title":"Not Permanent","text":"
    • Volatile - Programming lost if chip power lost

    SIngle-bit-storge element

    • Non-volatile

    \u200b Reasable

    \u200b Eletrically erasable

    \u200b Flash

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/DHI/Digital%20Hardware%20Implementation/#read-only-memoryrom","title":"Read Only Memory(ROM)","text":"
    • OR Gate Changable
    • \u4e5f\u53ef\u4ee5\u5c06\u8f93\u5165\u770b\u4f5c addr, \u8f93\u51fa\u770b\u4f5c data,\u6765\u4f5c\u50a8\u5b58\u529f\u80fd
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/DHI/Digital%20Hardware%20Implementation/#programmable-array-logicpal","title":"Programmable Array Logic(PAL)","text":"
    • AND Gate Changable

    \u53ef\u5c06\u9996\u6b21\u4e0e\u6216\u5f53\u4f5c\u8f93\u5165\u56de\u5230AND gates input \u53ef\u5b9e\u73b0\u591a\u53d8\u91cf\u4e0e\u6216.

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/DHI/Digital%20Hardware%20Implementation/#programmable-logic-array-pla","title":"Programmable Logic Array (PLA)","text":"
    • And Or gates all changable
    • \\(And\\) Gates limited

      \u9002\u5f53\u53d6\u53cd\uff0c\u5c06\u9700\u89816\u4e2a\u4e0e\u9879\u2192 \u9700\u89814\u4e2a\u4e0e\u9879

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/DHI/Digital%20Hardware%20Implementation/#complex-programmable-logic-device-cpld-or-field-programmable-gate-arrayfpga","title":"Complex Programmable Logic Device (CPLD) or Field-Programmable Gate Array(FPGA)","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/DHI/Digital%20Hardware%20Implementation/#look-up-tables","title":"Look up tables","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/","title":"Chapter 7 Memory Basics","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#memory-organization","title":"Memory Organization","text":"
    • Access is based on words as the access unit.
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#basic-memory-operations","title":"Basic Memory Operations","text":"
    • Read Memory
    Chip select Read/not Write memory operation 0 None 1 0 Write to selected word 1 1 Read from selected word
    • Write Memory
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#memory-opertion-timing","title":"Memory opertion timing","text":"

    65ns -- 'read speed'--is critical for the whole speed.

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#ram","title":"RAM","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#types-of-random-access-memory","title":"Types of Random Access Memory","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#static-ram-cell","title":"Static RAM -- Cell","text":"

    Information stored in Latches

    Select = 0 HOLD

    Select = 1 OUTPUT DATA. \u300cINPUT depends on \\(B\\) and \\(\\bar{B}\\)\u300d

    • Bit select = 0 : NO WRITING or READING -- Bit Slice Disabled

    • Word select : only one allowed to be ONE

    • Bit select = 1:

    Read/not Write B not B Word select Result 1 0 0 1 One piece of information stored in one selected latch output 0 Data not Data 1 The input information is stored in the one selected latch
    • \\(2^{n-1}\\) Word using 1-Bit RAM IC

    Chip Select : When CS=0 Data Output \u9ad8\u963b\u6001

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#cell-arrays-and-coincident-selection","title":"Cell Arrays and Coincident Selection","text":"
    • Uses two decoders, one for words and one for bits
    • Word select becomes Row select
    • Bit select becomes Column select

    16x1

    • Still one ONE chosen
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#ram-ics-with-1-bitword","title":"RAM ICs with > 1 Bit/Word","text":"

    8x2

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#making-larger-memories-word-extension","title":"Making Larger Memories: Word extension","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#making-wider-memories-bit-extension","title":"Making Wider Memories: Bit extension","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#dynamic-ram","title":"Dynamic RAM","text":"

    information stored as electrical charges

    • Read will affect the stored information(has to write again)

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#read-write","title":"Read & Write","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#types","title":"Types","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#synchronous-dram-sdram","title":"Synchronous DRAM (SDRAM)","text":"

    Transfers to and from the DRAM are synchronize with a clock

    Synchronous registers appear on:

    • Address input
    • Data input
    • Data output

    Column address counter

    • for addressing internal data to be transferred on each clock cycle
    • beginning with the column address counts up to column address + burst size \u2013 1

    Example: Memory data path width: 1 word = 4 bytes

    SDRAM burst time-- burst size=4

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#double-data-rate-sdram-ddr-sdram","title":"Double Data Rate SDRAM (DDR SDRAM)","text":"
    • Transfers data on both edges of the clock

    • Provides a transfer rate of 2 data words perclock cycle

    • Example: Same as for synchronous DRAM

    Read cycle time = 60 ns

    Memory Bandwidth: (2 x 32)/(60 x 10-9) = 1.066 Mbytes/sec

    • SRAM as Cache -- read more memory than expected makes CPU reads faster when asking for other data(CPU reads from SRAM)

    SPEED UP!

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#rambus-dram-rdram","title":"RAMBUS\u00ae DRAM (RDRAM)","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#dependence-on-power-supply","title":"Dependence on Power Supply","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#volatile","title":"Volatile","text":"

    Loses stored information when power turned off

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/MB/MB/#non-volatile","title":"Non-volatile","text":"

    Retains information when power turned off

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/","title":"Registers and Register Transfers","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#registers","title":"Registers","text":"Example"},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#storage-and-load-enable","title":"Storage and Load Enable","text":"
    • Load = 0 : Store

    • Load = 1 : Load

    The Problem is : Clock Skew \u300cAnd Gate Delay\u300d

    \u52d8\u8bef Load = 0 \u65f6 \u8109\u51b2\u6d88\u5931\uff0c\u5bc4\u5b58\u5668\u65e0\u6cd5\u88ab\u8f7d\u5165

    Example

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#register-transfer","title":"Register Transfer","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#microoperations","title":"Microoperations","text":"

    Logical Groupings:

    • Transfer - move data from one register to another
    • Arithmetic - perform arithmetic on data in registers
    • Logic - manipulate data or use bitwise logical operations
    • Shift - shift data in registers

    \\(if\\ \\ (K_1=1)\\ then\\ \\ (R_2\u2190R_1)\\) \u8868\u793a\u4e3a \\(K_1 : R_2\u2190R_1\\)

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#register-transfer-structures","title":"Register Transfer structures","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#multiplexer-based-transfers","title":"Multiplexer-Based Transfers","text":"

    note : clocks are omitted for clarity

    \\(K_1 : R_0\u2190R_1\\)

    \\(K2\\bar{K1}: R_0\u2190R_2\\)

    • \\(R_0\\) 's Load : \\(K_1+K2\\bar{K1}=K_1+K_2\\)

    Detailed-logic

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#register-cell-design","title":"Register Cell Design","text":"
    • Example 1 Not encoded \u300cone hot code\u300d

    • Example 2 Encoded. \u300cBinary or Gray\u300d

    EG1: Example

    Register A (m-bits) Sepecification:

    Data input B

    Control input \\(C_x \\ C_y\\) with combinations\\((0,0)\\ (0,1)\\ (1,0)\\)

    Register Transfers:

    \\(C_x : A \\leftarrow A\\ or\\ B\\)

    \\(C_y\\) : \\(A \\leftarrow A\\ xor\\ B\\)

    Hold State : \\((0,0)\\)

    Multiplexer Approach

    Thus , we have :

    \\(Load = C_x + C_y\\)

    Cost : 6+3+2(or)+8(xor) = 19

    Sequential Circuit Design Approach

    • State table\u300cCost Less\u300d

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#bus-based-transfers","title":"Bus-Based Transfers","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#dedicated-mux-based-transfers","title":"Dedicated Mux-Based Transfers","text":"

    Similar to using a MUX, the MUX in this case is no longer dedicated logic for a specific register but is shared logic used by three registers.

    The MUX in the bus selects one input among all registers and outputs it to all registers. The bus controls which (or how many) registers receive this signal by manipulating the Load signal.

    Advantages:

    1. The circuit is more streamlined, resulting in lower costs, and this advantage becomes more apparent as the number of registers increases.
    2. Cost-effectiveness is improved with the shared logic, as opposed to dedicated logic for each register.

    Disadvantages:

    1. At any given moment, the bus can only transmit one piece of data, meaning there is only one data source.
    2. Only one data transfer is possible to other locations within the same clock cycle. For instance, performing a swap operation requires at least two buses to implement.\u300c\u65e0\u6cd5\u505a\u5e76\u884c\u4f20\u8f93\u300d
    3. Due to these characteristics, the requirements must be carefully evaluated, and the appropriate structure chosen for implementation.

    Gate Cost. (increase linearly)

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#three-state-bus","title":"Three-State Bus","text":"

    The 3-input MUX can be replaced by a 3-state node (bus) and 3-state buffers.

    • Cost is further reduced, but transfers are limited.
    • Characterize the simultaneous transfers possible with this structure.
    • Characterize the cost savings and compare.
    • The input and output can share the same line, requiring only n pins.

    Gate Cost Only 2n (suppose cost for three-state is 2)

    Example

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#shift-registers","title":"Shift Registers","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#_1","title":"\u4e32\u884c\u5b9e\u73b0","text":"

    \u5047\u8bbe\u73b0\u5728\u6211\u4eec\u6709 4 \u4e2a FF \u9996\u5c3e\u76f8\u8fde\uff0c\u73b0\u5728\u4e32\u884c\u8f93\u5165 1001 \u8fd9 4bits \u7684\u6570\u636e\uff08\u5f53\u7136\uff0c\u5b8c\u5168\u8f93\u5165\u9700\u8981 4 \u4e2a\u65f6\u949f\u5468\u671f\uff09\u3002

    \u5047\u8bbe\u7b2c 1 \u4e2a\u5468\u671f\u7ed3\u675f\u540e\uff0c1001 \u6700\u53f3\u4fa7\u7684 1 \u88ab\u5b58\u5728\u4e86\u7b2c\u4e00\u4e2a FF\uff0c\u5219\uff1a

    \u5468\u671f \u5f85\u8f93\u5165 FF1 FF2 FF3 FF4 SO 1 100 1 ? ? ? 1??? 2 10 0 1 ? ? 01?? 3 1 0 0 1 ? 001? 4 1 0 0 1 1001 5 ? 1 0 0 ?100 6 ? ? 1 0 ??10 7 ? ? ? 1 ???1
    • \u8fd9\u91cc\u7684 SO \u6307\u7684\u662f\u4ece\u5f53\u524d\u8f6e\u6b21\u5f00\u59cb\uff0c\u8bfb\u5165 4bits \u6570\u636e\u5f97\u5230\u7684\u4e32\u884c\u8f93\u51fa\u7ed3\u679c\uff0c\u8fd9\u91cc\u7684 4bits \u5f53\u7136\u662f\u5bf9\u5e94\u8f93\u5165\u7684 4bits\u3002

    • \u53ef\u4ee5\u53d1\u73b0\uff0c\u5728\u7b2c\u56db\u8f6e\u524d\u540e\u7684\u7ed3\u679c\u5206\u522b\u662f\u5de6\u79fb\u548c\u53f3\u79fb\u7684\u7ed3\u679c\uff0c\u5f53\u7136\uff0c\u5982\u679c\u662f\u8981\u8003\u8651\u5177\u6709\u5b9e\u9645\u8ba1\u7b97\u4ef7\u503c\u7684\u4f4d\u79fb\uff0c\u6211\u4eec\u5f53\u7136\u9700\u8981\u586b\u5145 ? \u7684\u503c\uff0c\u4e0d\u8fc7\u8fd9\u90fd\u662f\u5c0f\u4e8b\u60c5\u3002

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#parallel-load-shift-registersmux","title":"Parallel Load Shift Registers\u300cMux\u300d","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#shift-registers-with-additional-functions","title":"Shift Registers with Additional Functions","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#counters","title":"Counters","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#ripple-counter","title":"Ripple Counter","text":"Example
    • The operating frequency gradually reduces to half of the previous layer.
    • Also, there is an intermediate process, eg. the transition from 111 to 000 has to go through 010
    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#synchronous-counter","title":"Synchronous Counter","text":"

    Internal details => Incrementer

    Internal Logic

    • \ufeff\ufeffXOR complements each bit
    • \ufeff\ufeffAND chain causes complement of a bit if all bits toward LSB from it equal 1

    Count Enable

    • Forces all outputs of AND chain to 0 to \"hold\" the state

    Carry Out

    • Added as part of incrementer

    • Connect to Count Enable of additional 4-bit counters to form larger counters

    \u4e3a\u4e86\u5b9e\u73b0\u9006\u5411\u8ba1\u6570\u5668\uff0c\u6211\u4eec\u5219\u9700\u8981\u5c06\u81ea\u589e\u5668\u6362\u4e3a\u81ea\u51cf\u5668\u3002\u505a\u6cd5\u53ea\u4e0d\u8fc7\u662f\u5c06\u5f02\u6216\u95e8\u7684\u63a7\u5236\u4fe1\u53f7\u53d6\u53cd

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#counter-with-parallel-load","title":"Counter with parallel load","text":"count Load Operation 0 0 Hold 0 1 Load Parallel data 1 x count"},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#design-example","title":"Design Example","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#synchronous-bcd","title":"Synchronous BCD","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#counting-modulo-n","title":"Counting Modulo N","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register/#serial-transforms-and-microoperations","title":"Serial Transforms and Microoperations","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/","title":"Registers and Register Transfers","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#registers","title":"Registers","text":"Example"},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#storage-and-load-enable","title":"Storage and Load Enable","text":"
    • Load = 0 : Store

    • Load = 1 : Load

    The Problem is : Clock Skew \u300cAnd Gate Delay\u300d

    \u52d8\u8bef Load = 0 \u65f6 \u8109\u51b2\u6d88\u5931\uff0c\u5bc4\u5b58\u5668\u65e0\u6cd5\u88ab\u8f7d\u5165

    Example

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#register-transfer","title":"Register Transfer","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#microoperations","title":"Microoperations","text":"

    Logical Groupings:

    • Transfer - move data from one register to another
    • Arithmetic - perform arithmetic on data in registers
    • Logic - manipulate data or use bitwise logical operations
    • Shift - shift data in registers

    \\(if\\ \\ (K_1=1)\\ then\\ \\ (R_2\u2190R_1)\\) \u8868\u793a\u4e3a \\(K_1 : R_2\u2190R_1\\)

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#register-transfer-structures","title":"Register Transfer structures","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#multiplexer-based-transfers","title":"Multiplexer-Based Transfers","text":"

    note : clocks are omitted for clarity

    \\(K_1 : R_0\u2190R_1\\)

    \\(K2\\bar{K1}: R_0\u2190R_2\\)

    • \\(R_0\\) 's Load : \\(K_1+K2\\bar{K1}=K_1+K_2\\)

    Detailed-logic

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#register-cell-design","title":"Register Cell Design","text":"
    • Example 1 Not encoded \u300cone hot code\u300d

    • Example 2 Encoded. \u300cBinary or Gray\u300d

    EG1: Example

    Register A (m-bits) Sepecification:

    Data input B

    Control input \\(C_x \\ C_y\\) with combinations\\((0,0)\\ (0,1)\\ (1,0)\\)

    Register Transfers:

    \\(C_x : A \\leftarrow A\\ or\\ B\\)

    \\(C_y\\) : \\(A \\leftarrow A\\ xor\\ B\\)

    Hold State : \\((0,0)\\)

    Multiplexer Approach

    Thus , we have :

    \\(Load = C_x + C_y\\)

    Cost : 6+3+2(or)+8(xor) = 19

    Sequential Circuit Design Approach

    • State table\u300cCost Less\u300d

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#bus-based-transfers","title":"Bus-Based Transfers","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#dedicated-mux-based-transfers","title":"Dedicated Mux-Based Transfers","text":"

    Similar to using a MUX, the MUX in this case is no longer dedicated logic for a specific register but is shared logic used by three registers.

    The MUX in the bus selects one input among all registers and outputs it to all registers. The bus controls which (or how many) registers receive this signal by manipulating the Load signal.

    Advantages:

    1. The circuit is more streamlined, resulting in lower costs, and this advantage becomes more apparent as the number of registers increases.
    2. Cost-effectiveness is improved with the shared logic, as opposed to dedicated logic for each register.

    Disadvantages:

    1. At any given moment, the bus can only transmit one piece of data, meaning there is only one data source.
    2. Only one data transfer is possible to other locations within the same clock cycle. For instance, performing a swap operation requires at least two buses to implement.\u300c\u65e0\u6cd5\u505a\u5e76\u884c\u4f20\u8f93\u300d
    3. Due to these characteristics, the requirements must be carefully evaluated, and the appropriate structure chosen for implementation.

    Gate Cost. (increase linearly)

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#three-state-bus","title":"Three-State Bus","text":"

    The 3-input MUX can be replaced by a 3-state node (bus) and 3-state buffers.

    • Cost is further reduced, but transfers are limited.
    • Characterize the simultaneous transfers possible with this structure.
    • Characterize the cost savings and compare.
    • The input and output can share the same line, requiring only n pins.

    Gate Cost Only 2n (suppose cost for three-state is 2)

    Example

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#shift-registers","title":"Shift Registers","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#_1","title":"\u4e32\u884c\u5b9e\u73b0","text":"

    \u5047\u8bbe\u73b0\u5728\u6211\u4eec\u6709 4 \u4e2a FF \u9996\u5c3e\u76f8\u8fde\uff0c\u73b0\u5728\u4e32\u884c\u8f93\u5165 1001 \u8fd9 4bits \u7684\u6570\u636e\uff08\u5f53\u7136\uff0c\u5b8c\u5168\u8f93\u5165\u9700\u8981 4 \u4e2a\u65f6\u949f\u5468\u671f\uff09\u3002

    \u5047\u8bbe\u7b2c 1 \u4e2a\u5468\u671f\u7ed3\u675f\u540e\uff0c1001 \u6700\u53f3\u4fa7\u7684 1 \u88ab\u5b58\u5728\u4e86\u7b2c\u4e00\u4e2a FF\uff0c\u5219\uff1a

    \u5468\u671f \u5f85\u8f93\u5165 FF1 FF2 FF3 FF4 SO 1 100 1 ? ? ? 1??? 2 10 0 1 ? ? 01?? 3 1 0 0 1 ? 001? 4 1 0 0 1 1001 5 ? 1 0 0 ?100 6 ? ? 1 0 ??10 7 ? ? ? 1 ???1
    • \u8fd9\u91cc\u7684 SO \u6307\u7684\u662f\u4ece\u5f53\u524d\u8f6e\u6b21\u5f00\u59cb\uff0c\u8bfb\u5165 4bits \u6570\u636e\u5f97\u5230\u7684\u4e32\u884c\u8f93\u51fa\u7ed3\u679c\uff0c\u8fd9\u91cc\u7684 4bits \u5f53\u7136\u662f\u5bf9\u5e94\u8f93\u5165\u7684 4bits\u3002

    • \u53ef\u4ee5\u53d1\u73b0\uff0c\u5728\u7b2c\u56db\u8f6e\u524d\u540e\u7684\u7ed3\u679c\u5206\u522b\u662f\u5de6\u79fb\u548c\u53f3\u79fb\u7684\u7ed3\u679c\uff0c\u5f53\u7136\uff0c\u5982\u679c\u662f\u8981\u8003\u8651\u5177\u6709\u5b9e\u9645\u8ba1\u7b97\u4ef7\u503c\u7684\u4f4d\u79fb\uff0c\u6211\u4eec\u5f53\u7136\u9700\u8981\u586b\u5145 ? \u7684\u503c\uff0c\u4e0d\u8fc7\u8fd9\u90fd\u662f\u5c0f\u4e8b\u60c5\u3002

    "},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#parallel-load-shift-registersmux","title":"Parallel Load Shift Registers\u300cMux\u300d","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#shift-registers-with-additional-functions","title":"Shift Registers with Additional Functions","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#counters","title":"Counters","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#ripple-counter","title":"Ripple Counter","text":""},{"location":"%E8%AE%A1%E7%AE%97%E6%9C%BA%E9%80%BB%E8%BE%91%E8%AE%BE%E8%AE%A1%E5%9F%BA%E7%A1%80/Register/register_%E5%89%AF%E6%9C%AC/#synchronous-counter","title":"Synchronous Counter","text":""}]} \ No newline at end of file diff --git a/sitemap.xml.gz b/sitemap.xml.gz index 9d3a57b6b14d02f2a02a269276f058f1c736eb8e..753242226f7b5e4420f26e3b29e04413d686b473 100644 GIT binary patch delta 16 Xcmeyw_KA&MzMF$1+kDwZ_H1SVFWLnl delta 16 Xcmeyw_KA&MzMF&N!}FyZ*|V7eH<$)g diff --git "a/\345\244\247\344\276\240/index.html" "b/\345\244\247\344\276\240/index.html" index cd2de387..3193354c 100644 --- "a/\345\244\247\344\276\240/index.html" +++ "b/\345\244\247\344\276\240/index.html" @@ -1386,8 +1386,6 @@ - - @@ -1561,26 +1559,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git "a/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/Chap1/chap1/index.html" "b/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/Chap1/chap1/index.html" index 63ee8211..84cd3583 100644 --- "a/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/Chap1/chap1/index.html" +++ "b/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/Chap1/chap1/index.html" @@ -1601,8 +1601,6 @@ - - @@ -1776,26 +1774,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git "a/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/Chap2/chap2/index.html" "b/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/Chap2/chap2/index.html" index 389fb056..b87cff11 100644 --- "a/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/Chap2/chap2/index.html" +++ "b/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/Chap2/chap2/index.html" @@ -1718,8 +1718,6 @@ - - @@ -1893,26 +1891,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git "a/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/Chap3/chap3/index.html" "b/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/Chap3/chap3/index.html" index 3d10a5d4..34d4a7b8 100644 --- "a/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/Chap3/chap3/index.html" +++ "b/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/Chap3/chap3/index.html" @@ -1730,8 +1730,6 @@ - - @@ -1905,26 +1903,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git "a/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/Chap4/chap4/index.html" "b/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/Chap4/chap4/index.html" index 56cddd49..38b8e983 100644 --- "a/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/Chap4/chap4/index.html" +++ "b/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/Chap4/chap4/index.html" @@ -1670,8 +1670,6 @@ - - @@ -1845,26 +1843,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git "a/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/DHI/Digital Hardware Implementation/index.html" "b/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/DHI/Digital Hardware Implementation/index.html" index 4a8fcb45..cb9b0e66 100644 --- "a/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/DHI/Digital Hardware Implementation/index.html" +++ "b/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/DHI/Digital Hardware Implementation/index.html" @@ -1502,8 +1502,6 @@ - - @@ -1677,26 +1675,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git "a/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/MB/MB/index.html" "b/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/MB/MB/index.html" index 46202c00..82332daf 100644 --- "a/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/MB/MB/index.html" +++ "b/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/MB/MB/index.html" @@ -1541,8 +1541,6 @@ - - @@ -1716,26 +1714,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git "a/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/Register/register/index.html" "b/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/Register/register/index.html" index 47e35b87..6704327b 100644 --- "a/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/Register/register/index.html" +++ "b/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/Register/register/index.html" @@ -1620,8 +1620,6 @@ - - @@ -1795,26 +1793,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - - diff --git "a/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/Register/register_\345\211\257\346\234\254/index.html" "b/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/Register/register_\345\211\257\346\234\254/index.html" index 049b10e4..10c99696 100644 --- "a/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/Register/register_\345\211\257\346\234\254/index.html" +++ "b/\350\256\241\347\256\227\346\234\272\351\200\273\350\276\221\350\256\276\350\256\241\345\237\272\347\241\200/Register/register_\345\211\257\346\234\254/index.html" @@ -1385,8 +1385,6 @@ - - @@ -1560,26 +1558,6 @@ - - - - - -
  • - - - - - Chapter 8 - - - - -
  • - - - -