|
O'zbekiston respublikasi raqamli texnologiyalar vazirligi muhammad al-xorazmiy nomidagi toshkent axborot texnologiyalari universiteti loyiha ishi Guruh: 13-21 Bajardi: Rahmonaliyev Toirjon Mahmudov Mohirjon Numonov Muxiddin Rustamov Farrux
|
bet | 9/10 | Sana | 16.12.2023 | Hajmi | 363,4 Kb. | | #120246 |
num = BigDecimal.valueOf(r);
}
System.out.println("Factors of " + n + " are ");
for (BigDecimal elem : ans)
System.out.println(elem + " ");
}}
Foydalanilgan adabiyotlar:
https://e-library.namdu.uz/30%20%D0%A2%D0%B5%D1%85%D0%BD%D0%B8%D0%BA%D0%B0%20%D1%84%D0%B0%D0%BD%D0%BB%D0%B0%D1%80/Asbob%20va%20ularni%20elementlari%20sinash%20usullari.%20Gaibnazarov%20B.B.pdf
https://tltaudit.ru/uz/heart-failure/razlozhenie-mnogochlenov-na-mnozhiteli-kak-razlozhit-na-mnozhiteli/
https://en.wikipedia.org/wiki/Pollard%27s_p_%E2%88%92_1_algorithm#:~:text=Pollard's%20p%20%E2%88%92%201%20algorithm%20is,an%20algebraic%2Dgroup%20factorisation%20algorithm.
https://www.geeksforgeeks.org/pollard-p-1-algorithm/
https://www.codingninjas.com/codestudio/library/the-pollard-p-1-algorithm
. Bu algoritmning C# da yozilgan kodini quyidagicha:
using System;
namespace PohligHellman
{
class Program
{
static void Main(string[] args)
{
// Berilgan ma'lumotlar
int E = 1048583;
int P_x = 169541;
int P_y = 556330;
int Q_x = 858751;
int Q_y = 762468;
// Diskret logarifmni topish
int p = 2;
int q = 1048581;
int[] factors = { 2, 3, 7, 17, 19, 37, 163, 263, 433, 683 };
int[] exponents = new int[factors.Length];
int[] congruences = new int[factors.Length];
int x = 0;
for (int i = 0; i < factors.Length; i++)
{
exponents[i] = (int)Math.Pow(factors[i], (p - 1) / factors[i]);
int Q_x_congruence = Q_x % factors[i];
int Q_y_congruence = Q_y % factors[i];
for (int j = 0; j < factors[i]; j++)
{
if ((int)Math.Pow(j, exponents[i]) % factors[i] == Q_x_congruence)
{
congruences[i] = j;
break;
}
}
}
for (int i = 0; i < factors.Length; i++)
{
int q_i = (q - 1) / factors[i];
int y_i = 1;
for (int j = 0; j < factors.Length; j++)
{
if (j != i)
{
int factor = factors[j];
int exponent = exponents[j];
int congruence = congruences[j];
int t = (congruence - y_i) % factor;
for (int k = 0; k < q_i - 1; k++)
{
t = (t * (congruence - y_i)) % factor;
}
y_i = (y_i + t * exponent) % factors[i];
}
}
int factor_i = (int)Math.Pow(factors[i], exponents[i]);
x += y_i * (q / factor_i) % q;
}
int log_P_Q = x % q;
Console.WriteLine("log_P_Q: " + log_P_Q);
}
}
}
Ushbu kod berilgan elliptik egri va nuqtalarni qabul qilib, diskret logarifmni topadi. Chiziqlash kodi odatda tez ishlaydi va berilgan nuqtalar uchun logarifmni topishda yordam berishi kerak. Kiritilgan ma'lumotlarga mos ravishda natijani chiqaradi.
Dasturning har bir qadamini tushuntirish uchun quyidagi ko'rsatmalarni ko'rib chiqamiz:
1.Dastur boshlanishida, berilgan elliptik egri va nuqtalarning koordinatalari kiritiladi:
int E = 1048583;
int P_x = 169541;
int P_y = 556330;
int Q_x = 858751;
int Q_y = 762468;
2. Keyingi qadamlar diskret logarifmni topish uchun faktorizatsiya qilishni o'z ichiga oladi. Faktorizatsiya natijalarini saqlash uchun factors, faktorlar darajasini saqlash uchun exponents va kongruensiyalar ro'yxatini saqlash uchun congruences massivlarini ishlatadi.
3. Faktorizatsiya uchun factors ro'yxatida ko'rsatilgan sonlar bo'yicha sikl ichida yurish qilinadi. Birinchi siklda faktor sonini factors[i] va uning darajasini exponents[i] ga o'zlashtiriladi:
|
|
Bosh sahifa
Aloqalar
Bosh sahifa
O'zbekiston respublikasi raqamli texnologiyalar vazirligi muhammad al-xorazmiy nomidagi toshkent axborot texnologiyalari universiteti loyiha ishi Guruh: 13-21 Bajardi: Rahmonaliyev Toirjon Mahmudov Mohirjon Numonov Muxiddin Rustamov Farrux
|