hermann on Wed, 15 Oct 2025 14:34:27 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: First non-trivial PARI/GP script from chatgpt session


On 2025-10-12 22:06, Bill Allombert wrote:
On Sun, Oct 12, 2025 at 05:35:48PM +0200, hermann@stamm-wilbrandt.de wrote:
vertex_count(n) = 12 * qfbclassno(-4 * n);

\\ Function to analyze face data
analyze_faces(n, face_counts) =
{
  V = vertex_count(n); \\ number of vertices
  F = 0; E2 = 0;
...
  print("Euler characteristic (should be 2): ", euler_check);
  print("Average face degree = ", avg_face_degree);
  print("Average vertex degree = ", avg_vertex_degree);
}

This is overly verbose and it does not apply GP scoping rules
correctly. Frankly this does not deserve a passing grade.

It was the script that surprised me, but even more that chatgpt proposed to run this script to determine the avererage face length.

Please do not use qfbclassno! quadclassunit is almost always a better choice.

I take your word, instead
classno(n)=qfbclassno(n);

better this?
? classno(n)=quadclassunit(n)[1];
? classno(41*73)
6
?


The trick is to lower user expectation to the point they are satisfied with
anything that is not obviously wrong.

Your negative view was mine not long ago.

At this years Heidelberg Laureate forum they had three events on AI, and mathematicians taked positive about using AI to help for complex mathematical problems (youtube video of first session in article):
https://scilogs.spektrum.de/hlf/mathematicians-new-best-friend/


Regards,

Hermann.


P.S:
While I use PARI/GP now for quite some time, I learned only recently about qhull.org (started last century as PARI/GP). I used some GP helper scripts, some C++ code, planar face coloring code and qconvex and geomview to nicely display sum of three squares polyhedron with at most 6 face colors:
https://github.com/Hermann-SW/RSA_numbers_factored/tree/main/qhull#readme