Is this intuition for the semidirect product of groups correct? My abstract algebra class introduced me to direct products, not semidirect products. I became interested in semidirect products when confronted with the following homework problem:

Define the quaternion group $Q_8 = \{1, i, j, i \mid i^2 = j^2 = k^2 = ijk = -1\}$. Show that the set $\mathbb{H} = \{a + bi + cj + dk \mid a, b, c, d \in \mathbb{R}\}$ is a group under multiplication.

Rather than checking all the properties, I wanted to use my intuition that $\mathbb{H}$ was a group because it "combined" $Q_8$ and $\mathbb{R}^4$, which were both groups. That is, any element of $\mathbb{H}$ can be uniquely specified by choosing an element of $Q_8$ and an element of $\mathbb{R}^4$. So I wrote down 

$\mathbb{H}$ is a group because it is isomorphic to $Q_8 \times \mathbb{R}^4$

which I now see is clearly wrong.
Now, the Internet tells me (I think) that what I was actually thinking about was the semidirect product, not the direct product. So that's my first question:


*

*Is $\mathbb{H}$ a semidirect product of $Q_8$ and $\mathbb{R}^4$? Which acts on which (which belongs on the left side of $\rtimes$?)


My second question: I'm forming the intuition that, given normal subgroup $N$ and subgroup $H$, one forms $G$ by:


*

*Defining an element of $g$ as a unique combination of an element of $N$ and an element of $H$.

*Giving rules for how multiplication between different elements $h_1n_1$ and $h_2n_2$ will work. If you choose:


$$(h_1n_1)(h_2n_2) = (h_1h_2)(n_1n_2)$$
then it's just a direct product, but you might choose anything, such as:
$$(h_1n_1)(h_2n_2) = (h_1h_2^{-1})(n_1n_2)$$
How inaccurate is this vague idea? In particular, is the above a valid choice for a way to multiply elements of $N \rtimes H$? What restrictions are there on these choices?
 A: As Ted says, when you have a semidirect product the action is usually natural. If it is not, then you shouldn't try to force it, because this means that there is no semi-direct product involve.
However when you have a group $G$ and try to write it as a semi-direct product, you have to find a group $N$ normal in $G$ and a complement $K$ to it (to finally end up with $G=N\rtimes K$). 
In the present case, here are some questions you should answer first :


*

*What is the law group on $\mathbb{H}$?



 There is essentially only one on it, it is the addition. For this addition structure $\mathbb{H}$ is abelian and isomorphic to $\mathbb{R}^4$. I assume that you rather mean $\mathbb{H}^*$ with the multiplication.



*

*The group $Q_8$ is a subgroup of $\mathbb{H}^*$ , is it normal?



 No.



*

*Is there a group in $\mathbb{H}^*$ isomorphic to $\mathbb{R}^4$?



 No.

So, we are far from having a semi-direct product structure in this case. I would like to end up with an explanation about the intuition you should have when talking about semi-direct product.
If in a group $G$ you have two subgroup $N,K$ such that any element $g$ of $G$ is   written as a product $g=nk$ with $n\in N$ and $k\in K$, this means that the application :
$$\psi:N\times K\rightarrow G$$
$$(n,k)\mapsto nk$$
is surjective. If you add a second hypothesis that $N\cap K$ is trivial and $N$ normal in $G$ then, this implies that $\psi$ is also one to one. 
The semi-direct product on the set $N\times K$ is then the push-back of the group on $G$ via $\psi$. Alternatively, it is the only group law on $N\times K$ making of $\psi$ an isomorphism of groups. Let us write down what it means :
\begin{align}
(n_1,k_1)(n_2,k_2)&=\psi^{-1}(\psi((n_1,k_1)(n_2,k_2)))\\
&=\psi^{-1}(n_1k_1n_2k_2)\\
&=\psi^{-1}(n_1 k_1n_2k_1^{-1}k_1k_2)\\
&=\psi^{-1}(n_1\underbrace{k_1n_2k_1^{-1}}_{\in N\text{ because }N\triangleleft G}k_1k_2)\\
&=\psi^{-1}(\underbrace{n_1 k_1n_2k_1^{-1}}_{\in N}\underbrace{k_1k_2}_{\in K})\\
&=(n_1 k_1n_2k_1^{-1},k_1k_2)
\end{align}
Whence this gives the definition of the semi-direct product if we fix $\phi:K\rightarrow Aut(N)$ a group morphism then the definition of the semi direct product $N\rtimes_{\phi}K$ is exactly :
$$(n_1,k_1)(n_2,k_2):=(n_1\phi(k_1)(n_2),k_1k_2)$$
