Skip to content

nevstas/ludmila

Repository files navigation

Ludmila – Solving Unsolved Mathematical Problems by Brute Force

README.md – English version of README.md

README-RU.md – Russian version of README.md

Description

The Ludmila script is designed to solve unsolved mathematical problems using a brute-force method.
It has a list of equation elements:

  • Numbers (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
  • Operations (+, *, /, -)
  • Brackets (left, right)
  • Powers (square, cubic, square root, cube root)
  • Variables x (there can be several in the dataset – x0, x1, x2, ...)

It uses input datasets:

  • data1.txt (linear equation)
  • data2.txt (Pythagoras theorem)
  • data3.txt (prime number series)

Example of data1.txt (linear equation):

3235    51    62    73
3350    52    63    74
3467    53    64    75
...

(100 elements total)

The first number is the value of y, the following numbers are the values of x (in this case x0, x1, x2).

To find the correct equation, combinations of equations are iterated over. It looks like this:

y = 1
y = 2
...

All equations of length 1 are tried, then of length 2. Equations of length 3 might look like:

y = 1 + x0
y = 1 + x1
...

and so on until reaching:

y = x0 * x1 + x2

As a result, the dataset (3235 51 62 73) will produce a match, then this formula is tested on all datasets in data1.txt (100 total). If all 100 datasets pass, the equation is considered solved.

Performance

Performance on CPU:

  • Linear equation is solved in 7 seconds (5 characters): v|x0;o|*;v|x1;o|+;v|x2
  • Pythagoras theorem is solved in 8100 seconds (8 characters): bl|(;v|x0;e|**2;o|+;v|x1;e|**2;br|);e|**0.5

Performance on GPU:

  • Linear equation solved in 0.27 seconds (5 characters) v|x0;o|*;v|x1;o|+;v|x2
  • Pythagorean theorem solved in 168 seconds (8 characters) bl|(;v|x0;e|**2;o|+;v|x1;e|**2;br|);e|**0.5

Purpose

The main goal of this script is to solve unsolved mathematical problems:

But not all of them can be represented as datasets.

To Do

  • Add more mathematical operations – sin, cos, tg, ctg, π, e, log (performance will drop, but the probability of finding a formula will increase).
  • Add datasets for other unsolved mathematical problems.

How to Run

  • Set the variable dataset_id to the dataset ID (1 – linear, 2 – Pythagoras theorem, 3 – prime number series). To add a dataset for a new equation, place the file in the datasets folder (tab separator; first element is y, the rest are x).
  • Run the file ludmila_cpu.py with the command:
c:\Python311\python d:\python\maths\ludmila_cpu.py

Files

Discussions on Mathematician & Programmer Forums

Useful Links

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published