Understanding Boolean Functions & 2-Valued Algebra

  • Context: Undergrad 
  • Thread starter Thread starter cepheid
  • Start date Start date
  • Tags Tags
    Functions
Click For Summary

Discussion Overview

The discussion revolves around the number of distinct Boolean functions that can be formed with n binary variables in two-valued Boolean algebra. Participants explore the reasoning behind the formula for the number of functions, addressing both theoretical and practical aspects, including truth tables and minterms.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant seeks clarification on why there are 2^(2n) Boolean functions for n variables, expressing confusion over the textbook explanation.
  • Another participant explains that each function can be represented by a truth table, with 2^n combinations of inputs, leading to 2^(2^n) possible functions based on the number of ways to fill the output states.
  • A different participant suggests that the correct formula might be 2^(2^n) instead of 2^(2n), providing reasoning based on the structure of truth tables.
  • One participant calculates the number of possible functions for n = 2, concluding that there are indeed 16 outcomes based on the input combinations, but expresses uncertainty about the reasoning process.
  • Another participant references K-maps and acknowledges the importance of certain functions while still questioning the initial reasoning about the number of functions.
  • One participant presents a table of functions, arguing that it demonstrates the correct number of unique truth tables for n = 3, challenging the earlier claim of 2^(2n).
  • A later reply acknowledges the previous misunderstanding and confirms that the calculations for n = 3 indeed point to 256 functions, while still seeking a simpler method for counting minterms.
  • Some participants express skepticism about the textbook's explanation, suggesting it may contain errors in the representation of the formula.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the correct formula for the number of Boolean functions, with some supporting 2^(2^n) and others adhering to 2^(2n). The discussion remains unresolved regarding the accuracy of the textbook's claims.

Contextual Notes

There are unresolved questions about the assumptions underlying the calculations and the definitions of terms used, particularly regarding minterms and the representation of functions in truth tables.

cepheid
Staff Emeritus
Science Advisor
Gold Member
Messages
5,197
Reaction score
38
I'm trying to understand why, in two-valued boolean algebra, for n variables, it is possible to form 22n different boolean functions. The textbook explanation is not quite clear.

Thanks
 
Mathematics news on Phys.org
Since the variables can only take on two values, 0 and 1 (or F and T), every function of them can be completely specified by a table with a cell for each distinct combination of input values. How many cells will there be? The first variable can be 0 or 1, so can the second,... what does this come out to be (you figure it), so call this number of cells N_C. Each of the N_C cells can be in one of two output states. How many states is that? (Another calculation). As a function of N_C; then plug your value for N_C into this formula. Does your answer match the one given in the textbook? If not you made a mistake somewhere, go back and find it. If still stuck post your work here and ask again.
 
I don't think it's 2^(2n) but rather 2^(2^n). Perhaps this was just a latex typo or formatting problem.

Anyway the easiest way to see why it's 2^(2^n) is to consider the function to be defined by a truth-table, that is, all 2^n possible combinations of the input variables listed on the left and the function output (which is either zero or one in any given position) listed on the right.

The question of how many different functions are possible is indentical to the question of how many unique ways can you fill out the truth-table output. Clearly a function differs from another function if it is different in even just one of the 2^n positions. So the number of such function is therefore precisely the same as the number of binary combinations that can be formed in the 2^n posistions of the truth-table, which of course is 2^(2^n)
 
selfAdjoint: I'll think it out...

if n = 2, (i.e. we have F(x,y)), then there are 4 possible inputs to the function, namely 00, 01, 10, 11. Are there 22n possible functions because each one of these inputs could result in either a zero or a one, so we have (2n)2 = 16 outcomes? i.e. it is possible to have all of the inputs produce a one, all produce a zero, and any combination in between?

Another way of looking at it: These inputs that I listed correspond to minterms: m0, m1, m2, and m3. So the question is reduced to how many possible ways are there to sum these minterms together:

[1] m0

[2] m0 + m1

[3]m0 + m1 + m2

[4]m0 + m1 + m2 + m3

plus three more (m1 by itself and the sum of it and each of the remaining two (2&3))

plus two more (m2 by itself and the sum of it and the remaining one (3))

plus one more (m3)

plus two more (the sum of m0 and each of 2 and 3)

Hmm...that's twelve...missing four. Wait...I got it:

0 + 2 + 3
0 + 1 + 3
1 + 2 + 3

arrrggghhh...that's only 15. Took me forever to realize that the last one I was missing was a sum of none of the terms:

F = 0. :redface:

Surely threre must be some easier way of arriving at this using permutations or something?
 
uart: sorry dude, I'm going with the book on this one...
 
selfAdjoint:

Ok...I also read the section on K-maps (slowly reviewing for my midterm tomorrow in digital logic design...I guess I should have known all about those 16 functions, because some are quite important: NAND, NOR, XOR XNOR, etc. Thankfully I've studied now.). It seems trivial now that for a two by two array of cells representing the minterms, each of which will be filled in with either 0 or 1, there will be 4 x 4 = 16 possible ways to fill in the K-map.

Three variable map: 2 X 4 cells...8 X 8 = 64 = (23)2.

But I'm still wondering about my first reply post and whether there is some easier way of doing it using n permute something...
 
Last edited:
cepheid said:
uart: sorry dude, I'm going with the book on this one...
Code:
abc	f0	f1	f2	f3	f4	f5	f6	f7  ...
---	--	--	--	--	--	--	--	--
000	0	0	0	0	0	0	0	0
001	0	0	0	0	0	0	0	0
010	0	0	0	0	0	0	0	0
011 	0	0	0	0	0	0	0	0
100	0	0	0	0	0	0	0	0
101	0	0	0	0	1	1	1	1
110	0	0	1	1	0	0	1	1
111	0	1	0	1	0	1	0	1

I hope you can see that this series of functions can be extended to 2^(2^3)) =256 unique truth-tables and that it is not limited to 2^(2*3) = 64 as you are claiming. Not unless you are placing some form of un-stated restriction on the characteristics of the functions under consideration.
 
Last edited:
I do see it! From your table it is obvious that the number of ways to fill eight different spots each with one of two possible values is

[tex]2^8 = 2^{2^3}[/tex].

I apologize for being so blase about it before. I was blinded to this because I was considering the [itex]n = 2[/itex] case, where it just so happens that

[tex]2^{(2 \times 2)} = 2^{2^2}[/tex].

Still, no matter how I look at it, all my methods...(the "reasoning out" method at the beginning of post #4 and the minterm method that made up the rest of the post, as well as the K-map method in post #6...all seem to point to 256 possible functions for [itex]n = 3[/itex].

About the minterm method, if somebody would kindly answer the question I posed in #4 about whether there is an easier method of finding out how many different ways to sum up [itex]2^n[/itex] minterms (using permutations, I think?), then that will probably clinch it. Still, I wasn't lying about the textbook:

From Digital Design, Third Edition, by M. Morris Mano, pg. 46:

It was previously stated that for n binary variables, one can obtain 2n distinct minterms, and that any Boolean function can be expressed as a sum of minterms . The minterms whose sum define the Boolean function are those that give the 1's of a function in a truth table. Since the function can be either 1 or 0 for each minterm, and since there are 2n minterms, one can calculate the possible functions that can be formed with n variables to be 22n.

(Now you see what I meant about the textbook explanation being crappy in the first place!) If this statement is truly a mistake (and I'm more and more convinced it is), then they commit it at least twice, once again on pg. 48.

 
and since there are 2^n minterms, one can calculate the possible functions that can be formed with n variables to be 2^(2n)

Yeah I've seen that book by Mano, I never thought it was a particularly good text. In this case though I think it is simply a text setting error that has slipped through the proof reading. Actually double indexes, such as this case of an exponent of an exponent, is something that can get messed-up fairly easily during text setting. I'll bet it was 2^(2^n) in the original manuscript and that it got broken somewhere in the text setting and printing of the book.
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 20 ·
Replies
20
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 6 ·
Replies
6
Views
6K
  • · Replies 2 ·
Replies
2
Views
2K