(1)To count all the possible paths from top left cell to bottom right cell in a mXn grid with the constraints that from each cell you can either move only to right or down.
Recurrentce relation
initial condition
if m==1 or n==1 then numberOfPaths(m,n) = 1
else numberOfPaths(m,n) = numberOfPaths(m-1, n) + numberOfPaths(m,
n-1);
(2)//C++ program
#include <iostream>
using namespace std;
int numberOfPaths(int m, int n)
{
int F[m][n];
for (int i = 0; i < m; i++)
F[i][0] = 1;
for (int j = 0; j < n; j++)
F[0][j] = 1;
for (int i = 1; i < m; i++)
{
for (int j = 1; j < n; j++)
F[i][j] = F[i-1][j] + F[i][j-1];
}
return F[m-1][n-1];
}
int main()
{ int m=4 , n=5;
cout << "number of paths in a Grid of
"<<m<<"x"<<n<<" is
"<<numberOfPaths(m, n);
return 0;
}
//sample output
5. Let F(n, m) denote the number of paths from top-left cell to bottom-right cell in a (n x m) grid (that only permits moving right or moving down). It satisfies the recurrence relation F(n, m) F(n-1...
ONLY NEED H, I, J, K, L, M 1. (65 points: 5 points each) For each situation below, what is the most appropriate probability model for the random variable X? (no n a) Let X - how many customers will buy a sofa tomorrow at Wolf's furniture store. b) In a program that provides free home inspections for seniors, let X- how many homes eed to specify parameter values) are inspected before one needs a new roof. c) Let X...