Prime number recognition is a very hard problem and yet no good enough solution has been found using classical algorithms. There are two ways to get around those limitations: find an algorithm with a better complexity or find a way to compute faster. The first one has already been researched by a large amount of people so I decided to give a shot to the second one.

We are limited by the speed of the electricity, so my idea is to use speed of light to improve speed by a great factor. I've come up with a simple example of how to use it to compute prime numbers.

We set up 2 mirrors with light sources that are directed.

Caption

We first set the sensor to the position lower 2

2 had no light so we create a new one that is going to en-light all the multiples of 2

Caption

3 had no light so we create a new one that is going to en-light all the multiples of 3

4 is already in the light, we skip it

4 is already in the light, we skip it


Here is the pseudo code of the prime calculation with Light & Mirror.

hasLight(n):
// Sensor placed at lower n that tells weither if it is enlightened or not
 
newLight(n):
// Creates a light that starts from lower n, targeted at the upper n + n/2,
// that first reflects to lower 2n and then to all the multiples of n.
 
isPrime(n):
for i = 2 to sqrt(n)
  if not hasLight(i)
    newLight(i)
 
return not hasLight(n)

This method allows us to recognize prime numbers with light sources, mirrors, sensors and a bit of programming.

Recognizing if a number is prime or not requires to have a lot of lasers and sensors. I don't think that is a viable process, however this could be interesting to do multiplications. You want to fire 2 lights and then see in what point they cross. However there are 2 main problems:

  • It requires to have 2 really long mirrors possibly infinite which is not possible in practice. It may be possible to add a vertical mirror in order to work in a bounded area. Yet to know how many times the light hit that mirror.
  • We are required either to have an infinite number of sensors. We could have only one sensor that checks all positions sequentially but then we loose the speed of light! What is wanted instead are mirrors in each position that would redirect light to a unique sensor capable of knowing where it came from.

This is an experiment and it is not at the moment near to be faster than actual methods but this is a new way to think about programming. I don't know if anything useful is going to be deviated from this but it shows how to use the light to compute things.

Random Posts

  • Project – WoR Guild Recruitment (0 Comments) -- December 23, 2009

    World of Raids Guild Recruitment Guild recruitment is a recurrent problem in World of Warcraft, many attempt have been made but none succedeed so far. After a brainstorming we decided that the following points were crucial. The guild recruiter has to spend less time as possible to set-up a...

  • Project – Conference Delphi (0 Comments) -- August 4, 2009

    Together with Alban Perillat-Merceroz, we organized a one-hour presentation of the programming langage Delphi followed by 3 hours of exercises. The objective was to introduce Delphi to the students in order for them to be able to start working on their year project. Students had no more than ...

  • Mysqli Wrapper – Short and Secure Queries (6 Comments) -- August 14, 2009

    Mysqli Wrapper is shortening the code required to run queries, make them 100% safe against SQL Injections and gives a handy Array as result. No more pain writing queries! When developing a PHP application, SQL queries is the most dangerous area. This is because the built-in tools are either not s...

  • Javascript – Type Casting (0 Comments) -- September 4, 2009

    Comparison In Javascript there are 3 types we are often comparing: String, Number and Boolean. After digging through the ECMA-262 specifications, here is the behaviour of the == operator (11.9.3) on these types: Number == String Typecasted as follow: Number == Number(String) Number == Boolean ...

  • Project – Cineartistes (0 Comments) -- August 4, 2009

    Philippe Pelletier has been gathering information of people working on the cinema industry for years as a hobby. He realized that people could be interested in his work and he could share it over the internet. The website Cineartistes.com is a database of biographies and filmographies of acto...

Trackback

1 comment until now

  1. Wait to be in the LRDE to publish that !

Add your comment now