Proving special case of SAT is in P

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












Let SAT-100 be the following problem:



Input: Any boolean logic formula



Output: True if there exists a combination of exactly 100 input variables that satisfy the formula.



This is the description of a problem that is appearently in $P$. (old exam question)



I have tried to design an algorithm but I got stuck, so here it goes:



Input: boolean logic formula F
If(count(variables in F)) < 100:
return false
else
# try all combinations of input variables


And here is the problem: building and evaluating all combinations of input variables cant seem to be polynomial because:



$$ n choose 100 = fracn! 100! cdot (n-100)! in mathcalO(n!)
$$



and this nasty factorial cant be bounded with any polinomial that I know of.



I dont think the exam is wrong, so I must have overlooked something.







share|cite|improve this question






















  • Hint: how many input variable combinations are there and how long does it take to check if each one satisfies the formula or not?
    – badroit
    Sep 2 at 13:51










  • What do you mean by a combination of input variables satisfying the formula?
    – David Richerby
    Sep 2 at 20:54














up vote
2
down vote

favorite












Let SAT-100 be the following problem:



Input: Any boolean logic formula



Output: True if there exists a combination of exactly 100 input variables that satisfy the formula.



This is the description of a problem that is appearently in $P$. (old exam question)



I have tried to design an algorithm but I got stuck, so here it goes:



Input: boolean logic formula F
If(count(variables in F)) < 100:
return false
else
# try all combinations of input variables


And here is the problem: building and evaluating all combinations of input variables cant seem to be polynomial because:



$$ n choose 100 = fracn! 100! cdot (n-100)! in mathcalO(n!)
$$



and this nasty factorial cant be bounded with any polinomial that I know of.



I dont think the exam is wrong, so I must have overlooked something.







share|cite|improve this question






















  • Hint: how many input variable combinations are there and how long does it take to check if each one satisfies the formula or not?
    – badroit
    Sep 2 at 13:51










  • What do you mean by a combination of input variables satisfying the formula?
    – David Richerby
    Sep 2 at 20:54












up vote
2
down vote

favorite









up vote
2
down vote

favorite











Let SAT-100 be the following problem:



Input: Any boolean logic formula



Output: True if there exists a combination of exactly 100 input variables that satisfy the formula.



This is the description of a problem that is appearently in $P$. (old exam question)



I have tried to design an algorithm but I got stuck, so here it goes:



Input: boolean logic formula F
If(count(variables in F)) < 100:
return false
else
# try all combinations of input variables


And here is the problem: building and evaluating all combinations of input variables cant seem to be polynomial because:



$$ n choose 100 = fracn! 100! cdot (n-100)! in mathcalO(n!)
$$



and this nasty factorial cant be bounded with any polinomial that I know of.



I dont think the exam is wrong, so I must have overlooked something.







share|cite|improve this question














Let SAT-100 be the following problem:



Input: Any boolean logic formula



Output: True if there exists a combination of exactly 100 input variables that satisfy the formula.



This is the description of a problem that is appearently in $P$. (old exam question)



I have tried to design an algorithm but I got stuck, so here it goes:



Input: boolean logic formula F
If(count(variables in F)) < 100:
return false
else
# try all combinations of input variables


And here is the problem: building and evaluating all combinations of input variables cant seem to be polynomial because:



$$ n choose 100 = fracn! 100! cdot (n-100)! in mathcalO(n!)
$$



and this nasty factorial cant be bounded with any polinomial that I know of.



I dont think the exam is wrong, so I must have overlooked something.









share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Sep 3 at 10:58









Filippo De Bortoli

1276




1276










asked Sep 2 at 13:28









zython

217110




217110











  • Hint: how many input variable combinations are there and how long does it take to check if each one satisfies the formula or not?
    – badroit
    Sep 2 at 13:51










  • What do you mean by a combination of input variables satisfying the formula?
    – David Richerby
    Sep 2 at 20:54
















  • Hint: how many input variable combinations are there and how long does it take to check if each one satisfies the formula or not?
    – badroit
    Sep 2 at 13:51










  • What do you mean by a combination of input variables satisfying the formula?
    – David Richerby
    Sep 2 at 20:54















Hint: how many input variable combinations are there and how long does it take to check if each one satisfies the formula or not?
– badroit
Sep 2 at 13:51




Hint: how many input variable combinations are there and how long does it take to check if each one satisfies the formula or not?
– badroit
Sep 2 at 13:51












What do you mean by a combination of input variables satisfying the formula?
– David Richerby
Sep 2 at 20:54




What do you mean by a combination of input variables satisfying the formula?
– David Richerby
Sep 2 at 20:54










1 Answer
1






active

oldest

votes

















up vote
6
down vote



accepted










Note that
$$fracn!(n-100)!100!<fracn!(n-100)!= n cdot (n-1)cdot ldots cdot (n-99)< n^100.$$



Thus, your algorithm runs in polynomial time






share|cite|improve this answer




















  • this is just what I was looking for, thank you
    – zython
    Sep 2 at 13:58










Your Answer




StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
);
);
, "mathjax-editing");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "419"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcs.stackexchange.com%2fquestions%2f96900%2fproving-special-case-of-sat-is-in-p%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
6
down vote



accepted










Note that
$$fracn!(n-100)!100!<fracn!(n-100)!= n cdot (n-1)cdot ldots cdot (n-99)< n^100.$$



Thus, your algorithm runs in polynomial time






share|cite|improve this answer




















  • this is just what I was looking for, thank you
    – zython
    Sep 2 at 13:58














up vote
6
down vote



accepted










Note that
$$fracn!(n-100)!100!<fracn!(n-100)!= n cdot (n-1)cdot ldots cdot (n-99)< n^100.$$



Thus, your algorithm runs in polynomial time






share|cite|improve this answer




















  • this is just what I was looking for, thank you
    – zython
    Sep 2 at 13:58












up vote
6
down vote



accepted







up vote
6
down vote



accepted






Note that
$$fracn!(n-100)!100!<fracn!(n-100)!= n cdot (n-1)cdot ldots cdot (n-99)< n^100.$$



Thus, your algorithm runs in polynomial time






share|cite|improve this answer












Note that
$$fracn!(n-100)!100!<fracn!(n-100)!= n cdot (n-1)cdot ldots cdot (n-99)< n^100.$$



Thus, your algorithm runs in polynomial time







share|cite|improve this answer












share|cite|improve this answer



share|cite|improve this answer










answered Sep 2 at 13:57









user3563894

1318




1318











  • this is just what I was looking for, thank you
    – zython
    Sep 2 at 13:58
















  • this is just what I was looking for, thank you
    – zython
    Sep 2 at 13:58















this is just what I was looking for, thank you
– zython
Sep 2 at 13:58




this is just what I was looking for, thank you
– zython
Sep 2 at 13:58

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcs.stackexchange.com%2fquestions%2f96900%2fproving-special-case-of-sat-is-in-p%23new-answer', 'question_page');

);

Post as a guest













































































Comments

Popular posts from this blog

What does second last employer means? [closed]

List of Gilmore Girls characters

Confectionery