The respective values of \( |\vec{a}| \) and} \( |\vec{b}| \), if given \[ (\vec{a} - \vec{b}) \cdot (\vec{a} + \vec{b}) = 512 \quad \text{and} \quad |\vec{a}| = 3 |\vec{b}|, \] are:
A battery of emf \( E \) and internal resistance \( r \) is connected to a rheostat. When a current of 2A is drawn from the battery, the potential difference across the rheostat is 5V. The potential difference becomes 4V when a current of 4A is drawn from the battery. Calculate the value of \( E \) and \( r \).