mercredi 19 avril 2023

Fdj et nouvelle crise de paranoïa.

Je joue une fois par mois au Lotto ou à Euromillion pour environ 2,5€.

J'ai joué avec Euromillion le weekend dernier (mi avril ) pour un tirage le mardi. Enfin je le croyais car lorsque j'ai voulu consulter le résultat, l'historique ne comportait pas de trace de ce paris. J'ai donc probablement oublié de valider le jeux après avoir choisi les numéros.

Mais en y pensent à nouveau je suis pris de doute et je consulte le résultat du tirage. Je joue toujours les même numéros. J'aurais dû gagner ....6€.

Bon ça va. Je ne suis pas passé à côté de la fortune.

Mais en y repensant je trouve dommage que l'on ne puisse pas imprimer à la maison un ticket qui ait une valeur juridique ou d'avoir une confirmation du pari par email.

Car quelle preuve a-t-on si veut faire un recours devant le justice?

Il faudrait mieux valider chez le buraliste alors? .... Mais il doit y avoir aussi d'autres risques ....Je pense.

Si je joue c'est que je crois qu'il ne faut pas hésiter à laisser la chance -même infime- s'exprimer.

Si cela est pour une bonne cause bien sûr!

Pourquoi laisser cet argent à d'autres? 

Cela fait environ 30 € par an plus le temps passé une fois par mois.

Voler 2,5 + 6 euros, ça c'est la nouvelle forme qu'à pris le crime organisé. Le faire avec 100 milles voir un million de personnes ça commence à être intéressant. 

Et c'est peut être moins risqué que de voler une voiture!

Mais ça demande plus de savoir faire.

Peut être en utilisant des Pcs vendu d'occasion?  

mardi 11 avril 2023

Paranoïa informatique

 En ce moment j'ai beaucoup de soupçon concernant le fonctionnement de mes machine online et offline équipées avec linux ou window. 

Il est bien sur possible que ce soit une illusion et que je sois le seul responsable.

Mais j'ai l'impression que des données ont été supprimées à plusieurs reprise. Et je me demande si cela n'est pa dû aux disques ssd. 

Qu'est ce qui pourrait bien justifier l'emploi de tels moyens?

Ce que je crée a-t-il une réelle valeur? 

Cela vaut-il le coup de le voler?

Il y a toujours des gens pour prétendre qu'ils veulent me protéger. 

Mais à partir du moment ou ils utilisent le criminalité, j'ai le droit de me demander s'ils sont sincere et s'il ne cherchent pas à simplement calmer le jeux au moyen d'une attitude ambigüe.

Il y a peut-être des méthodes qui permettent de me protéger sans m'espionner voir me voler.  

Elle pourrait compléter l'approche criminelle.

Pourquoi ne m'avoir pas conseillé directement?


 

dimanche 9 avril 2023

Microsoft W11

 sur  un machine achetée d'occasion dégradation progressives du fonctionnement:

  •  Perte de donné sur usb.
  • Dans le gestionnaire de fichier plus d'indication taille des fichier en mode détail, verrouillage de fichiers et impossibilité d'imprimer ou supprimer. 
  • Très faible performance de WSL et pas de support INTL.
  • Perte de fonctionnalité sur driver imprimant Brother HL2135W plus de support recto/verso.

samedi 8 avril 2023

HUAWEI B525 LTE reglo mobile et reseaux SFR 4G

 Cela fait déjà environ une semaine que j'ai des problèmes avec cette box 4G. La diode d'état de la connection passe au rouge et il n'est plus possible de communique sur internet. Mais la ligne téléphonique semble encore marcher. 

Le seul remède que j'ai trouvé c'est de débrancher le câble d'alimentation. Une simple mise hors/sous tension est insuffisante. 

Je soupçonne une attaque sur mon IP et le dépôt d'un virus en RAM dans la boxe. Cela m'est arrivé aussi quelque fois avec un PC. 

Peut-être une faille de sécurité de la box 4G HUAWEI B525 qui pourrait  peut-être être corrigée si elle n'était pas n'était pas quasi obsolète. Elle marchait bien sinon 130Mb/s quand le réseau 4G n'est pas saturé. Le seul bémol c'est l'incapacité de surfer en cours de communication téléphonique. Mais c'est la même chose avec  mon smartphone.

vendredi 31 mars 2023

P=NP Chap 3

  Following :   Chap 2


This provide a correction of the salesman.c program that was partially  functional  (the bugged version has been renamed to .salesman.sv1 in Drive ).

This new version select the new best route  (having lowest distance) at each node.

This is the first step in order to be able to store and reclaim the best branch of a subtree (route and distance) and cut duplicated subtrees.  

It has been painful!

A new explanation for duplicated subtrees. (new in this post of course!).

If the town p is at depth level m (root being at 0 and leaf being at n) then we can count the number of duplication:
We have (m-2)! permutation of (a1,a2,.....ak) and k = m-2.
But how much branch or how much node do we have at level m?
It seems to me that it is the number of permutation of (m-1) element taken from n elements:
n! / (m-1)!.
And the number of unique sub-trees at depth level m would be n! / [ (m-2)! (m-1)! ]
Even if it is True mathematically (I am not very good!) then I find it very difficult to evaluate the total number of nodes we really need to go though.
But if the calculus is done it could give us a proof that there is no way to try to resolve the salesman problem in polynomial time using this method.
I will try to get an idee of what I can spare experimentally.
But the amount of memory and CPU time needed to exploit the full potential of this theory might counter-balance the gain.
That is why I will try to count it with the salesman program using duplication detection for a small amount of town at each depth level.
If I am able spare some time then, it could still be useful.
Not for the P=NP problem.

What ever I am not desperate to find another method to resolve the problem quickly. It might be an incentive to learn Quantom computing. I am not very well advanced  in this topic. But I hope I will have enough time.... now that I am retired. 

If I have some time left I will also try to learn big data.I know nothing about it. But ..... I don't know .... I could make a barycentre of the town and try to guess the optimized distance.......

Last news 2023/04/09:

lets define seq2 = f ( dl , n , seq1 ) 

dl = current depth-level ; n = total number of towns. 

 seq2 >= seq   

seq is the current chronological sequence number of a node at the same depth level. 

seq2 is the sequence number  of a previous node that has an equivalent subtree.

if seq2 = seq1 it means that we  are encountering for the first time a permutation and we must store the result given from exploring the subtree below the current node 

if seq2 < seq it means we have already store the result and just have to restore from an array (A[seq2])

I think it is reasonably likely that I will find a f() that will eliminate half the nodes (due to two towns permutations in  the branch above the current depth level). It might be la little bit complex but it will allow us to avoid to memset the cache when diving and avoid to access multi-dim array that need to be at each depth level [n][n][n] for a 2 towns permutation. We will still  have to store the best route and the best distance.

I'll publish it if I can get it.

I already have a  f()  that is able to say if have to store. But I need to make further tests before publishing. 

I still need f() to be able to return the sequence node where a previous  result has been stored but I got today some clue it is possible.

2023/04/23 :

After starting to build on it I have discovered that it doesn't always work well: I don't store or save a node result at the right time! Too much risks taken! hope to find a correction. It should still be possible to save restore but with the use of large quantity of memory initialisation with memset. If I can't correct it I might have to fall back to memory initialisation.

First explanation is that, due to cuts, nodes sequences (on the same depth level ) do not correspond to the same permutations and it doesn't save or restore at the right time.  But !! It might be compensated because permutations seems to stay in the same order. They are just regular holes in the sequences. I 'll give it a try by  incrementing "artificially"  the nodes sequence number. 

I hope I will be lucky. It doesn't bother me if I am. Though. I don't mind getting some-free help! 

If the holes in sequences fit the permutations already found!

Idiots usually don't get as much luck as smart ones...... No free-some then! 

dimanche 19 mars 2023

REDMI 8A

Après avoir appuyé sur  l'icône SMS j'attends 18 secondes avant de voir apparaître la liste des SMS.

Il me semble très probable quelqu'un a décidé que je devais acheter un nouveau smartphone. 


lundi 13 mars 2023

P=NP (chap2)

Follwing Chap 1

To give a better idea of what could perhaps be done with a methode derived from Ec software.

We want  to resolve  the traveler purchaser problem  with a collection of towns T={A,B,C,D......}.

(Starting from A and going through each town in T/ {A})

For each permutations P of (B,C,D...) we need to find the one with the lowest distance the salesman has to run through. We could find several one but we need only one. 


One solution is run through a tree that build the permutation and at each leaf of calculate the distance for this permutation and record if it is lower that the previous one we found.

Another solution  is to upload the best distance  found in a sub tree and to select the best one at each level. 

In this case we can see that they are duplicated subtrees. Let's compare to branches:

(A,B,C,D, Tail1......)  and (A,D,C,B,Tail2) 

Tail1 and Tail2  subtrees have the same collection of towns and should yield the same  result. 

We don't need to explore the duplication we can simply cut it and use for ADCB the result previously found for ABCD.

For a 3 towns circular permutation we can spare half the nodes at each level for n level is approximately dividing the full process by 2^n. Approximately because it is not possible for all level (deepness).

They are perhaps several ways to find the duplication at each level (deepness in the tree):

  • we can use an array (created at each dive in the next level toward the leaf) and look up (B,C,D) when the previous nodes are (D,C,B). Each town being designated by a number. 
  • We could perhaps avoid to create a multi dim  array because duplicated subtree come  at a regular positions  at the same depth level  when using a specific permutation systeme (I show it in langage C program  and its output at the end of this post ). We could build in advance an array providing for each node at a same level which node previously got the result. Or better (to spare memory)  have a function for each level which provide for each node (its chronologic number) which previous node has the result. It could perhaps even be done with some quantum computer solution. I mean using a quantum computer as a coprocessor. The biggest problem is to find a way to build  automatically this function  for each level. It might be possible. Or we can use a build-in advance array. I will try this in a langage C program with thread. It will  give an idea on the number of nodes we can spare.    
But we might exploit  better the full potential  of this method.
because it should also work for a 2 town permutation :
for (A,B,C,tail1)  and (A,C,B,tail2)  tail1 and tail2 yield also the same result.
in fact we can cut each time we encounter  in a tree 
(A,,,X1,X2,,,,Xm, tail) and if  we already recorded this circular permutation of (Xm...,X2,X1) at this level.

It is not sure we can build a program that can do this with reasonable amount of memory.

But some brains might theoretically calculate the amount of node exploration we can spare.

Does it make the salesman problem polynomial or even logarithmic?

Finally. 
I'd like to excuse myself in advance in case of big error made by me  in this post.
I needed to fill the pressure of writing it down.
I discovered new things doing it. 

A first attempt to compute the number of node with and without cut:

Number of nodes without cut should be N=n!+(n-1)!+(n-2)!............+3!+2!

If we are able to detect sub tree duplication (in a "polynomial" way and with reasonable amount of memory) then with detection of permutation of 2 nodes in a branch from (head0,A,B,tail0) to (head0,B,A,tail0) we could lower the total amount by 2 at each level.

  
The new number of nodes would N2= N/(2^n)

The expressions N2 or N3.2 or Nm...3.2 are just variable name  with a suffix that  try to explain that  we could also use circular permutations  of 3,4,m subsequent nodes (m <n).

With a full optimisation it is difficult (for me) to count how many nodes with spare on the entire tree.

And finally difficult to know if we can reach the polynomial or logarithmic  target this way.

I tried to see what I can spare mixing 3 and 2 town permutation  optimisation with a branch-head of  
4  towns:  I got only  6 subtrees I need to really explore instead of 24.
If we do it at (n-m) levels we ca reduce the total number of nodes to N3.2 = N/(6^n)

If we mix  m ,m-1, .....3,2 town permutations optimisation we would get something like:
Nm.(m-1)...3.2= N/(X^m) but I don't know X.
The expression for the dénominator must be much more complicated.
The hope is we can choose m so  that X can be near enough of n without inducing a to high CPU/memory cost.
But it could still be useful for pure theoretical solution.

I will try an experimentation with Pthread... a good opportunity to work again with C language and learn Pthread. 
  
This a a first "dirty" version of the salesman programm without cut but ready for its implementation.
Just to show how the permutations are generated. 
The full directory can be found on Google Drive . It is interesting is to study the list of all routes generated by the program and mark the permutations  having the same collection of towns in a  a subtree. Town are numbers in the program.

We can see on this output of the programm that, if a list of more than 5 towns was used, duplication of permutation of two towns (green) and three town (red) would allow us to explore only 6 subtrees. But it is also very interesting to see the regularity at which green and red hyphens appear. It means that we could perhaps avoid to use a three dim lookup but only one dim. This one dim being the sequence at which nodes apper at the same depth level.

 A new version of salesman.c has been made  that seems to work much better in  Chap 3 .