Talk:Boolean values: Difference between revisions

From Rosetta Code
Content added Content deleted
(→‎Rename page?: better example?)
No edit summary
Line 52: Line 52:
:* for (13), LCM(a, ¬a) = Ø = 0, given any finite non-zero a, ¬a has to be 0; but this leads to a problem in (14): now GCD(a, ¬a) = GCD(a, 0) = a, not I.
:* for (13), LCM(a, ¬a) = Ø = 0, given any finite non-zero a, ¬a has to be 0; but this leads to a problem in (14): now GCD(a, ¬a) = GCD(a, 0) = a, not I.
: It would seem plain GCD and LCM don't make good Boolean operators. You'd have to map numbers to sets to have a viable definition. --[[User:Ledrug|Ledrug]] 22:54, 30 April 2012 (UTC)
: It would seem plain GCD and LCM don't make good Boolean operators. You'd have to map numbers to sets to have a viable definition. --[[User:Ledrug|Ledrug]] 22:54, 30 April 2012 (UTC)

:: GCD and LCM work just fine as boolean operators if the set you are dealing with is non-negative integers. Using the set of integers can also work with a minor clarification about the sign of least common multiple (for example: the result of lcm has the same sign as the product of the two numbers).

:: But it was Shannon that placed the emphasis on restricting focus in boolean algebra to the two-valued case. Boolean algebra on integers was established well before this. And, nowadays, because so many people have been working with computer languages which use "boolean" as a synonym for "two valued boolean", we are losing track of what boolean algebra is. The reference works (such as the ones I cited) focus almost exclusively on the "logic value" case, but shy away from the issue of what distinguishes "logic" from "boolean algebra". --[[User:Rdm|Rdm]] 13:06, 1 May 2012 (UTC)

Revision as of 13:06, 1 May 2012

Python twice?

It's already been noted. a merge is in the works. --Mwn3d 20:20, 10 July 2009 (UTC)

Sorry about the wait. All done. --Paddy3118 21:12, 10 July 2009 (UTC)

Rename page?

This page only deals with the two-valued boolean algebra.

This leaves out some important history and the full scope of what the word "Boolean" means. This is a distressingly common practice.

See, for example:

http://sumon3get.hubpages.com/hub/Basic-Concept-And-History-Of-Boolean-Algebra

http://mathworld.wolfram.com/BooleanAlgebra.html

Remedies might include:

1. A new page title that somehow incorporates the phrase "two valued".

2. A new Rosetta code task which treats some other subset of boolean values. For example, here's a table the boolean operation which corresponds to "logical and" on the integers 0 through 3:

<lang J> *. table i. 4 ┌──┬───────┐ │*.│0 1 2 3│ ├──┼───────┤ │0 │0 0 0 0│ │1 │0 1 2 3│ │2 │0 2 2 6│ │3 │0 3 6 3│ └──┴───────┘</lang>

(this operation is "least common multiple",).

And here's the boolean operation which corresponds to "logical or" (greatest common divisor) on these integers:

<lang J> +. table i. 4 ┌──┬───────┐ │+.│0 1 2 3│ ├──┼───────┤ │0 │0 1 2 3│ │1 │1 1 1 1│ │2 │2 1 2 1│ │3 │3 1 1 3│ └──┴───────┘</lang>

Also, I cannot find any treatment of "logical not" in older treatments of boolean algebra. It has been added to newer works, but in that context it seems to be an arbitrary operation (it might be 1-x, or it might be any of a wide variety of other operations). --Rdm 13:40, 30 April 2012 (UTC)

Using the Mathworld page you cited, which LCM as "and", and GCD as "or":
  • Eqs. 1-8 are sastified;
  • For eqs. 9-12, we have LCM(a, Ø) = Ø and GCD(a, Ø) = a for all a; only viable candidate for Ø is Ø = 0. Similarly, LCM(a, I) = a and GCD(a, I) = I means I = 1.
  • for (13), LCM(a, ¬a) = Ø = 0, given any finite non-zero a, ¬a has to be 0; but this leads to a problem in (14): now GCD(a, ¬a) = GCD(a, 0) = a, not I.
It would seem plain GCD and LCM don't make good Boolean operators. You'd have to map numbers to sets to have a viable definition. --Ledrug 22:54, 30 April 2012 (UTC)
GCD and LCM work just fine as boolean operators if the set you are dealing with is non-negative integers. Using the set of integers can also work with a minor clarification about the sign of least common multiple (for example: the result of lcm has the same sign as the product of the two numbers).
But it was Shannon that placed the emphasis on restricting focus in boolean algebra to the two-valued case. Boolean algebra on integers was established well before this. And, nowadays, because so many people have been working with computer languages which use "boolean" as a synonym for "two valued boolean", we are losing track of what boolean algebra is. The reference works (such as the ones I cited) focus almost exclusively on the "logic value" case, but shy away from the issue of what distinguishes "logic" from "boolean algebra". --Rdm 13:06, 1 May 2012 (UTC)