
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
Define the determinant $\begin{vmatrix} a_{1} & a_{2} \\ a_{3} & a_{4}\end{vmatrix} = a_{1}a_{4} - a_{2}a_{3}$, and let the function $g(\theta) = \begin{vmatrix} \sin\theta & 3-\cos\theta \\ m & \sin\theta\end{vmatrix}$ (where $0 \leq \theta \leq \frac{\pi}{2}$).  
(1) Find the value of $g\left( \frac{\pi}{2} \right)$;  
(2) If the maximum value of the function $g(\theta)$ is 4, find the value of $m$.

Present the answer in LaTex format: \boxed{Your answer}
user