<?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>Mon, 06 Sep 2010 11:19:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<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[I&#8217;ve finally finished my lab course last week &#8211; thanks to my supervisor Matthäus G. Chajdas &#8211; you can read his blog here -, it wasn&#8217;t your usual lab course with work sheets and boring homework, instead I&#8217;ve been allowed &#8230; <a href="http://blog.blackhc.net/2010/07/light-propagation-volumes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve finally finished my lab course last week &#8211; thanks to my supervisor Matthäus G. Chajdas &#8211; <a href="http://anteru.net/" target="_self">you can read his blog here</a> -, it wasn&#8217;t your usual lab course with work sheets and boring homework, instead I&#8217;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&#8217;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&#8217;t explain everything needed to implement it in great detail (like eg the solid angles of the side faces), so I&#8217;ve written two documents detailing the mistakes I&#8217;ve found and the additional calculations I&#8217;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&#8217;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> &#8211; it&#8217;s 68 MB big (and it&#8217;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&#8217;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&#8217;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>5</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[I&#8217;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; <a href="http://blog.blackhc.net/2010/06/rotation-of-low-order-spherical-harmonics/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;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&#8217;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;"><img src="http://blog.blackhc.net/wp-content/cache/tex_706d2523bb7365dae8ac1eaa44f1734d.png" class="tex" alt="S_0 \left( x, y, z \right ) = \frac{1}{2 \sqrt{\pi}}" title="S_0 \left( x, y, z \right ) = \frac{1}{2 \sqrt{\pi}}" align="absmiddle" /><br />
<img src="http://blog.blackhc.net/wp-content/cache/tex_2a90a081c65c08627081aff156902440.png" class="tex" alt="S_1 \left( x, y, z \right ) = - \frac{\sqrt{3}}{2 \sqrt{\pi}} y" title="S_1 \left( x, y, z \right ) = - \frac{\sqrt{3}}{2 \sqrt{\pi}} y" align="absmiddle" /><br />
<img src="http://blog.blackhc.net/wp-content/cache/tex_f71c3646eaced6589b903fbc55202646.png" class="tex" alt="S_2 \left( x, y, z \right ) = \frac{\sqrt{3}}{2 \sqrt{\pi}} z " title="S_2 \left( x, y, z \right ) = \frac{\sqrt{3}}{2 \sqrt{\pi}} z " align="absmiddle" /><br />
<img src="http://blog.blackhc.net/wp-content/cache/tex_e62b566d079a3237f32e3e6a600d53f6.png" class="tex" alt="S_3 \left( x, y, z \right ) = - \frac{\sqrt{3}}{2 \sqrt{\pi}} x" title="S_3 \left( x, y, z \right ) = - \frac{\sqrt{3}}{2 \sqrt{\pi}} x" align="absmiddle" /></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;"><img src="http://blog.blackhc.net/wp-content/cache/tex_62efdb3cfc8367587aaa24daa5e54c20.png" class="tex" alt=" L = \sum_i s_i \, S_i \left( v \right ) " title=" L = \sum_i s_i \, S_i \left( v \right ) " align="absmiddle" /></p>
<p style="text-align: left;">Let&#8217;s assume we know the coefficients <img src="http://blog.blackhc.net/wp-content/cache/tex_1576a652d84c1978430a8247c5db798d.png" class="tex" alt=" s^z_0, s^z_1, ... " title=" s^z_0, s^z_1, ... " align="absmiddle" /> 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;"><img src="http://blog.blackhc.net/wp-content/cache/tex_a9d43578de309ca75a1ef416e635cb8e.png" class="tex" alt=" L = \sum_i s^z_i \, S_i \left( R_{n \to z} \, v \right ) " title=" L = \sum_i s^z_i \, S_i \left( R_{n \to z} \, v \right ) " align="absmiddle" /></p>
<p style="text-align: left;">where <img src="http://blog.blackhc.net/wp-content/cache/tex_72c05df713d9d70bd2c19005825c4654.png" class="tex" alt=" R_{n \to z} " title=" R_{n \to z} " align="absmiddle" /> is a rotation matrix that rotates n onto z.</p>
<p style="text-align: left;">The idea is to expand <img src="http://blog.blackhc.net/wp-content/cache/tex_9b51b7bfc7626af61c73fba376411b92.png" class="tex" alt=" S_i \left( R_{n \to z} \, v \right ) " title=" S_i \left( R_{n \to z} \, v \right ) " align="absmiddle" /> and rewrite it in terms of <img src="http://blog.blackhc.net/wp-content/cache/tex_9dca7e9f9901d704dbe0a9a640b1b9ef.png" class="tex" alt=" S_i \left ( v \right ) " title=" S_i \left ( v \right ) " align="absmiddle" />.</p>
<p style="text-align: left;">Before doing this, let&#8217;s first take a look at the coefficients of the clamped cosine lobe:</p>
<p style="text-align: left;"><img src="http://blog.blackhc.net/wp-content/cache/tex_d0a30d506fd071e950de9020a3682e3a.png" class="tex" alt="\begin{align*}<br />
s^z_0 &amp;=\frac{ \sqrt{ \pi } }{ 2 }<br />
s^z_1 &amp;= 0<br />
s^z_2 &amp;= \sqrt\frac{ \pi }{3}<br />
s^z_3 &amp;= 0<br />
\end{align*}" title="\begin{align*}<br />
s^z_0 &amp;=\frac{ \sqrt{ \pi } }{ 2 }<br />
s^z_1 &amp;= 0<br />
s^z_2 &amp;= \sqrt\frac{ \pi }{3}<br />
s^z_3 &amp;= 0<br />
\end{align*}" align="absmiddle" /></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&#8217;s look at the expanded version of this formula if <img src="http://blog.blackhc.net/wp-content/cache/tex_21d8857e73e37ea774391e045332b63b.png" class="tex" alt=" r_1^T " title=" r_1^T " align="absmiddle" />, <img src="http://blog.blackhc.net/wp-content/cache/tex_34bef2d01462b580813b1c032d44a5f0.png" class="tex" alt=" r_2^T " title=" r_2^T " align="absmiddle" />, <img src="http://blog.blackhc.net/wp-content/cache/tex_498bc755e068ea1e03c36b7fd60344bf.png" class="tex" alt=" r_3^T " title=" r_3^T " align="absmiddle" /> are the row vectors of the matrix,<br />
<img src="http://blog.blackhc.net/wp-content/cache/tex_4583ab901f451d50856a4a981a165831.png" class="tex" alt=" v=\bigl(\begin{smallmatrix}<br />
x\\<br />
y\\<br />
z<br />
\end{smallmatrix}\bigr)" title=" v=\bigl(\begin{smallmatrix}<br />
x\\<br />
y\\<br />
z<br />
\end{smallmatrix}\bigr)" align="absmiddle" /> and <img src="http://blog.blackhc.net/wp-content/cache/tex_901880b2e0e491395415af47612607db.png" class="tex" alt=" R_{n \to z}=\left(\begin{smallmatrix}<br />
r_1^T\\<br />
r_2^T\\<br />
r_3^T<br />
\end{smallmatrix}\right ) " title=" R_{n \to z}=\left(\begin{smallmatrix}<br />
r_1^T\\<br />
r_2^T\\<br />
r_3^T<br />
\end{smallmatrix}\right ) " align="absmiddle" />, then:</p>
<p style="text-align: left;"><img src="http://blog.blackhc.net/wp-content/cache/tex_fbcdef97093c88c3b7ea82fff66bca39.png" 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}<br />
r_1^T \, v\\<br />
r_2^T \, v\\<br />
r_3^T \, v\end{smallmatrix}\right ) \right ) " title=" 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}<br />
r_1^T \, v\\<br />
r_2^T \, v\\<br />
r_3^T \, v\end{smallmatrix}\right ) \right ) " align="absmiddle" /><br />
<img src="http://blog.blackhc.net/wp-content/cache/tex_7e039101c8e64ccaa0d41c9238db1a7e.png" class="tex" alt="\begin{align*} L &amp;= s^z_0 \, c_0\\<br />
&amp;+ s^z_1 \, (-c_1) \, r_2^T \, v \\<br />
&amp;+ s^z_2 \, c_1 \, r_3^T \, v\\<br />
&amp;+ s^z_3 \, (-c_1) \, r_1^T \, v<br />
\end{align*} " title="\begin{align*} L &amp;= s^z_0 \, c_0\\<br />
&amp;+ s^z_1 \, (-c_1) \, r_2^T \, v \\<br />
&amp;+ s^z_2 \, c_1 \, r_3^T \, v\\<br />
&amp;+ s^z_3 \, (-c_1) \, r_1^T \, v<br />
\end{align*} " align="absmiddle" /></p>
<p style="text-align: left;">Since <img src="http://blog.blackhc.net/wp-content/cache/tex_10080ca9d8790e9e105fe19a8207da6a.png" class="tex" alt=" s^z_1 = 0 " title=" s^z_1 = 0 " align="absmiddle" /> and <img src="http://blog.blackhc.net/wp-content/cache/tex_dfd368e9d908cd15e20b6b5c0f16ee95.png" class="tex" alt=" s^z_3 = 0 " title=" s^z_3 = 0 " align="absmiddle" />:</p>
<p style="text-align: left;"><img src="http://blog.blackhc.net/wp-content/cache/tex_db640f1bac2ea6839ae440f962a7d6e3.png" 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 " title=" 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 " align="absmiddle" /></p>
<p style="text-align: left;"><img src="http://blog.blackhc.net/wp-content/cache/tex_d15e0f20255d1a7e36b4ef82f507bd97.png" 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 ) " title="  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 ) " align="absmiddle" /></p>
<p style="text-align: left;">Now the question is: what is the third row of <img src="http://blog.blackhc.net/wp-content/cache/tex_72c05df713d9d70bd2c19005825c4654.png" class="tex" alt=" R_{n \to z} " title=" R_{n \to z} " align="absmiddle" />? If we look at the inverse matrix instead: <img src="http://blog.blackhc.net/wp-content/cache/tex_6888161c8e42f0612159bf67a6ec5d1f.png" class="tex" alt=" R_{z \to n} " title=" R_{z \to n} " align="absmiddle" />, we can immediately see that its third column has to be n, because <img src="http://blog.blackhc.net/wp-content/cache/tex_259796b5da66c3e792a6091a40d1209e.png" class="tex" alt=" R_{n \to z} \, \bigl(\begin{smallmatrix}<br />
0\\<br />
0\\<br />
1<br />
\end{smallmatrix}\bigr) = n " title=" R_{n \to z} \, \bigl(\begin{smallmatrix}<br />
0\\<br />
0\\<br />
1<br />
\end{smallmatrix}\bigr) = n " align="absmiddle" /> by construction. Since rotations are orthogonal matrices, the inverse is the same as the transposed, so we can deduce that the third row of <img src="http://blog.blackhc.net/wp-content/cache/tex_72c05df713d9d70bd2c19005825c4654.png" class="tex" alt=" R_{n \to z} " title=" R_{n \to z} " align="absmiddle" /> is the same as the third column of <img src="http://blog.blackhc.net/wp-content/cache/tex_6888161c8e42f0612159bf67a6ec5d1f.png" class="tex" alt=" R_{z \to n} " title=" R_{z \to n} " align="absmiddle" />,  that is: n. Thus with <img src="http://blog.blackhc.net/wp-content/cache/tex_6a99ace36b4a4fc64870cc780adac7e5.png" class="tex" alt=" n = \bigl(\begin{smallmatrix}<br />
n_x\\<br />
n_y\\<br />
n_z<br />
\end{smallmatrix}\bigr) " title=" n = \bigl(\begin{smallmatrix}<br />
n_x\\<br />
n_y\\<br />
n_z<br />
\end{smallmatrix}\bigr) " align="absmiddle" /> we get:</p>
<p style="text-align: left;"><img src="http://blog.blackhc.net/wp-content/cache/tex_2540af4a2b20386cc6a543882c27434b.png" 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 ) " title="  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 ) " align="absmiddle" /></p>
<p style="text-align: left;">So the SH coefficients of the clamped cosine lobe along n are:</p>
<p style="text-align: left;"><img src="http://blog.blackhc.net/wp-content/cache/tex_ca9023bfa87b1ef326758d6dd4c594d1.png" class="tex" alt="<br />
s^n_0 = s^z_0 = \frac{ \sqrt{ \pi } }{ 2 } \\<br />
s^n_1 = - s^z_2 \, n_y =  -\sqrt{ \frac{ \pi }{3} } \, n_y \\<br />
s^n_2 = s^z_2 \, n_z = \sqrt{\frac{ \pi }{3} } \, n_z \\<br />
s^n_1 = - s^z_2 \, n_x = - \sqrt{\frac{ \pi }{3}} \, n_x<br />
" title="<br />
s^n_0 = s^z_0 = \frac{ \sqrt{ \pi } }{ 2 } \\<br />
s^n_1 = - s^z_2 \, n_y =  -\sqrt{ \frac{ \pi }{3} } \, n_y \\<br />
s^n_2 = s^z_2 \, n_z = \sqrt{\frac{ \pi }{3} } \, n_z \\<br />
s^n_1 = - s^z_2 \, n_x = - \sqrt{\frac{ \pi }{3}} \, n_x<br />
" align="absmiddle" />
</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>0</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[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[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; <a href="http://blog.blackhc.net/2010/05/rigid-body-motion/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<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&#8217;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[It&#8217;s been a while since my last post and now it&#8217;s time for a mathematical post: I&#8217;m currently preparing for a math exam (calculus) and I&#8217;m thinking it would be nice if there was a way to avoid much of &#8230; <a href="http://blog.blackhc.net/2010/03/a-quick-note-on-quantifiers-for-almost-all-and-there-exist-infinitely-many/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since my last post and now it&#8217;s time for a mathematical post:</p>
<p>I&#8217;m currently preparing for a math exam (calculus) and I&#8217;m thinking it would be nice if there was a way to avoid much of the &#8220;for every <img src="http://blog.blackhc.net/wp-content/cache/tex_48cd3d9bc60a933438e6e151fcabafdf.png" class="tex" alt="\epsilon &gt; 0" title="\epsilon &gt; 0" align="absmiddle" /> there is an <img src="http://blog.blackhc.net/wp-content/cache/tex_c42a0e6c42f40626fb62587caa77429f.png" class="tex" alt="N \in \mathbb{N}" title="N \in \mathbb{N}" align="absmiddle" />, so that for all <img src="http://blog.blackhc.net/wp-content/cache/tex_bb453b8f91c47deeaf9bd5d7849872ec.png" class="tex" alt="n \ge N" title="n \ge N" align="absmiddle" /> some property &#8230; holds&#8221; stuff you find in textbooks. Some textbooks actually shorten it to &#8220;for every <img src="http://blog.blackhc.net/wp-content/cache/tex_48cd3d9bc60a933438e6e151fcabafdf.png" class="tex" alt="\epsilon &gt; 0" title="\epsilon &gt; 0" align="absmiddle" /> some property &#8230; holds for almost all <img src="http://blog.blackhc.net/wp-content/cache/tex_7b8b965ad4bca0e41ab51de7b31363a1.png" class="tex" alt="n" title="n" align="absmiddle" />&#8220;.<br />
However, I haven&#8217;t found a quantifier to express this anywhere yet, so I&#8217;m proposing to introduce a new one:</p>
<p><img src="http://blog.blackhc.net/wp-content/cache/tex_e3e9535b6be5e98db02a53b15c62f58a.png" class="tex" alt="\tilde{\forall} x \in M: P(x)" title="\tilde{\forall} x \in M: P(x)" align="absmiddle" /> should mean &#8220;for almost all <img src="http://blog.blackhc.net/wp-content/cache/tex_50f459b5ecb20bc2bdb8fefcef483b46.png" class="tex" alt="x \in M" title="x \in M" align="absmiddle" /> <img src="http://blog.blackhc.net/wp-content/cache/tex_c19f6b6a7bae1fd5b14f578c6edc3454.png" class="tex" alt="P(x)" title="P(x)" align="absmiddle" /> holds&#8221;, which suggests that there are only finitely many elements for which it does not hold.<br />
One can formalize this as:<br />
<img src="http://blog.blackhc.net/wp-content/cache/tex_bf28bf4fed82cc8f93b2eab6210c01f5.png" 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 " title="\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 " align="absmiddle" /> </p>
<p>Of course, a new existential quantifier is required then, too (for negation):<br />
<img src="http://blog.blackhc.net/wp-content/cache/tex_e54870464fe6cde68b61d27cef01da21.png" class="tex" alt="\tilde{\exists} x \in M: P(x)" title="\tilde{\exists} x \in M: P(x)" align="absmiddle" /> stands for &#8220;there exist infinitely many <img src="http://blog.blackhc.net/wp-content/cache/tex_50f459b5ecb20bc2bdb8fefcef483b46.png" class="tex" alt="x \in M" title="x \in M" align="absmiddle" />, for which <img src="http://blog.blackhc.net/wp-content/cache/tex_c19f6b6a7bae1fd5b14f578c6edc3454.png" class="tex" alt="P(x)" title="P(x)" align="absmiddle" /> holds&#8221;.<br />
And this can be formalized as:<br />
<img src="http://blog.blackhc.net/wp-content/cache/tex_9e0c734b4ab524a714517427dbbd828e.png" 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 | &gt; n " title="\tilde{\exists} x \in M: P(x) \equiv \forall n \in \mathbb{N}: \left | \left \{ x \in M \mid P(x) \right \} \right | &gt; n " align="absmiddle" /></p>
<p>It&#8217;s easy to see that <img src="http://blog.blackhc.net/wp-content/cache/tex_1fdd16569e37aaf00fc1921d617617fe.png" class="tex" alt="\neg \left ( \tilde{\forall} x \in M: P(x) \right ) \equiv \tilde{\exists} x \in M: \neg P(x) " title="\neg \left ( \tilde{\forall} x \in M: P(x) \right ) \equiv \tilde{\exists} x \in M: \neg P(x) " align="absmiddle" /></p>
<p>Thus one can use the two quantifiers just as one would use <img src="http://blog.blackhc.net/wp-content/cache/tex_8b141f94d4371ad99206ca92a896986d.png" class="tex" alt="\forall" title="\forall" align="absmiddle" /> and <img src="http://blog.blackhc.net/wp-content/cache/tex_32ff223f4b9214ce44a3f7cac5abe8bf.png" class="tex" alt="\exists" title="\exists" align="absmiddle" /> usually. Note however than <img src="http://blog.blackhc.net/wp-content/cache/tex_8b141f94d4371ad99206ca92a896986d.png" class="tex" alt="\forall" title="\forall" align="absmiddle" /> and <img src="http://blog.blackhc.net/wp-content/cache/tex_c4513a0476f5fcb3cf3544dfcc8f2bcd.png" class="tex" alt="\tilde{\forall}" title="\tilde{\forall}" align="absmiddle" /> don&#8217;t interchange and neither do  <img src="http://blog.blackhc.net/wp-content/cache/tex_32ff223f4b9214ce44a3f7cac5abe8bf.png" class="tex" alt="\exists" title="\exists" align="absmiddle" /> and <img src="http://blog.blackhc.net/wp-content/cache/tex_e8bba45759530463d99840a9e2c41410.png" class="tex" alt="\tilde{\exists}" title="\tilde{\exists}" align="absmiddle" />.</p>
<p>One last note: it might be worth using a different notation, for example: <img src="http://blog.blackhc.net/wp-content/cache/tex_209a97792dc00e30ae0a859394f13808.png" class="tex" alt="\exists ^ \infty" title="\exists ^ \infty" align="absmiddle" /> might be easier to understand than <img src="http://blog.blackhc.net/wp-content/cache/tex_c6d62924951d67e36e51e9fe9c40262b.png" class="tex" alt=" \tilde{\exists} " title=" \tilde{\exists} " align="absmiddle" />, and <img src="http://blog.blackhc.net/wp-content/cache/tex_a930248701d2dc2963faa7833ff935c0.png" class="tex" alt="\forall ^ \approx" title="\forall ^ \approx" align="absmiddle" /> might be better than <img src="http://blog.blackhc.net/wp-content/cache/tex_c4513a0476f5fcb3cf3544dfcc8f2bcd.png" class="tex" alt="\tilde{\forall}" title="\tilde{\forall}" align="absmiddle" />.</p>
<p>I&#8217;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[It&#8217;s been a while since the last update. Here&#8217;s a small update on what I&#8217;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; <a href="http://blog.blackhc.net/2009/11/random-things/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a while since the last update. Here&#8217;s a small update on what I&#8217;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&#8217;t knock off my chair (terrain popping and other ugliness), but multiplayer is loads of fun with friends. Physics isn&#8217;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&#8217;t watched it already, don&#8217;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&#8217;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 <img src="http://blog.blackhc.net/wp-content/cache/tex_3c6cf5781b9f871308dd7095e01ea46d.png" class="tex" alt=" S_n^p = 1^p + 2^p + ... + n^p " title=" S_n^p = 1^p + 2^p + ... + n^p " align="absmiddle" />, then the following equation by Pascal holds: <img src="http://blog.blackhc.net/wp-content/cache/tex_131195a6c7f4bab1fa5e8a69eddcbd9e.png" 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 " title=" (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 " align="absmiddle" /></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&#8217;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[I&#8217;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; <a href="http://blog.blackhc.net/2009/08/semi-conductor-optimization-uni-project/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;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&#8217;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 &#8211; 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&#8217;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&#8217;s I sat down and wrote a small Flash application to show the algorithms at work. It&#8217;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&#8217;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&#8217;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&#8217;s syntax is straight-forward and consistent, too. You can&#8217;t say that about the IDE (Flash CS4), which is braindead, but if you&#8217;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&#8217;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> 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[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&#8217;s not immediately clear what is meant, so let me clarify it. Let be a proposition that &#8230; <a href="http://blog.blackhc.net/2009/05/epsilon-induction/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<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&#8217;s not immediately clear what is meant, so let me clarify it.</p>
<p>Let <img src="http://blog.blackhc.net/wp-content/cache/tex_4eacabc4122cc8a49a2fa5ed6533d4f2.png" class="tex" alt="P(v)" title="P(v)" align="absmiddle" /> be a proposition that we want to show for all <img src="http://blog.blackhc.net/wp-content/cache/tex_4ef529b0768b2c7b11c5b4ebe8fa8235.png" class="tex" alt=" v \in \mathbb{R}^+_0 " title=" v \in \mathbb{R}^+_0 " align="absmiddle" />.</p>
<p>Then we can use the following &#8220;induction principle&#8221; to prove it:</p>
<p><img src="http://blog.blackhc.net/wp-content/cache/tex_4ed3fd9939368a7c657268ca45ac0740.png" class="tex" alt=" \exists \epsilon \in \mathbb{R}^+ " title=" \exists \epsilon \in \mathbb{R}^+ " align="absmiddle" /><br />
<img src="http://blog.blackhc.net/wp-content/cache/tex_1a825cfc56fc1a7864e366b23b69e765.png" class="tex" alt=" \text{a)} \forall u \in \left [0,\epsilon \right ]: P(u) " title=" \text{a)} \forall u \in \left [0,\epsilon \right ]: P(u) " align="absmiddle" /><br />
<img src="http://blog.blackhc.net/wp-content/cache/tex_a65634803ce24dfbf22492f22b45deaf.png" class="tex" alt=" \text{b)} \left( \forall u \in \left  [0, v - \epsilon \right ]: P(u) \right ) \Rightarrow P(v) " title=" \text{b)} \left( \forall u \in \left  [0, v - \epsilon \right ]: P(u) \right ) \Rightarrow P(v) " align="absmiddle" /><a class="annotation" title="v &gt;= \epsilon, of course" href="javascript:;"><strong>&#180;</strong></a></p>
<p>It&#8217;s easy to show that this is a correct way to prove it. I&#8217;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 <img src="http://blog.blackhc.net/wp-content/cache/tex_84e6fa6b8cd1ac2af066a2ddf9e78a75.png" class="tex" alt=" I_k := \left [k \cdot \frac \epsilon 2, (k+1) \cdot \frac \epsilon 2 \right ] " title=" I_k := \left [k \cdot \frac \epsilon 2, (k+1) \cdot \frac \epsilon 2 \right ] " align="absmiddle" />.<br />
Then let&#8217;s show by induction over <img src="http://blog.blackhc.net/wp-content/cache/tex_365c0b3ff8a6fa58b7ae709949b55608.png" class="tex" alt=" k " title=" k " align="absmiddle" /> that <img src="http://blog.blackhc.net/wp-content/cache/tex_518cc22ea3ef1899c68572484c0c48b0.png" class="tex" alt=" \text{(*)} \forall u \in I_k: P(u) " title=" \text{(*)} \forall u \in I_k: P(u) " align="absmiddle" />:</p>
<h4>Base:</h4>
<p>From a) it follows that (*) already holds for <img src="http://blog.blackhc.net/wp-content/cache/tex_7cb83b83e7602ed56ce440eaac109fdf.png" class="tex" alt="I_0" title="I_0" align="absmiddle" /> and <img src="http://blog.blackhc.net/wp-content/cache/tex_a3686747d7705aad1baeec00e8898bc5.png" class="tex" alt="I_1" title="I_1" align="absmiddle" />.</p>
<h4>Induction Step (<img src="http://blog.blackhc.net/wp-content/cache/tex_f5245254702353112f2d9ffbee011db4.png" class="tex" alt=" k \ge 2 " title=" k \ge 2 " align="absmiddle" />):</h4>
<p>If (*) holds for <img src="http://blog.blackhc.net/wp-content/cache/tex_7a7b56e8ee881a5318d5d7a75e59d282.png" class="tex" alt=" I_0, ..., I_{k-1}" title=" I_0, ..., I_{k-1}" align="absmiddle" />, then it obviously holds for all <img src="http://blog.blackhc.net/wp-content/cache/tex_d256d887527157f45b3d141b2ced027b.png" class="tex" alt=" u \in \left [ 0, k \cdot \frac \epsilon 2 \right ]" title=" u \in \left [ 0, k \cdot \frac \epsilon 2 \right ]" align="absmiddle" />.</p>
<p>Fix <img src="http://blog.blackhc.net/wp-content/cache/tex_227476f15d4238bed0fe7c364e5bbca2.png" class="tex" alt=" v \in I_k " title=" v \in I_k " align="absmiddle" />, then <img src="http://blog.blackhc.net/wp-content/cache/tex_71d75d91cec3e4f2b6ed6a2693130b22.png" class="tex" alt=" v \le (k+1) \cdot \frac \epsilon 2 \Leftrightarrow v - \epsilon \le (k-2) \cdot \frac \epsilon 2 &lt; k \cdot \frac \epsilon 2 \right " title=" v \le (k+1) \cdot \frac \epsilon 2 \Leftrightarrow v - \epsilon \le (k-2) \cdot \frac \epsilon 2 &lt; k \cdot \frac \epsilon 2 \right " align="absmiddle" />. With b) it follows that <img src="http://blog.blackhc.net/wp-content/cache/tex_4eacabc4122cc8a49a2fa5ed6533d4f2.png" class="tex" alt="P(v)" title="P(v)" align="absmiddle" /> holds.</p>
<p>That is, <img src="http://blog.blackhc.net/wp-content/cache/tex_c14cb9bed6f0ffa8ca787629c3fe2b5b.png" class="tex" alt=" P(v) " title=" P(v) " align="absmiddle" />  <img src="http://blog.blackhc.net/wp-content/cache/tex_996ff7a19947411ae3c5edbda90f577b.png" class="tex" alt=" \forall v \in I_k " title=" \forall v \in I_k " align="absmiddle" />.</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><img src="http://blog.blackhc.net/wp-content/cache/tex_4ed3fd9939368a7c657268ca45ac0740.png" class="tex" alt=" \exists \epsilon \in \mathbb{R}^+ " title=" \exists \epsilon \in \mathbb{R}^+ " align="absmiddle" /><br />
<img src="http://blog.blackhc.net/wp-content/cache/tex_1a825cfc56fc1a7864e366b23b69e765.png" class="tex" alt=" \text{a)} \forall u \in \left [0,\epsilon \right ]: P(u) " title=" \text{a)} \forall u \in \left [0,\epsilon \right ]: P(u) " align="absmiddle" /><br />
<img src="http://blog.blackhc.net/wp-content/cache/tex_3c96543a0d89a0091bd7b80fe5d6e966.png" class="tex" alt=" \text{b)} \left( \forall u \in \left  [\psi(v), \phi( v ) \right ]: P(u) \right ) \Rightarrow P(v) " title=" \text{b)} \left( \forall u \in \left  [\psi(v), \phi( v ) \right ]: P(u) \right ) \Rightarrow P(v) " align="absmiddle" /><br />
with <img src="http://blog.blackhc.net/wp-content/cache/tex_be10e2511e1a0130bcc40c7048f87acc.png" class="tex" alt=" \phi( v ):  \mathbb{R}^+ \to \mathbb{R}^+_0 " title=" \phi( v ):  \mathbb{R}^+ \to \mathbb{R}^+_0 " align="absmiddle" />, <img src="http://blog.blackhc.net/wp-content/cache/tex_060d256854c741b2daec620750967d14.png" class="tex" alt=" \psi( v ): \mathbb{R}^+ \to \mathbb{R}^+_0 " title=" \psi( v ): \mathbb{R}^+ \to \mathbb{R}^+_0 " align="absmiddle" /> and <img src="http://blog.blackhc.net/wp-content/cache/tex_3eb13bc100d238b0e91c6e29d679e7a2.png" class="tex" alt=" \psi(v) \le \phi(v) &lt; v " title=" \psi(v) \le \phi(v) &lt; v " align="absmiddle" />.</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[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; <a href="http://blog.blackhc.net/2009/05/analysis-cauchy-schwarz-and-reciprocal-sums/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<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&#8217;t claim that my solutions are correct and there are probably quite a few (uncorrected) mistakes, but right now I haven&#8217;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 &#8220;Analysis for Computer Scientists&#8221; 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><img src="http://blog.blackhc.net/wp-content/cache/tex_31612daa4359da0ed0b6cf851f207676.png" class="tex" alt=" &lt;a,b&gt; \leq ||a|| \cdot ||b|| " title=" &lt;a,b&gt; \leq ||a|| \cdot ||b|| " align="absmiddle" /> with <img src="http://blog.blackhc.net/wp-content/cache/tex_3cfcfe14f5ba6f287bccf25020771b66.png" class="tex" alt=" &lt;a,b&gt; = || a || \cdot || b || " title=" &lt;a,b&gt; = || a || \cdot || b || " align="absmiddle" /> when <img src="http://blog.blackhc.net/wp-content/cache/tex_63c3f5e5399274efb59cb25a58775df0.png" class="tex" alt=" \exists \lambda: a = \lambda b " title=" \exists \lambda: a = \lambda b " align="absmiddle" /></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&#8217;s take a look at this problem:</p>
<p>We have <img src="http://blog.blackhc.net/wp-content/cache/tex_83e67c9b7f91c75719599084d74faec4.png" class="tex" alt=" x \in \mathbb{R}^n, 0 &lt; x, \sum_{i=1}^n {x_i} = 1 " title=" x \in \mathbb{R}^n, 0 &lt; x, \sum_{i=1}^n {x_i} = 1 " align="absmiddle" /> and want to minimize <img src="http://blog.blackhc.net/wp-content/cache/tex_e6f7306e2a5b1dc4d09e2fd31e627f99.png" class="tex" alt=" \sum_{i=1}^n { \frac 1 x } " title=" \sum_{i=1}^n { \frac 1 x } " align="absmiddle" />.<br />
We simply set <img src="http://blog.blackhc.net/wp-content/cache/tex_c15476905129abebc744f6038ed162fc.png" class="tex" alt=" a_i := \sqrt{x_i}, b_i := \sqrt{ \frac 1 x_i } " title=" a_i := \sqrt{x_i}, b_i := \sqrt{ \frac 1 x_i } " align="absmiddle" />.</p>
<p>Then we get:</p>
<p><img src="http://blog.blackhc.net/wp-content/cache/tex_8adffed432ecc82ed7d60f6bc904a117.png" 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  " title=" \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  " align="absmiddle" /><br />
<img src="http://blog.blackhc.net/wp-content/cache/tex_ca4b513bda511ba9b57c85f915803ca2.png" 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 } " title=" \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 } " align="absmiddle" /></p>
<p>That is: <img src="http://blog.blackhc.net/wp-content/cache/tex_1e26df891c906620d1aae65d87ae8b51.png" class="tex" alt=" \sum_{i=1}^n \frac 1 x_i \geq n^2 " title=" \sum_{i=1}^n \frac 1 x_i \geq n^2 " align="absmiddle" />.</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><img src="http://blog.blackhc.net/wp-content/cache/tex_22e9de6955f13db68efcfc426d8fb653.png" class="tex" alt=" a = \lamda b \Leftrightarrow \sqrt x_i = \lambda \frac 1 \x_i \Leftrightarrow x_i = \lambda " title=" a = \lamda b \Leftrightarrow \sqrt x_i = \lambda \frac 1 \x_i \Leftrightarrow x_i = \lambda " align="absmiddle" /></p>
<p>We use that with the constraint: <img src="http://blog.blackhc.net/wp-content/cache/tex_1232946f791b2dc637f0a31c92321606.png" class="tex" alt=" 1 = \sum_{i=1}^n x_i = \sum_{i=1}^n \lambda = n \cdot \lambda " title=" 1 = \sum_{i=1}^n x_i = \sum_{i=1}^n \lambda = n \cdot \lambda " align="absmiddle" />,<br />
resulting in: <img src="http://blog.blackhc.net/wp-content/cache/tex_9251efffc23bb66856a1a7afc2d814e0.png" class="tex" alt=" x_i = \lambda = \frac 1 n " title=" x_i = \lambda = \frac 1 n " align="absmiddle" />.</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><img src="http://blog.blackhc.net/wp-content/cache/tex_71bad5c55344abc07d70545214404e98.png" class="tex" alt=" x,q \in \mathbb{R}^n; 0 &lt; x, q" title=" x,q \in \mathbb{R}^n; 0 &lt; x, q" align="absmiddle" /><br />
<img src="http://blog.blackhc.net/wp-content/cache/tex_0715a3f97cc8d261df2d419bb68a1c85.png" class="tex" alt="0 &lt; \alpha, \gamma &lt; \infty; \beta &gt; 0 " title="0 &lt; \alpha, \gamma &lt; \infty; \beta &gt; 0 " align="absmiddle" /><br />
<img src="http://blog.blackhc.net/wp-content/cache/tex_b87dc05d1e0996cc260c737f3efc7e9e.png" class="tex" alt="\large\sum_{i=1}^n {x_i}^\gamma = \beta " title="\large\sum_{i=1}^n {x_i}^\gamma = \beta " align="absmiddle" /><br />
<img src="http://blog.blackhc.net/wp-content/cache/tex_c6ead4e09d7480dc9759d5ee92a5fc41.png" class="tex" alt="\large min \sum_{i=1}^n \frac {q_i} {x_i^\alpha} " title="\large min \sum_{i=1}^n \frac {q_i} {x_i^\alpha} " align="absmiddle" /></p>
<p>by utilizing</p>
<p><img src="http://blog.blackhc.net/wp-content/cache/tex_c5bf315f2db25666d67e68a697435e39.png" 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'} " title="\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'} " align="absmiddle" /> with <img src="http://blog.blackhc.net/wp-content/cache/tex_0d6a186e22f39cb87eec1fb532862d79.png" class="tex" alt=" \frac 1 p + \frac 1 {p'} = 1 " title=" \frac 1 p + \frac 1 {p'} = 1 " align="absmiddle" /></p>
<p>Equality requires the same linear dependence condition as the normal Cauchy-Schwarz inequation.</p>
<p>I&#8217;ve only deduced the solution for <img src="http://blog.blackhc.net/wp-content/cache/tex_56620f44b066c09c401fc1b74d4224d0.png" class="tex" alt=" \gamma = 1 " title=" \gamma = 1 " align="absmiddle" /> but it shouldn&#8217;t be difficult to adapt it once you get the idea how it works (it&#8217;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">&#8220;Minimum of a Generalized Reciprocal Sum&#8221;</a>.</p>
<p>For completeness&#8217; sake here are the results for an optimal solution <img src="http://blog.blackhc.net/wp-content/cache/tex_5fdd64df7a44ea702e2133f5cab2e491.png" class="tex" alt=" x^{*} " title=" x^{*} " align="absmiddle" />:</p>
<p><img src="http://blog.blackhc.net/wp-content/cache/tex_9e880f7f51811d4b691e19c4ea98bd25.png" class="tex" alt="\large x_i^{*} = \beta \cdot \frac { \sqrt[1 + \alpha]{q_i} }{\sum_{k=1}^n \sqrt[1 + \alpha]{q_k}} " title="\large x_i^{*} = \beta \cdot \frac { \sqrt[1 + \alpha]{q_i} }{\sum_{k=1}^n \sqrt[1 + \alpha]{q_k}} " align="absmiddle" /></p>
<p><img src="http://blog.blackhc.net/wp-content/cache/tex_7093cf869d21174715207b13a02a3d8c.png" 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}" title="\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}" align="absmiddle" /></p>
<h4>Epilog</h4>
<p>Coming up with the solution was actually a lot of fun and quite interesting because I didn&#8217;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&#8217;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 <img src="http://blog.blackhc.net/wp-content/cache/tex_d5a7d2957d1777c35f7903224ab637ff.png" class="tex" alt=" x ^ {*} " title=" x ^ {*} " align="absmiddle" />, you can shortcut everything by immediately skipping to the equality case once <img src="http://blog.blackhc.net/wp-content/cache/tex_74d37d601e20578216a4981034dde4bc.png" class="tex" alt=" p " title=" p " align="absmiddle" /> and <img src="http://blog.blackhc.net/wp-content/cache/tex_d964473f93bc137b2fee290e633ae9e7.png" class="tex" alt=" p' " title=" p' " align="absmiddle" /> 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&#8217;t for my Analysis lecture last term, I probably wouldn&#8217;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[Everybody (I hope) knows about the pigeonhole principle. In short it states that: If and , then there exists at least one with . For example, if we have n + 1 pigeons in only n pigeonholes, there is (at &#8230; <a href="http://blog.blackhc.net/2009/05/the-reverse-pigeonhole-principle/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Everybody (I hope) knows about the pigeonhole principle.</p>
<p>In short it states that:</p>
<p style="padding-left: 30px;">If <img src="http://blog.blackhc.net/wp-content/cache/tex_06dd343dc0737dfde00a7d6bf5fe2920.png" class="tex" alt=" f: N \to M " title=" f: N \to M " align="absmiddle" /> and <img src="http://blog.blackhc.net/wp-content/cache/tex_eec64c20a2bec155b2c2c7f1471ba191.png" class="tex" alt=" n:= \left | N \right | \leq \left | M \right | =: m " title=" n:= \left | N \right | \leq \left | M \right | =: m " align="absmiddle" />, then there exists at least one <img src="http://blog.blackhc.net/wp-content/cache/tex_fcb572d9cbda8688d3e3e8d14330cae9.png" class="tex" alt=" m_0 " title=" m_0 " align="absmiddle" /> with <img src="http://blog.blackhc.net/wp-content/cache/tex_f6d2fb7c93475055a53f56b047d49eca.png" class="tex" alt=" \left | f^{-1}\left ( m_0 \right ) \right | \geq \left \lceil \frac {n} {m} \right \rceil  " title=" \left | f^{-1}\left ( m_0 \right ) \right | \geq \left \lceil \frac {n} {m} \right \rceil  " align="absmiddle" />.</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&#8217;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 <img src="http://blog.blackhc.net/wp-content/cache/tex_06dd343dc0737dfde00a7d6bf5fe2920.png" class="tex" alt=" f: N \to M " title=" f: N \to M " align="absmiddle" /> and <img src="http://blog.blackhc.net/wp-content/cache/tex_e35c4cba5772ead0b749040e3454163c.png" class="tex" alt=" n  := \left | N \right | \leq \left | M \right |  =: m " title=" n  := \left | N \right | \leq \left | M \right |  =: m " align="absmiddle" />, then there exists at least one <img src="http://blog.blackhc.net/wp-content/cache/tex_a16ddb0a3716218e8de4f2bb98dadfb5.png" class="tex" alt=" m_0 \in M " title=" m_0 \in M " align="absmiddle" /> with <img src="http://blog.blackhc.net/wp-content/cache/tex_a3ebb27fd34aa9756af7c123ec3d2023.png" class="tex" alt=" \left | f^{-1}\left ( m_0 \right ) \right | \leq \left \lfloor \frac {n} {m} \right \rfloor " title=" \left | f^{-1}\left ( m_0 \right ) \right | \leq \left \lfloor \frac {n} {m} \right \rfloor " align="absmiddle" />.</p>
<p>Again an example: if we have n + 1 pigeons (it&#8217;s valid up to 2n &#8211; 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 <img src="http://blog.blackhc.net/wp-content/cache/tex_a16ddb0a3716218e8de4f2bb98dadfb5.png" class="tex" alt=" m_0 \in M " title=" m_0 \in M " align="absmiddle" />: <img src="http://blog.blackhc.net/wp-content/cache/tex_b164d0a82238f470944ba4cf800dcd26.png" class="tex" alt=" \left | f^{-1}\left ( m_0 \right ) \right | &gt; \left \lfloor \frac {n} {m} \right \rfloor" title=" \left | f^{-1}\left ( m_0 \right ) \right | &gt; \left \lfloor \frac {n} {m} \right \rfloor" align="absmiddle" />, that is each such set contains at least  <img src="http://blog.blackhc.net/wp-content/cache/tex_3f08e28402a695abfd8fb26b63754706.png" class="tex" alt=" \left \lfloor \frac {n} {m} \right \rfloor + 1 " title=" \left \lfloor \frac {n} {m} \right \rfloor + 1 " align="absmiddle" /> elements, then from  <img src="http://blog.blackhc.net/wp-content/cache/tex_35acf827c8029cf01e4c59f924be9537.png" class="tex" alt="  \frac n m - 1 &lt; \left \lfloor \frac {n} {m} \right \rfloor " title="  \frac n m - 1 &lt; \left \lfloor \frac {n} {m} \right \rfloor " align="absmiddle" /> it follows that:</p>
<p style="padding-left: 30px;"><img src="http://blog.blackhc.net/wp-content/cache/tex_d643f88d0f40dfe9bc10a5db671aa7bc.png" 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 ) &gt; m \cdot \frac n m = n  } " title=" 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 ) &gt; m \cdot \frac n m = n  } " align="absmiddle" />.</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&#8217;t seen this written down anywhere before and it&#8217;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&#8217;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 &#8221; 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>
		<item>
		<title>Seminar about Motion Retargeting</title>
		<link>http://blog.blackhc.net/2009/01/seminar-about-motion-retargeting/</link>
		<comments>http://blog.blackhc.net/2009/01/seminar-about-motion-retargeting/#comments</comments>
		<pubDate>Fri, 30 Jan 2009 23:32:20 +0000</pubDate>
		<dc:creator>BlackHC</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Maths]]></category>
		<category><![CDATA[University]]></category>
		<category><![CDATA[CCD]]></category>
		<category><![CDATA[Inverse Kinematics]]></category>
		<category><![CDATA[Macros]]></category>
		<category><![CDATA[Motion Retargeting]]></category>
		<category><![CDATA[Particle IK]]></category>
		<category><![CDATA[PowerPoint]]></category>
		<category><![CDATA[Spore]]></category>
		<category><![CDATA[VBA]]></category>

		<guid isPermaLink="false">http://blog.blackhc.net/?p=290</guid>
		<description><![CDATA[Two weeks ago I had to give a presentation about Motion Retargeting, which I want to share with you now. I created it due to me attending a seminar about the latest developments in Computer Graphics at university and my &#8230; <a href="http://blog.blackhc.net/2009/01/seminar-about-motion-retargeting/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.blackhc.net/wp-content/uploads/2009/01/creatureanimationwb.gif"><img class="alignright size-full wp-image-300" title="creatureanimationwb" src="http://blog.blackhc.net/wp-content/uploads/2009/01/creatureanimationwb.gif" alt="creatureanimationwb" width="147" height="110" /></a>Two weeks ago I had to give a presentation about Motion Retargeting, which I want to share with you now.<br />
I created it due to me attending a seminar about the latest developments in Computer Graphics at university and my presentation was about the Siggraph &#8217;08 paper &#8220;<a href="http://www.chrishecker.com/images/c/cb/Sporeanim-siggraph08.pdf" target="_blank">Real-time Motion Retargeting to Highly Varied User-Created Morphologies</a>&#8221; from Chris Hecker et al.<br />
You can check it out on <a href="http://www.chrishecker.com/Real-time_Motion_Retargeting_to_Highly_Varied_User-Created_Morphologies" target="_blank">Chris Hecker&#8217;s homepage</a> &#8211; his website also contains a bunch of other really cool articles and presentations from various conferences, so it certainly is worth taking a look at it.</p>
<p>I&#8217;ve also sifted through quite a lot of IK papers and lectures for my presentation to understand the later part about the IK solver in Spore and I&#8217;ve found a few links that are a nice read:</p>
<ul>
<li><a href="http://www.chrishecker.com/Inverse_Kinematics" target="_blank">Chris Hecker&#8217;s talk</a> about IK is a nice introduction (you also get an audiostream which is nice, too).</li>
<li><a href="http://ir.lib.sfu.ca/handle/1892/7119" target="_blank">Chris Welman&#8217;s Master Thesis</a> is nice for reading about some of the common methods to solve IK problems.</li>
<li><a href="http://graphics.ucsd.edu/courses/cse169_w05/index.html" target="_blank">Steve Rotenberg&#8217;s Computer Animation</a> course is awesome &#8211; the slides about IK are nice, but the ones about locomotion are just awesome<a class="annotation" title="they really really are!" href="javascript:;"><strong>&#180;</strong></a>!</li>
<li>Particle IK and particle physics in games are related a lot (the constraint solver is pretty much the same) and for a nice read I can recommend <span lang="EN-US"><a href="http://www.teknikus.dk/tj/gdc2001.htm" target="_blank">Thomas Jakobsen&#8217;s Advanced Character Physics</a>.</span></li>
<li><span lang="EN-US"><a href="http://www.pixar.com/companyinfo/research/pbm2001/" target="_blank">Pixar&#8217;s Physically Based Modelling</a> course from 2001 is also nice to get going with physics again &#8211; it also explains everything you need to understand the idea behind ODE solvers in rigid body simulations  and also has a very nice explanation of stiffness in ODEs.</span></li>
<li><span lang="EN-US"><a href="http://books.google.com/books?id=2anZacrFaxoC&amp;printsec=frontcover" target="_blank">Principles of Animal Locomotion</a> is a very neat book that is about, well, the principles of animal locomotion, which I have read a bit thanks to Google books and it certainly is quite interesting.</span></li>
<li><span lang="EN-US"><a href="http://www.robotom.de/robi.htm" target="_blank">Numerical Robot Kinematics Based on Stochastic and Molecular Simulation Methods</a> is interesting, too, just to see what&#8217;s possible with particle IK</span></li>
</ul>
<p>Ive created a huge PowerPoint presentation for my seminar  <img src='http://blog.blackhc.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  It includes a few videos (thanks again to Chris Hecker for uploading them and replying to my emails incredibly fast <a class="annotation" title="he replied to each and every one of them within 20 minutes, which is crazy fast, if you're used to university communication ;-)" href="javascript:;"><strong>&#180;</strong></a>) and two <strong>awesome</strong> IK solvers that I&#8217;ve implemented with VBA macros<a class="annotation" title="VBA is horrible BTW" href="javascript:;"><strong>&#180;</strong></a> to show how CCD and Particle IK solvers work.</p>
<p>You can find a zip with all the videos and high resolution images <a href="http://blog.blackhc.net/wp-content/uploads/2009/01/MotionRetargeting.zip">here </a>(includes both a PPT 2003 file and a 2007 file). I&#8217;ve also uploaded a small version without videos, macros as PPT 2003 file <a href="http://blog.blackhc.net/wp-content/uploads/2009/01/motionretargetingcompat.ppt">here</a>, if you don&#8217;t feel like downloading the 23 MB .zip file.</p>
<p>Here&#8217;s a YouTube video of the two IK solvers:</p>
<a href="http://blog.blackhc.net/2009/01/seminar-about-motion-retargeting/"><p><em>Click here to view the embedded video.</em></p></a>
<div class="expandable"><a class="expandable_link" href="javascript:blackhc_replacements_togglediv('blackhc_expandable_1');">Click to expand &#187;</a>
<div class="expandable_text" name="blackhc_expandable_1" id="blackhc_expandable_1" style="display:none">The CCD solver usually works by solving one bone per inner iteration &#8211; I only added a max delta angle to create smooth animations (same for the max delta length in the Particle IK solver).</p>
<p>It seems as if the CCD solver could converge faster if it randomly chose the first joint instead of starting with the end effector joint in every outer iteration.</p></div>
<p></div>
<p>I&#8217;ve exported the code into an additional IK Playground presentation which contains just one slide and the two IK solvers with the setup you see in the video above. You can find the PPT 2003 version of it <a href="http://blog.blackhc.net/wp-content/uploads/2009/01/ikplayground.ppt">here</a> and the 2007 one <a href="http://blog.blackhc.net/wp-content/uploads/2009/01/ikplayground.pptm">here</a>.</p>
<p>I&#8217;ve zipped up the macros <a href="http://blog.blackhc.net/wp-content/uploads/2009/01/mr-pptmacros.zip">here</a> if you want to use them in your own slides. I&#8217;ve also written a handy VBA form that allows one to edit everything more easily (the macros are hardly documented though, but if anyone really wants to use them and runs into problems &#8211; you can always drop me a line or two in a comment <img src='http://blog.blackhc.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )</p>
<p style="text-align: center;">
<div id="attachment_302" class="wp-caption aligncenter" style="width: 501px"><a href="http://blog.blackhc.net/wp-content/uploads/2009/01/iksolvertool1.jpg"><img class="size-large wp-image-302" title="iksolvertool1" src="http://blog.blackhc.net/wp-content/uploads/2009/01/iksolvertool1-1024x622.jpg" alt="The IK Solver Tool Form" width="491" height="298" /></a><p class="wp-caption-text">The IK Solver Tool Form</p></div>
<p>BTW I&#8217;m not sure you know about it<a class="annotation" title="I only learned of it by chance" href="javascript:;"><strong>&#180;</strong></a>, but <a href="http://www.blender.org/">Blender</a> contains an awesome video editor &#8211; the UI needs some time to get used to, but the online documentation has improved a lot and with it, it works like a charm. Blender also supports some <a href="http://wiki.blender.org/index.php/Manual/Sequence_Plugins">pretty professional filters</a>, so it&#8217;s going to be my video editing tool of choice from now on.</p>
<p>Cheers,<br />
Andreas</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.blackhc.net/2009/01/seminar-about-motion-retargeting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
