Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > sci.math > #639731

Monte Carlo sampling the frontier version (Re: Yeah, we have another name!)

From Mild Shock <janburse@fastmail.fm>
Newsgroups sci.math
Subject Monte Carlo sampling the frontier version (Re: Yeah, we have another name!)
Date 2025-08-16 12:44 +0200
Message-ID <107pnem$463p$6@solani.org> (permalink)
References <106p0ct$3b6se$3@solani.org> <107lai9$1hn9$2@solani.org> <107oa45$3c0p$3@solani.org> <107oa9r$3c8m$1@solani.org> <107pn6g$463p$3@solani.org>

Show all headers | View raw


You can also test what was posted 06.08.2025
on comp.lang.prolog and then adopted by @kuniaki.mukai .
Here are the benchmark resuts, I find now.
Using again the Monte Carlo method:

?- time((between(1,100,_), mercio2, fail; true)).
% 4,404,670 inferences, 0.375 CPU in 0.375 seconds
true.

Practically no difference between mercio2/3
and mercio/2. The problem is that mercio2 doesn’t
add much smarts to the algorithm. Whereas for
example SWI-Prolog compare/3

has the smarts of Union Find. So a little break
through in Mercio’s Idea needs more than only
recasting the truncation sequences as a frontier list:

mercio2(C, X, Y) :- X == Y, !, C = (=).
mercio2(C, X, Y) :- mercio2_iter(C, [X-Y]).

mercio2_iter(C, L) :-
     compare_truncs(D, L),
     D \== (=), !, C = D.
mercio2_iter(C, L) :-
     next_truncs(L, R),
     mercio2_iter(C, R).

compare_truncs(C, []) :- !, C = (=).
compare_truncs(C, [X-Y|_]) :-
     trunc(X, A),
     trunc(Y, B),
     compare(D, A, B),
     D \== (=), !, C = D.
compare_truncs(C, [_|L]) :-
     compare_truncs(C, L).

trunc(X, A) :- var(X), !, X = A.
trunc(X, F/N) :- functor(X, F, N).

next_truncs([], []).
next_truncs([X-_|L], R) :-  var(X), !,
     next_truncs(L, R).
next_truncs([X-Y|L], R) :-
     next_truncs(L, H),
     X =.. [_|A],
     Y =.. [_|B],
     zip(A, B, J),
     append(J, H, R).

zip([], [], []).
zip([X|L], [Y|R], [X-Y|H]) :-
     zip(L, R, H).

Mild Shock schrieb:
> 
> I like the vibe, clearing the mind of everything
> existing has a touch of a mystic human being living
> an eremitic solitary vocation on a far out mountain
> top. Using the internet only to emit his wisdom,
> 
> but not to ingest the outer world, just as in
> Thus Spoke Zarathustra (*). Another name for Fuzzy Testing,
> if the outcome is not finding the needle in the haystack,
> but rather producing quantitative outcomes is,
> 
> unless of course you were living in a submerged pineapple (**):
> 
> Monte Carlo methods
> or Monte Carlo experiments, are a broad class of
> computational algorithms that rely on repeated random
> sampling to obtain numerical results
> https://en.wikipedia.org/wiki/Monte_Carlo_method
> 
> (*)
> Also Sprach Zarathustra, Op. 30 - Strauss
> https://www.youtube.com/watch?v=dfe8tCcHnKY
> 
> (**)
> Every Time Patrick Was Actually Smart
> https://www.youtube.com/watch?v=siBRUuDxU1E

Back to sci.math | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Mercio’s Algorithm for Rational Tree Compare in Prolog Mild Shock <janburse@fastmail.fm> - 2025-08-04 02:54 +0200
  The Original Ganster (OG) of Gameification: IEEE 1044.1-1995 (Re: Mercio’s Algorithm for Rational Tree Compare in Prolog) Mild Shock <janburse@fastmail.fm> - 2025-08-04 13:50 +0200
    The Bitrot called Math Stack Exchange (Re: The Original Ganster (OG) of Gameification: IEEE 1044.1-1995) Mild Shock <janburse@fastmail.fm> - 2025-08-04 13:57 +0200
      I guess its back to Hopcroft and Karp (Re: The Bitrot called Math Stack Exchange) Mild Shock <janburse@fastmail.fm> - 2025-08-04 14:12 +0200
  Szpilrajn Theorem and Suzumura Consistency (Re: Mercio’s Algorithm for Rational Tree Compare in Prolog Mild Shock <janburse@fastmail.fm> - 2025-08-06 01:53 +0200
    The good thing is we have at least Mercio’s Algorithm (Re: Szpilrajn Theorem and Suzumura Consistency) Mild Shock <janburse@fastmail.fm> - 2025-08-06 08:09 +0200
      Hopcroft and Karp’s is just Contraction (Re: The good thing is we have at least Mercio’s Algorithm) Mild Shock <janburse@fastmail.fm> - 2025-08-06 08:16 +0200
        Re: Hopcroft and Karp’s is just Contraction (Re: The good thing is we have at least Mercio’s Algorithm) Mild Shock <janburse@fastmail.fm> - 2025-08-06 08:23 +0200
  Mercios decidability was already attested in 2012 (Re: Mercio’s Algorithm for Rational Tree Compare in Prolog) Mild Shock <janburse@fastmail.fm> - 2025-08-14 20:40 +0200
    Performance of Mercio’s Total Order (Re: Mercios decidability was already attested in 2012) Mild Shock <janburse@fastmail.fm> - 2025-08-15 23:51 +0200
      Fuzzy Testing is your Swiss Knife (Was: Performance of Mercio’s Total Order) Mild Shock <janburse@fastmail.fm> - 2025-08-15 23:54 +0200
        Yeah, we have another name! (Re: Fuzzy Testing is your Swiss Knife) Mild Shock <janburse@fastmail.fm> - 2025-08-16 12:40 +0200
          Monte Carlo sampling the frontier version (Re: Yeah, we have another name!) Mild Shock <janburse@fastmail.fm> - 2025-08-16 12:44 +0200
  An NPU could give 1000x more LIPS (Re: Mercio’s Algorithm for Rational Tree Compare in Prolog) Mild Shock <janburse@fastmail.fm> - 2025-11-27 14:23 +0100
    Zeus: A Language for Expressing Algorithms in Hardware (Re: Neural Network based dif/2 respectively (#\=)/2) Mild Shock <janburse@fastmail.fm> - 2025-11-27 15:02 +0100
    100% serious Giga Logical Inferences per Second (GLIPS) (Re: An NPU could give 1000x more LIPS (Re: Mercio’s Algorithm for Rational Tree Compare in Prolog) Mild Shock <janburse@fastmail.fm> - 2025-11-28 14:53 +0100

csiph-web