Can ChatGPT Prove I Was an Idiot in  1989?

Can ChatGPT Prove I Was an Idiot in 1989?

Yes. (And so can Google and GitHub CoPilot.)

To elaborate, in 1989 I was in my senior year of college and the new hotness was Chaos Theory, Fractals and especially the Mandelbrot Set. Articles, books, TV shows, all claimed this would revolutionize the world--sound familiar? Anyway, I decided to write an honors thesis on the mathematics as I was a math major and thought I knew some stuff. I did not.

I recall one book I "read" about the Geometry of Fractal Sets. It was 177 pages in a pocket sized format. I literally spent hours with my advisor puzzling over a page, no a line, no, a single symbol. (Google happily provides me with post-traumatic flashback stress by producing the whole book here: https://mate.dm.uba.ar/~umolter/materias/referencias/1.pdf)

So I hand-waved my way through the real math of an isomorphism diagram, which my adviser told me it would be the first of many in my career--it was my last. And instead focused on some of those pretty pictures of fractals that I had seen in the book The Beauty of Fractals.

I am embarrassed for my past self. To be fair though, this version of BASIC only looks at the first 2 letters of a variable name.


This is where ChatGPT comes in. I wrote some abysmal BASIC code and ran it on the fastest computer available to me, and the only one with color graphics: an Epson Equity III with a 286 processor and EGA graphics (16 colors!) located behind the locked door of the Computer Lab. I would fire up the machine, run my code, hang on sign saying "Don't Touch" on it, and come back 8+ hours later for the, hopefully successful, result.

And then I printed it on the only color printer--dot matrix color mind you. That also took hours.

But why did I use BASIC? I did know other computer languages: Pascal I used, and had heard of C. Both would probably be faster, but I never thought to try. I didn't know how to do graphics in either one, so I just took the easy route.

I said ChatGPT, right? In 2023, here's my prompt: could you translate the my BASIC code into Pascal suitable for Turbo Pascal made by Borland in 1989 and also for Turbo C.

And it worked! Had I had ChatGPT back in the day, I could have saved a lot of time. (And possibly burned as a witch.)

Instead of nearly 9 hours, I could have had my graphics in under 8 minutes.

So I went a little, um, crazy on a Sunday afternoon. I asked ChatGPT to rewrite it in C++, Julia, Rust, Python, and x86 Assembly. And then to make parallelized versions of some of them. If you really want to know, the code is here: https://github.com/dsagman/mandelbrots

This is Rust. I don't know Rust.

So how fast could we go if we use my Framework laptop in 2023 instead of a PC in 1989. A lot fast.

Instead of nearly 9 hours, or best case of 8 minutes in 1989, we can have the same image in 3 hundredths of a second.

Here's some interesting facts:

  • The whole programming exercise took me only about a day.
  • ChatGPT is, as always, better the more there is ample code sources available.
  • Turbo Pascal and Turbo C in a DOS emulator (DOSBox-X) took some mucking with graphics libraries, ChatGPT helped me figure it out.
  • GitHub CoPilot kept trying to attribute my BASIC code to someone named Russell in the UK.
  • It was Google that showed me I was really dumb. I could have kept my exact code and used Microsoft's Quick Basic Compiler to reduce my compute time to 30 minutes, without changing my code. Oh, my spleen!
  • In 1989 cheap programming languages cost around $90, about $220 today. And professional ones cost $500, about $1,200 today. This is one reason I used BASIC, as it was the only free programming language. When I ran my little test in 2023, all the programming languages were free.
  • The C, C++, Python, and Rust were essentially cut and paste from the initial response.
  • Making the code parallel was also basically cut and paste from the first response.
  • Julia took a bunch of back and forth prompts. ChatGPT did not know how to make graphics in Julia.
  • ChatGPT kept telling me that x86 Assembly is hard. I know! That's why I'm asking you! Here's my favorite part of the code it gave me, where it tells me to "implement fixed-point multiplication and subtraction". Nope.

; z = z * z + c, where z is (cx, dx), c is (ax, bx) in complex numbers
; You have to implement the multiplication and addition for fixed points.
; Below are stubs representing the concept.
; Calculate z * z for both parts (real and imaginary).
; Stub: zreal = cx  cx - dx  dx, zimag = 2  cx  dx
; ... (implement fixed-point multiplication and subtraction)
; Add c to the result.
; Stub: zreal += ax, zimag += bx
; ... (implement fixed-point addition)        

  • I never could get FORTRAN working in DOSBOX-x, so I couldn't try it.

Anyone want to try some other languages?


Linda Lesniak

Adjunct Faculty Department of Mathematics at Western Michigan University

1 年

What are you up to over the holidays?

回复
Linda Lesniak

Adjunct Faculty Department of Mathematics at Western Michigan University

1 年

Who was your advisor?

回复

要查看或添加评论,请登录

David Silverman的更多文章

  • Another Puzzle

    Another Puzzle

    Content Advisory: Some discrete math. Word puzzles.

  • Less Spelling Bee

    Less Spelling Bee

    In my recent post I said that there weren't billions of possible New York Times Spelling Bee puzzles. https://www.

    3 条评论
  • Too Much Spelling Bee!

    Too Much Spelling Bee!

    Content warning: Computer programming and mild combinatorics. May not be suitable for anyone.

    10 条评论
  • US Financial Regulators

    US Financial Regulators

    Another excerpt from Stop Harming Customers, an excellent book about the exciting world of financial industry…

  • Are we Complying with the Law? A Google (or ChatGPT) for Compliance

    Are we Complying with the Law? A Google (or ChatGPT) for Compliance

    TL/DR: Today an excerpt from my book, Stop Harming Customers, where I discuss the dream. A meeting of technology and…

    6 条评论
  • ChatGPT: There will be math

    ChatGPT: There will be math

    This is not a post about financial industry compliance. It is about math, and programming, and, yes, ChatGPT.

    5 条评论
  • Programming Is Not Dead. Math Is Not Dead. Art Is Not Dead. Law Is Not Dead.

    Programming Is Not Dead. Math Is Not Dead. Art Is Not Dead. Law Is Not Dead.

    I used to be a pretty good chess player. 40 years ago.

    3 条评论
  • What's It Like Programming with ChatGPT?

    What's It Like Programming with ChatGPT?

    TL/DR: ChatGPT can save days of time when writing code, and it can also waste days of time chasing ghosts. If you use…

    3 条评论
  • Crypto Contagion: Who's Got It?

    Crypto Contagion: Who's Got It?

    TL/DR: Crypto is going nuts. I am trying to track who's turning off the lights in a spreadsheet.

社区洞察

其他会员也浏览了