pages tagged mathematics http://meng6net.localhost/tag/mathematics/ <p><small>Copyright © 2005-2017 by <code>Meng Lu &lt;lumeng3@gmail.com&gt;</code></small></p> Meng Lu's home page ikiwiki Tue, 16 May 2017 23:59:39 +0000 Drawing polyhedra with textured faces in Mathematica http://meng6net.localhost/blog/drawing_polyhedra_with_textured_faces_in_Mathematica/ http://meng6net.localhost/blog/drawing_polyhedra_with_textured_faces_in_Mathematica/ blog computing geometry graphics mathematics note polyhedron programming Tue, 16 May 2017 23:59:39 +0000 2017-05-16T23:59:39Z <p>In Mathematica and Wolfram Language, with the feature called <a href= "https://reference.wolfram.com/language/ref/Texture.html">Texture</a> it's easy to draw 3D solids such as polyhedra with <a href= "https://en.wikipedia.org/wiki/Image_texture">image textures</a> on the surface such as the faces of polyhedra. When playing with this, I drew a <a href= "https://en.wikipedia.org/wiki/Rhombic_hexecontahedron">rhombic hexecontahedron</a> (<a href= "https://www.wolframalpha.com/input/?t=crmtb01&amp;f=ob&amp;i=rhombic+hexecontahedron">properties</a>), the logo of <a href= "https://www.wolframalpha.com/">Wolfram|Alpha</a> with national flags on its faces:</p> <p><a href= "http://meng6net.localhost/blog/drawing_polyhedra_with_textured_faces_in_Mathematica/image/rhombic_hexecontahedron__60-largest-countries-flags.png"> <img src= "http://meng6net.localhost/blog/drawing_polyhedra_with_textured_faces_in_Mathematica/900x-rhombic_hexecontahedron__60-largest-countries-flags.png" width="900" height="902" class="img" /></a></p> <p>☝ Rhombic hexecontahedron wrapped with the 60 most populous countries' national flags, one different flag drawn on each of the 60 rhombic faces. (It's somewhat odd that the most populous countries happen to have a lot of red and green colors in their national flags.)</p> <p>The code is in <a href= "https://github.com/lumeng/repo-meng-lib/blob/master/Mathematica/Notebook/polyhedra_with_textured_faces.nb"> my Git repository</a>.</p> <p>Remarks:</p> <ul> <li>It was a bit tricky to understand what the option <a href= "https://reference.wolfram.com/language/ref/VertexTextureCoordinates.html"> VertexTextureCoordinates</a> is and does, and how to set it up for what I'm trying to draw. It turns out for putting the national flags on the faces of a rhombic hexecontahedron, since both are (usually) isomorphic to a square, <code>VertexTextureCoordinates -&gt; {{0, 0}, {1, 0}, {1, 1}, {0, 1}}</code> is would work as it aligns the four vertices of a rectangular flag to the four vertices of a rhombic face.</li> </ul> <p>Something left to be improved:</p> <ul> <li> <p>Avoid flags that's not isomorphic to the face of the given polyhedron;</p> </li> <li> <p>Compute the suitable values of <code>VertexTextureCoordinates</code> to reduce or even avoid distortion of the flags;</p> </li> <li> <p>Find a reasonable way to align national flags of shapes not isomorphic to the shape of a face of a given polyhedron, such that the main feature of the national flag wrapped on a polyhedron face is well recognizable.</p> </li> </ul> /blog/drawing_polyhedra_with_textured_faces_in_Mathematica/#comments Category theory note http://meng6net.localhost/journal/category_theory_note/ http://meng6net.localhost/journal/category_theory_note/ category theory mathematics programming to-do Tue, 11 Apr 2017 07:18:07 +0000 2017-05-16T21:31:58Z <h2>Draft</h2> <ul> <li> <p><a href= "https://en.wikipedia.org/wiki/Multigraph">multigraph</a></p> </li> <li> <p>quiver graph: directed multigraph, 有向伪图</p> </li> <li> <p>quiver, loop arrows from and to the same vertex</p> </li> <li> <p>object, vertex in a graph</p> </li> <li> <p>from directed multigraph to categories</p> </li> <li> <p>morphism, or arrow</p> </li> <li> <p>identity morphism</p> </li> <li> <p>composition of morphisms</p> </li> <li> <p>There can be multiple different loops on one object, but one of them must be the identity morphism. Why?</p> </li> <li> <p>endofunctor</p> </li> <li> <p>Haskell languge is a category, Hask, with the Haskell language types as the objects and Haskell-langauge functions are morphisms.</p> </li> <li> <p>'Hask' is a Cartesian closed category</p> </li> <li> <p>n-category</p> </li> <li> <p>monoids for input and output in Haskell language</p> </li> </ul> <h2>Topics</h2> <ul> <li> <p>Haskell and WL</p> </li> <li> <p>category theory and WL</p> </li> </ul> <h2>References</h2> <ul> <li>Bartosz Milewsk, "Category Theory for Programmers," 2014 - 2017, https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/.</li> <li><a href="http://cheng.staff.shef.ac.uk/research.html">Eugenia Cheng's research papers on category theory</a></li> <li><a href= "https://www.youtube.com/user/TheCatsters">'TheCatsters' Youtube channel</a> <ul> <li><a href="https://byorgey.wordpress.com/catsters-guide-2/">Brent Yorgey's index to 'TheCatsters' videos</a></li> </ul> </li> <li>Tom Leinster, "Basic Category Theory," 2016, <a href= "https://arxiv.org/pdf/1612.09375.pdf">arXiv:1612.09375v1 [math.CT]</a></li> <li><a href= "https://arxiv.org/find/math/1/au:+Leinster_T/0/1/0/all/0/1">Tom Leinster's research papers</a></li> </ul> Compute sample variance of data stream http://meng6net.localhost/blog/compute_sample_variance_of_data_stream/ http://meng6net.localhost/blog/compute_sample_variance_of_data_stream/ alogrithm data stream mathematics note probability statistics study Tue, 06 Oct 2015 19:39:59 +0000 2015-10-09T23:34:58Z <p>Sample variance of a data stream $\left \{ X_1, X_2, \cdots, X_N, X_{N+1}, \cdots \right \}$ can be computed without saving the data points individually, but only sample mean and sample variance values for the current sample size $N$:</p> <p>\begin{align} s<sup>2</sup> <em>N &amp;= \frac{1}{N} \sum</em> {i=1}^N \left( X <em>i - \bar{X}</em> N \right)<sup>2</sup> \\ &amp;= \frac{1}{N} \sum <em>{i=1}^N \left( X</em> i<sup>2</sup> - \bar{X} _N<sup>2</sup> \right)~, \end{align}</p> <p>where</p> <p>$$$${\bar{X}} <em>N = \frac{1}{N} \sum</em> {i=1}^N X _i~.$$$$</p> <p>Store $N$, $\bar{X} <em>N$, and $s</em> N<sup>2</sup>$. When datum $X _{N+1}$ is obtained, the values can be updated as the following:</p> <p>$$$$\bar{X} <em>{N+1} = \frac{1}{N+1} \left( N \bar{X}</em> N + X _{N+1} \right)~,$$$$</p> <p>\begin{align} s<sup>2</sup> <em>{N+1} &amp;= \frac{1}{N+1} \sum</em> {i=1}^{N+1} \left( X <em>i<sup>2</sup> - \bar{X}</em> {N+1}^2\right) \\ &amp;= \frac{1}{N+1} \sum <em>{i=1}^{N+1}X</em> i<sup>2</sup> - \bar{X} <em>{N+1}^2 \\ &amp;= \frac{1}{N+1} \left(N s</em> N<sup>2</sup> + \bar{X} <em>N<sup>2</sup> + X</em> {N+1}^2 \right)- \bar{X} _{N+1}^2~. \end{align}</p> /blog/compute_sample_variance_of_data_stream/#comments 1.1.4 summary on basic properties of real number system http://meng6net.localhost/academics/course/zhang_zhusheng__calculus/1.1.4_summary_on_basic_properties_of_real_number_system/ http://meng6net.localhost/academics/course/zhang_zhusheng__calculus/1.1.4_summary_on_basic_properties_of_real_number_system/ academics course mathematical analysis mathematics note Thu, 16 Jul 2015 22:37:46 +0000 2015-07-16T22:37:46Z <p>實數系是一個連續的有序域。</p>