Math Genome Fun 2, UPB and beyond?

This is a follow-on from the original “Math Genome Fun” thread here

I think it’s time to test out GAs on a bigger problem, the old one was at the boundary of home computation for an exhaustive search (OMD I said “search!” get on that Mung) – but I’m going to propose a *much* bigger search / smaller target.

Friends, you target is Pi

I’ve chosen Pi because of its qualities, being irrational and transcendental you cannot describe it in an equation, only approximate it.

Our target is the first 150 digits of Pi.

Our vocabulary is the same numbers and operators as before: [1,2,3,4,5,6,7,8,9,+,-,*,/], but this time they can all be used as often as required and the genome can be anywhere from 1 to 1000 characters in length.

The design approximation is now harder due to the decimal place and the absence of zeros in our vocabulary (but there’s quite a few in Pi).

I’ve done no computation on this myself, can a GA find that proverbial needle in a haystack?

 

131 thoughts on “Math Genome Fun 2, UPB and beyond?

  1. …can a GA find that proverbial needle in a haystack?

    How many haystacks are there?

    How many needles are there in each haystack?

    How will a blind search process know when it has encountered a haystack?

    How will a blind search process know when it has encountered a needle?

    Are needles only found in haystacks?

    Try to program a GA that lacks any concept relevant to the search problem. Nothing analogous to a haystack is allowed, and nothing analogous to a needle is allowed. No “search space” is allowed. And one needle in one haystack is absolutely Dazz-forbidden!

    The problem would perhaps be more interesting if the idea was to develop a GA that could find an algorithm that could calculate Pi to exactly 150 digits. But that would require knowledge of Pi to 150 digits. And that is Dazz-Verboten!

  2. Mung: The problem would perhaps be more interesting if the idea was to develop a GA that could find an algorithm that could calculate Pi to exactly 150 digits. But that would require knowledge of Pi to 150 digits. And that is Dazz-Verboten!

    Oh dear Mung. On the wobbly pops? The methodology would be extensible to any target number. I picked Pi because it has features that make it one of the hardest targets. I’d have hoped the target of “largest” in the last post would have moved you past that miss-understanding. But perhaps GAs are not for you.

  3. Richardthughes: I picked Pi because it has features that make it one of the hardest targets.

    And you’re to be commended for that! Perhaps a full examination of Pi will reveal that there is more than one combination of digits that conform to the description “Pi to 150 decimal places.”

    But if only one target exists, then according to Dazz-Rules, it cannot be found by a GA. I’m inferring that your silence when faced with the Dazz-Rules indicates implicit acceptance of the Dazz-Rules. Are you rejecting the Dazz-Rules for Genetic Algorithms?

  4. Mung,

    I’m inferring that your silence when faced with the Dazz-Rules indicates implicit acceptance of the Dazz-Rules.

    You should consider the possibility that Rich doesn’t share your Dazz-Obsession.

  5. Rich,

    So to summarize, the task is to write a GA that will form expressions of 1000 characters or less from the set [1,2,3,4,5,6,7,8,9,+,-,*,/] in order to minimize

    |expr – pi150|

    …where pi150 = 3.14159…n where n is the 150th digit of pi.

    Correct?

  6. keiths: You should consider the possibility that Rich doesn’t share your Dazz-Obsession.

    Please consider the possibility that no one agrees with dazz.

    Please consider the possibility that no one who is anti-ID has the guts to say so.

    You obviously think your implementation of the Dawkins Weasel program is a GA, right?

    But that would mean that you disagree with dazz.

    Why not just say so?

  7. Rich,

    Pretty much. Pipes = abs, right?

    No, sixpack = abs. Pipes = absolute value.

    You giving it a shot?

    Might as well. I’ve already got a GA for the other one, and it should be easy to adapt it.

    There might be a paper in this one maybe?

    For Bio-Complexity? Maybe, but there’s more money in selling wristbands.

  8. “Hello, NASA? Look I don’t believe in gravity and have never built a rocket but here’s a list of things you’re doing wrong…”

  9. Mung,

    Please consider the possibility that no one agrees with dazz.

    Please consider the possibility that no one who is anti-ID has the guts to say so.

    Why should I, when I know it’s untrue? If you haven’t noticed, I don’t hesitate to disagree with other ID critics. (Besides, do you really think it takes “guts” to disagree with someone on your side of the ID debate? If so, that may explain what’s in Barry’s purse.)

    You obviously think your implementation of the Dawkins Weasel program is a GA, right?

    Yes.

    But that would mean that you disagree with dazz.

    Why not just say so?

    Because I haven’t noticed dazz saying that Weasel isn’t a GA. I don’t read every comment posted at TSZ, Mung, and I’m not Dazz-Obsessed as you are.

    For the record, if dazz has said that Weasel isn’t a GA, then I disagree.

  10. keiths: For Bio-Complexity? Maybe, but there’s more money in selling wristbands.

    Make sure you smuggle in all the right information *wink*

  11. It’s pretty amazing that keiths has a GA but hasn’t posted it. DiEb has a GA but didn’t post it. This is typical, but it’s not science.

    keiths, please write a GA to solve the problem presented in the OP and demonstrate the steps you took in the design and implementation of your GA.

  12. Mung,

    It’s pretty amazing that keiths has a GA but hasn’t posted it.

    Why? I just finished it, doofus.

  13. 24 hours late for a Friday meltdown!

    Mung: It’s pretty amazing that keiths has a GA but hasn’t posted it. DiEb has a GA but didn’t post it.

    OH THEY’RE BOTH CHEATERS!!!1111111

    Mung: Richardthughes: Make sure you smuggle in all the right information *wink*

    keiths doesn’t know what that means. Neither do you.

    Care to expand on that a bit?

  14. Richardthughes: “Hello, NASA? Look I don’t believe in gravity and have never built a rocket but here’s a list of things you’re doing wrong…”

    You’re a retail cashier. I doubt NASA cares what you think about how they build rockets. But please continue to post those letters to NASA!

  15. Mung,

    The point isn’t whether or not you disagree. The point is your failure to say so before now.

    You think that I should have said, out of the blue, that I disagreed with anyone who said that Weasel wasn’t a GA, when I had no idea that anyone was making such a claim?

    Jesus, Mung.

  16. keiths: Why? I just finished it, doofus.

    You just finished it. You don’t know if it actually works. I wouldn’t post it either if I were you.

  17. keiths: You think that I should have said, out of the blue, that I disagreed with anyone who said that Weasel wasn’t a GA, when I had no idea that anyone was making such a claim?

    Sure! Let’s pretend that you only read comments I make and not comments that dazz makes. Does that work for you?

    Do you have dazz on ignore?

  18. Mung,

    I don’t even come close to reading every comment posted at TSZ.

    If you do, you might want to reevaluate your priorities in life.

  19. Mung: You’re a retail cashier. I doubt NASA cares what you think about how they build rockets. But please continue to post those letters to NASA!

    Letters? I just snipe from my echo-chamber no outsiders blog!

  20. Mung: You ask me to expand on your ignorance. I cannot do that. Your ignorance is boundless.

    Praise be! the Gallien’s spirit has moved another, My position also cannot explain donuts.

  21. Mung:

    keiths, please write a GA to solve the problem presented in the OP and demonstrate the steps you took in the design and implementation of your GA.

    You didn’t understand my Weasel code, did you?

    The basic principles are the same for all three GAs. You have a population of genomes and a function for evaluating each genome’s fitness. In each generation the fittest individuals survive and are allowed to reproduce while the others die. The “slots” vacated by the dead individuals are filled by (conditionally mutated) offspring of the survivors.

    In Weasel the fitness function determined the genome’s proximity to the target phrase “METHINKS IT IS LIKE A WEASEL”. In the last thread it was based on the value of the genome when evaluated as an arithmetic expression, with greater values being better. In this thread it is also based on the value of the genome when evaluated as an arithmetic expression, but here the fitness increases with proximity to the target value represented by a 150-digit approximation of pi.

    Take another look at my Weasel code and ask questions about the parts you don’t understand. Don’t be shy.

  22. keiths: I don’t even come close to reading every comment posted at TSZ. If you do, you might want to reevaluate your priorities in life.

    You’re not telling me anything I don’t already know. Yet your failure to notice is itself remarkable given that you’re ready and willing to support nonsensical claims by DNA_Jock. Not that you’re objective in any meaningful sense of the word.

    If you are going to develop a GA in response to the OP, please share your step-by-step design thinking and your steps to implement a solution. It would be great if you could actually provide tests of your code to demonstrate that your code actually meets the specifications.

  23. keiths, if I ever claimed that your program was not a GA because it incorporated a single target known in advance it was due to SARCASM.

    If you say that a GA does not depend on whether or not there is a single target then I agree with you. If you say that if there is a single target it cannot therefore be a GA I disagree with you. If you say that because evaluation of multiple strings result in the same value it cannot therefore be a GA I disagree with you.

  24. Mung,

    If you are going to develop a GA in response to the OP, please share your step-by-step design thinking and your steps to implement a solution. It would be great if you could actually provide tests of your code to demonstrate that your code actually meets the specifications.

    You don’t understand my Weasel code, do you?

    Take another look at it. Pay attention to the comments. Ask questions about the parts you don’t understand.

  25. Mung,

    You don’t understand my Weasel code, do you?

    Take another look at it. Pay attention to the comments. Ask questions about the parts you don’t understand.

  26. keiths: You don’t understand my Weasel code, do you?

    You don’t get it. So let’s take this one step at a time. Your Weasel code is a GA.

  27. Rich,

    The part of your spec that will really slow things down is the requirement for 150 decimal digits of precision.

    Hardware implementations of floating-point arithmetic are typically 64 or 80 bits, with 128 bits supported in software. You’ll need to go well beyond that to get 150 decimal digits of precision.

    I’d suggest changing the target to the 64-bit floating-point approximation of pi.

  28. keiths:
    Rich,

    The part of your spec that will really slow things down is the requirement for 150 decimal digits of precision.

    Hardware implementations of floating-point arithmetic are typically 64 or 80 bits, with 128 bits supported in software. You’ll need to go well beyond that to get 150 decimal digits of precision.

    I’d suggest changing the target to the 64-bit floating-point approximation of pi.

    Good point. We’re interested in the search cost, not the evaluation. How long a string for 64 bit?

  29. Mung:
    Richard, are you pleased that your buddy keiths has managed to derail your thread?

    Yeah KeithS, quit stopping Mung coding!

  30. If so, we can try again with a target of e, which has a zero in the 14th decimal digit:

    2.718281828459045235

  31. LOL @ Mung and his pathetic gotcha games.
    Mungy, if you’ve coded a GA before and it’s a search, why is it that you can’t answer how do you know the algo has found a target? It’s such a simple question for such an avid coder

  32. Mung: keiths, if I ever claimed that your program was not a GA because it incorporated a single target known in advance it was due to SARCASM.

    Nice dodge. So anything you might have said in the past might have been SARCASM and should be ignored. So basically you can revise history at a whim.

    ALL SCIENCE SO FAR.

  33. Mung:
    It’s pretty amazing that keiths has a GA but hasn’t posted it. DiEb has a GA but didn’t post it. This is typical, but it’s not science.

    keiths, please write a GA to solve the problem presented in the OP and demonstrate the steps you took in the design and implementation of your GA.

    Have a look.

Leave a Reply