4 [Answer this question on the insert provided.]
An algorithm involves the following steps.
Step 1: Input two positive integers, \(A\) and \(B\).
Let \(C = 0\)
Step 2: If \(B\) is odd, replace \(C\) by \(C + A\).
Step 3: If \(B = 1\), go to step 6.
Step 4: Replace \(A\) by \(2 A\).
If \(B\) is even, replace \(B\) by \(B \div 2\), otherwise replace \(B\) by ( \(B - 1\) ) รท 2 .
Step 5: Go back to step 2.
Step 6: Output the value of \(C\).
- Demonstrate the use of the algorithm for the inputs \(A = 6\) and \(B = 13\).
- When \(B = 8\), what is the output in terms of \(A\) ? What is the relationship between the output and the original inputs?