# does the order of the rows matter? [closed]

from my understanding the truth table is supposed to generate every possible combination of true and false values without the order of the combination taking into account.

however one of my teachers said that their is a particular order to each row that is used to generate multiple combinations.

can you please explain this to me.

## closed as unclear what you're asking by David Richerby, Evil, Discrete lizard♦, Yuval Filmus, Luke MathiesonFeb 12 at 23:49

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• Your understanding is correct. However, can you think of any way in which your teacher might make sense? – Apass.Jack Feb 4 at 16:00
• I don't understand your question. Are you just asking if it matters what order the rows of a truth table are written in? – David Richerby Feb 4 at 16:10
• @DavidRicherby yes – Abdullah Mustapha Feb 4 at 16:42
• The order of the row don’t matter, as long as you cover every possible combination of input values. Doing this without an order in mind, does not make it incorrect, but it does make it easier to miss some entries. I think your prof is suggesting using a order so you cover all the combinations in a systemic way. What I do, if I have N Boolean inputs for example, I start with the first row have all values assumed false. In the next row, I make the Nth bool true, then only the N-1 true, then both N and N-1 true, then N-2 true with N and N-1 false, and so on. Any such system is fine. – ScottK Feb 4 at 16:50
• @ScottK Summary: you order the rows to be the binary representation of the numbers $0, \dots, 2^N-1$. – David Richerby Feb 4 at 16:53

"The order of the row don’t matter, as long as you cover every possible combination of input values. Doing this without an order in mind, does not make it incorrect, but it does make it easier to miss some entries. I think your prof is suggesting using a order so you cover all the combinations in a systemic way. What I do, if I have N Boolean inputs for example, I start with the first row have all values assumed false. In the next row, I make the Nth bool true, then only the N-1 true, then both N and N-1 true, then N-2 true with N and N-1 false, and so on. Any such system is fine." -@Scottk

"@ScottK Summary: you order the rows to be the binary representation of the numbers $$0, \dots, 2^N-1$$. " -@DavidRicherby

"Your prof seems to be wanting you to follow the binary ordering that @DavidRicherby pointed out earlier: either starting with all true or all false. All orders are correct but go with the binary order since that is what your prof seems to be teaching you, and it is was most pros use. There are other useful orderings that engineers use for circuit simplification for example Karnaugh Maps https://en.m.wikipedia.org/wiki/Karnaugh_map" -@Scottk

• I am rather surprised that you came up with an answer that is very different from the helpful comments given by ScottK and David Richerby . "Preferences may exist from the person taking the course", which is not very interesting since we are seeking the scientific reason behind that person's preference. I have not seen Gray code being used in the current case of truth tables a lot. Do you? – Apass.Jack Feb 6 at 19:04
• @Apass.Jack I was hoping to summarize. but it may have derailed. I meant the person teaching the course. I will fix that – Abdullah Mustapha Feb 6 at 20:08
• @Apass.Jack maybe I didn't get it myself, but I think I do now. – Abdullah Mustapha Feb 6 at 20:24
• Sorry if I appear nitpicking, but i think the first comment by @ScottK contains the most helpful information about the situation. 1) order does not matter for correctness. 2) order does matter since a particular order of the rows such as the most popular one by the order of increasing binary numbers helps easier production, visualization and usage. – Apass.Jack Feb 6 at 23:37
• @Ab Upvoted although I would love to see your own words that explains the ideas coherently. – Apass.Jack Feb 8 at 8:49