<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>BlackHC's Adventures in the Dev World &#187; Maths</title>
	<atom:link href="http://blog.blackhc.net/category/maths/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.blackhc.net</link>
	<description>Just another weblog</description>
	<lastBuildDate>Wed, 16 Nov 2011 23:12:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Books on Numerical Analysis</title>
		<link>http://blog.blackhc.net/2011/08/books-on-numerical-analysis/</link>
		<comments>http://blog.blackhc.net/2011/08/books-on-numerical-analysis/#comments</comments>
		<pubDate>Sun, 31 Jul 2011 23:01:52 +0000</pubDate>
		<dc:creator>BlackHC</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Maths]]></category>
		<category><![CDATA[University]]></category>
		<category><![CDATA[differential equations]]></category>
		<category><![CDATA[numerical analysis]]></category>

		<guid isPermaLink="false">http://blog.blackhc.net/?p=855</guid>
		<description><![CDATA[<a href="http://blog.blackhc.net/2011/08/books-on-numerical-analysis/" title="Books on Numerical Analysis"></a>Due my writing an exam on numerical analysis I had the pleasure to look through lots and lots of books on numerical analysis, and here is a list of my favorite ones so far: Afternotes on Numerical Analysis &#38; Afternotes Goes &#8230;<p class="read-more"><a href="http://blog.blackhc.net/2011/08/books-on-numerical-analysis/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://blog.blackhc.net/2011/08/books-on-numerical-analysis/" title="Books on Numerical Analysis"></a><p>Due my writing an exam on numerical analysis I had the pleasure to look through lots and lots of books on numerical analysis, and here is a list of my favorite ones so far:</p>
<ul>
<li><a href="http://www.amazon.com/Afternotes-Numerical-Analysis-G-Stewart/dp/0898713625/ref=sr_1_1?s=books&amp;ie=UTF8&amp;qid=1312149653&amp;sr=1-1" target="_blank">Afternotes on Numerical Analysis</a> &amp; <a href="http://www.amazon.com/Afternotes-Goes-Graduate-School-Numerical/dp/0898714044/ref=sr_1_2?s=books&amp;ie=UTF8&amp;qid=1312149653&amp;sr=1-2" target="_blank">Afternotes Goes to Graduate School</a> by G. W. Stewart<br />
Both books are very readable and introduce many of the concepts in a light way that builds an intuitive understanding for them.<br />
It's possible to read the books cover to cover in a few days and you can learn a lot very quickly.<br />
They are also quite amusing:</p>
<blockquote><p>"In the nineteenth century the Norwegian mathematician Niels Abel showed that no polynomial of degree five could be solved by a finite number of additions, multiplications, divisions, and root extractions. If we had a finite algorithm for finding eigenvalues of general matrices, we could apply it to companion matrices and make a fool out of Abel. Abel was no fool."</p></blockquote>
<li><a href="http://www.amazon.com/Numerical-Linear-Algebra-Lloyd-Trefethen/dp/0898713617" target="_blank">Numerical Linear Algebra</a> by Trefethen<br />
another very good book which I haven't used much personally, though</li>
<li><a href="http://www.amazon.com/Iterative-Nonlinear-Equations-Frontiers-Mathematics/dp/0898713528/ref=sr_1_1?s=books&amp;ie=UTF8&amp;qid=1312152511&amp;sr=1-1" target="_blank">Numerical Methods</a> by Kelley<br />
contains an okay introduction to CG and GMRES.</li>
<li><a href="http://www.amazon.de/Numerische-Mathematik-algorithmisch-orientierte-Einf%C3%BChrung/dp/3110203545/ref=pd_bxgy_b_text_b" target="_blank">Numerische Mathematik I</a> &amp; <a href="http://www.amazon.de/Numerische-Mathematik-Gew%C3%B6hnliche-Differentialgleichungen-Lehrbuch/dp/3110203561/ref=sr_1_4?ie=UTF8&amp;qid=1312152645&amp;sr=8-4" target="_blank">Numerische Mathematik II</a><br />
are very good books, too. The first volume contains a good introduction to everything but ODEs and PDEs and the second volume consists of a very thorough overview of numerical algorithms for differential equations, including a nice introduction to the general theory of their solvability etc</li>
<li><a href="http://www.amazon.com/Numerical-Analysis-Richard-L-Burden/dp/0538733519/ref=sr_1_1?s=books&amp;ie=UTF8&amp;qid=1312152187&amp;sr=1-1" target="_blank">Numerical Analysis</a> by Burden and Faires<br />
a very nice book that contains lots of visualizations and covers many topics</li>
</ul>
<div>More to follow soon <img src='http://blog.blackhc.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </div>
<div>Cheers,</div>
<div> Andreas</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.blackhc.net/2011/08/books-on-numerical-analysis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Light Propagation Volumes</title>
		<link>http://blog.blackhc.net/2010/07/light-propagation-volumes/</link>
		<comments>http://blog.blackhc.net/2010/07/light-propagation-volumes/#comments</comments>
		<pubDate>Sun, 18 Jul 2010 15:44:39 +0000</pubDate>
		<dc:creator>BlackHC</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Game Projects]]></category>
		<category><![CDATA[Maths]]></category>
		<category><![CDATA[University]]></category>
		<category><![CDATA[Corrections]]></category>
		<category><![CDATA[Crytek]]></category>
		<category><![CDATA[I3D]]></category>
		<category><![CDATA[Light Propagation Volume]]></category>
		<category><![CDATA[LPV]]></category>
		<category><![CDATA[Reflective Shadow Map]]></category>
		<category><![CDATA[RSM]]></category>
		<category><![CDATA[Sponza]]></category>

		<guid isPermaLink="false">http://blog.blackhc.net/?p=795</guid>
		<description><![CDATA[<a href="http://blog.blackhc.net/2010/07/light-propagation-volumes/" title="Light Propagation Volumes"></a>I've finally finished my lab course last week - thanks to my supervisor Matthäus G. Chajdas - you can read his blog here -, it wasn't your usual lab course with work sheets and boring homework, instead I've been allowed &#8230;<p class="read-more"><a href="http://blog.blackhc.net/2010/07/light-propagation-volumes/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://blog.blackhc.net/2010/07/light-propagation-volumes/" title="Light Propagation Volumes"></a><p>I've finally finished my lab course last week - thanks to my supervisor Matthäus G. Chajdas - <a href="http://anteru.net/" target="_self">you can read his blog here</a> -, it wasn't your usual lab course with work sheets and boring homework, instead I've been allowed to implement a nice paper about a <a href="http://en.wikipedia.org/wiki/Global Illumination" target="_blank" >Global Illumination</a> approximation algorithm called <a href="http://www.crytek.com/fileadmin/user_upload/inside/presentations/2010_I3D/20100301_lpv.pdf" target="_blank">(Cascaded) Light Propagation Volumes</a>. It's been developed by Crytek and you can find more information (including some presentations and videos) on <a href="http://www.crytek.com/technology/presentations/" target="_blank">their server</a>. (Note: this is an implementation of the I3D paper, not the earlier SIGGRAPH one.)</p>
<div id="attachment_798" class="wp-caption alignnone" style="width: 650px"><a href="http://blog.blackhc.net/wp-content/uploads/2010/07/LPVfinal0.jpg"><img class="size-large wp-image-798 " title="LPVfinal0" src="http://blog.blackhc.net/wp-content/uploads/2010/07/LPVfinal0-1024x573.jpg" alt="" width="640" height="358" /></a><p class="wp-caption-text">Sponza scene (direct + indirect lighting w/ occlusion)</p></div>
<div id="attachment_799" class="wp-caption alignnone" style="width: 650px"><a href="http://blog.blackhc.net/wp-content/uploads/2010/07/LPVfinal1.jpg"><img class="size-large wp-image-799" title="LPVfinal1" src="http://blog.blackhc.net/wp-content/uploads/2010/07/LPVfinal1-1024x573.jpg" alt="" width="640" height="358" /></a><p class="wp-caption-text">Sponza scene (only indirect lighting w/ occlusion)</p></div>
<div id="attachment_800" class="wp-caption alignnone" style="width: 650px"><a href="http://blog.blackhc.net/wp-content/uploads/2010/07/LPVfinal2.jpg"><img class="size-large wp-image-800" title="LPVfinal2" src="http://blog.blackhc.net/wp-content/uploads/2010/07/LPVfinal2-1024x573.jpg" alt="" width="640" height="358" /></a><p class="wp-caption-text">Sponza scene (ony direct lighting)</p></div>
<div id="attachment_801" class="wp-caption alignnone" style="width: 650px"><a href="http://blog.blackhc.net/wp-content/uploads/2010/07/LPVfinal3.jpg"><img class="size-large wp-image-801" title="LPVfinal3" src="http://blog.blackhc.net/wp-content/uploads/2010/07/LPVfinal3-1024x573.jpg" alt="" width="640" height="358" /></a><p class="wp-caption-text">Sponza scene (boosted indirect lighting w/ occlusion)</p></div>
<div id="attachment_802" class="wp-caption alignnone" style="width: 650px"><a href="http://blog.blackhc.net/wp-content/uploads/2010/07/LPVfinal4.jpg"><img class="size-large wp-image-802" title="LPVfinal4" src="http://blog.blackhc.net/wp-content/uploads/2010/07/LPVfinal4-1024x573.jpg" alt="" width="640" height="358" /></a><p class="wp-caption-text">Sponza scene (boosted indirect lighting w/o occlusion)</p></div>
<p>The algorithm approximates global illumination by rendering the light into a <a href="http://www.vis.uni-stuttgart.de/dachsbacher/download/rsm.pdf" target="_blank">reflective shadow map</a>, injecting it into a volume (using a spherical harmonics representation) and propagates the light flux in this volume (hence the name of the algorithm) and taking into account occlusion as possible extension.</p>
<p>The whole algorithm is physically motivated but corners everywhere, of course, to be more efficient. The paper also contains a few errors and doesn't explain everything needed to implement it in great detail (like eg the solid angles of the side faces), so I've written two documents detailing the mistakes I've found and the additional calculations I've performed.</p>
<p>You can find the mistakes <a href="http://blog.blackhc.net/wp-content/uploads/2010/07/lpv-corrections.pdf" target="_blank">here</a> (including suggested corrections) and the full annotations document <a href="http://blog.blackhc.net/wp-content/uploads/2010/07/lpv-annotations.pdf" target="_blank">here</a>.</p>
<p>Finally I've also uploaded the whole prototype (including my code licensed under the FreeBSD license and the media files) <a href="http://blog.blackhc.net/wp-content/uploads/2010/07/LPVPrototype.zip" target="_blank">here</a> - it's 68 MB big (and it's been compressed with 7zip with a compression mode that might not be supported by WinZIP. The Sponza model is from Crytek, too. You can download the original model and textures <a href="http://www.crytek.com/downloads/technology/" target="_blank">here</a>.<br />
The project uses DirectX 10.1 and by default it won't run in DirectX 10, because it uses a texture format that is deprecated in D3D10 but supported again 10.1 (BGRA). See the comment by <strong>FatGarfield</strong> for the location that needs to be changed for it work in DX10, too. (However red and blue will be swapped then.)</p>
<p>I haven't implemented cascaded LPVs and I also use only one light/RSM and only inject its depth into the occlusion volume, but the results already look very nice in my opinion.</p>
<p>Stay tuned for more <img src='http://blog.blackhc.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
Cheers,<br />
Andreas</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blackhc.net/2010/07/light-propagation-volumes/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Rotation of Low Order Spherical Harmonics</title>
		<link>http://blog.blackhc.net/2010/06/rotation-of-low-order-spherical-harmonics/</link>
		<comments>http://blog.blackhc.net/2010/06/rotation-of-low-order-spherical-harmonics/#comments</comments>
		<pubDate>Sat, 19 Jun 2010 23:10:05 +0000</pubDate>
		<dc:creator>BlackHC</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Maths]]></category>
		<category><![CDATA[Crytek]]></category>
		<category><![CDATA[Light Propagation Volume]]></category>
		<category><![CDATA[Rotation]]></category>
		<category><![CDATA[Spherical Harmonics]]></category>

		<guid isPermaLink="false">http://blog.blackhc.net/?p=740</guid>
		<description><![CDATA[<a href="http://blog.blackhc.net/2010/06/rotation-of-low-order-spherical-harmonics/" title="Rotation of Low Order Spherical Harmonics"></a>I'm currently working at university on implementing Light Propagation Volumes. The paper makes extensive use of spherical harmonics while the implementation uses the first two bands. Below is a visualization of the first 4 bands of the SH basis functions &#8230;<p class="read-more"><a href="http://blog.blackhc.net/2010/06/rotation-of-low-order-spherical-harmonics/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://blog.blackhc.net/2010/06/rotation-of-low-order-spherical-harmonics/" title="Rotation of Low Order Spherical Harmonics"></a><p>I'm currently working at university on implementing <a href="http://www.crytek.com/technology/presentations/" target="_blank">Light Propagation Volumes</a>. The paper makes extensive use of <a href="http://en.wikipedia.org/wiki/Spherical_harmonics" target="_blank">spherical harmonics</a> while the implementation uses the first two bands.</p>
<p>Below is a visualization of the first 4 bands of the SH basis functions (created using <a href="http://code.enthought.com/projects/mayavi/" target="_blank">Mayavi</a>):</p>
<div id="attachment_742" class="wp-caption aligncenter" style="width: 629px"><a href="http://blog.blackhc.net/wp-content/uploads/2010/06/sh0to3.jpg"><img class="size-full wp-image-742" title="sh0to3" src="http://blog.blackhc.net/wp-content/uploads/2010/06/sh0to3.jpg" alt="sh0to3" width="619" height="283" /></a><p class="wp-caption-text">The first 4 bands of the spherical harmonic basis functions</p></div>
<p>As you can see the first two bands are 4 functions, so 4 coefficients to store which conveniently fits into one RGBA texture.</p>
<p>One of the main transformations that is performed in the LPV paper is the rotation of the spherical harmonics representation of a clamped cosine lobe (that represents surface lighting) onto a normal vector direction.  It took me a while to figure out, but actually it's quite easy, which is why I write about it <img src='http://blog.blackhc.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>The analytical presentation of the first four base functions is simple:</p>
<p style="text-align: left;"><span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_706d2523bb7365dae8ac1eaa44f1734d.gif' style=' ' class='tex' alt="S_0 \left( x, y, z \right ) = \frac{1}{2 \sqrt{\pi}}" /></span><script type='math/tex'>S_0 \left( x, y, z \right ) = \frac{1}{2 \sqrt{\pi}}</script><br />
<span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_2a90a081c65c08627081aff156902440.gif' style=' ' class='tex' alt="S_1 \left( x, y, z \right ) = - \frac{\sqrt{3}}{2 \sqrt{\pi}} y" /></span><script type='math/tex'>S_1 \left( x, y, z \right ) = - \frac{\sqrt{3}}{2 \sqrt{\pi}} y</script><br />
<span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_f71c3646eaced6589b903fbc55202646.gif' style=' ' class='tex' alt="S_2 \left( x, y, z \right ) = \frac{\sqrt{3}}{2 \sqrt{\pi}} z " /></span><script type='math/tex'>S_2 \left( x, y, z \right ) = \frac{\sqrt{3}}{2 \sqrt{\pi}} z </script><br />
<span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_e62b566d079a3237f32e3e6a600d53f6.gif' style=' ' class='tex' alt="S_3 \left( x, y, z \right ) = - \frac{\sqrt{3}}{2 \sqrt{\pi}} x" /></span><script type='math/tex'>S_3 \left( x, y, z \right ) = - \frac{\sqrt{3}}{2 \sqrt{\pi}} x</script></p>
<p style="text-align: left;">To evaluate lighting with SH for some direction v, you first determine the coefficients/weights of the SH basis functions and then sum them up.</p>
<p style="text-align: left;"><span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_62efdb3cfc8367587aaa24daa5e54c20.gif' style=' ' class='tex' alt=" L = \sum_i s_i \, S_i \left( v \right ) " /></span><script type='math/tex'> L = \sum_i s_i \, S_i \left( v \right ) </script></p>
<p style="text-align: left;">Let's assume we know the coefficients <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_1576a652d84c1978430a8247c5db798d.gif' style=' ' class='tex' alt=" s^z_0, s^z_1, ... " /></span><script type='math/tex'> s^z_0, s^z_1, ... </script> of the clamped cosine lobe around the z axis, then we can determine the lighting in direction v for the cosine lobe around the normal n by transforming it into the space where the normal coincides with the z axis (ie rotate n onto the z axis):</p>
<p style="text-align: left;"><span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_a9d43578de309ca75a1ef416e635cb8e.gif' style=' ' class='tex' alt=" L = \sum_i s^z_i \, S_i \left( R_{n \to z} \, v \right ) " /></span><script type='math/tex'> L = \sum_i s^z_i \, S_i \left( R_{n \to z} \, v \right ) </script></p>
<p style="text-align: left;">where <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_72c05df713d9d70bd2c19005825c4654.gif' style=' padding-bottom:1px;' class='tex' alt=" R_{n \to z} " /></span><script type='math/tex'> R_{n \to z} </script> is a rotation matrix that rotates n onto z.</p>
<p style="text-align: left;">The idea is to expand <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_9b51b7bfc7626af61c73fba376411b92.gif' style=' ' class='tex' alt=" S_i \left( R_{n \to z} \, v \right ) " /></span><script type='math/tex'> S_i \left( R_{n \to z} \, v \right ) </script> and rewrite it in terms of <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_9dca7e9f9901d704dbe0a9a640b1b9ef.gif' style=' ' class='tex' alt=" S_i \left ( v \right ) " /></span><script type='math/tex'> S_i \left ( v \right ) </script>.</p>
<p style="text-align: left;">Before doing this, let's first take a look at the coefficients of the clamped cosine lobe:</p>
<p style="text-align: left;"><span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_66126bf5cd9db5ff94cc4fa73659dd0c.gif' style=' ' class='tex' alt="\begin{align*} 
s^z_0 &=\frac{ \sqrt{ \pi } }{ 2 }\\ 
s^z_1 &= 0\\ 
s^z_2 &= \sqrt\frac{ \pi }{3}\\ 
s^z_3 &= 0\\ 
\end{align*}" /></span><script type='math/tex'>\begin{align*} 
s^z_0 &=\frac{ \sqrt{ \pi } }{ 2 }\\ 
s^z_1 &= 0\\ 
s^z_2 &= \sqrt\frac{ \pi }{3}\\ 
s^z_3 &= 0\\ 
\end{align*}</script></p>
<p style="text-align: left;">The y and x direction are 0 because the cosine lobe is centered isotropic around the z axis:</p>
<p style="text-align: left;">So let's look at the expanded version of this formula if <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_21d8857e73e37ea774391e045332b63b.gif' style=' ' class='tex' alt=" r_1^T " /></span><script type='math/tex'> r_1^T </script>, <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_34bef2d01462b580813b1c032d44a5f0.gif' style=' ' class='tex' alt=" r_2^T " /></span><script type='math/tex'> r_2^T </script>, <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_498bc755e068ea1e03c36b7fd60344bf.gif' style=' ' class='tex' alt=" r_3^T " /></span><script type='math/tex'> r_3^T </script> are the row vectors of the matrix,<br />
<span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_e09264b9334a6de4f744ae811ba8eed9.gif' style=' ' class='tex' alt=" v=\bigl(\begin{smallmatrix} 
x\\ 
y\\ 
z 
\end{smallmatrix}\bigr)" /></span><script type='math/tex'> v=\bigl(\begin{smallmatrix} 
x\\ 
y\\ 
z 
\end{smallmatrix}\bigr)</script> and <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_fbb924431dfe73853b446dbbd4635631.gif' style=' ' class='tex' alt=" R_{n \to z}=\left(\begin{smallmatrix} 
r_1^T\\ 
r_2^T\\ 
r_3^T 
\end{smallmatrix}\right ) " /></span><script type='math/tex'> R_{n \to z}=\left(\begin{smallmatrix} 
r_1^T\\ 
r_2^T\\ 
r_3^T 
\end{smallmatrix}\right ) </script>, then:</p>
<p style="text-align: left;"><span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_ff18dec00347fa5012ee1b824ef9db4e.gif' style=' ' class='tex' alt=" L = \sum_i s^z_i \, S_i \left( R_{n \to z} \, v \right ) = \sum_i s^z_i \, S_i \left( \left(\begin{smallmatrix} 
r_1^T \, v\\ 
r_2^T \, v\\ 
r_3^T \, v\end{smallmatrix}\right ) \right ) " /></span><script type='math/tex'> L = \sum_i s^z_i \, S_i \left( R_{n \to z} \, v \right ) = \sum_i s^z_i \, S_i \left( \left(\begin{smallmatrix} 
r_1^T \, v\\ 
r_2^T \, v\\ 
r_3^T \, v\end{smallmatrix}\right ) \right ) </script><br />
<span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_f7480868c3bcafa1bfba780d14bdf03a.gif' style=' ' class='tex' alt="\begin{align*} L &= s^z_0 \, c_0\\ 
&+ s^z_1 \, (-c_1) \, r_2^T \, v \\ 
&+ s^z_2 \, c_1 \, r_3^T \, v\\ 
&+ s^z_3 \, (-c_1) \, r_1^T \, v 
\end{align*} " /></span><script type='math/tex'>\begin{align*} L &= s^z_0 \, c_0\\ 
&+ s^z_1 \, (-c_1) \, r_2^T \, v \\ 
&+ s^z_2 \, c_1 \, r_3^T \, v\\ 
&+ s^z_3 \, (-c_1) \, r_1^T \, v 
\end{align*} </script></p>
<p style="text-align: left;">Since <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_10080ca9d8790e9e105fe19a8207da6a.gif' style=' ' class='tex' alt=" s^z_1 = 0 " /></span><script type='math/tex'> s^z_1 = 0 </script> and <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_dfd368e9d908cd15e20b6b5c0f16ee95.gif' style=' ' class='tex' alt=" s^z_3 = 0 " /></span><script type='math/tex'> s^z_3 = 0 </script>:</p>
<p style="text-align: left;"><span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_db640f1bac2ea6839ae440f962a7d6e3.gif' style=' ' class='tex' alt=" L = s^z_0 \, c_0 + s^z_2 \, c_1 \, r_3^T \, v = s^z_0 \, c_0 + s^z_2 \, c_1 \, r_{31} \, x + s^z_2 \, c_1 \, r_{32} \, y + s^z_2 \, c_1 \, r_{33} \, z " /></span><script type='math/tex'> L = s^z_0 \, c_0 + s^z_2 \, c_1 \, r_3^T \, v = s^z_0 \, c_0 + s^z_2 \, c_1 \, r_{31} \, x + s^z_2 \, c_1 \, r_{32} \, y + s^z_2 \, c_1 \, r_{33} \, z </script></p>
<p style="text-align: left;"><span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_d15e0f20255d1a7e36b4ef82f507bd97.gif' style=' ' class='tex' alt="  L = s^z_0 \, S_0 \left ( v \right ) - s^z_2 \, r_{32} \, S_1 \left ( v \right )+ s^z_2 \, r_{33} \, S_2 \left ( v \right ) - s^z_2 \, r_{31} \, S_3 \left ( v \right ) " /></span><script type='math/tex'>  L = s^z_0 \, S_0 \left ( v \right ) - s^z_2 \, r_{32} \, S_1 \left ( v \right )+ s^z_2 \, r_{33} \, S_2 \left ( v \right ) - s^z_2 \, r_{31} \, S_3 \left ( v \right ) </script></p>
<p style="text-align: left;">Now the question is: what is the third row of <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_72c05df713d9d70bd2c19005825c4654.gif' style=' padding-bottom:1px;' class='tex' alt=" R_{n \to z} " /></span><script type='math/tex'> R_{n \to z} </script>? If we look at the inverse matrix instead: <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_6888161c8e42f0612159bf67a6ec5d1f.gif' style=' padding-bottom:1px;' class='tex' alt=" R_{z \to n} " /></span><script type='math/tex'> R_{z \to n} </script>, we can immediately see that its third column has to be n, because <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_e2e67bad12ec4b33002810f806a3cea1.gif' style=' ' class='tex' alt=" R_{z \to n} \, \bigl(\begin{smallmatrix} 
0\\ 
0\\ 
1 
\end{smallmatrix}\bigr) = n " /></span><script type='math/tex'> R_{z \to n} \, \bigl(\begin{smallmatrix} 
0\\ 
0\\ 
1 
\end{smallmatrix}\bigr) = n </script> by construction. Since rotations are orthogonal matrices, the inverse is the same as the transposed, so we can deduce that the third row of <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_72c05df713d9d70bd2c19005825c4654.gif' style=' padding-bottom:1px;' class='tex' alt=" R_{n \to z} " /></span><script type='math/tex'> R_{n \to z} </script> is the same as the third column of <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_6888161c8e42f0612159bf67a6ec5d1f.gif' style=' padding-bottom:1px;' class='tex' alt=" R_{z \to n} " /></span><script type='math/tex'> R_{z \to n} </script>,  that is: n. Thus with <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_ef07c9f2fc39079162be1fe78a77ecdc.gif' style=' ' class='tex' alt=" n = \bigl(\begin{smallmatrix} 
n_x\\ 
n_y\\ 
n_z 
\end{smallmatrix}\bigr) " /></span><script type='math/tex'> n = \bigl(\begin{smallmatrix} 
n_x\\ 
n_y\\ 
n_z 
\end{smallmatrix}\bigr) </script> we get:</p>
<p style="text-align: left;"><span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_2540af4a2b20386cc6a543882c27434b.gif' style=' ' class='tex' alt="  L = s^z_0 \, S_0 \left ( v \right ) - s^z_2 \, n_y \, S_1 \left (  v \right )+ s^z_2 \, n_z \, S_2 \left ( v \right ) - s^z_2 \, n_x  \, S_3 \left ( v \right ) " /></span><script type='math/tex'>  L = s^z_0 \, S_0 \left ( v \right ) - s^z_2 \, n_y \, S_1 \left (  v \right )+ s^z_2 \, n_z \, S_2 \left ( v \right ) - s^z_2 \, n_x  \, S_3 \left ( v \right ) </script></p>
<p style="text-align: left;">So the SH coefficients of the clamped cosine lobe along n are:</p>
<p style="text-align: left;"><span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_fc99ccf1a7f5eb0d3e7a711f01aa6bd1.gif' style=' ' class='tex' alt=" 
s^n_0 = s^z_0 = \frac{ \sqrt{ \pi } }{ 2 } \\ 
s^n_1 = - s^z_2 \, n_y =  -\sqrt{ \frac{ \pi }{3} } \, n_y \\ 
s^n_2 = s^z_2 \, n_z = \sqrt{\frac{ \pi }{3} } \, n_z \\ 
s^n_1 = - s^z_2 \, n_x = - \sqrt{\frac{ \pi }{3}} \, n_x 
" /></span><script type='math/tex'> 
s^n_0 = s^z_0 = \frac{ \sqrt{ \pi } }{ 2 } \\ 
s^n_1 = - s^z_2 \, n_y =  -\sqrt{ \frac{ \pi }{3} } \, n_y \\ 
s^n_2 = s^z_2 \, n_z = \sqrt{\frac{ \pi }{3} } \, n_z \\ 
s^n_1 = - s^z_2 \, n_x = - \sqrt{\frac{ \pi }{3}} \, n_x 
</script></p>
<p style="text-align: left;">This is it <img src='http://blog.blackhc.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p style="text-align: left;">Cheers,<br />
Andreas</p>
<p style="text-align: left;">PS: a few screenshots from the LPV project:</p>
<p style="text-align: left;"><a href="http://blog.blackhc.net/wp-content/uploads/2010/06/GPUPropCopy-0616.jpeg"><img class="size-medium wp-image-770 alignnone" title="GPUPropCopy 0616" src="http://blog.blackhc.net/wp-content/uploads/2010/06/GPUPropCopy-0616-300x236.jpg" alt="GPUPropCopy 0616" width="300" height="236" /></a><a href="http://blog.blackhc.net/wp-content/uploads/2010/06/noLPV.JPG"><br />
<img class="size-medium wp-image-773 alignnone" title="noLPV" src="http://blog.blackhc.net/wp-content/uploads/2010/06/noLPV-300x210.jpg" alt="noLPV" width="300" height="210" /></a><a href="http://blog.blackhc.net/wp-content/uploads/2010/06/LPV32P128C.JPG"><img class="alignnone size-medium wp-image-771" title="LPV32P128C" src="http://blog.blackhc.net/wp-content/uploads/2010/06/LPV32P128C-300x210.jpg" alt="LPV32P128C" width="300" height="210" /></a></p>
<p style="text-align: left;"><a href="http://blog.blackhc.net/wp-content/uploads/2010/06/noLPV_2.JPG"><img class="alignnone size-medium wp-image-774" title="noLPV_2" src="http://blog.blackhc.net/wp-content/uploads/2010/06/noLPV_2-300x210.jpg" alt="noLPV_2" width="300" height="210" /></a><a href="http://blog.blackhc.net/wp-content/uploads/2010/06/LPV32P128C_2.JPG"><img class="alignnone size-medium wp-image-772" title="LPV32P128C_2" src="http://blog.blackhc.net/wp-content/uploads/2010/06/LPV32P128C_2-300x210.jpg" alt="LPV32P128C_2" width="300" height="210" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blackhc.net/2010/06/rotation-of-low-order-spherical-harmonics/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Rigid Body Motion</title>
		<link>http://blog.blackhc.net/2010/05/rigid-body-motion/</link>
		<comments>http://blog.blackhc.net/2010/05/rigid-body-motion/#comments</comments>
		<pubDate>Sun, 30 May 2010 15:10:11 +0000</pubDate>
		<dc:creator>BlackHC</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Maths]]></category>
		<category><![CDATA[University]]></category>
		<category><![CDATA[introduction]]></category>
		<category><![CDATA[physics]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[rigid body]]></category>
		<category><![CDATA[rigid body physics]]></category>

		<guid isPermaLink="false">http://blog.blackhc.net/?p=729</guid>
		<description><![CDATA[<a href="http://blog.blackhc.net/2010/05/rigid-body-motion/" title="Rigid Body Motion"></a>Last week I had to give a presentation about Rigid Body Motion (ie the basics of rigid body physics and some general mechanics). Here are two versions of my presentation (one with less text and one with more): Rigid Body &#8230;<p class="read-more"><a href="http://blog.blackhc.net/2010/05/rigid-body-motion/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://blog.blackhc.net/2010/05/rigid-body-motion/" title="Rigid Body Motion"></a><p>Last week I had to give a presentation about Rigid Body Motion (ie the basics of rigid body physics and some general mechanics).</p>
<p>Here are two versions of my presentation (one with less text and one with more):</p>
<p><a href="http://blog.blackhc.net/wp-content/uploads/2010/05/Rigid-Body-Motion-Presentation.pptx">Rigid Body Motion Presentation as PPTX</a>; <a href="http://blog.blackhc.net/wp-content/uploads/2010/05/Rigid-Body-Motion-Presentation.pdf">Rigid Body Motion Presentation as PDF<br />
</a><a href="http://blog.blackhc.net/wp-content/uploads/2010/05/Rigid-Body-Motion-Full-Version.pptm">Rigid Body Motion Full Version as PPTM</a>; <a href="http://blog.blackhc.net/wp-content/uploads/2010/05/Rigid-Body-Motion-Full-Version.pdf">Rigid Body Motion Full Version as PDF</a></p>
<p>If you are truly interested in learning about rigid body physics, here are some books/links:</p>
<ul>
<li> “Technische Mechanik 1 &amp; 3” by Gross, Hauger, Schröder &amp; Wall</li>
<li> <a href="http://www.pixar.com/companyinfo/research/pbm2001/" target="_blank">“Physically Based Modeling” by Pixar (SIGGRAPH 2001)</a></li>
<li> “Mathematics for 3D Game Programming &amp; Computer Graphics” by Eric Lengyel</li>
<li> “Physics for Game Developers” by David M. Bourg</li>
<li> “Game Physics” by David H. Eberly</li>
<li><a href="http://chrishecker.com/Rigid_Body_Dynamics" target="_blank">Chris Hecker's Rigid Body Physics page</a></li>
</ul>
<p>Cheers,<br />
Andreas</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blackhc.net/2010/05/rigid-body-motion/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A quick note on quantifiers: For almost all and there exist infinitely many</title>
		<link>http://blog.blackhc.net/2010/03/a-quick-note-on-quantifiers-for-almost-all-and-there-exist-infinitely-many/</link>
		<comments>http://blog.blackhc.net/2010/03/a-quick-note-on-quantifiers-for-almost-all-and-there-exist-infinitely-many/#comments</comments>
		<pubDate>Sat, 27 Mar 2010 14:55:00 +0000</pubDate>
		<dc:creator>BlackHC</dc:creator>
				<category><![CDATA[Maths]]></category>
		<category><![CDATA[University]]></category>
		<category><![CDATA[Exists]]></category>
		<category><![CDATA[For All]]></category>
		<category><![CDATA[For Almost All]]></category>
		<category><![CDATA[Quantifiers]]></category>

		<guid isPermaLink="false">http://blog.blackhc.net/?p=712</guid>
		<description><![CDATA[<a href="http://blog.blackhc.net/2010/03/a-quick-note-on-quantifiers-for-almost-all-and-there-exist-infinitely-many/" title="A quick note on quantifiers: For almost all and there exist infinitely many"></a>It's been a while since my last post and now it's time for a mathematical post: I'm currently preparing for a math exam (calculus) and I'm thinking it would be nice if there was a way to avoid much of &#8230;<p class="read-more"><a href="http://blog.blackhc.net/2010/03/a-quick-note-on-quantifiers-for-almost-all-and-there-exist-infinitely-many/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://blog.blackhc.net/2010/03/a-quick-note-on-quantifiers-for-almost-all-and-there-exist-infinitely-many/" title="A quick note on quantifiers: For almost all and there exist infinitely many"></a><p>It's been a while since my last post and now it's time for a mathematical post:</p>
<p>I'm currently preparing for a math exam (calculus) and I'm thinking it would be nice if there was a way to avoid much of the "for every <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_48cd3d9bc60a933438e6e151fcabafdf.gif' style=' padding-bottom:1px;' class='tex' alt="\epsilon > 0" /></span><script type='math/tex'>\epsilon > 0</script> there is an <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_c42a0e6c42f40626fb62587caa77429f.gif' style=' padding-bottom:1px;' class='tex' alt="N \in \mathbb{N}" /></span><script type='math/tex'>N \in \mathbb{N}</script>, so that for all <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_bb453b8f91c47deeaf9bd5d7849872ec.gif' style=' padding-bottom:1px;' class='tex' alt="n \ge N" /></span><script type='math/tex'>n \ge N</script> some property ... holds" stuff you find in textbooks. Some textbooks actually shorten it to "for every <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_48cd3d9bc60a933438e6e151fcabafdf.gif' style=' padding-bottom:1px;' class='tex' alt="\epsilon > 0" /></span><script type='math/tex'>\epsilon > 0</script> some property ... holds for almost all <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_7b8b965ad4bca0e41ab51de7b31363a1.gif' style=' padding-bottom:2px;' class='tex' alt="n" /></span><script type='math/tex'>n</script>".<br />
However, I haven't found a quantifier to express this anywhere yet, so I'm proposing to introduce a new one:</p>
<p><span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_e3e9535b6be5e98db02a53b15c62f58a.gif' style=' ' class='tex' alt="\tilde{\forall} x \in M: P(x)" /></span><script type='math/tex'>\tilde{\forall} x \in M: P(x)</script> should mean "for almost all <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_50f459b5ecb20bc2bdb8fefcef483b46.gif' style=' padding-bottom:1px;' class='tex' alt="x \in M" /></span><script type='math/tex'>x \in M</script> <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_c19f6b6a7bae1fd5b14f578c6edc3454.gif' style=' ' class='tex' alt="P(x)" /></span><script type='math/tex'>P(x)</script> holds", which suggests that there are only finitely many elements for which it does not hold.<br />
One can formalize this as:<br />
<span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_bf28bf4fed82cc8f93b2eab6210c01f5.gif' style=' ' class='tex' alt="\tilde{\forall} x \in M: P(x) \equiv \exists n \in \mathbb{N}: \left | \left \{ x \in M \mid \neg P(x) \right \} \right | \le n " /></span><script type='math/tex'>\tilde{\forall} x \in M: P(x) \equiv \exists n \in \mathbb{N}: \left | \left \{ x \in M \mid \neg P(x) \right \} \right | \le n </script> </p>
<p>Of course, a new existential quantifier is required then, too (for negation):<br />
<span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_e54870464fe6cde68b61d27cef01da21.gif' style=' ' class='tex' alt="\tilde{\exists} x \in M: P(x)" /></span><script type='math/tex'>\tilde{\exists} x \in M: P(x)</script> stands for "there exist infinitely many <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_50f459b5ecb20bc2bdb8fefcef483b46.gif' style=' padding-bottom:1px;' class='tex' alt="x \in M" /></span><script type='math/tex'>x \in M</script>, for which <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_c19f6b6a7bae1fd5b14f578c6edc3454.gif' style=' ' class='tex' alt="P(x)" /></span><script type='math/tex'>P(x)</script> holds".<br />
And this can be formalized as:<br />
<span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_9e0c734b4ab524a714517427dbbd828e.gif' style=' ' class='tex' alt="\tilde{\exists} x \in M: P(x) \equiv \forall n \in \mathbb{N}: \left | \left \{ x \in M \mid P(x) \right \} \right | > n " /></span><script type='math/tex'>\tilde{\exists} x \in M: P(x) \equiv \forall n \in \mathbb{N}: \left | \left \{ x \in M \mid P(x) \right \} \right | > n </script></p>
<p>It's easy to see that <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_1fdd16569e37aaf00fc1921d617617fe.gif' style=' ' class='tex' alt="\neg \left ( \tilde{\forall} x \in M: P(x) \right ) \equiv \tilde{\exists} x \in M: \neg P(x) " /></span><script type='math/tex'>\neg \left ( \tilde{\forall} x \in M: P(x) \right ) \equiv \tilde{\exists} x \in M: \neg P(x) </script></p>
<p>Thus one can use the two quantifiers just as one would use <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_8b141f94d4371ad99206ca92a896986d.gif' style=' padding-bottom:1px;' class='tex' alt="\forall" /></span><script type='math/tex'>\forall</script> and <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_32ff223f4b9214ce44a3f7cac5abe8bf.gif' style=' padding-bottom:1px;' class='tex' alt="\exists" /></span><script type='math/tex'>\exists</script> usually. Note however than <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_8b141f94d4371ad99206ca92a896986d.gif' style=' padding-bottom:1px;' class='tex' alt="\forall" /></span><script type='math/tex'>\forall</script> and <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_c4513a0476f5fcb3cf3544dfcc8f2bcd.gif' style=' ' class='tex' alt="\tilde{\forall}" /></span><script type='math/tex'>\tilde{\forall}</script> don't interchange and neither do  <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_32ff223f4b9214ce44a3f7cac5abe8bf.gif' style=' padding-bottom:1px;' class='tex' alt="\exists" /></span><script type='math/tex'>\exists</script> and <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_e8bba45759530463d99840a9e2c41410.gif' style=' ' class='tex' alt="\tilde{\exists}" /></span><script type='math/tex'>\tilde{\exists}</script>.</p>
<p>One last note: it might be worth using a different notation, for example: <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_209a97792dc00e30ae0a859394f13808.gif' style=' padding-bottom:1px;' class='tex' alt="\exists ^ \infty" /></span><script type='math/tex'>\exists ^ \infty</script> might be easier to understand than <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_c6d62924951d67e36e51e9fe9c40262b.gif' style=' ' class='tex' alt=" \tilde{\exists} " /></span><script type='math/tex'> \tilde{\exists} </script>, and <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_a930248701d2dc2963faa7833ff935c0.gif' style=' padding-bottom:1px;' class='tex' alt="\forall ^ \approx" /></span><script type='math/tex'>\forall ^ \approx</script> might be better than <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_c4513a0476f5fcb3cf3544dfcc8f2bcd.gif' style=' ' class='tex' alt="\tilde{\forall}" /></span><script type='math/tex'>\tilde{\forall}</script>.</p>
<p>I'll try to formalize these quantifiers some more when I find some spare time.</p>
<p>Stay tuned for coding related updates soon <img src='http://blog.blackhc.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
Cheers,<br />
 Andreas</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blackhc.net/2010/03/a-quick-note-on-quantifiers-for-almost-all-and-there-exist-infinitely-many/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Random Things</title>
		<link>http://blog.blackhc.net/2009/11/random-things/</link>
		<comments>http://blog.blackhc.net/2009/11/random-things/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 16:56:20 +0000</pubDate>
		<dc:creator>BlackHC</dc:creator>
				<category><![CDATA[Maths]]></category>
		<category><![CDATA[Personal Rantings]]></category>

		<guid isPermaLink="false">http://blog.blackhc.net/?p=686</guid>
		<description><![CDATA[<a href="http://blog.blackhc.net/2009/11/random-things/" title="Random Things"></a>It's been a while since the last update. Here's a small update on what I'm thinking about various stuff. Prototype Gameplay is okay I guess. Nothing I would spent too much time on though. It looks a lot worse than &#8230;<p class="read-more"><a href="http://blog.blackhc.net/2009/11/random-things/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://blog.blackhc.net/2009/11/random-things/" title="Random Things"></a><p>It's been a while since the last update. Here's a small update on what I'm thinking about various stuff.</p>
<h4>Prototype</h4>
<p>Gameplay is okay I guess. Nothing I would spent too much time on though. It looks a lot worse than GTA 4 though (same as Crackdown).</p>
<h4>Resident Evil</h4>
<p>Seems to be lots of fun and some nice graphics, too.</p>
<h4>Red Faction: Guerrilla</h4>
<p>Some weird texture filtering issues and the presentation doesn't knock off my chair (terrain popping and other ugliness), but multiplayer is loads of fun with friends. Physics isn't completely stable though. I played the game for one hour in MP with friends and there were quite a few cases where geometry dropped through the floor with enough pressure from above (after destroying a building).</p>
<h4>Brüno</h4>
<p>A bad and quite stupid movie (Ali G in Da House is probably the only movie I kinda like that stars Cohen). If you haven't watched it already, don't &gt;_&lt;</p>
<h4>Shadow Complex</h4>
<p>I bought shadow complex a few weeks ago and I have to say that it is an awesome game. I read somewhere that the developer used the Metroid series as inspiration and it shows. It's really fun to play and quite addictive. The graphics are pretty awesome (it is using the Unreal 3 engine) and the whole presentation is pretty polished. It certainly is worth its 1200 gamerpoints</p>
<h3>Summing Formulas</h3>
<p>A month ago I was doing some exercises in an analysis book (Königsberger) and found a nice/interesting problem:</p>
<p>Prove that if we denote of the sum of the numbers 1 to n to the p-th power by <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_3c6cf5781b9f871308dd7095e01ea46d.gif' style=' ' class='tex' alt=" S_n^p = 1^p + 2^p + ... + n^p " /></span><script type='math/tex'> S_n^p = 1^p + 2^p + ... + n^p </script>, then the following equation by Pascal holds: <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_131195a6c7f4bab1fa5e8a69eddcbd9e.gif' style=' ' class='tex' alt=" (p+1) S_n^p + \binom{ p + 1 }{ 2 } S_n^{p-1} + \binom{ p + 1 }{ 3 } S_n^{p-2} + ... + S_n^0 = (n+1)^{p+1} - 1 " /></span><script type='math/tex'> (p+1) S_n^p + \binom{ p + 1 }{ 2 } S_n^{p-1} + \binom{ p + 1 }{ 3 } S_n^{p-2} + ... + S_n^0 = (n+1)^{p+1} - 1 </script></p>
<p>It can be used to get recursively/iteratively get formulas for sums of higher powers of numbers.</p>
<p>This is interesting because the proof doesn't need any advanced maths (like eg the Euler-MacLaurin formula, which can be used to show this, too).</p>
<p style="text-align: left;">You can download the proof and a few examples <a href="http://blog.blackhc.net/wp-content/uploads/2009/11/PascalSumFormula.pdf" target="_blank">here</a>.</p>
<p style="text-align: left;">Cheers</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blackhc.net/2009/11/random-things/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Semi-Conductor Optimization (Uni Project)</title>
		<link>http://blog.blackhc.net/2009/08/semi-conductor-optimization-uni-project/</link>
		<comments>http://blog.blackhc.net/2009/08/semi-conductor-optimization-uni-project/#comments</comments>
		<pubDate>Sun, 02 Aug 2009 12:29:55 +0000</pubDate>
		<dc:creator>BlackHC</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Maths]]></category>
		<category><![CDATA[University]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[MatLAB]]></category>
		<category><![CDATA[PowerPoint]]></category>
		<category><![CDATA[Semi-Conductor Optimization]]></category>

		<guid isPermaLink="false">http://blog.blackhc.net/?p=611</guid>
		<description><![CDATA[<a href="http://blog.blackhc.net/2009/08/semi-conductor-optimization-uni-project/" title="Semi-Conductor Optimization (Uni Project)"></a>I've written my last exam yesterday (except for two oral exams in September), so now I have got some spare time before I start working on my Bachelor Thesis tomorrow and I want to use it to wrap up a &#8230;<p class="read-more"><a href="http://blog.blackhc.net/2009/08/semi-conductor-optimization-uni-project/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://blog.blackhc.net/2009/08/semi-conductor-optimization-uni-project/" title="Semi-Conductor Optimization (Uni Project)"></a><p>I've written my last exam yesterday (except for two oral exams in September), so now I have got some spare time before I start working on my Bachelor Thesis tomorrow and I want to use it to wrap up a few things.</p>
<p>During this term I took part in a course that was both a (research) project/presentation/lecture thing, which was fun but also a lot of work.<br />
I've already written about one mathematical aspect of it in my post about <a href="http://blog.blackhc.net/2009/05/analysis-cauchy-schwarz-and-reciprocal-sums/" target="_blank">Analysis, Cauchy-Schwarz and Reciprocal Sums</a>.</p>
<p>The project was about optimizing semi-conductor wiring placement. We wrote a small paper about our findings and the work it was based one - you can look download it <a href="http://blog.blackhc.net/wp-content/uploads/2009/08/SemiConductorPaper.pdf">here</a>.</p>
<p>We also created a self-running presentation that doesn't contain any Maths at all but makes heavy use of Flash animations (which were exported to .gif manually, which was a huge pain in the ass, which I will never do again if possible) to visualize all the concepts and algorithms.</p>
<p>You can download a PowerPoint 2007 (.pptx) version <a href="http://blog.blackhc.net/wp-content/uploads/2009/07/Aufbereitung.pptx" target="_blank">here</a> or one that works with PowerPoint 2003 <a href="http://blog.blackhc.net/wp-content/uploads/2009/07/Aufbereitung.ppt" target="_blank">here</a>.</p>
<p>For the Student's I sat down and wrote a small Flash application to show the algorithms at work. It's not obvious how it works, so let me explain the major points:</p>
<ul>
<li>On the right you have a number of panels that you can enlarge by clicking on the small button in the upper right of each panel.</li>
<li>The upper three panels show different views of the same dataset. They will all be updated as you run the algorithm step by step.</li>
<li>The fourth panel lets you change the number of wires and/or their activity.</li>
<li>The last panel shows the electrical field that is created by one active wire in the center. It was created using MatLAB. I've also uploaded the script <a href="http://blog.blackhc.net/wp-content/uploads/2009/08/leiter.m" target="_blank">here</a>.</li>
</ul>
<p><object id="Abitag" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="250" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="align" value="middle" /><param name="allowFullScreen" value="true" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><param name="src" value="http://blog.blackhc.net/wp-content/uploads/2009/08/Abitag.swf" /><param name="name" value="Abitag" /><param name="allowfullscreen" value="true" /><embed id="Abitag" type="application/x-shockwave-flash" width="400" height="250" src="http://blog.blackhc.net/wp-content/uploads/2009/08/Abitag.swf" name="Abitag" bgcolor="#ffffff" quality="high" allowfullscreen="true" align="middle"></embed></object></p>
<p><a href="http://blog.blackhc.net/wp-content/uploads/2009/08/Abitag.swf">Abitag</a></p>
<p>Last but not least I've also uploaded the current version of all my .fla and .as files. You can download it <a href="http://blog.blackhc.net/wp-content/uploads/2009/08/FlashSources.zip" target="_blank">here</a>.</p>
<p>ActionScript is a nice language and you can quickly learn it using the <a href="http://help.adobe.com/en_US/Flash/10.0_Welcome/WS091A3800-D889-4425-B647-C44097B73F34.html" target="_blank">available resources from Adobe</a>.<br />
While ActionScript 2.0 is arguably weird, ActionScript 3.0 is quite logical and it's syntax is straight-forward and consistent, too. You can't say that about the IDE (Flash CS4), which is braindead, but if you're only interested in writing ActionScript code, <a href="http://www.flashdevelop.org/" target="_blank">FlashDevelop</a> is an excellent and free alternative.</p>
<p>This is it for now, maybe I'll play around with Flash some more another time.<br />
Cheers,<br />
Andreas</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blackhc.net/2009/08/semi-conductor-optimization-uni-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>\epsilon Induction</title>
		<link>http://blog.blackhc.net/2009/05/epsilon-induction/</link>
		<comments>http://blog.blackhc.net/2009/05/epsilon-induction/#comments</comments>
		<pubDate>Tue, 26 May 2009 22:25:48 +0000</pubDate>
		<dc:creator>BlackHC</dc:creator>
				<category><![CDATA[Maths]]></category>
		<category><![CDATA[University]]></category>
		<category><![CDATA[induction]]></category>
		<category><![CDATA[real numbers]]></category>

		<guid isPermaLink="false">http://blog.blackhc.net/?p=463</guid>
		<description><![CDATA[<a href="http://blog.blackhc.net/2009/05/epsilon-induction/" title="$$\epsilon$$ Induction"></a>Induction over natural numbers is a standard tool in Mathematics. But what about doing induction over real numbers&#180;? The structure is different and it's not immediately clear what is meant, so let me clarify it. Let P(v) be a proposition &#8230;<p class="read-more"><a href="http://blog.blackhc.net/2009/05/epsilon-induction/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://blog.blackhc.net/2009/05/epsilon-induction/" title="$$\epsilon$$ Induction"></a><p>Induction over natural numbers is a standard tool in Mathematics. But what about doing induction over real numbers<a class="annotation" title="non-negative real numbers that is" href="javascript:;"><strong>&#180;</strong></a>? The structure is different and it's not immediately clear what is meant, so let me clarify it.</p>
<p>Let <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_4eacabc4122cc8a49a2fa5ed6533d4f2.gif' style=' ' class='tex' alt="P(v)" /></span><script type='math/tex'>P(v)</script> be a proposition that we want to show for all <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_4ef529b0768b2c7b11c5b4ebe8fa8235.gif' style=' ' class='tex' alt=" v \in \mathbb{R}^+_0 " /></span><script type='math/tex'> v \in \mathbb{R}^+_0 </script>.</p>
<p>Then we can use the following "induction principle" to prove it:</p>
<p><span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_4ed3fd9939368a7c657268ca45ac0740.gif' style=' ' class='tex' alt=" \exists \epsilon \in \mathbb{R}^+ " /></span><script type='math/tex'> \exists \epsilon \in \mathbb{R}^+ </script><br />
<span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_1a825cfc56fc1a7864e366b23b69e765.gif' style=' ' class='tex' alt=" \text{a)} \forall u \in \left [0,\epsilon \right ]: P(u) " /></span><script type='math/tex'> \text{a)} \forall u \in \left [0,\epsilon \right ]: P(u) </script><br />
<span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_a65634803ce24dfbf22492f22b45deaf.gif' style=' ' class='tex' alt=" \text{b)} \left( \forall u \in \left  [0, v - \epsilon \right ]: P(u) \right ) \Rightarrow P(v) " /></span><script type='math/tex'> \text{b)} \left( \forall u \in \left  [0, v - \epsilon \right ]: P(u) \right ) \Rightarrow P(v) </script><a class="annotation" title="v &gt;= \epsilon, of course" href="javascript:;"><strong>&#180;</strong></a></p>
<p>It's easy to show that this is a correct way to prove it. I'll use induction over natural numbers to prove it <img src='http://blog.blackhc.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Let <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_84e6fa6b8cd1ac2af066a2ddf9e78a75.gif' style=' ' class='tex' alt=" I_k := \left [k \cdot \frac \epsilon 2, (k+1) \cdot \frac \epsilon 2 \right ] " /></span><script type='math/tex'> I_k := \left [k \cdot \frac \epsilon 2, (k+1) \cdot \frac \epsilon 2 \right ] </script>.<br />
Then let's show by induction over <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_365c0b3ff8a6fa58b7ae709949b55608.gif' style=' padding-bottom:1px;' class='tex' alt=" k " /></span><script type='math/tex'> k </script> that <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_518cc22ea3ef1899c68572484c0c48b0.gif' style=' ' class='tex' alt=" \text{(*)} \forall u \in I_k: P(u) " /></span><script type='math/tex'> \text{(*)} \forall u \in I_k: P(u) </script>:</p>
<h4>Base:</h4>
<p>From a) it follows that (*) already holds for <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_7cb83b83e7602ed56ce440eaac109fdf.gif' style=' padding-bottom:1px;' class='tex' alt="I_0" /></span><script type='math/tex'>I_0</script> and <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_a3686747d7705aad1baeec00e8898bc5.gif' style=' padding-bottom:1px;' class='tex' alt="I_1" /></span><script type='math/tex'>I_1</script>.</p>
<h4>Induction Step (<span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_f5245254702353112f2d9ffbee011db4.gif' style=' ' class='tex' alt=" k \ge 2 " /></span><script type='math/tex'> k \ge 2 </script>):</h4>
<p>If (*) holds for <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_7a7b56e8ee881a5318d5d7a75e59d282.gif' style=' padding-bottom:1px;' class='tex' alt=" I_0, ..., I_{k-1}" /></span><script type='math/tex'> I_0, ..., I_{k-1}</script>, then it obviously holds for all <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_d256d887527157f45b3d141b2ced027b.gif' style=' ' class='tex' alt=" u \in \left [ 0, k \cdot \frac \epsilon 2 \right ]" /></span><script type='math/tex'> u \in \left [ 0, k \cdot \frac \epsilon 2 \right ]</script>.</p>
<p>Fix <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_227476f15d4238bed0fe7c364e5bbca2.gif' style=' padding-bottom:1px;' class='tex' alt=" v \in I_k " /></span><script type='math/tex'> v \in I_k </script>, then <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_e539cbd0deca9fe3fc3e382d729e9937.gif' style=' ' class='tex' alt=" v \le (k+1) \cdot \frac \epsilon 2 \Leftrightarrow v - \epsilon \le (k-2) \cdot \frac \epsilon 2 < k \cdot \frac \epsilon 2 \right " /></span><script type='math/tex'> v \le (k+1) \cdot \frac \epsilon 2 \Leftrightarrow v - \epsilon \le (k-2) \cdot \frac \epsilon 2 < k \cdot \frac \epsilon 2 \right </script>. With b) it follows that <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_4eacabc4122cc8a49a2fa5ed6533d4f2.gif' style=' ' class='tex' alt="P(v)" /></span><script type='math/tex'>P(v)</script> holds.</p>
<p>That is, <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_c14cb9bed6f0ffa8ca787629c3fe2b5b.gif' style=' ' class='tex' alt=" P(v) " /></span><script type='math/tex'> P(v) </script>  <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_996ff7a19947411ae3c5edbda90f577b.gif' style=' padding-bottom:1px;' class='tex' alt=" \forall v \in I_k " /></span><script type='math/tex'> \forall v \in I_k </script>.</p>
<p style="text-align: right;">#</p>
<p style="text-align: left;">It should be possible to show that you can generalize this to:</p>
<p><span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_4ed3fd9939368a7c657268ca45ac0740.gif' style=' ' class='tex' alt=" \exists \epsilon \in \mathbb{R}^+ " /></span><script type='math/tex'> \exists \epsilon \in \mathbb{R}^+ </script><br />
<span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_1a825cfc56fc1a7864e366b23b69e765.gif' style=' ' class='tex' alt=" \text{a)} \forall u \in \left [0,\epsilon \right ]: P(u) " /></span><script type='math/tex'> \text{a)} \forall u \in \left [0,\epsilon \right ]: P(u) </script><br />
<span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_3c96543a0d89a0091bd7b80fe5d6e966.gif' style=' ' class='tex' alt=" \text{b)} \left( \forall u \in \left  [\psi(v), \phi( v ) \right ]: P(u) \right ) \Rightarrow P(v) " /></span><script type='math/tex'> \text{b)} \left( \forall u \in \left  [\psi(v), \phi( v ) \right ]: P(u) \right ) \Rightarrow P(v) </script><br />
with <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_be10e2511e1a0130bcc40c7048f87acc.gif' style=' ' class='tex' alt=" \phi( v ):  \mathbb{R}^+ \to \mathbb{R}^+_0 " /></span><script type='math/tex'> \phi( v ):  \mathbb{R}^+ \to \mathbb{R}^+_0 </script>, <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_060d256854c741b2daec620750967d14.gif' style=' ' class='tex' alt=" \psi( v ): \mathbb{R}^+ \to \mathbb{R}^+_0 " /></span><script type='math/tex'> \psi( v ): \mathbb{R}^+ \to \mathbb{R}^+_0 </script> and <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_3eb13bc100d238b0e91c6e29d679e7a2.gif' style=' ' class='tex' alt=" \psi(v) \le \phi(v) < v " /></span><script type='math/tex'> \psi(v) \le \phi(v) < v </script>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blackhc.net/2009/05/epsilon-induction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Analysis, Cauchy-Schwarz and Reciprocal Sums</title>
		<link>http://blog.blackhc.net/2009/05/analysis-cauchy-schwarz-and-reciprocal-sums/</link>
		<comments>http://blog.blackhc.net/2009/05/analysis-cauchy-schwarz-and-reciprocal-sums/#comments</comments>
		<pubDate>Thu, 07 May 2009 22:29:48 +0000</pubDate>
		<dc:creator>BlackHC</dc:creator>
				<category><![CDATA[Maths]]></category>
		<category><![CDATA[Personal Rantings]]></category>
		<category><![CDATA[University]]></category>
		<category><![CDATA[Bornemann]]></category>
		<category><![CDATA[Cauchy-Schwarz]]></category>
		<category><![CDATA[Konkrete Analysis]]></category>
		<category><![CDATA[Reciprocal Sum]]></category>

		<guid isPermaLink="false">http://blog.blackhc.net/?p=421</guid>
		<description><![CDATA[<a href="http://blog.blackhc.net/2009/05/analysis-cauchy-schwarz-and-reciprocal-sums/" title="Analysis, Cauchy-Schwarz and Reciprocal Sums"></a>Konkrete Analysis First I want to share some solutions for the exercises of a Maths book. The book is called Konkrete Analysis by Folkmar Bornemann and is written in German as are my solutions for some of the exercises. (I &#8230;<p class="read-more"><a href="http://blog.blackhc.net/2009/05/analysis-cauchy-schwarz-and-reciprocal-sums/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://blog.blackhc.net/2009/05/analysis-cauchy-schwarz-and-reciprocal-sums/" title="Analysis, Cauchy-Schwarz and Reciprocal Sums"></a><h3>Konkrete Analysis</h3>
<p>First I want to share some solutions for the exercises of a Maths book. The book is called <a href="http://www.springer.com/computer/mathematics/book/978-3-540-70845-2">Konkrete Analysis by Folkmar Bornemann</a> and is written in German as are my solutions for some of the exercises. (I think I cover about 70% of all exercises in the book and pretty much every easy one <img src='http://blog.blackhc.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> )</p>
<p>I don't claim that my solutions are correct and there are probably quite a few (uncorrected) mistakes, but right now I haven't been able to find any other openly available solutions. Although the book claims to be easily readable without attending the lectures of Professor Bornemann, I doubt that it is possible to do so successfully without being able to do the exercises and while doing so being able to get help or look at possible solutions to find new ideas.</p>
<p>I did all the exercises as way to prepare myself for the exam (it was very successful alas probably not in the most time efficient way), so it also contains solutions for old exams (but those are appended at the end and probably not interesting at all).</p>
<p><a href="http://blog.blackhc.net/wp-content/uploads/2009/05/konkrete-analysis-solutions.pdf" target="_blank">You can download the PDF konkrete-analysis-solutions here.</a></p>
<h3>Cauchy-Schwarz and a Problem</h3>
<p>The book is quite useful though as was the lecture "Analysis for Computer Scientists" which was based on the book (or vice-versa) and it is probably the single one lecture that has taught most since I started attending Computer Science at university.</p>
<p>One of the many topics (we covered a lot which was one of the nice things) was inequalities and the useful things you can do with them. Especially the Cauchy-Schwarz inequality turns out to be quite useful while pretty basic:</p>
<p><span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_a24e1e6e9afef8a1e7522b949071edde.gif' style=' ' class='tex' alt=" <a,b> \leq ||a|| \cdot ||b|| " /></span><script type='math/tex'> <a,b> \leq ||a|| \cdot ||b|| </script> with <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_cda5cca5c6a02bbe6fb8f59a5d97800d.gif' style=' ' class='tex' alt=" <a,b> = || a || \cdot || b || " /></span><script type='math/tex'> <a,b> = || a || \cdot || b || </script> when <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_63c3f5e5399274efb59cb25a58775df0.gif' style=' padding-bottom:1px;' class='tex' alt=" \exists \lambda: a = \lambda b " /></span><script type='math/tex'> \exists \lambda: a = \lambda b </script></p>
<p>Interestingly enough this can already yield results that are quite difficult to obtain otherwise. For example we can easily prove lower or upper bounds that is the existence of a maximum or minimum by applying it.</p>
<p>First we obtain a lower or upper bound (for the right or the left side respectively) and then we can use the equality case to prove the existence of the a minium or maximum.</p>
<p>For example, let's take a look at this problem:</p>
<p>We have <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_45609f671ccf21c4981f037088184db8.gif' style=' ' class='tex' alt=" x \in \mathbb{R}^n, 0 < x, \sum_{i=1}^n {x_i} = 1 " /></span><script type='math/tex'> x \in \mathbb{R}^n, 0 < x, \sum_{i=1}^n {x_i} = 1 </script> and want to minimize <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_e6f7306e2a5b1dc4d09e2fd31e627f99.gif' style=' ' class='tex' alt=" \sum_{i=1}^n { \frac 1 x } " /></span><script type='math/tex'> \sum_{i=1}^n { \frac 1 x } </script>.<br />
We simply set <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_c15476905129abebc744f6038ed162fc.gif' style=' ' class='tex' alt=" a_i := \sqrt{x_i}, b_i := \sqrt{ \frac 1 x_i } " /></span><script type='math/tex'> a_i := \sqrt{x_i}, b_i := \sqrt{ \frac 1 x_i } </script>.</p>
<p>Then we get:</p>
<p><span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_8adffed432ecc82ed7d60f6bc904a117.gif' style=' ' class='tex' alt=" \sum_{i=1}^n { a_i b_i } = \sum_{i=1}^n { \sqrt{ x_i } \frac 1 {\sqrt{ x_i }} } = \sum_{i=1}^n 1 = n  " /></span><script type='math/tex'> \sum_{i=1}^n { a_i b_i } = \sum_{i=1}^n { \sqrt{ x_i } \frac 1 {\sqrt{ x_i }} } = \sum_{i=1}^n 1 = n  </script><br />
<span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_ca4b513bda511ba9b57c85f915803ca2.gif' style=' ' class='tex' alt=" \leq \sqrt{ \sum_{i=1}^n \sqrt{x_i}^2 } \sqrt{ \sum_{i=1}^n \frac 1 {\sqrt{x_i}^2} } = \sqrt { \sum_{i=1}^n x_i } \sqrt{\sum_{i=1}^n \frac 1 x_i } = 1 \cdot \sqrt{\sum_{i=1}^n \frac 1 x_i } " /></span><script type='math/tex'> \leq \sqrt{ \sum_{i=1}^n \sqrt{x_i}^2 } \sqrt{ \sum_{i=1}^n \frac 1 {\sqrt{x_i}^2} } = \sqrt { \sum_{i=1}^n x_i } \sqrt{\sum_{i=1}^n \frac 1 x_i } = 1 \cdot \sqrt{\sum_{i=1}^n \frac 1 x_i } </script></p>
<p>That is: <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_1e26df891c906620d1aae65d87ae8b51.gif' style=' ' class='tex' alt=" \sum_{i=1}^n \frac 1 x_i \geq n^2 " /></span><script type='math/tex'> \sum_{i=1}^n \frac 1 x_i \geq n^2 </script>.</p>
<p>Now we know an lower bound for the reciprocal sum.<br />
To determine the minimal x vector, we remember to start with:</p>
<p><span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_22e9de6955f13db68efcfc426d8fb653.gif' style=' ' class='tex' alt=" a = \lamda b \Leftrightarrow \sqrt x_i = \lambda \frac 1 \x_i \Leftrightarrow x_i = \lambda " /></span><script type='math/tex'> a = \lamda b \Leftrightarrow \sqrt x_i = \lambda \frac 1 \x_i \Leftrightarrow x_i = \lambda </script></p>
<p>We use that with the constraint: <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_1232946f791b2dc637f0a31c92321606.gif' style=' ' class='tex' alt=" 1 = \sum_{i=1}^n x_i = \sum_{i=1}^n \lambda = n \cdot \lambda " /></span><script type='math/tex'> 1 = \sum_{i=1}^n x_i = \sum_{i=1}^n \lambda = n \cdot \lambda </script>,<br />
resulting in: <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_9251efffc23bb66856a1a7afc2d814e0.gif' style=' ' class='tex' alt=" x_i = \lambda = \frac 1 n " /></span><script type='math/tex'> x_i = \lambda = \frac 1 n </script>.</p>
<h4>Generalization</h4>
<p>The nice thing is you can go and generalize this finding to more interesting minimization problems as there also exist more advanced versions of the Cauchy-Schwarz inequality<a class="annotation" title="actually it's Hölder's inequality" href="javascript:;"><strong>&#180;</strong></a> adding degrees of freedom to play around with<a class="annotation" title="just one DoF in my case" href="javascript:;"><strong>&#180;</strong></a>.</p>
<p>Thus it is possible to solve the following class of problems using a slightly more advanced Cauchy-Schwarz inequality:</p>
<p><span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_3205bcf0d2b2770f4271a2425f17ec82.gif' style=' ' class='tex' alt=" x,q \in \mathbb{R}^n; 0 < x, q" /></span><script type='math/tex'> x,q \in \mathbb{R}^n; 0 < x, q</script><br />
<span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_b8683219a96f3a8973e82eee8ead511e.gif' style=' ' class='tex' alt="0 < \alpha, \gamma < \infty; \beta > 0 " /></span><script type='math/tex'>0 < \alpha, \gamma < \infty; \beta > 0 </script><br />
<span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_b87dc05d1e0996cc260c737f3efc7e9e.gif' style=' ' class='tex' alt="\large\sum_{i=1}^n {x_i}^\gamma = \beta " /></span><script type='math/tex'>\large\sum_{i=1}^n {x_i}^\gamma = \beta </script><br />
<span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_c6ead4e09d7480dc9759d5ee92a5fc41.gif' style=' ' class='tex' alt="\large min \sum_{i=1}^n \frac {q_i} {x_i^\alpha} " /></span><script type='math/tex'>\large min \sum_{i=1}^n \frac {q_i} {x_i^\alpha} </script></p>
<p>by utilizing</p>
<p><span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_c5bf315f2db25666d67e68a697435e39.gif' style=' ' class='tex' alt="\large \sum_{i=1}^n { a_i b_i } \le \sqrt[p]{ \sum_{i=1}^n a_i^p} \sqrt[p']{ \sum_{i=1}^n b_i^p'} " /></span><script type='math/tex'>\large \sum_{i=1}^n { a_i b_i } \le \sqrt[p]{ \sum_{i=1}^n a_i^p} \sqrt[p']{ \sum_{i=1}^n b_i^p'} </script> with <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_0d6a186e22f39cb87eec1fb532862d79.gif' style=' ' class='tex' alt=" \frac 1 p + \frac 1 {p'} = 1 " /></span><script type='math/tex'> \frac 1 p + \frac 1 {p'} = 1 </script></p>
<p>Equality requires the same linear dependence condition as the normal Cauchy-Schwarz inequation.</p>
<p>I've only deduced the solution for <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_56620f44b066c09c401fc1b74d4224d0.gif' style=' ' class='tex' alt=" \gamma = 1 " /></span><script type='math/tex'> \gamma = 1 </script> but it shouldn't be difficult to adapt it once you get the idea how it works (it's fairly straight forward).</p>
<p>You can find the whole deduction in the PDF <a href="http://blog.blackhc.net/wp-content/uploads/2009/05/minimum-of-a-generalized-reciprocal-sum.pdf" target="_blank">"Minimum of a Generalized Reciprocal Sum"</a>.</p>
<p>For completeness' sake here are the results for an optimal solution <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_5fdd64df7a44ea702e2133f5cab2e491.gif' style=' padding-bottom:1px;' class='tex' alt=" x^{*} " /></span><script type='math/tex'> x^{*} </script>:</p>
<p><span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_9e880f7f51811d4b691e19c4ea98bd25.gif' style=' ' class='tex' alt="\large x_i^{*} = \beta \cdot \frac { \sqrt[1 + \alpha]{q_i} }{\sum_{k=1}^n \sqrt[1 + \alpha]{q_k}} " /></span><script type='math/tex'>\large x_i^{*} = \beta \cdot \frac { \sqrt[1 + \alpha]{q_i} }{\sum_{k=1}^n \sqrt[1 + \alpha]{q_k}} </script></p>
<p><span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_7093cf869d21174715207b13a02a3d8c.gif' style=' ' class='tex' alt="\large \frac { \left (\sum_{i=1}^n \sqrt[1 + \alpha]{q_i} \right )^{1 + \alpha}} {\beta^\alpha} = \sum_{i=1}^n \frac {q_i} {x_i^{*}^\alpha}" /></span><script type='math/tex'>\large \frac { \left (\sum_{i=1}^n \sqrt[1 + \alpha]{q_i} \right )^{1 + \alpha}} {\beta^\alpha} = \sum_{i=1}^n \frac {q_i} {x_i^{*}^\alpha}</script></p>
<h4>Epilog</h4>
<p>Coming up with the solution was actually a lot of fun and quite interesting because I didn't know it was possible to deduce it this way nor did I know how to do it before. If you read the PDF, I think it's quite nice how you can play around with the formulas and come up with new things from the Cauchy-Schwarz inequality.<br />
If you are only interested in <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_d5a7d2957d1777c35f7903224ab637ff.gif' style=' padding-bottom:1px;' class='tex' alt=" x ^ {*} " /></span><script type='math/tex'> x ^ {*} </script>, you can shortcut everything by immediately skipping to the equality case once <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_74d37d601e20578216a4981034dde4bc.gif' style=' padding-bottom:2px;' class='tex' alt=" p " /></span><script type='math/tex'> p </script> and <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_d964473f93bc137b2fee290e633ae9e7.gif' style=' ' class='tex' alt=" p' " /></span><script type='math/tex'> p' </script> have been determined and solve for that.<br />
I mainly wrote it all out because I wanted to make sure, that it actually was correct.</p>
<p>If it wasn't for my Analysis lecture last term, I probably wouldn't have found this.</p>
<p>Cheers,<br />
Andreas</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blackhc.net/2009/05/analysis-cauchy-schwarz-and-reciprocal-sums/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Reverse Pigeonhole Principle</title>
		<link>http://blog.blackhc.net/2009/05/the-reverse-pigeonhole-principle/</link>
		<comments>http://blog.blackhc.net/2009/05/the-reverse-pigeonhole-principle/#comments</comments>
		<pubDate>Tue, 05 May 2009 00:36:37 +0000</pubDate>
		<dc:creator>BlackHC</dc:creator>
				<category><![CDATA[Maths]]></category>
		<category><![CDATA[University]]></category>
		<category><![CDATA[Pigeonhole Principle]]></category>

		<guid isPermaLink="false">http://blog.blackhc.net/?p=385</guid>
		<description><![CDATA[<a href="http://blog.blackhc.net/2009/05/the-reverse-pigeonhole-principle/" title="The Reverse Pigeonhole Principle"></a>Everybody (I hope) knows about the pigeonhole principle. In short it states that: If f: N \to M and n:= \left &#124; N \right &#124; \leq \left &#124; M \right &#124; =: m , then there exists at least one &#8230;<p class="read-more"><a href="http://blog.blackhc.net/2009/05/the-reverse-pigeonhole-principle/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://blog.blackhc.net/2009/05/the-reverse-pigeonhole-principle/" title="The Reverse Pigeonhole Principle"></a><p>Everybody (I hope) knows about the pigeonhole principle.</p>
<p>In short it states that:</p>
<p style="padding-left: 30px;">If <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_06dd343dc0737dfde00a7d6bf5fe2920.gif' style=' padding-bottom:1px;' class='tex' alt=" f: N \to M " /></span><script type='math/tex'> f: N \to M </script> and <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_eec64c20a2bec155b2c2c7f1471ba191.gif' style=' ' class='tex' alt=" n:= \left | N \right | \leq \left | M \right | =: m " /></span><script type='math/tex'> n:= \left | N \right | \leq \left | M \right | =: m </script>, then there exists at least one <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_fcb572d9cbda8688d3e3e8d14330cae9.gif' style=' padding-bottom:2px;' class='tex' alt=" m_0 " /></span><script type='math/tex'> m_0 </script> with <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_f6d2fb7c93475055a53f56b047d49eca.gif' style=' ' class='tex' alt=" \left | f^{-1}\left ( m_0 \right ) \right | \geq \left \lceil \frac {n} {m} \right \rceil  " /></span><script type='math/tex'> \left | f^{-1}\left ( m_0 \right ) \right | \geq \left \lceil \frac {n} {m} \right \rceil  </script>.</p>
<p>For example, if we have n + 1 pigeons in only n pigeonholes, there is (at least) one pigeonhole that has at least two pigeons inside (thus the name).</p>
<p>One thing I haven't seen mentioned anywhere yet (at least not with this name) is the <strong>reverse pigeonhole principle</strong>:</p>
<p style="padding-left: 30px;">If <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_06dd343dc0737dfde00a7d6bf5fe2920.gif' style=' padding-bottom:1px;' class='tex' alt=" f: N \to M " /></span><script type='math/tex'> f: N \to M </script> and <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_e35c4cba5772ead0b749040e3454163c.gif' style=' ' class='tex' alt=" n  := \left | N \right | \leq \left | M \right |  =: m " /></span><script type='math/tex'> n  := \left | N \right | \leq \left | M \right |  =: m </script>, then there exists at least one <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_a16ddb0a3716218e8de4f2bb98dadfb5.gif' style=' padding-bottom:1px;' class='tex' alt=" m_0 \in M " /></span><script type='math/tex'> m_0 \in M </script> with <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_a3ebb27fd34aa9756af7c123ec3d2023.gif' style=' ' class='tex' alt=" \left | f^{-1}\left ( m_0 \right ) \right | \leq \left \lfloor \frac {n} {m} \right \rfloor " /></span><script type='math/tex'> \left | f^{-1}\left ( m_0 \right ) \right | \leq \left \lfloor \frac {n} {m} \right \rfloor </script>.</p>
<p>Again an example: if we have n + 1 pigeons (it's valid up to 2n - 1) and n pigeonholes, then there exists (at least one) pigeonhole with at most one pigeon in it.</p>
<p>The proof for the reverse principle is simple:</p>
<p style="padding-left: 30px;">Assume that for all <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_a16ddb0a3716218e8de4f2bb98dadfb5.gif' style=' padding-bottom:1px;' class='tex' alt=" m_0 \in M " /></span><script type='math/tex'> m_0 \in M </script>: <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_f227ad385c8b832be15e6b630015e8d7.gif' style=' ' class='tex' alt=" \left | f^{-1}\left ( m_0 \right ) \right | > \left \lfloor \frac {n} {m} \right \rfloor" /></span><script type='math/tex'> \left | f^{-1}\left ( m_0 \right ) \right | > \left \lfloor \frac {n} {m} \right \rfloor</script>, that is each such set contains at least  <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_3f08e28402a695abfd8fb26b63754706.gif' style=' ' class='tex' alt=" \left \lfloor \frac {n} {m} \right \rfloor + 1 " /></span><script type='math/tex'> \left \lfloor \frac {n} {m} \right \rfloor + 1 </script> elements, then from  <span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_2902f8fa5b7a53f3d167d52bd4e196b6.gif' style=' ' class='tex' alt="  \frac n m - 1 < \left \lfloor \frac {n} {m} \right \rfloor " /></span><script type='math/tex'>  \frac n m - 1 < \left \lfloor \frac {n} {m} \right \rfloor </script> it follows that:</p>
<p style="padding-left: 30px;"><span class='MathJax_Preview'><img src='http://blog.blackhc.net/wp-content/plugins/latex/cache/tex_f4a962ab68cb35a0eaf7b6f1333ec021.gif' style=' ' class='tex' alt=" n = \sum_{m_0 \in M} { \left | f^{-1} \left ( m_0 \right ) \right | \geq m \left ( \left \lfloor \frac {n} {m} \right \rfloor + 1 \right ) > m \cdot \frac n m = n  } " /></span><script type='math/tex'> n = \sum_{m_0 \in M} { \left | f^{-1} \left ( m_0 \right ) \right | \geq m \left ( \left \lfloor \frac {n} {m} \right \rfloor + 1 \right ) > m \cdot \frac n m = n  } </script>.</p>
<p style="padding-left: 30px;">This clearly is a contradiction, so the original assumption must have been wrong, which proves the reverse pigeonhole principle.</p>
<p>I haven't seen this written down anywhere before and it's useful to keep it in my mind on its own because it shortens some arguments, so I hope this might help someone <img src='http://blog.blackhc.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>On other news my LaTeX script is severly broken and I don't know why <img src='http://blog.blackhc.net/wp-includes/images/smilies/icon_neutral.gif' alt=':-|' class='wp-smiley' /><br />
For some reason it sometimes merges two LaTeX pieces into one because it forgets to echo the last " after the title (which is <em>impossible</em>, of course..).<br />
Cheers,<br />
Andreas</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blackhc.net/2009/05/the-reverse-pigeonhole-principle/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

