There are \(\left(\begin{array}{c}52 \\ 2\end{array}\right)=\frac{52 \cdot 51}{2}=26 \cdot 51\) ways to choose two cards from a 52 -card deck. There are \(\left(\begin{array}{c}13 \\ 2\end{array}\right)=\frac{13 \cdot 12}{2}\) ways to choose two cards which are both hearts, and the same number of ways to choose two cards which are both diamonds. Therefore, the probability of choosing two cards which are both hearts or both diamonds is \(\frac{13 \cdot 12}{26 \cdot 51}=\frac{2}{17}\).
Final Answer: The final answer is \(\frac{2}{17}\)