Bill Allombert on Sun, 12 Oct 2025 22:06:49 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: First non-trivial PARI/GP script from chatgpt session |
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("Analyzing for n = ", n); > print("Vertex count V = ", V); > > \\ face_counts should be a vector of [face_degree, count] > for(i=1, #face_counts, > local(k = face_counts[i][1], c = face_counts[i][2]); > F += c; > E2 += k * c; > ); > > E = E2 / 2; > euler_check = V - E + F; > > avg_face_degree = E2 / F; > avg_vertex_degree = 2 * E / V; > > print("Number of faces F = ", F); > print("Number of edges E = ", E); > 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. Please do not use qfbclassno! quadclassunit is almost always a better choice. > Now chatgpt.com seems to be version 5, and the free mode without login allows > for impressive discussion sessions. I wanted to mention this here only because > of the noon-trivial GP script created from chatgpt. The trick is to lower user expectation to the point they are satisfied with anything that is not obviously wrong. Some years ago, gp would be considered an AI but not anymore, so AI mathematical capability has regressed a lot! Cheers, Bill