title: Truth Table Generation
body: <p>Anybody have thoughts on generating a row of a truth table with out creating the entire table. For example, a user would enter in a row number and that truth table row is generated. Also, this should be done without creating the table until you get to that row number. Essentially, I want to know if there is an efficient way to calculate a truth row value only based on a the truth table row as an input. </p>
  
  <p>Example:
  Assume 3 variables
  printTruthTableRow(3) would produce 010</p>
  
  <p>Actually, could I just convert the input-1 to a binary value to get that truth table row?</p>
  
  <p>EDIT: Let me give you guys a little more background. I am wrote a basic DPLL SAT Solver in Java. My goal is to have a bunch of threads run the solver to solve the n-Queen problem. Currently, my algorithm generate a row of a truth table, one at a time, then feeds it to a thread to solve. The problem is that my truth table generation cannot be done concurrently by the threads. If a thread grabs a truth table row, it must lock the method, generate a row, and then unlock. I can increase speedup if less work is done when generating a truth table row. I can just convert an atomic count value to binary and have the thread test that. Thank you all for the answers.</p>