How actually do we decide acidity and basicity order?
I'm not sure about the first order, but I'll try to explain the reason for the second one. The acidic strength increases as $$\ce{HF&lt;HCl&lt;HBr}$$

One reason is the bond strength between the hydrogen and the halogen atom. Since the bond between $\ce F$ and $\ce H$ is very strong, the molecule does not easily lose $\ce H^+$. On the other hand, as the size of the halogen atom increases, the overlapping of the orbitals between halogen and hydrogen becomes less efficient. Thus, $\ce {Cl}$ and $\ce {Br}$ can more easily lose $\ce {H^+}$ than $\ce {F}$. Hence, the acidic strength increases as size of halogen atom increases.

Second reason is the stability of formation of conjugate base. When an acid loses $\ce {H^+}$ ion, it forms what is called as conjugate base. Similarly, when a base loses $\ce {OH^-}$ ion, it forms a conjugate acid. In case of $\ce {HF}$, we have $$\ce{HF &lt;=&gt; H^+ +F- }$$
Here, $\ce {F^-}$ is the conjugate base. Now, due to small size of $\ce {F}$, it is difficult for $\ce {F-}$ to hold negative charge. There are strong repulsions.

Now, for $\ce {HBr}$, we have $$\ce{HBr &lt;=&gt; H^+ +Br^-}$$

$\ce {Br}$ has a greater atomic radius. It is also less electronegative than $\ce {F}$. Hence, the repulsions are less in $\ce {Br-}$. Thus, $\ce {Br^-}$ is quite stable. The more stable is the conjugate base, the more readily the acid loses $\ce {H^+}$ ion, and so, more is its acidic strength.

Check this link. Maybe you'll find it useful.