Why are generalized positions and generalized velocities considered as independent of each other? I'm confused how
$$\dot{\mathbf{r}}_{j}=\sum_{k}\frac{\partial\mathbf{r}_{j}}{\partial q_{k}}\dot{q}_k+\frac{\partial\mathbf{r}_{j}}{\partial t}$$
leads to the relation,
$$\frac{\partial\dot{\mathbf{r}}_{i}}{\partial\dot{q}_{j}}=\frac{\partial\mathbf{r}_{i}}{\partial q_{j}}$$
Sources suggest that while differentiating the first equation the generalized velocity and generalized positions are considered as independent of each other, i.e., $(\dot{q_1},\dot{q_2},...,\dot{q_n})$ is independent of $(q_1,q_2,...,q_n)$. I don't understand how they are independent. 
 A: If $q$ is a known function of time, then $\dot q$ is not independent. But before writing and solving the equations (before finding $q(t)$, you may have unknown and independent variables (like $x$ and $y$), which is suggested by your source.
A: Starting with the following definition of $\mathbf{r}_j$ in terms of generalized coordinates
$$\mathbf{r}_{j}=\mathbf{r}_{j}(q_1, q_2, \ldots, q_n,t) \; ,$$
it is clear that taking the total derivative with respect to time, we arrive at the following relation
$$\dot{\mathbf{r}}_{j}=\sum_{k}\frac{\partial\mathbf{r}_{j}}{\partial q_{k}}\dot{q}_k+\frac{\partial\mathbf{r}_{j}}{\partial t} \; .$$
But because of the appearance of $\dot{q}_k$, $\dot{\mathbf{r}}_{j}$ also depends on $\dot{q}_k$. Therefore, it makes sense to take partial derivatives of $\dot{\mathbf{r}}_{j}$ with respect to the $\dot{q}_k$ and from the relation above, we indeed get the relation you find.
While $\dot{q}_k$ is the time derivative of $q_k$, it can not be expressed as a function of the $q_j$. The derivative is an operator, not a function from tuples of real numbers to real numbers so that does not count. Physically, you could say the difference is in the fact that a real function on n-tuples only involves information of what happens in that point at that specific instant. A derivative however involves information about what happens at a point at an instant but also at a different point an infinitesimal instant before that.
Or another way of seeing this is that the state of a classical system is completely specified when one gives the positions and velocities at one instant. If only positions where sufficient, the equations of motion would be first order equations and the time derivative would really be dependent on the positions at one instant, because it would be fully determined by them. This is not the case with the classical second order equations we have for most classical systems of point particles.
