How to find x-coordinate of the curve If y-coordinate is given?
Show older comments
disp('y^2 = x^3 + 14 mod 17')
y=0:16
for i=1:17
left_side = mod(y(i).^2,17);
right_side = mod(x.^3+14,17;
end
If I have y-coordinates from 0 to 16, how can I find the corresponding x-coordinate that satifies 'y^2 = x^3 + 14 mod 17'
Accepted Answer
More Answers (1)
Image Analyst
on 27 Mar 2021
Because of missing parentheses regarding mod, and a poorly worded question, it's unclear what you want and exactly what is to be moded. But let's start here, then you can explain further.
disp('y^2 = x^3 + 14 mod 17')
y=0:16
x = (y .^ 2 - 14) .^ (1/3)
nexttile;
plot(x, y, 'b.-', 'LineWidth', 2, 'MarkerSize', 25);
grid on
xlabel('x', 'Interpreter', 'none', 'FontSize', 15);
ylabel('y', 'Interpreter', 'none', 'FontSize', 15);
for k=1:17
left_side(k) = mod(y(k).^2,17)
right_side(k) = mod(real(x(k).^3+14),17)
% If I have y-coordinate from 0 to 16
% how can I find corresponding x-coordinate that
% satisfies 'y^2 = x^3 + 14 mod 17'
end
nexttile;
plot(right_side, left_side, 'b.-', 'LineWidth', 2, 'MarkerSize', 25);
grid on
xlabel('right_side', 'Interpreter', 'none', 'FontSize', 15);
ylabel('left_side', 'Interpreter', 'none', 'FontSize', 15);

2 Comments
Ammy
on 27 Mar 2021
Image Analyst
on 27 Mar 2021
So if x=1 and y=7,
y^2 = 49 and mod(49,17) is 15
x^3+14 = 17 and mod(17,17) is 0
So explain again in detail why point (1,7) is a point where this condition is true.
And please make clear whether y^2 is also supposed to be moded by 17, or if it's just the right hand (x) side of the equation that's supposed to be moded with 17. In other words is it
mod(y^2, 17)
AND
mod(x.^3+14,17)
OR JUST the right hand side (because you did not use mod explicitly on the left hand side).
mod(x.^3+14,17)
In other word did you mean
y^2 = x^3 + 14 mod 17
or did you mean
y^2 mod 17 = x^3 + 14 mod 17
So, since y^2 = x.^3+14, whenever y^2 is mod 17, then x.^3+14 will also be mod 17 since y^2 = x.^3+14. They will both be mod 17 at the same time.
And finally, you might want to look at rem() rather than mod.
Categories
Find more on Mathematics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!