Fw: Lightbulb stumper...

"Robert J. Brown" (rj@eli.elilabs.com)
Fri, 24 Oct 1997 09:45:50 -0500


Bro Tyler wrote:

    With two switches that can be toggled on and off,
    these are the possibilities:

	     switch A  B      o == on        x == off

	 result 1-  o  o
		2-  o  x
		3-  x  o
		4-  x  x       or 2**2 distinctive results (2 squared)


    With three switches, these are the possibilities:

	     switch A  B  C   o == on        x == off

	 result 1-  o  o  o
		2-  o  o  x
		3-  o  x  o
		4-  o  x  x
		5-  x  o  o
		6-  x  o  x
		7-  x  x  o
		8-  x  x  x   or 2**3 distinctive results (2 cubed)

What you say is true, but you have only enumerated the possible
*INPUT* combinations to the switching function.  For each of these
inputs, you must also specify all possible outputs.  Thus you have
enumerated input combinations numbered 1 thru 8.  The list of
switching functions would look thus:

Input states: 1 2 3 4 5 6 7 8

Assume a single output line (1 light bulb): 0 1 (for off or on)

Input   Switching functions
state   (each column is a different function)

1 000	0 1 0 1 0 1 0 1 0\
2 001	0 0 1 1 0 0 1 1 0 \
3 010	0 0 0 0 1 1 1 1 0  \
4 011	0 0 0 0 0 0 0 0 1   \__ etc..... (256 columns)
5 100	0 0 0 0 0 0 0 0 0   /
6 101	0 0 0 0 0 0 0 0 0  /
7 110	0 0 0 0 0 0 0 0 0 /
8 111	0 0 0 0 0 0 0 0 0/

So we see that 3 input lines can produce 256 unique switching
functions; therefore, my first email was correct, and it is 2^(2^n)
switching functions of n boolean variables, hence the 16 million
figure is the correct answer.

-- 
--------  "And there came a writing to him from Elijah"  [2Ch 21:12]  --------
Robert Jay Brown III rj@eli.elilabs.com  http://www.elilabs.com 1 847 705-0424
Elijah Laboratories Inc.;  37 South Greenwood Avenue;  Palatine, IL 60067-6328
-----  M o d e l i n g   t h e   M e t h o d s   o f   t h e   M i n d  ------