Discussion:
Simple Programming Problem but How Many Ways to Do It?
(too old to reply)
PHPBABY3
2023-08-26 17:09:33 UTC
Permalink
Program 1 returns a Boolean value call it A.
Program 2 returns a Boolean value call it B.
We want one program that returns A ^ B (the value of A and B).
We don’t want to call 1 and 2.
We want to take the code in these two programs and create a new program.

Assume we have the common commands and expression elements e.g. those of PHP.
How many different programs can we create?

PB3
Allodoxaphobia
2023-08-27 13:20:12 UTC
Permalink
Post by PHPBABY3
Program 1 returns a Boolean value call it A.
Program 2 returns a Boolean value call it B.
We want one program that returns A ^ B (the value of A and B).
We don’t want to call 1 and 2.
We want to take the code in these two programs and create a new program.
Assume we have the common commands and expression elements e.g. those of PHP.
How many different programs can we create?
It's actually been a long time since I've seen a homework question on USENET.
J.O. Aho
2023-08-27 14:59:55 UTC
Permalink
Post by Allodoxaphobia
Post by PHPBABY3
Program 1 returns a Boolean value call it A.
Program 2 returns a Boolean value call it B.
We want one program that returns A ^ B (the value of A and B).
We don’t want to call 1 and 2.
We want to take the code in these two programs and create a new program.
Assume we have the common commands and expression elements e.g. those of PHP.
How many different programs can we create?
It's actually been a long time since I've seen a homework question on USENET.
Maybe one of those that promised to not use ChatGPT ;)
--
//Aho
PHPBABY3
2023-09-02 18:36:20 UTC
Permalink
Post by Allodoxaphobia
Post by PHPBABY3
Program 1 returns a Boolean value call it A.
Program 2 returns a Boolean value call it B.
We want one program that returns A ^ B (the value of A and B).
We don’t want to call 1 and 2.
We want to take the code in these two programs and create a new program.
Assume we have the common commands and expression elements e.g. those of PHP.
How many different programs can we create?
It's actually been a long time since I've seen a homework question on USENET.
I've never seen one. This is part of what I (arguably) believe is the most important problem of Computer Science - both in theory and practice.

C-B

Loading...