If I wrote a computer program that generates private btc addresses and then generated the public address
You're missing a point:
Private address to public address, there is no process like this.
It's one-way flow from k > K > A
Private key > Public key > Public address
It is one-way and irreversible process as you can read more in
Chapter 3: Key, addresses in Mastering Bitcoin book