-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jacc question #6
Open
AJaccP
wants to merge
1
commit into
main
Choose a base branch
from
Jacc-problem
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Comment on lines
+5
to
+27
Imagine, for instance, that you have an unsorted list of numbers, and you want to write an algorithm to find the largest one. | ||
The algorithm has to look at all the numbers in the list: there’s no way around that. But if it simply keeps a record of the largest | ||
number it’s seen so far, it has to look at each entry only once. The algorithm’s execution time is thus directly proportional to the | ||
number of elements it’s handling — which computer scientists designate N. Of course, most algorithms are more complicated, and thus | ||
less efficient, than the one for finding the largest number in a list; but many common algorithms have execution times proportional | ||
to N2, or N times the logarithm of N, or the like. | ||
|
||
A mathematical expression that involves N’s and N2s and N’s raised to other powers is called a polynomial, and that’s what the “P” in | ||
“P = NP” stands for. P is the set of problems whose solution times are proportional to polynomials involving N's. | ||
|
||
Obviously, an algorithm whose execution time is proportional to N3 is slower than one whose execution time is proportional to N. But such | ||
differences dwindle to insignificance compared to another distinction, between polynomial expressions — where N is the number being raised | ||
to a power — and expressions where a number is raised to the Nth power, like, say, 2N. | ||
|
||
If an algorithm whose execution time is proportional to N takes a second to perform a computation involving 100 elements, an algorithm whose | ||
execution time is proportional to N3 takes almost three hours. But an algorithm whose execution time is proportional to 2N takes 300 | ||
quintillion years. And that discrepancy gets much, much worse the larger N grows. | ||
|
||
NP (which stands for nondeterministic polynomial time) is the set of problems whose solutions can be verified in polynomial time. But as far as | ||
anyone can tell, many of those problems take exponential time to solve. Perhaps the most famous exponential-time problem in NP, for example, is | ||
finding prime factors of a large number. Verifying a solution just requires multiplication, but solving the problem seems to require systematically | ||
trying out lots of candidates. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
Imagine, for instance, that you have an unsorted list of numbers, and you want to write an algorithm to find the largest one. | |
The algorithm has to look at all the numbers in the list: there’s no way around that. But if it simply keeps a record of the largest | |
number it’s seen so far, it has to look at each entry only once. The algorithm’s execution time is thus directly proportional to the | |
number of elements it’s handling — which computer scientists designate N. Of course, most algorithms are more complicated, and thus | |
less efficient, than the one for finding the largest number in a list; but many common algorithms have execution times proportional | |
to N2, or N times the logarithm of N, or the like. | |
A mathematical expression that involves N’s and N2s and N’s raised to other powers is called a polynomial, and that’s what the “P” in | |
“P = NP” stands for. P is the set of problems whose solution times are proportional to polynomials involving N's. | |
Obviously, an algorithm whose execution time is proportional to N3 is slower than one whose execution time is proportional to N. But such | |
differences dwindle to insignificance compared to another distinction, between polynomial expressions — where N is the number being raised | |
to a power — and expressions where a number is raised to the Nth power, like, say, 2N. | |
If an algorithm whose execution time is proportional to N takes a second to perform a computation involving 100 elements, an algorithm whose | |
execution time is proportional to N3 takes almost three hours. But an algorithm whose execution time is proportional to 2N takes 300 | |
quintillion years. And that discrepancy gets much, much worse the larger N grows. | |
NP (which stands for nondeterministic polynomial time) is the set of problems whose solutions can be verified in polynomial time. But as far as | |
anyone can tell, many of those problems take exponential time to solve. Perhaps the most famous exponential-time problem in NP, for example, is | |
finding prime factors of a large number. Verifying a solution just requires multiplication, but solving the problem seems to require systematically | |
trying out lots of candidates. | |
Math is icky. Draw a happy face :) |
l004p
reviewed
Oct 21, 2023
## Question | ||
Does P equal NP? | ||
or | ||
If the solution to a problem can be verified in polynomial time, can it be found in polynomial time? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:)
don't make us think :) no math allowed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.