# Addition on an Elliptic Curve and Modular Arithmetic involving fractions

I'm having a bit of an issue with addition on elliptic curves.

For example, I've been given the curve $Y^2 = X^3 + 2X + 1$, working modulo 3.

Now, say I want to add the point $(1,2)$ with itself. To do this, I calculate the slope of the tangent at this point, which is given by $$\lambda = \frac{3x^{2}_{1} + A}{2y_1}$$ Subbing in my values for $x_1 = 1$, $y_1 = 2$ and $A = 2$, I get... $$\lambda = \frac{3\times1^{2}_{1} + 2}{2\times2} = \frac{5}{4}$$

However, my problem here is that I'm now trying to take the modulus of a fraction.

So, I guess I'm asking how I can determine what $\frac{5}{4}$ mod 3 is equivalent to??

Thank you for any help in this - I can totally finish the problem from here, I'm just unsure what to do with modular arithmetic involving fractions.

You have to interpret expressions like $\frac{5}{4}$ in the finite field $\mathbb{F}_3$ of $3$ elements: this fraction actually means that you multiply the element $5=1+1+1+1+1=2$ with the multiplicative inverse of $4=1$. So which element $a$ in $\mathbb{F}_3$ has the property, that $a*1=1$? It is the element $a=1$ itself. Consequently $\frac{5}{4}=2$
• Thank you!! But wouldn't the inverse of 4 just be 1, as $4 \times 1 \equiv 1$ mod 3 ?? So, I should be reading this as $\frac{5}{4} \equiv 5 \times 4^{-1} \equiv 2 \times 1 \equiv 2$ ?? – Jack Apr 13 '14 at 10:58