# 2015F001/Homework 10

## 1. Area estimation

Using Matlab to estimate the percentage of the area of the white shape in the box. You need to complete the matlab code provided below to obtain the image matrix.

In matlab, the follow code can be used to obtain a matrix (denoted as X) to represent the picture.

clear all; clc;
[X, map] = rgb2ind(M, 2); % the image matrix contains two colors only.
image(X);
colormap(map)
colorbar
[m, n] =size(X); % m and n correspond to the size of the image matrix.


## 2. Integration

Given two mathematical functions $f(x) = 1/x * e^{-(\ln(x) -1)^2}$ and g(x) = sin2(x) − 0.5, calculate the area between the two curves from x=1.4 to x = 6.6 as shown in the following figure.

## 3. Calculation of PI

4. Area of an Ellipse. Suppose that we have an ellipse with major axis length 2a and minor axis length 2b. Without changing the answer to the problem, suppose that the major axis is on the x-axis. How do we find the area of the ellipse? (assuming a = 2 and b = 1; or any other values you want to use.) Recall that the equation of an ellipse like the one picture above is given by: x2 / a2 + y2 / b2 = 1

## 4. Population Eqn.

Consider the following model of population

Every year, population increases a value of 10% of the population in the previous year. However, if the predicted population is over 100, a disease outbreak instantly kills 80% of this predicted population value. For example, if the predicted population is 110, then the next year the population is 0.2*110.

Use Matlab to plot population as a function of time for 40 years. Assume that the initial population is 20.

## 5. Bacteria colony growth

Suppose a colony of 10000 bacteria is multiplying at the rate of r = 0.8 per hour per individual (i.e., an individual produces an average of 0.8 offspring every hour). How many bacteria are there after 10 hours? Assuming that the colony grows continuously and without restriction.