Is the language belongs to NP class? The 2019 Stack Overflow Developer Survey Results Are InIs determining if there is a prime in an interval known to be in P or NP-complete?If the language of a TM is TMs which cannot self recognize, can the original TM?Why is $A_TM$ reducible to $HALT_TM$?Proving a language is not Turing-recognizable by reduction from $D = langle Mrangle mid M text rejects input langle Mrangle$Show that the set of all TMs that move only to the right and loop for some input is decidableProving that a set of grammars for a given finite language is decidableDecidability of the TM's computing a non-empty subset of total functionssmn-theorem: Application by instantiating s<m, n> with other functionUnion of R.E. and Non R.E. languageShow: “Checking no solution for system of linear equations with integer variables and coefficients” $in mathbfNP$Rice's Theorem - usage on $DFA$ or $LBA$

What is the meaning of the verb "bear" in this context?

Shouldn't "much" here be used instead of "more"?

Delete all lines which don't have n characters before delimiter

What do the Banks children have against barley water?

How to manage monthly salary

Why hard-Brexiteers don't insist on a hard border to prevent illegal immigration after Brexit?

Did Section 31 appear in Star Trek: The Next Generation?

Button changing it's text & action. Good or terrible?

Deal with toxic manager when you can't quit

How come people say “Would of”?

Return to UK after being refused entry years previously

Can a rogue use sneak attack with weapons that have the thrown property even if they are not thrown?

Are there any other methods to apply to solving simultaneous equations?

What is the closest word meaning "respect for time / mindful"

Which Sci-Fi work first showed weapon of galactic-scale mass destruction?

Have you ever entered Singapore using a different passport or name?

Time travel alters history but people keep saying nothing's changed

FPGA - DIY Programming

Why isn't the circumferential light around the M87 black hole's event horizon symmetric?

Resizing object distorts it (Illustrator CC 2018)

One word riddle: Vowel in the middle

Can you compress metal and what would be the consequences?

When should I buy a clipper card after flying to OAK?

Can we generate random numbers using irrational numbers like π and e?



Is the language


belongs to NP class?



The 2019 Stack Overflow Developer Survey Results Are InIs determining if there is a prime in an interval known to be in P or NP-complete?If the language of a TM is TMs which cannot self recognize, can the original TM?Why is $A_TM$ reducible to $HALT_TM$?Proving a language is not Turing-recognizable by reduction from $D = langle Mrangle mid M text rejects input langle Mrangle$Show that the set of all TMs that move only to the right and loop for some input is decidableProving that a set of grammars for a given finite language is decidableDecidability of the TM's computing a non-empty subset of total functionssmn-theorem: Application by instantiating s<m, n> with other functionUnion of R.E. and Non R.E. languageShow: “Checking no solution for system of linear equations with integer variables and coefficients” $in mathbfNP$Rice's Theorem - usage on $DFA$ or $LBA$










1












$begingroup$


I was wondering if the following language belongs to NP class and if its complimentary belongs to NP class:



beginalign
C=leftlangle p,nranglemidright.& left. p text and $n$ are natural numbersright.\
&left.text and there's no prime number in the rangeleft[p,p+nright]right
endalign



could you please check if my reasoning is okay to deduce NP?
(I am not sure, but here's what I think):
for each word $langle p,nrangle in C$ we know that the word belongs to C because there exists a primal certificate - an nontrivial divisor to any of the numbers between $[p,p+n]$, though I am not really sure it is in NP.



regarding the complement: I think it is in NP because the compliment compositeness can be decided by guessing a factor nondeterministically. But again I am not so sure about it and I don't know how to correctly prove and show it.



Would really appreciate your input on that as I am quite unsure and also checked textbooks and internet (and this site) about it.



Edit: for the sake of solving the problem, due to xskxzr's comment, let's assume p and n are represented by binary, as there's a difference according to his comment between p and n being represented in unary and binary(this is also quite interesting).










share|cite|improve this question









New contributor




hps13 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$











  • $begingroup$
    It may depend on how $p$ and $n$ are represented (by unary or binary).
    $endgroup$
    – xskxzr
    Apr 7 at 11:50






  • 1




    $begingroup$
    Possible duplicate of Is determining if there is a prime in an interval known to be in P or NP-complete?
    $endgroup$
    – xskxzr
    Apr 7 at 12:43










  • $begingroup$
    My question is about: 1) is my reasoning is enough/correct to deduce C being NP class? 2)regarding its complimentary(which is not written in the aforementioned link - they don't deal with it). those are 2 different questions and i would appreciate learning from my problem in order to understand my mistake and additionally if the compliment of C is in NP
    $endgroup$
    – hps13
    Apr 7 at 12:57






  • 1




    $begingroup$
    @xskxzr That's not the same question. The OP is asking whether it is in NP, not NP-complete. That question is also the complement of this one.
    $endgroup$
    – orlp
    Apr 7 at 13:05






  • 1




    $begingroup$
    @hps13 Your certificate does not work. To prove that (p,n) is in C, you need to show that every number in that interval is not a prime, so you will need n divisors. But then your certificate will be of size O(n *log(n+p)), which is exponential compared to the size log(p)+log(n) of the word.
    $endgroup$
    – mlk
    Apr 7 at 15:59















1












$begingroup$


I was wondering if the following language belongs to NP class and if its complimentary belongs to NP class:



beginalign
C=leftlangle p,nranglemidright.& left. p text and $n$ are natural numbersright.\
&left.text and there's no prime number in the rangeleft[p,p+nright]right
endalign



could you please check if my reasoning is okay to deduce NP?
(I am not sure, but here's what I think):
for each word $langle p,nrangle in C$ we know that the word belongs to C because there exists a primal certificate - an nontrivial divisor to any of the numbers between $[p,p+n]$, though I am not really sure it is in NP.



regarding the complement: I think it is in NP because the compliment compositeness can be decided by guessing a factor nondeterministically. But again I am not so sure about it and I don't know how to correctly prove and show it.



Would really appreciate your input on that as I am quite unsure and also checked textbooks and internet (and this site) about it.



Edit: for the sake of solving the problem, due to xskxzr's comment, let's assume p and n are represented by binary, as there's a difference according to his comment between p and n being represented in unary and binary(this is also quite interesting).










share|cite|improve this question









New contributor




hps13 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$











  • $begingroup$
    It may depend on how $p$ and $n$ are represented (by unary or binary).
    $endgroup$
    – xskxzr
    Apr 7 at 11:50






  • 1




    $begingroup$
    Possible duplicate of Is determining if there is a prime in an interval known to be in P or NP-complete?
    $endgroup$
    – xskxzr
    Apr 7 at 12:43










  • $begingroup$
    My question is about: 1) is my reasoning is enough/correct to deduce C being NP class? 2)regarding its complimentary(which is not written in the aforementioned link - they don't deal with it). those are 2 different questions and i would appreciate learning from my problem in order to understand my mistake and additionally if the compliment of C is in NP
    $endgroup$
    – hps13
    Apr 7 at 12:57






  • 1




    $begingroup$
    @xskxzr That's not the same question. The OP is asking whether it is in NP, not NP-complete. That question is also the complement of this one.
    $endgroup$
    – orlp
    Apr 7 at 13:05






  • 1




    $begingroup$
    @hps13 Your certificate does not work. To prove that (p,n) is in C, you need to show that every number in that interval is not a prime, so you will need n divisors. But then your certificate will be of size O(n *log(n+p)), which is exponential compared to the size log(p)+log(n) of the word.
    $endgroup$
    – mlk
    Apr 7 at 15:59













1












1








1





$begingroup$


I was wondering if the following language belongs to NP class and if its complimentary belongs to NP class:



beginalign
C=leftlangle p,nranglemidright.& left. p text and $n$ are natural numbersright.\
&left.text and there's no prime number in the rangeleft[p,p+nright]right
endalign



could you please check if my reasoning is okay to deduce NP?
(I am not sure, but here's what I think):
for each word $langle p,nrangle in C$ we know that the word belongs to C because there exists a primal certificate - an nontrivial divisor to any of the numbers between $[p,p+n]$, though I am not really sure it is in NP.



regarding the complement: I think it is in NP because the compliment compositeness can be decided by guessing a factor nondeterministically. But again I am not so sure about it and I don't know how to correctly prove and show it.



Would really appreciate your input on that as I am quite unsure and also checked textbooks and internet (and this site) about it.



Edit: for the sake of solving the problem, due to xskxzr's comment, let's assume p and n are represented by binary, as there's a difference according to his comment between p and n being represented in unary and binary(this is also quite interesting).










share|cite|improve this question









New contributor




hps13 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$




I was wondering if the following language belongs to NP class and if its complimentary belongs to NP class:



beginalign
C=leftlangle p,nranglemidright.& left. p text and $n$ are natural numbersright.\
&left.text and there's no prime number in the rangeleft[p,p+nright]right
endalign



could you please check if my reasoning is okay to deduce NP?
(I am not sure, but here's what I think):
for each word $langle p,nrangle in C$ we know that the word belongs to C because there exists a primal certificate - an nontrivial divisor to any of the numbers between $[p,p+n]$, though I am not really sure it is in NP.



regarding the complement: I think it is in NP because the compliment compositeness can be decided by guessing a factor nondeterministically. But again I am not so sure about it and I don't know how to correctly prove and show it.



Would really appreciate your input on that as I am quite unsure and also checked textbooks and internet (and this site) about it.



Edit: for the sake of solving the problem, due to xskxzr's comment, let's assume p and n are represented by binary, as there's a difference according to his comment between p and n being represented in unary and binary(this is also quite interesting).







complexity-theory turing-machines computability np decision-problem






share|cite|improve this question









New contributor




hps13 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|cite|improve this question









New contributor




hps13 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|cite|improve this question




share|cite|improve this question








edited Apr 7 at 12:54







hps13













New contributor




hps13 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Apr 7 at 11:21









hps13hps13

226




226




New contributor




hps13 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





hps13 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






hps13 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











  • $begingroup$
    It may depend on how $p$ and $n$ are represented (by unary or binary).
    $endgroup$
    – xskxzr
    Apr 7 at 11:50






  • 1




    $begingroup$
    Possible duplicate of Is determining if there is a prime in an interval known to be in P or NP-complete?
    $endgroup$
    – xskxzr
    Apr 7 at 12:43










  • $begingroup$
    My question is about: 1) is my reasoning is enough/correct to deduce C being NP class? 2)regarding its complimentary(which is not written in the aforementioned link - they don't deal with it). those are 2 different questions and i would appreciate learning from my problem in order to understand my mistake and additionally if the compliment of C is in NP
    $endgroup$
    – hps13
    Apr 7 at 12:57






  • 1




    $begingroup$
    @xskxzr That's not the same question. The OP is asking whether it is in NP, not NP-complete. That question is also the complement of this one.
    $endgroup$
    – orlp
    Apr 7 at 13:05






  • 1




    $begingroup$
    @hps13 Your certificate does not work. To prove that (p,n) is in C, you need to show that every number in that interval is not a prime, so you will need n divisors. But then your certificate will be of size O(n *log(n+p)), which is exponential compared to the size log(p)+log(n) of the word.
    $endgroup$
    – mlk
    Apr 7 at 15:59
















  • $begingroup$
    It may depend on how $p$ and $n$ are represented (by unary or binary).
    $endgroup$
    – xskxzr
    Apr 7 at 11:50






  • 1




    $begingroup$
    Possible duplicate of Is determining if there is a prime in an interval known to be in P or NP-complete?
    $endgroup$
    – xskxzr
    Apr 7 at 12:43










  • $begingroup$
    My question is about: 1) is my reasoning is enough/correct to deduce C being NP class? 2)regarding its complimentary(which is not written in the aforementioned link - they don't deal with it). those are 2 different questions and i would appreciate learning from my problem in order to understand my mistake and additionally if the compliment of C is in NP
    $endgroup$
    – hps13
    Apr 7 at 12:57






  • 1




    $begingroup$
    @xskxzr That's not the same question. The OP is asking whether it is in NP, not NP-complete. That question is also the complement of this one.
    $endgroup$
    – orlp
    Apr 7 at 13:05






  • 1




    $begingroup$
    @hps13 Your certificate does not work. To prove that (p,n) is in C, you need to show that every number in that interval is not a prime, so you will need n divisors. But then your certificate will be of size O(n *log(n+p)), which is exponential compared to the size log(p)+log(n) of the word.
    $endgroup$
    – mlk
    Apr 7 at 15:59















$begingroup$
It may depend on how $p$ and $n$ are represented (by unary or binary).
$endgroup$
– xskxzr
Apr 7 at 11:50




$begingroup$
It may depend on how $p$ and $n$ are represented (by unary or binary).
$endgroup$
– xskxzr
Apr 7 at 11:50




1




1




$begingroup$
Possible duplicate of Is determining if there is a prime in an interval known to be in P or NP-complete?
$endgroup$
– xskxzr
Apr 7 at 12:43




$begingroup$
Possible duplicate of Is determining if there is a prime in an interval known to be in P or NP-complete?
$endgroup$
– xskxzr
Apr 7 at 12:43












$begingroup$
My question is about: 1) is my reasoning is enough/correct to deduce C being NP class? 2)regarding its complimentary(which is not written in the aforementioned link - they don't deal with it). those are 2 different questions and i would appreciate learning from my problem in order to understand my mistake and additionally if the compliment of C is in NP
$endgroup$
– hps13
Apr 7 at 12:57




$begingroup$
My question is about: 1) is my reasoning is enough/correct to deduce C being NP class? 2)regarding its complimentary(which is not written in the aforementioned link - they don't deal with it). those are 2 different questions and i would appreciate learning from my problem in order to understand my mistake and additionally if the compliment of C is in NP
$endgroup$
– hps13
Apr 7 at 12:57




1




1




$begingroup$
@xskxzr That's not the same question. The OP is asking whether it is in NP, not NP-complete. That question is also the complement of this one.
$endgroup$
– orlp
Apr 7 at 13:05




$begingroup$
@xskxzr That's not the same question. The OP is asking whether it is in NP, not NP-complete. That question is also the complement of this one.
$endgroup$
– orlp
Apr 7 at 13:05




1




1




$begingroup$
@hps13 Your certificate does not work. To prove that (p,n) is in C, you need to show that every number in that interval is not a prime, so you will need n divisors. But then your certificate will be of size O(n *log(n+p)), which is exponential compared to the size log(p)+log(n) of the word.
$endgroup$
– mlk
Apr 7 at 15:59




$begingroup$
@hps13 Your certificate does not work. To prove that (p,n) is in C, you need to show that every number in that interval is not a prime, so you will need n divisors. But then your certificate will be of size O(n *log(n+p)), which is exponential compared to the size log(p)+log(n) of the word.
$endgroup$
– mlk
Apr 7 at 15:59










2 Answers
2






active

oldest

votes


















5












$begingroup$

Note that there's always a prime between $p$ and $2p$ for any $p$ thus we can eliminate $n$ as a complexity parameter, as for any non-trivial instance we have $n < p$.



The complement (there exists a prime in range $[p, p+n]$) is quite easy (due to the shoulders of giants). There are various well-known polynomial size certificates of primality of $q$ you could return along with some $q in [p, p+n]$ if that prime $q$ exists. Thus your language is in co-NP.



However the question of whether it is in NP or not seems very hard to me. Our input size is $b$ such that $2^b approx p$. You need the existence of a $O(b^c)$ sized certificate that in the worst case asserts the compositeness of an exponentially large ($|[p, p+n]| approx |[p, 2p]| approx p approx 2^b$) series of consecutive integers. From my intuition about number theory, finding such a certificate would be a major result, but disproving its existence would be as well. But perhaps someone with more number theoretic knowledge than me can pitch in if either of those turn out to be easy.






share|cite|improve this answer









$endgroup$












  • $begingroup$
    thank you very much for your answer. it really helps me understand the background behind the problem, but as you've written, i am trying to check whether it is an NP problem and it is indeed a difficult yet interesting thing. thank you so much for what you've written, it really helps
    $endgroup$
    – hps13
    Apr 7 at 12:41










  • $begingroup$
    I am wondering - did the explanation i tried to give is wrong? I am not sure, but here's what I think: for each word ⟨p,n⟩∈C we know that the word belongs to C because there exists a primal certificate - an nontrivial divisor to any of the numbers between [p,p+n],
    $endgroup$
    – hps13
    Apr 7 at 12:53










  • $begingroup$
    "disproving its existence would be [a major result] as well" Well, proving this problem is not in NP would prove $NPneq co-NP$, which has a corollary $Pneq NP$. So yes, it would be quite a result!
    $endgroup$
    – Wojowu
    Apr 7 at 18:21


















2












$begingroup$

As orlp says, it's trivial to give a certificate if the answer is "YES" (just give a non-trivial factor of each of the numbers in question), the problem is whether this certificate is polynomial sized.



There is a conjecture, backed by heuristics and some computational evidence, that there is a constant c > 0 such that for any k-bit prime p, there is a prime between p and p + c * k^2. If this conjecture is true, then the certificate is actually of size O (k^3) whenever the answer is YES, so the problem is in NP. But, it's just a conjecture.



But of course if we might be able to prove the much weaker conjecture "for some c, there is always a prime between p and p + c * k^3" or the even weaker conjecture "there is a polynomial pol (k) such that there is always a prime between p and p + pol(k)", then this problem would also be in NP. So we can prove that is in NP by proving something about prime gaps.



There is also the possibility that a less obvious and shorter certificate exists.






share|cite|improve this answer









$endgroup$













    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',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );






    hps13 is a new contributor. Be nice, and check out our Code of Conduct.









    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcs.stackexchange.com%2fquestions%2f106600%2fis-the-language-p-n-p-and-n-are-natural-numbers-and-theres-no-prime-number%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    5












    $begingroup$

    Note that there's always a prime between $p$ and $2p$ for any $p$ thus we can eliminate $n$ as a complexity parameter, as for any non-trivial instance we have $n < p$.



    The complement (there exists a prime in range $[p, p+n]$) is quite easy (due to the shoulders of giants). There are various well-known polynomial size certificates of primality of $q$ you could return along with some $q in [p, p+n]$ if that prime $q$ exists. Thus your language is in co-NP.



    However the question of whether it is in NP or not seems very hard to me. Our input size is $b$ such that $2^b approx p$. You need the existence of a $O(b^c)$ sized certificate that in the worst case asserts the compositeness of an exponentially large ($|[p, p+n]| approx |[p, 2p]| approx p approx 2^b$) series of consecutive integers. From my intuition about number theory, finding such a certificate would be a major result, but disproving its existence would be as well. But perhaps someone with more number theoretic knowledge than me can pitch in if either of those turn out to be easy.






    share|cite|improve this answer









    $endgroup$












    • $begingroup$
      thank you very much for your answer. it really helps me understand the background behind the problem, but as you've written, i am trying to check whether it is an NP problem and it is indeed a difficult yet interesting thing. thank you so much for what you've written, it really helps
      $endgroup$
      – hps13
      Apr 7 at 12:41










    • $begingroup$
      I am wondering - did the explanation i tried to give is wrong? I am not sure, but here's what I think: for each word ⟨p,n⟩∈C we know that the word belongs to C because there exists a primal certificate - an nontrivial divisor to any of the numbers between [p,p+n],
      $endgroup$
      – hps13
      Apr 7 at 12:53










    • $begingroup$
      "disproving its existence would be [a major result] as well" Well, proving this problem is not in NP would prove $NPneq co-NP$, which has a corollary $Pneq NP$. So yes, it would be quite a result!
      $endgroup$
      – Wojowu
      Apr 7 at 18:21















    5












    $begingroup$

    Note that there's always a prime between $p$ and $2p$ for any $p$ thus we can eliminate $n$ as a complexity parameter, as for any non-trivial instance we have $n < p$.



    The complement (there exists a prime in range $[p, p+n]$) is quite easy (due to the shoulders of giants). There are various well-known polynomial size certificates of primality of $q$ you could return along with some $q in [p, p+n]$ if that prime $q$ exists. Thus your language is in co-NP.



    However the question of whether it is in NP or not seems very hard to me. Our input size is $b$ such that $2^b approx p$. You need the existence of a $O(b^c)$ sized certificate that in the worst case asserts the compositeness of an exponentially large ($|[p, p+n]| approx |[p, 2p]| approx p approx 2^b$) series of consecutive integers. From my intuition about number theory, finding such a certificate would be a major result, but disproving its existence would be as well. But perhaps someone with more number theoretic knowledge than me can pitch in if either of those turn out to be easy.






    share|cite|improve this answer









    $endgroup$












    • $begingroup$
      thank you very much for your answer. it really helps me understand the background behind the problem, but as you've written, i am trying to check whether it is an NP problem and it is indeed a difficult yet interesting thing. thank you so much for what you've written, it really helps
      $endgroup$
      – hps13
      Apr 7 at 12:41










    • $begingroup$
      I am wondering - did the explanation i tried to give is wrong? I am not sure, but here's what I think: for each word ⟨p,n⟩∈C we know that the word belongs to C because there exists a primal certificate - an nontrivial divisor to any of the numbers between [p,p+n],
      $endgroup$
      – hps13
      Apr 7 at 12:53










    • $begingroup$
      "disproving its existence would be [a major result] as well" Well, proving this problem is not in NP would prove $NPneq co-NP$, which has a corollary $Pneq NP$. So yes, it would be quite a result!
      $endgroup$
      – Wojowu
      Apr 7 at 18:21













    5












    5








    5





    $begingroup$

    Note that there's always a prime between $p$ and $2p$ for any $p$ thus we can eliminate $n$ as a complexity parameter, as for any non-trivial instance we have $n < p$.



    The complement (there exists a prime in range $[p, p+n]$) is quite easy (due to the shoulders of giants). There are various well-known polynomial size certificates of primality of $q$ you could return along with some $q in [p, p+n]$ if that prime $q$ exists. Thus your language is in co-NP.



    However the question of whether it is in NP or not seems very hard to me. Our input size is $b$ such that $2^b approx p$. You need the existence of a $O(b^c)$ sized certificate that in the worst case asserts the compositeness of an exponentially large ($|[p, p+n]| approx |[p, 2p]| approx p approx 2^b$) series of consecutive integers. From my intuition about number theory, finding such a certificate would be a major result, but disproving its existence would be as well. But perhaps someone with more number theoretic knowledge than me can pitch in if either of those turn out to be easy.






    share|cite|improve this answer









    $endgroup$



    Note that there's always a prime between $p$ and $2p$ for any $p$ thus we can eliminate $n$ as a complexity parameter, as for any non-trivial instance we have $n < p$.



    The complement (there exists a prime in range $[p, p+n]$) is quite easy (due to the shoulders of giants). There are various well-known polynomial size certificates of primality of $q$ you could return along with some $q in [p, p+n]$ if that prime $q$ exists. Thus your language is in co-NP.



    However the question of whether it is in NP or not seems very hard to me. Our input size is $b$ such that $2^b approx p$. You need the existence of a $O(b^c)$ sized certificate that in the worst case asserts the compositeness of an exponentially large ($|[p, p+n]| approx |[p, 2p]| approx p approx 2^b$) series of consecutive integers. From my intuition about number theory, finding such a certificate would be a major result, but disproving its existence would be as well. But perhaps someone with more number theoretic knowledge than me can pitch in if either of those turn out to be easy.







    share|cite|improve this answer












    share|cite|improve this answer



    share|cite|improve this answer










    answered Apr 7 at 12:24









    orlporlp

    5,9851826




    5,9851826











    • $begingroup$
      thank you very much for your answer. it really helps me understand the background behind the problem, but as you've written, i am trying to check whether it is an NP problem and it is indeed a difficult yet interesting thing. thank you so much for what you've written, it really helps
      $endgroup$
      – hps13
      Apr 7 at 12:41










    • $begingroup$
      I am wondering - did the explanation i tried to give is wrong? I am not sure, but here's what I think: for each word ⟨p,n⟩∈C we know that the word belongs to C because there exists a primal certificate - an nontrivial divisor to any of the numbers between [p,p+n],
      $endgroup$
      – hps13
      Apr 7 at 12:53










    • $begingroup$
      "disproving its existence would be [a major result] as well" Well, proving this problem is not in NP would prove $NPneq co-NP$, which has a corollary $Pneq NP$. So yes, it would be quite a result!
      $endgroup$
      – Wojowu
      Apr 7 at 18:21
















    • $begingroup$
      thank you very much for your answer. it really helps me understand the background behind the problem, but as you've written, i am trying to check whether it is an NP problem and it is indeed a difficult yet interesting thing. thank you so much for what you've written, it really helps
      $endgroup$
      – hps13
      Apr 7 at 12:41










    • $begingroup$
      I am wondering - did the explanation i tried to give is wrong? I am not sure, but here's what I think: for each word ⟨p,n⟩∈C we know that the word belongs to C because there exists a primal certificate - an nontrivial divisor to any of the numbers between [p,p+n],
      $endgroup$
      – hps13
      Apr 7 at 12:53










    • $begingroup$
      "disproving its existence would be [a major result] as well" Well, proving this problem is not in NP would prove $NPneq co-NP$, which has a corollary $Pneq NP$. So yes, it would be quite a result!
      $endgroup$
      – Wojowu
      Apr 7 at 18:21















    $begingroup$
    thank you very much for your answer. it really helps me understand the background behind the problem, but as you've written, i am trying to check whether it is an NP problem and it is indeed a difficult yet interesting thing. thank you so much for what you've written, it really helps
    $endgroup$
    – hps13
    Apr 7 at 12:41




    $begingroup$
    thank you very much for your answer. it really helps me understand the background behind the problem, but as you've written, i am trying to check whether it is an NP problem and it is indeed a difficult yet interesting thing. thank you so much for what you've written, it really helps
    $endgroup$
    – hps13
    Apr 7 at 12:41












    $begingroup$
    I am wondering - did the explanation i tried to give is wrong? I am not sure, but here's what I think: for each word ⟨p,n⟩∈C we know that the word belongs to C because there exists a primal certificate - an nontrivial divisor to any of the numbers between [p,p+n],
    $endgroup$
    – hps13
    Apr 7 at 12:53




    $begingroup$
    I am wondering - did the explanation i tried to give is wrong? I am not sure, but here's what I think: for each word ⟨p,n⟩∈C we know that the word belongs to C because there exists a primal certificate - an nontrivial divisor to any of the numbers between [p,p+n],
    $endgroup$
    – hps13
    Apr 7 at 12:53












    $begingroup$
    "disproving its existence would be [a major result] as well" Well, proving this problem is not in NP would prove $NPneq co-NP$, which has a corollary $Pneq NP$. So yes, it would be quite a result!
    $endgroup$
    – Wojowu
    Apr 7 at 18:21




    $begingroup$
    "disproving its existence would be [a major result] as well" Well, proving this problem is not in NP would prove $NPneq co-NP$, which has a corollary $Pneq NP$. So yes, it would be quite a result!
    $endgroup$
    – Wojowu
    Apr 7 at 18:21











    2












    $begingroup$

    As orlp says, it's trivial to give a certificate if the answer is "YES" (just give a non-trivial factor of each of the numbers in question), the problem is whether this certificate is polynomial sized.



    There is a conjecture, backed by heuristics and some computational evidence, that there is a constant c > 0 such that for any k-bit prime p, there is a prime between p and p + c * k^2. If this conjecture is true, then the certificate is actually of size O (k^3) whenever the answer is YES, so the problem is in NP. But, it's just a conjecture.



    But of course if we might be able to prove the much weaker conjecture "for some c, there is always a prime between p and p + c * k^3" or the even weaker conjecture "there is a polynomial pol (k) such that there is always a prime between p and p + pol(k)", then this problem would also be in NP. So we can prove that is in NP by proving something about prime gaps.



    There is also the possibility that a less obvious and shorter certificate exists.






    share|cite|improve this answer









    $endgroup$

















      2












      $begingroup$

      As orlp says, it's trivial to give a certificate if the answer is "YES" (just give a non-trivial factor of each of the numbers in question), the problem is whether this certificate is polynomial sized.



      There is a conjecture, backed by heuristics and some computational evidence, that there is a constant c > 0 such that for any k-bit prime p, there is a prime between p and p + c * k^2. If this conjecture is true, then the certificate is actually of size O (k^3) whenever the answer is YES, so the problem is in NP. But, it's just a conjecture.



      But of course if we might be able to prove the much weaker conjecture "for some c, there is always a prime between p and p + c * k^3" or the even weaker conjecture "there is a polynomial pol (k) such that there is always a prime between p and p + pol(k)", then this problem would also be in NP. So we can prove that is in NP by proving something about prime gaps.



      There is also the possibility that a less obvious and shorter certificate exists.






      share|cite|improve this answer









      $endgroup$















        2












        2








        2





        $begingroup$

        As orlp says, it's trivial to give a certificate if the answer is "YES" (just give a non-trivial factor of each of the numbers in question), the problem is whether this certificate is polynomial sized.



        There is a conjecture, backed by heuristics and some computational evidence, that there is a constant c > 0 such that for any k-bit prime p, there is a prime between p and p + c * k^2. If this conjecture is true, then the certificate is actually of size O (k^3) whenever the answer is YES, so the problem is in NP. But, it's just a conjecture.



        But of course if we might be able to prove the much weaker conjecture "for some c, there is always a prime between p and p + c * k^3" or the even weaker conjecture "there is a polynomial pol (k) such that there is always a prime between p and p + pol(k)", then this problem would also be in NP. So we can prove that is in NP by proving something about prime gaps.



        There is also the possibility that a less obvious and shorter certificate exists.






        share|cite|improve this answer









        $endgroup$



        As orlp says, it's trivial to give a certificate if the answer is "YES" (just give a non-trivial factor of each of the numbers in question), the problem is whether this certificate is polynomial sized.



        There is a conjecture, backed by heuristics and some computational evidence, that there is a constant c > 0 such that for any k-bit prime p, there is a prime between p and p + c * k^2. If this conjecture is true, then the certificate is actually of size O (k^3) whenever the answer is YES, so the problem is in NP. But, it's just a conjecture.



        But of course if we might be able to prove the much weaker conjecture "for some c, there is always a prime between p and p + c * k^3" or the even weaker conjecture "there is a polynomial pol (k) such that there is always a prime between p and p + pol(k)", then this problem would also be in NP. So we can prove that is in NP by proving something about prime gaps.



        There is also the possibility that a less obvious and shorter certificate exists.







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Apr 7 at 21:20









        gnasher729gnasher729

        11.8k1218




        11.8k1218




















            hps13 is a new contributor. Be nice, and check out our Code of Conduct.









            draft saved

            draft discarded


















            hps13 is a new contributor. Be nice, and check out our Code of Conduct.












            hps13 is a new contributor. Be nice, and check out our Code of Conduct.











            hps13 is a new contributor. Be nice, and check out our Code of Conduct.














            Thanks for contributing an answer to Computer Science Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcs.stackexchange.com%2fquestions%2f106600%2fis-the-language-p-n-p-and-n-are-natural-numbers-and-theres-no-prime-number%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            getting Checkpoint VPN SSL Network Extender working in the command lineHow to connect to CheckPoint VPN on Ubuntu 18.04LTS?Will the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayVPN SSL Network Extender in FirefoxLinux Checkpoint SNX tool configuration issuesCheck Point - Connect under Linux - snx + OTPSNX VPN Ububuntu 18.XXUsing Checkpoint VPN SSL Network Extender CLI with certificateVPN with network manager (nm-applet) is not workingWill the Linux ( red-hat ) Open VPNC Client connect to checkpoint or nortel VPN gateways?VPN client for linux machine + support checkpoint gatewayImport VPN config files to NetworkManager from command lineTrouble connecting to VPN using network-manager, while command line worksStart a VPN connection with PPTP protocol on command linestarting a docker service daemon breaks the vpn networkCan't connect to vpn with Network-managerVPN SSL Network Extender in FirefoxUsing Checkpoint VPN SSL Network Extender CLI with certificate

            Cannot Extend partition with GParted The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsCan't increase partition size with GParted?GParted doesn't recognize the unallocated space after my current partitionWhat is the best way to add unallocated space located before to Ubuntu 12.04 partition with GParted live?I can't figure out how to extend my Arch home partition into free spaceGparted Linux Mint 18.1 issueTrying to extend but swap partition is showing as Unknown in Gparted, shows proper from fdiskRearrange partitions in gparted to extend a partitionUnable to extend partition even though unallocated space is next to it using GPartedAllocate free space to root partitiongparted: how to merge unallocated space with a partition

            Marilyn Monroe Ny fiainany manokana | Jereo koa | Meny fitetezanafanitarana azy.