tag:blogger.com,1999:blog-41292035629097872142024-03-13T11:26:35.612+01:00Marco and Andrea's AlgorithmsAnonymoushttp://www.blogger.com/profile/16324713419112790490noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-4129203562909787214.post-78649421742193566422012-05-05T12:43:00.000+02:002012-05-05T13:23:36.599+02:00<h2>
<span style="font-size: x-large;">
Conventions</span></h2>
<br />
The first post will probably be a bit boring but this is a step we need to go through in order to understand each other later.<br />
Here, we just want to list all (or at least most) of the conventions we are going to use in our blog.<br />
<br />
<h3>
Greek letters</h3>
<div>
Greek letters are used as constants or angles. For example $\pi$ is the constant 3.14159....<br />
<br /></div>
<div>
<h3>
Functions </h3>
</div>
<div>
Functions are identified by Latin letters like $f$ or $g$ and the variable is always seen in the definition. For example $f(x)$ is a function depending on $x$.</div>
<div>
If we want to describe a recursive function we put an index below the function name.<br />
$$g_i(x) = g_{i-1}(x) + 2x^2$$<br />
<br /></div>
<h3>
Vectors and Matrix</h3>
<div>
Vectors are identified by bold Latin letters with a bar above them and Matrix are just bold capital letters</div>
<div>
$${\bf A \bar{x}}= {\bf \bar{y}}$$</div>
<div>
To indicate a component of a vector we put an index below the vector name and we do not put the bar above<br />
$${\bf \bar{v}} = ({\bf v}_1, {\bf v}_2)$$<br />
<h3>
Sets</h3>
Sets are identified by big Latin letters $A$ or $B$. A definition of a set is done using $\{$ and $\}$ for example:<br />
$$ A = \{a, e, o ,i , u\}, \, B = \{a, b, c ,d , e\}, \, C = \{a, c, e\}, \, D = \{a, e\}, \, E = \{a, b, c, d, e, o ,i , u\}$$<br />
Element membership is expressed as $a \in A$ and not membership $b \notin A$<br />
The usual operation are defined between sets<br />
<ul>
<li>Equal $\equiv$ and not equal $\not\equiv$</li>
<br />
$$A \equiv A, \, A \not\equiv B$$<br />
<li>Inclusion $\subset$ or $\supset$ and its negation $\not\subset$ or $\not\supset$.</li>
</ul>
$$C \subset B, \, B \supset C, \, C \not\subset A, \, A \not\supset B$$<br />
<br />
<ul>
<li>Intersection $\cap$ and union $\cup$</li>
</ul>
$$A \cap B \equiv D, \, A \cup B \equiv E$$<br />
<ul></ul>
<h3>
Binary Operators (<span style="background-color: white;">Bit-wise operators</span>)</h3>
<div>
<ul>
<li>LEFT SHIFT $\ll$</li>
<li>RIGHT SHIFT $\gg$</li>
<li>AND $\&$</li>
<li>OR $|$</li>
<li>XOR $\otimes$</li>
<li>MOD $\%$</li>
</ul>
<ul>
</ul>
</div>
<div>
<br />
<h3>
Other Symbols</h3>
<div>
$\sum{}$ is used to indicate a repeated sum over indexes. For example</div>
<div>
$$\sum_{i=0}^n g_i$$</div>
<div>
is the sum of all $g$ with index between $0$ and $n$.</div>
<div>
The same is for the symbol $\prod$ where the product is used instead of the sum,</div>
<div>
$\lceil a \rceil$ is to indicate the upper value of a and $\lfloor a \rfloor$ the lower value.</div>
<div>
$\log$ is always the $\log_2$ of a number.</div>
<div>
$\approx$ means almost equals to.</div>
<div>
$\partial$ is a derivative and $\int$ is an integral<br />
<br /></div>
</div>
<h3>
Order of growth</h3>
We indicate the order of growth with a big $O$ and the parameter in the brackets. For example<br />
$$O(n)$$<br />
is the sign of a linear growth.<br />
The order of growth is an indication of the efficiency of the algorithm. If an algorithm is $O(n)$ is called linear and it completes in a number of operation proportional to the size of the problem $n$. If we have an algorithm that is $O(n^2)$ it will complete in a number of operation proportional to the squared of the size of the problem.<br />
<br />
<h3>
"Pseudo" code</h3>
There won't be any "Pseudo code" we will use C/C++ code. We think that C/C++ can be clear enough for our purpose.<br />
<br />
<br />
<br />
<br />
<br /></div>
<div>
<br /></div>
<div>
</div>
<br />
<br />Anonymoushttp://www.blogger.com/profile/16324713419112790490noreply@blogger.com0