<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Ask Ghassem - Recent questions tagged ga</title>
<link>https://ask.ghassem.com/tag/ga</link>
<description>Powered by Question2Answer</description>
<item>
<title>How to use Genetic Algorithm to optimize a function?</title>
<link>https://ask.ghassem.com/1010/how-to-use-genetic-algorithm-to-optimize-a-function</link>
<description>&lt;p&gt;Assume the function is defined as $f(x,y)=x^2+y^2-4xy$, and $1\leq x \leq 4,1\leq y \leq 4$. &amp;nbsp;The Genetic Algorithm is selected&amp;nbsp;to maximize the function. If the first population for pairs of $(x,y)$&amp;nbsp;is defined as $S=\{A=(1,2), B=(2,1), C=(2,2), D=(2,3), E=(3,1) \}$.&amp;nbsp;&amp;nbsp;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;a) &lt;/strong&gt;Calculate the fitness of each of individuals (A,B,C,D,E) in population if:&amp;nbsp; &amp;nbsp;$\text{fitness function}=f(x,y)$&amp;nbsp;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;b)&lt;/strong&gt; Calculate the probability of each individual&amp;nbsp;and sort them in descending order. Which individual has the maximum fitness (probability)? $p_{i}=\frac{f_{i}}{\sum_{j=1}^{N} f_{j}}$&lt;br&gt;
&lt;strong&gt;c) &lt;/strong&gt;Draw&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;the roulette wheel and calculate&amp;nbsp;the boundaries for each individual&lt;br&gt;
&lt;strong&gt;d) &lt;/strong&gt;If we use two individuals and their arithmetic mean for crossover each time,&amp;nbsp;and for mutation, we add 0.1 to x and subtract 0.1 from y for each individual created after crossover, what will be the next population with five members?&lt;br&gt;
For part (d), use the following random numbers in order whenever you need them in the selection process:&lt;br&gt;
$\text{random numbers} =&amp;nbsp; \{0.780,0.220,0.776,0.507,0.822,0.765,0.288,0.881,0.895,0.421\}$&lt;br&gt;
&amp;nbsp;&lt;/p&gt;</description>
<category>Artificial Intelligence</category>
<guid isPermaLink="true">https://ask.ghassem.com/1010/how-to-use-genetic-algorithm-to-optimize-a-function</guid>
<pubDate>Tue, 07 Dec 2021 23:53:51 +0000</pubDate>
</item>
</channel>
</rss>