Re-read what you've typed in that cell see if you typed it correctly.
Note: The matrix referred to in the question is: ![M = \left[\begin{array}{ccc}1/2&1/3&0\\1/2&1/3&0\\0&1/3&1\end{array}\right]](https://tex.z-dn.net/?f=M%20%3D%20%5Cleft%5B%5Cbegin%7Barray%7D%7Bccc%7D1%2F2%261%2F3%260%5C%5C1%2F2%261%2F3%260%5C%5C0%261%2F3%261%5Cend%7Barray%7D%5Cright%5D)
Answer:
a) [5/18, 5/18, 4/9]'
Explanation:
The adjacency matrix is ![M = \left[\begin{array}{ccc}1/2&1/3&0\\1/2&1/3&0\\0&1/3&1\end{array}\right]](https://tex.z-dn.net/?f=M%20%3D%20%5Cleft%5B%5Cbegin%7Barray%7D%7Bccc%7D1%2F2%261%2F3%260%5C%5C1%2F2%261%2F3%260%5C%5C0%261%2F3%261%5Cend%7Barray%7D%5Cright%5D)
To start the power iteration, let us start with an initial non zero approximation,
![X_o = \left[\begin{array}{ccc}1\\1\\1\end{array}\right]](https://tex.z-dn.net/?f=X_o%20%3D%20%5Cleft%5B%5Cbegin%7Barray%7D%7Bccc%7D1%5C%5C1%5C%5C1%5Cend%7Barray%7D%5Cright%5D)
To get the rank vector for the first Iteration:

![X_1 = \left[\begin{array}{ccc}1/2&1/3&0\\1/2&1/3&0\\0&1/3&1\end{array}\right]\left[\begin{array}{ccc}1\\1\\1\end{array}\right] \\\\X_1 = \left[\begin{array}{ccc}5/6\\5/6\\4/3\end{array}\right]\\](https://tex.z-dn.net/?f=X_1%20%3D%20%20%5Cleft%5B%5Cbegin%7Barray%7D%7Bccc%7D1%2F2%261%2F3%260%5C%5C1%2F2%261%2F3%260%5C%5C0%261%2F3%261%5Cend%7Barray%7D%5Cright%5D%5Cleft%5B%5Cbegin%7Barray%7D%7Bccc%7D1%5C%5C1%5C%5C1%5Cend%7Barray%7D%5Cright%5D%20%5C%5C%5C%5CX_1%20%3D%20%5Cleft%5B%5Cbegin%7Barray%7D%7Bccc%7D5%2F6%5C%5C5%2F6%5C%5C4%2F3%5Cend%7Barray%7D%5Cright%5D%5C%5C)
Multiplying the above matrix by 1/3
![X_1 = \left[\begin{array}{ccc}5/18\\5/18\\4/9\end{array}\right]](https://tex.z-dn.net/?f=X_1%20%3D%20%5Cleft%5B%5Cbegin%7Barray%7D%7Bccc%7D5%2F18%5C%5C5%2F18%5C%5C4%2F9%5Cend%7Barray%7D%5Cright%5D)
Answer:
FOR i% = 1 TO 100
IF ((i%\3) = i%/3) AND ((i%\7) = i%/7) THEN
PRINT i%
END IF
NEXT i%
Explanation:
Of course using MOD would be cleaner, but another way to check if a number is integer divisable is to compare the outcome of an integer division to the outcome of a floating-point division. If they are equal, the division is an integer division.
The program outputs:
21
42
63
84
Answer:
C++ code is given below
Explanation:
#include <iostream>
#include <cctype>
#include <string.h>
#include <cstring>
#include <sstream>
using namespace std;
struct Car {
public:
char reportingMark[5];
int carNumber;
string kind;
bool loaded;
string destination;
};
void input(Car *);
void output(Car *);
int main() {
Car *T = new Car;
input(T);
output(T);
delete T;
return 0;
}
void input(Car *T)
{
string str, s;
cout << " Enter the reporting mark as a 5 or less character uppercase string: ";
cin >> str;
for (int i = 0; i < str.length(); i++)
T->reportingMark[i] = toupper(str[i]);
cout << " Enter the car number: ";
cin >> T->carNumber;
cout << " Enter the kind: ";
cin >> T->kind;
cout << " Enter the loaded status as true or false: ";
cin >> s;
istringstream(s) >> boolalpha >> T->loaded;
if (T->loaded == true) {
cout << " Enter the destination: ";
cin.ignore();
getline(cin, T->destination);
}
else
T->destination = "NONE";
}
void output(Car *T)
{
cout << " Reporting Mark: " << T->reportingMark;
cout << " Car Number: " << T->carNumber;
cout << " Kind: " << T->kind;
cout << " Loaded Status: " << boolalpha << T->loaded;
cout << " Destination: " << T->destination << " ";
}