commit 2870d40f6b888cb1d91c1d8ed33fbb8287a3aa04 Author: Renge Date: Sat Sep 3 21:05:06 2022 -0400 add: hw1 diff --git a/HW1/2_1_1.png b/HW1/2_1_1.png new file mode 100644 index 0000000..b45647f Binary files /dev/null and b/HW1/2_1_1.png differ diff --git a/HW1/2_1_2.png b/HW1/2_1_2.png new file mode 100644 index 0000000..20b6458 Binary files /dev/null and b/HW1/2_1_2.png differ diff --git a/HW1/2_1_3.png b/HW1/2_1_3.png new file mode 100644 index 0000000..67d6804 Binary files /dev/null and b/HW1/2_1_3.png differ diff --git a/HW1/2_2_1.png b/HW1/2_2_1.png new file mode 100644 index 0000000..90c9d35 Binary files /dev/null and b/HW1/2_2_1.png differ diff --git a/HW1/2_2_2.png b/HW1/2_2_2.png new file mode 100644 index 0000000..c0bd6f1 Binary files /dev/null and b/HW1/2_2_2.png differ diff --git a/HW1/HW1.pdf b/HW1/HW1.pdf new file mode 100644 index 0000000..62d907c Binary files /dev/null and b/HW1/HW1.pdf differ diff --git a/HW1/hw1-polygon1-guard.ipe b/HW1/hw1-polygon1-guard.ipe new file mode 100644 index 0000000..1457e62 --- /dev/null +++ b/HW1/hw1-polygon1-guard.ipe @@ -0,0 +1,464 @@ + + + + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0.6 0 0 0.6 0 0 e +0.4 0 0 0.4 0 0 e + + + + +0.6 0 0 0.6 0 0 e + + + + + +0.5 0 0 0.5 0 0 e + + +0.6 0 0 0.6 0 0 e +0.4 0 0 0.4 0 0 e + + + + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h +-0.4 -0.4 m +0.4 -0.4 l +0.4 0.4 l +-0.4 0.4 l +h + + + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h + + + + + +-0.5 -0.5 m +0.5 -0.5 l +0.5 0.5 l +-0.5 0.5 l +h + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h +-0.4 -0.4 m +0.4 -0.4 l +0.4 0.4 l +-0.4 0.4 l +h + + + + + + +-0.43 -0.57 m +0.57 0.43 l +0.43 0.57 l +-0.57 -0.43 l +h + + +-0.43 0.57 m +0.57 -0.43 l +0.43 -0.57 l +-0.57 0.43 l +h + + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +-1 0.333 m +0 0 l +-1 -0.333 l + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h +-1 0 m +-2 0.333 l +-2 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h +-1 0 m +-2 0.333 l +-2 -0.333 l +h + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +552 204 m +304 184 l +328 260 l +368 240 l +388 300 l +252 308 l +288 216 l +176 164 l +228 244 l +98.4 190 l +144 164 l +48 160 l +32 216 l +65.16 318.72 l +147.6 307.2 l +108 264 l +316 380 l +488 236 l +530.4 258 l +552 204 l + +Polygon P1 +0 +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +16 +17 +18 + +98.4 190 m +48 160 l + + +65.16 318.72 m +108 264 l + + +32 216 m +98.4 190 l + + +108 264 m +32 216 l + + +108 264 m +98.4 190 l + + +108 264 m +228 244 l + + +228 244 m +288 216 l + + +252 308 m +228 244 l + + +252 308 m +316 380 l + + +252 308 m +108 264 l + + +388 300 m +488 236 l + + +388 300 m +316 380 +316 380 c + + +368 240 m +488 236 l + + +368 240 m +304 184 l + + +368 240 m +552 204 l + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +488 236 m +552 204 l + + + + + + + + + + + + + + + + + + + + + + +144 164 m +64 208 l +34.338 223.243 l +34.338 223.243 l + + +176 164 m +259.069 289.936 l + + +320 304 m +413.803 298.118 l + + +320 304 m +193.362 311.606 l + + +328 260 m +455.333 196.204 l + +A +B +C +D +E + +529.948 258.011 m +405.471 190.959 l + + + diff --git a/HW1/hw1-polygon2-guard.ipe b/HW1/hw1-polygon2-guard.ipe new file mode 100644 index 0000000..a06a2c2 --- /dev/null +++ b/HW1/hw1-polygon2-guard.ipe @@ -0,0 +1,521 @@ + + + + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0.6 0 0 0.6 0 0 e +0.4 0 0 0.4 0 0 e + + + + +0.6 0 0 0.6 0 0 e + + + + + +0.5 0 0 0.5 0 0 e + + +0.6 0 0 0.6 0 0 e +0.4 0 0 0.4 0 0 e + + + + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h +-0.4 -0.4 m +0.4 -0.4 l +0.4 0.4 l +-0.4 0.4 l +h + + + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h + + + + + +-0.5 -0.5 m +0.5 -0.5 l +0.5 0.5 l +-0.5 0.5 l +h + + +-0.6 -0.6 m +0.6 -0.6 l +0.6 0.6 l +-0.6 0.6 l +h +-0.4 -0.4 m +0.4 -0.4 l +0.4 0.4 l +-0.4 0.4 l +h + + + + + + +-0.43 -0.57 m +0.57 0.43 l +0.43 0.57 l +-0.57 -0.43 l +h + + +-0.43 0.57 m +0.57 -0.43 l +0.43 -0.57 l +-0.57 0.43 l +h + + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-0.8 0 l +-1 -0.333 l +h + + + + +-1 0.333 m +0 0 l +-1 -0.333 l + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h +-1 0 m +-2 0.333 l +-2 -0.333 l +h + + + + +0 0 m +-1 0.333 l +-1 -0.333 l +h +-1 0 m +-2 0.333 l +-2 -0.333 l +h + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +228 784 m +504 748 l +368 724 l +324 664 l +268 700 l +260 652 l +454.4 652 l +428 704 l +540 636 l +388 624 l +388 644 l +340 620 l +572 496 l +492 480 l +352 480 l +420 520 l +460 520 l +444 548 l +104 496 l +120 612 l +152 572 l +208 584 l +196 544 l +248 536 l +228 784 l + +Polygon P2 +0 +1 +2 +3 +6 +7 +8 +9 +17 +11 +12 +13 +19 +15 +16 +18 +21 +22 +23 +4 +5 +10 +20 +14 + +151.322 572.678 m +103.322 496.678 l + + +151.322 572.678 m +195.322 544.678 l + + +195.322 544.678 m +103.322 496.678 l + + +247.322 536.678 m +103.322 496.678 l + + +247.322 536.678 m +443.322 548.678 l + + +419.322 520.678 m +491.322 480.678 l + + +459.322 520.678 m +491.322 480.678 l + + +459.322 520.678 m +571.322 496.678 l + + +443.322 548.678 m +571.322 496.678 l + + +443.322 548.678 m +339.322 620.678 l + + +339.322 620.678 m +247.322 536.678 l + + +453.722 652.678 m +539.322 636.678 l + + +453.722 652.678 m +387.322 624.678 l + + +387.322 644.678 m +453.722 652.678 l + + +387.322 644.678 m +259.322 652.678 l + + +339.322 620.678 m +259.322 652.678 l + + +259.322 652.678 m +247.322 536.678 l + + +267.322 700.678 m +367.322 724.678 l + + +367.322 724.678 m +227.322 784.678 l + + +227.322 784.678 m +267.322 700.678 l + + +259.322 652.678 m +227.322 784.678 l + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +207.322 584.678 m +112.65 564.301 l + + +207.322 584.678 m +185.045 509.176 l + + +351.322 480.678 m +499.76 534.926 l + + +499.76 534.926 m +459.322 520.678 l + + +427.322 704.678 m +464.177 630.745 l + + +503.322 748.678 m +234.115 700.444 l + + +356.547 629.29 m +404.44 652.678 l + + +356.547 629.29 m +244.679 569.454 +244.679 569.454 +244.757 568.484 c + + +356.547 629.29 m +237.585 657.425 l + + +259.322 652.678 m +237.585 657.425 l + + +288 832 m +304 832 l + + +259.322 652.678 m +237.585 657.425 l + + +288 832 m +304 832 l + +A +B +C +D +E +A + + diff --git a/HW1/hw1.html b/HW1/hw1.html new file mode 100644 index 0000000..cdb126e --- /dev/null +++ b/HW1/hw1.html @@ -0,0 +1,853 @@ + + + + + HW1 + + + + + + + + + + +

HW1

+

Problem 1

+ +

Problem 2

+ + + + + + \ No newline at end of file diff --git a/HW1/hw1.md b/HW1/hw1.md new file mode 100644 index 0000000..9166fb2 --- /dev/null +++ b/HW1/hw1.md @@ -0,0 +1,38 @@ +# HW1 +## Problem 1 + - 1. In this graph, there are 3 forced diagonals (7-12, 6-14 and 5-17) which divide this graph in to 4 parts. For the right most part it is a blunt nose fox so it has 4 ways of triangulations; for the second one there is only one way because it is a fox; the third one is again, a blunt nose fox with 4 ways; as for the last part we have to do case analysis: + - 1. use 4-17 but not 2-5: there are two convex polygon with 3 and 6 vertices, so there are 14*1=14 ways to triangulation + - 2. use 2-5 but not 4-17: for the graph under 2-5, it is a convex polygon with 4 vertices so there are 2 ways; for the upper part, 2-17 is a forced diagonal so it can be treated as a 4 vertices polygon so overall it has 2*2=4 ways + - 3. not use both 4-17 and 2-5: for the last situation, 3-17 is a forced diagonal so it has 5\*1\*1=5 ways + + Overall, there are 4\*1\*4\*(14+4+5)=368 distinct ways to triangulation this graph + + - 2. In this graph, there are a pair of diagonals that are mutual exclusive: 1-6 and 0-2, if we do case analysis based on that: + - 1. use 1-6: the left side is a convex polygon with 8 vertices so it has 6 ways; the right side is a blunt nose fox so it has 4 ways + - 2. use 0-2: then there are two forced diagonals (0-6 and 2-6). If we connect them, then there is a convex polygon with 7 vertices on the left and a fox on the right. In total, there should be 1\*1\*1\*42 ways + + Over all, there are 132*4+42=570 distinct ways of triangulations. + +## Problem 2 + - 1. + - 1. ![2_1_1](2_1_1.png) + - 2. As the graph above, there are 6 reds, 6 blues and 7 yellows, then we put guards on either reds or blues and we can get 6 guards. + - 3. ![2_1_2](2_1_2.png) + If we put witness points near 18, 2, 7 and 10, and in between 4 and 5, we got 5 areas that does not overlap on any vertex, $w(P) \geq 5$. Also, we can find 5 guards A, B, C, D and E that cover P, thus $g(P) \leq 5$ + + $5 \leq w(p) \leq g(p) \leq 5$, and we can get $g(p) = 5$ + - 4. ![2_1_3](2_1_3.png) + If we put witness points near 18, 2 and 7, and in between 4 and 5, we got 4 areas that does not overlap, so $w(P) \geq 4$. Also, we can find 4 guards A, B, C and D that cover P, thus $g(P) \leq 4$ + + $4 \leq w(p) \leq g(p) \leq 4$, and we can get $g(p) = 4$ + - 2. + - 1. ![2_2_1](2_2_1.png) + - 2. As the graph above, there are 8 reds, 8 blues and 8 yellows, then we put guards on any of reds, yellows or blues and we can get 8 guards. + - 3. ![2_2_2](2_2_2.png) + If we put witness points near 3, 10, 17 and 23, and in between 13 and 14, we got 5 areas that does not overlap on any vertex, $w(P) \geq 5$. Also, we can find 5 guards A, B, C, D and E that cover P, thus $g(P) \leq 5$ + + $5 \leq w(p) \leq g(p) \leq 5$, and we can get $g(p) = 5$ + - 4. ![2_2_2](2_2_2.png) + If we put witness points near 3, 10, 17 and 23, and in between 13 and 14, we got 5 areas that does not overlap, $w(P) \geq 5$. Also, we can find 5 guards A, B, C, D and E that cover P, thus $g(P) \leq 5$ + + $5 \leq w(p) \leq g(p) \leq 5$, and we can get $g(p) = 5$ \ No newline at end of file