The dimensionality as observed from the residual variance curve is most probably four, since the plot begins to smoothen out after that and successive variance values lie closer(this can be disputed, since the plot is not really so clear). The plot drawn using tangent distances instead of euclidean distances offers more convincing evidence, that four should be the correct answer. The explanation lies in the fact that the system of two arms has combined four degrees of freedom, each arm contributing two degrees: theta1, theta2, theta3, theta4.