CINXE.COM
Complexity class - Wikipedia
<!DOCTYPE html> <html class="client-nojs vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-enabled skin-theme-clientpref-day vector-toc-available" lang="en" dir="ltr"> <head> <meta charset="UTF-8"> <title>Complexity class - Wikipedia</title> <script>(function(){var className="client-js vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-sticky-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-feature-night-mode-enabled skin-theme-clientpref-day vector-toc-available";var cookie=document.cookie.match(/(?:^|; )enwikimwclientpreferences=([^;]+)/);if(cookie){cookie[1].split('%2C').forEach(function(pref){className=className.replace(new RegExp('(^| )'+pref.replace(/-clientpref-\w+$|[^\w-]+/g,'')+'-clientpref-\\w+( |$)'),'$1'+pref+'$2');});}document.documentElement.className=className;}());RLCONF={"wgBreakFrames":false,"wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"dmy", "wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgRequestId":"935f5996-97c6-4809-a071-6855a0ff2c5e","wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"Complexity_class","wgTitle":"Complexity class","wgCurRevisionId":1251434113,"wgRevisionId":1251434113,"wgArticleId":502426,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":null,"wgUserGroups":["*"],"wgCategories":["Articles with short description","Short description is different from Wikidata","Articles to be expanded from April 2017","All articles to be expanded","Webarchive template wayback links","Complexity classes","Computational complexity theory","Measures of complexity","Theoretical computer science"],"wgPageViewLanguage":"en","wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgRelevantPageName":"Complexity_class","wgRelevantArticleId":502426,"wgIsProbablyEditable":true ,"wgRelevantPageIsProbablyEditable":true,"wgRestrictionEdit":[],"wgRestrictionMove":[],"wgRedirectedFrom":"Complexity_classes","wgNoticeProject":"wikipedia","wgCiteReferencePreviewsActive":false,"wgFlaggedRevsParams":{"tags":{"status":{"levels":1}}},"wgMediaViewerOnClick":true,"wgMediaViewerEnabledByDefault":true,"wgPopupsFlags":0,"wgVisualEditor":{"pageLanguageCode":"en","pageLanguageDir":"ltr","pageVariantFallbacks":"en"},"wgMFDisplayWikibaseDescriptions":{"search":true,"watchlist":true,"tagline":false,"nearby":true},"wgWMESchemaEditAttemptStepOversample":false,"wgWMEPageLength":80000,"wgInternalRedirectTargetUrl":"/wiki/Complexity_class","wgRelatedArticlesCompat":[],"wgCentralAuthMobileDomain":false,"wgEditSubmitButtonLabelPublish":true,"wgULSPosition":"interlanguage","wgULSisCompactLinksEnabled":false,"wgVector2022LanguageInHeader":true,"wgULSisLanguageSelectorEmpty":false,"wgWikibaseItemId":"Q908207","wgCheckUserClientHintsHeadersJsApi":["brands","architecture","bitness", "fullVersionList","mobile","model","platform","platformVersion"],"GEHomepageSuggestedEditsEnableTopics":true,"wgGETopicsMatchModeEnabled":false,"wgGEStructuredTaskRejectionReasonTextInputEnabled":false,"wgGELevelingUpEnabledForUser":false};RLSTATE={"ext.globalCssJs.user.styles":"ready","site.styles":"ready","user.styles":"ready","ext.globalCssJs.user":"ready","user":"ready","user.options":"loading","ext.cite.styles":"ready","ext.math.styles":"ready","skins.vector.search.codex.styles":"ready","skins.vector.styles":"ready","skins.vector.icons":"ready","jquery.makeCollapsible.styles":"ready","ext.wikimediamessages.styles":"ready","ext.visualEditor.desktopArticleTarget.noscript":"ready","ext.uls.interlanguage":"ready","wikibase.client.init":"ready","ext.wikimediaBadges":"ready"};RLPAGEMODULES=["mediawiki.action.view.redirect","ext.cite.ux-enhancements","mediawiki.page.media","ext.scribunto.logs","site","mediawiki.page.ready","jquery.makeCollapsible","mediawiki.toc","skins.vector.js", "ext.centralNotice.geoIP","ext.centralNotice.startUp","ext.gadget.ReferenceTooltips","ext.gadget.switcher","ext.urlShortener.toolbar","ext.centralauth.centralautologin","mmv.bootstrap","ext.popups","ext.visualEditor.desktopArticleTarget.init","ext.visualEditor.targetLoader","ext.echo.centralauth","ext.eventLogging","ext.wikimediaEvents","ext.navigationTiming","ext.uls.interface","ext.cx.eventlogging.campaigns","ext.cx.uls.quick.actions","wikibase.client.vector-2022","ext.checkUser.clientHints","ext.quicksurveys.init","ext.growthExperiments.SuggestedEditSession","wikibase.sidebar.tracking"];</script> <script>(RLQ=window.RLQ||[]).push(function(){mw.loader.impl(function(){return["user.options@12s5i",function($,jQuery,require,module){mw.user.tokens.set({"patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"}); }];});});</script> <link rel="stylesheet" href="/w/load.php?lang=en&modules=ext.cite.styles%7Cext.math.styles%7Cext.uls.interlanguage%7Cext.visualEditor.desktopArticleTarget.noscript%7Cext.wikimediaBadges%7Cext.wikimediamessages.styles%7Cjquery.makeCollapsible.styles%7Cskins.vector.icons%2Cstyles%7Cskins.vector.search.codex.styles%7Cwikibase.client.init&only=styles&skin=vector-2022"> <script async="" src="/w/load.php?lang=en&modules=startup&only=scripts&raw=1&skin=vector-2022"></script> <meta name="ResourceLoaderDynamicStyles" content=""> <link rel="stylesheet" href="/w/load.php?lang=en&modules=site.styles&only=styles&skin=vector-2022"> <meta name="generator" content="MediaWiki 1.44.0-wmf.4"> <meta name="referrer" content="origin"> <meta name="referrer" content="origin-when-cross-origin"> <meta name="robots" content="max-image-preview:standard"> <meta name="format-detection" content="telephone=no"> <meta property="og:image" content="https://upload.wikimedia.org/wikipedia/commons/thumb/6/6e/Complexity_subsets_pspace.svg/1200px-Complexity_subsets_pspace.svg.png"> <meta property="og:image:width" content="1200"> <meta property="og:image:height" content="1091"> <meta property="og:image" content="https://upload.wikimedia.org/wikipedia/commons/thumb/6/6e/Complexity_subsets_pspace.svg/800px-Complexity_subsets_pspace.svg.png"> <meta property="og:image:width" content="800"> <meta property="og:image:height" content="727"> <meta property="og:image" content="https://upload.wikimedia.org/wikipedia/commons/thumb/6/6e/Complexity_subsets_pspace.svg/640px-Complexity_subsets_pspace.svg.png"> <meta property="og:image:width" content="640"> <meta property="og:image:height" content="582"> <meta name="viewport" content="width=1120"> <meta property="og:title" content="Complexity class - Wikipedia"> <meta property="og:type" content="website"> <link rel="preconnect" href="//upload.wikimedia.org"> <link rel="alternate" media="only screen and (max-width: 640px)" href="//en.m.wikipedia.org/wiki/Complexity_class"> <link rel="alternate" type="application/x-wiki" title="Edit this page" href="/w/index.php?title=Complexity_class&action=edit"> <link rel="apple-touch-icon" href="/static/apple-touch/wikipedia.png"> <link rel="icon" href="/static/favicon/wikipedia.ico"> <link rel="search" type="application/opensearchdescription+xml" href="/w/rest.php/v1/search" title="Wikipedia (en)"> <link rel="EditURI" type="application/rsd+xml" href="//en.wikipedia.org/w/api.php?action=rsd"> <link rel="canonical" href="https://en.wikipedia.org/wiki/Complexity_class"> <link rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en"> <link rel="alternate" type="application/atom+xml" title="Wikipedia Atom feed" href="/w/index.php?title=Special:RecentChanges&feed=atom"> <link rel="dns-prefetch" href="//meta.wikimedia.org" /> <link rel="dns-prefetch" href="//login.wikimedia.org"> </head> <body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject mw-editable page-Complexity_class rootpage-Complexity_class skin-vector-2022 action-view"><a class="mw-jump-link" href="#bodyContent">Jump to content</a> <div class="vector-header-container"> <header class="vector-header mw-header"> <div class="vector-header-start"> <nav class="vector-main-menu-landmark" aria-label="Site"> <div id="vector-main-menu-dropdown" class="vector-dropdown vector-main-menu-dropdown vector-button-flush-left vector-button-flush-right" > <input type="checkbox" id="vector-main-menu-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-main-menu-dropdown" class="vector-dropdown-checkbox " aria-label="Main menu" > <label id="vector-main-menu-dropdown-label" for="vector-main-menu-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-menu mw-ui-icon-wikimedia-menu"></span> <span class="vector-dropdown-label-text">Main menu</span> </label> <div class="vector-dropdown-content"> <div id="vector-main-menu-unpinned-container" class="vector-unpinned-container"> <div id="vector-main-menu" class="vector-main-menu vector-pinnable-element"> <div class="vector-pinnable-header vector-main-menu-pinnable-header vector-pinnable-header-unpinned" data-feature-name="main-menu-pinned" data-pinnable-element-id="vector-main-menu" data-pinned-container-id="vector-main-menu-pinned-container" data-unpinned-container-id="vector-main-menu-unpinned-container" > <div class="vector-pinnable-header-label">Main menu</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-main-menu.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-main-menu.unpin">hide</button> </div> <div id="p-navigation" class="vector-menu mw-portlet mw-portlet-navigation" > <div class="vector-menu-heading"> Navigation </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-mainpage-description" class="mw-list-item"><a href="/wiki/Main_Page" title="Visit the main page [z]" accesskey="z"><span>Main page</span></a></li><li id="n-contents" class="mw-list-item"><a href="/wiki/Wikipedia:Contents" title="Guides to browsing Wikipedia"><span>Contents</span></a></li><li id="n-currentevents" class="mw-list-item"><a href="/wiki/Portal:Current_events" title="Articles related to current events"><span>Current events</span></a></li><li id="n-randompage" class="mw-list-item"><a href="/wiki/Special:Random" title="Visit a randomly selected article [x]" accesskey="x"><span>Random article</span></a></li><li id="n-aboutsite" class="mw-list-item"><a href="/wiki/Wikipedia:About" title="Learn about Wikipedia and how it works"><span>About Wikipedia</span></a></li><li id="n-contactpage" class="mw-list-item"><a href="//en.wikipedia.org/wiki/Wikipedia:Contact_us" title="How to contact Wikipedia"><span>Contact us</span></a></li> </ul> </div> </div> <div id="p-interaction" class="vector-menu mw-portlet mw-portlet-interaction" > <div class="vector-menu-heading"> Contribute </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="n-help" class="mw-list-item"><a href="/wiki/Help:Contents" title="Guidance on how to use and edit Wikipedia"><span>Help</span></a></li><li id="n-introduction" class="mw-list-item"><a href="/wiki/Help:Introduction" title="Learn how to edit Wikipedia"><span>Learn to edit</span></a></li><li id="n-portal" class="mw-list-item"><a href="/wiki/Wikipedia:Community_portal" title="The hub for editors"><span>Community portal</span></a></li><li id="n-recentchanges" class="mw-list-item"><a href="/wiki/Special:RecentChanges" title="A list of recent changes to Wikipedia [r]" accesskey="r"><span>Recent changes</span></a></li><li id="n-upload" class="mw-list-item"><a href="/wiki/Wikipedia:File_upload_wizard" title="Add images or other media for use on Wikipedia"><span>Upload file</span></a></li> </ul> </div> </div> </div> </div> </div> </div> </nav> <a href="/wiki/Main_Page" class="mw-logo"> <img class="mw-logo-icon" src="/static/images/icons/wikipedia.png" alt="" aria-hidden="true" height="50" width="50"> <span class="mw-logo-container skin-invert"> <img class="mw-logo-wordmark" alt="Wikipedia" src="/static/images/mobile/copyright/wikipedia-wordmark-en.svg" style="width: 7.5em; height: 1.125em;"> <img class="mw-logo-tagline" alt="The Free Encyclopedia" src="/static/images/mobile/copyright/wikipedia-tagline-en.svg" width="117" height="13" style="width: 7.3125em; height: 0.8125em;"> </span> </a> </div> <div class="vector-header-end"> <div id="p-search" role="search" class="vector-search-box-vue vector-search-box-collapses vector-search-box-show-thumbnail vector-search-box-auto-expand-width vector-search-box"> <a href="/wiki/Special:Search" class="cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only search-toggle" title="Search Wikipedia [f]" accesskey="f"><span class="vector-icon mw-ui-icon-search mw-ui-icon-wikimedia-search"></span> <span>Search</span> </a> <div class="vector-typeahead-search-container"> <div class="cdx-typeahead-search cdx-typeahead-search--show-thumbnail cdx-typeahead-search--auto-expand-width"> <form action="/w/index.php" id="searchform" class="cdx-search-input cdx-search-input--has-end-button"> <div id="simpleSearch" class="cdx-search-input__input-wrapper" data-search-loc="header-moved"> <div class="cdx-text-input cdx-text-input--has-start-icon"> <input class="cdx-text-input__input" type="search" name="search" placeholder="Search Wikipedia" aria-label="Search Wikipedia" autocapitalize="sentences" title="Search Wikipedia [f]" accesskey="f" id="searchInput" > <span class="cdx-text-input__icon cdx-text-input__start-icon"></span> </div> <input type="hidden" name="title" value="Special:Search"> </div> <button class="cdx-button cdx-search-input__end-button">Search</button> </form> </div> </div> </div> <nav class="vector-user-links vector-user-links-wide" aria-label="Personal tools"> <div class="vector-user-links-main"> <div id="p-vector-user-menu-preferences" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-userpage" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <nav class="vector-appearance-landmark" aria-label="Appearance"> <div id="vector-appearance-dropdown" class="vector-dropdown " title="Change the appearance of the page's font size, width, and color" > <input type="checkbox" id="vector-appearance-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-appearance-dropdown" class="vector-dropdown-checkbox " aria-label="Appearance" > <label id="vector-appearance-dropdown-label" for="vector-appearance-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-appearance mw-ui-icon-wikimedia-appearance"></span> <span class="vector-dropdown-label-text">Appearance</span> </label> <div class="vector-dropdown-content"> <div id="vector-appearance-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <div id="p-vector-user-menu-notifications" class="vector-menu mw-portlet emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> <div id="p-vector-user-menu-overflow" class="vector-menu mw-portlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="https://donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source=donate&utm_medium=sidebar&utm_campaign=C13_en.wikipedia.org&uselang=en" class=""><span>Donate</span></a> </li> <li id="pt-createaccount-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Special:CreateAccount&returnto=Complexity+class" title="You are encouraged to create an account and log in; however, it is not mandatory" class=""><span>Create account</span></a> </li> <li id="pt-login-2" class="user-links-collapsible-item mw-list-item user-links-collapsible-item"><a data-mw="interface" href="/w/index.php?title=Special:UserLogin&returnto=Complexity+class" title="You're encouraged to log in; however, it's not mandatory. [o]" accesskey="o" class=""><span>Log in</span></a> </li> </ul> </div> </div> </div> <div id="vector-user-links-dropdown" class="vector-dropdown vector-user-menu vector-button-flush-right vector-user-menu-logged-out" title="Log in and more options" > <input type="checkbox" id="vector-user-links-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-user-links-dropdown" class="vector-dropdown-checkbox " aria-label="Personal tools" > <label id="vector-user-links-dropdown-label" for="vector-user-links-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-ellipsis mw-ui-icon-wikimedia-ellipsis"></span> <span class="vector-dropdown-label-text">Personal tools</span> </label> <div class="vector-dropdown-content"> <div id="p-personal" class="vector-menu mw-portlet mw-portlet-personal user-links-collapsible-item" title="User menu" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-sitesupport" class="user-links-collapsible-item mw-list-item"><a href="https://donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source=donate&utm_medium=sidebar&utm_campaign=C13_en.wikipedia.org&uselang=en"><span>Donate</span></a></li><li id="pt-createaccount" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Special:CreateAccount&returnto=Complexity+class" title="You are encouraged to create an account and log in; however, it is not mandatory"><span class="vector-icon mw-ui-icon-userAdd mw-ui-icon-wikimedia-userAdd"></span> <span>Create account</span></a></li><li id="pt-login" class="user-links-collapsible-item mw-list-item"><a href="/w/index.php?title=Special:UserLogin&returnto=Complexity+class" title="You're encouraged to log in; however, it's not mandatory. [o]" accesskey="o"><span class="vector-icon mw-ui-icon-logIn mw-ui-icon-wikimedia-logIn"></span> <span>Log in</span></a></li> </ul> </div> </div> <div id="p-user-menu-anon-editor" class="vector-menu mw-portlet mw-portlet-user-menu-anon-editor" > <div class="vector-menu-heading"> Pages for logged out editors <a href="/wiki/Help:Introduction" aria-label="Learn more about editing"><span>learn more</span></a> </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="pt-anoncontribs" class="mw-list-item"><a href="/wiki/Special:MyContributions" title="A list of edits made from this IP address [y]" accesskey="y"><span>Contributions</span></a></li><li id="pt-anontalk" class="mw-list-item"><a href="/wiki/Special:MyTalk" title="Discussion about edits from this IP address [n]" accesskey="n"><span>Talk</span></a></li> </ul> </div> </div> </div> </div> </nav> </div> </header> </div> <div class="mw-page-container"> <div class="mw-page-container-inner"> <div class="vector-sitenotice-container"> <div id="siteNotice"><!-- CentralNotice --></div> </div> <div class="vector-column-start"> <div class="vector-main-menu-container"> <div id="mw-navigation"> <nav id="mw-panel" class="vector-main-menu-landmark" aria-label="Site"> <div id="vector-main-menu-pinned-container" class="vector-pinned-container"> </div> </nav> </div> </div> <div class="vector-sticky-pinned-container"> <nav id="mw-panel-toc" aria-label="Contents" data-event-name="ui.sidebar-toc" class="mw-table-of-contents-container vector-toc-landmark"> <div id="vector-toc-pinned-container" class="vector-pinned-container"> <div id="vector-toc" class="vector-toc vector-pinnable-element"> <div class="vector-pinnable-header vector-toc-pinnable-header vector-pinnable-header-pinned" data-feature-name="toc-pinned" data-pinnable-element-id="vector-toc" > <h2 class="vector-pinnable-header-label">Contents</h2> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-toc.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-toc.unpin">hide</button> </div> <ul class="vector-toc-contents" id="mw-panel-toc-list"> <li id="toc-mw-content-text" class="vector-toc-list-item vector-toc-level-1"> <a href="#" class="vector-toc-link"> <div class="vector-toc-text">(Top)</div> </a> </li> <li id="toc-Background" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Background"> <div class="vector-toc-text"> <span class="vector-toc-numb">1</span> <span>Background</span> </div> </a> <button aria-controls="toc-Background-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle Background subsection</span> </button> <ul id="toc-Background-sublist" class="vector-toc-list"> <li id="toc-Computational_problems" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Computational_problems"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.1</span> <span>Computational problems</span> </div> </a> <ul id="toc-Computational_problems-sublist" class="vector-toc-list"> <li id="toc-Decision_problems" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Decision_problems"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.1.1</span> <span>Decision problems</span> </div> </a> <ul id="toc-Decision_problems-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Computational_models" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Computational_models"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.2</span> <span>Computational models</span> </div> </a> <ul id="toc-Computational_models-sublist" class="vector-toc-list"> <li id="toc-Deterministic_Turing_machines" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Deterministic_Turing_machines"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.2.1</span> <span>Deterministic Turing machines</span> </div> </a> <ul id="toc-Deterministic_Turing_machines-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Nondeterministic_Turing_machines" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Nondeterministic_Turing_machines"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.2.2</span> <span>Nondeterministic Turing machines</span> </div> </a> <ul id="toc-Nondeterministic_Turing_machines-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Resource_bounds" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Resource_bounds"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.3</span> <span>Resource bounds</span> </div> </a> <ul id="toc-Resource_bounds-sublist" class="vector-toc-list"> <li id="toc-Time_bounds" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Time_bounds"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.3.1</span> <span>Time bounds</span> </div> </a> <ul id="toc-Time_bounds-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Space_bounds" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Space_bounds"> <div class="vector-toc-text"> <span class="vector-toc-numb">1.3.2</span> <span>Space bounds</span> </div> </a> <ul id="toc-Space_bounds-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> </ul> </li> <li id="toc-Basic_complexity_classes" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Basic_complexity_classes"> <div class="vector-toc-text"> <span class="vector-toc-numb">2</span> <span>Basic complexity classes</span> </div> </a> <button aria-controls="toc-Basic_complexity_classes-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle Basic complexity classes subsection</span> </button> <ul id="toc-Basic_complexity_classes-sublist" class="vector-toc-list"> <li id="toc-Basic_definitions" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Basic_definitions"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.1</span> <span>Basic definitions</span> </div> </a> <ul id="toc-Basic_definitions-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Time_complexity_classes" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Time_complexity_classes"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.2</span> <span>Time complexity classes</span> </div> </a> <ul id="toc-Time_complexity_classes-sublist" class="vector-toc-list"> <li id="toc-P_and_NP" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#P_and_NP"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.2.1</span> <span>P and NP</span> </div> </a> <ul id="toc-P_and_NP-sublist" class="vector-toc-list"> <li id="toc-The_P_versus_NP_problem" class="vector-toc-list-item vector-toc-level-4"> <a class="vector-toc-link" href="#The_P_versus_NP_problem"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.2.1.1</span> <span>The P versus NP problem</span> </div> </a> <ul id="toc-The_P_versus_NP_problem-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-EXPTIME_and_NEXPTIME" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#EXPTIME_and_NEXPTIME"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.2.2</span> <span>EXPTIME and NEXPTIME</span> </div> </a> <ul id="toc-EXPTIME_and_NEXPTIME-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Space_complexity_classes" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Space_complexity_classes"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.3</span> <span>Space complexity classes</span> </div> </a> <ul id="toc-Space_complexity_classes-sublist" class="vector-toc-list"> <li id="toc-L_and_NL" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#L_and_NL"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.3.1</span> <span>L and NL</span> </div> </a> <ul id="toc-L_and_NL-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-PSPACE_and_NPSPACE" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#PSPACE_and_NPSPACE"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.3.2</span> <span>PSPACE and NPSPACE</span> </div> </a> <ul id="toc-PSPACE_and_NPSPACE-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-EXPSPACE_and_NEXPSPACE" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#EXPSPACE_and_NEXPSPACE"> <div class="vector-toc-text"> <span class="vector-toc-numb">2.3.3</span> <span>EXPSPACE and NEXPSPACE</span> </div> </a> <ul id="toc-EXPSPACE_and_NEXPSPACE-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> </ul> </li> <li id="toc-Properties_of_complexity_classes" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Properties_of_complexity_classes"> <div class="vector-toc-text"> <span class="vector-toc-numb">3</span> <span>Properties of complexity classes</span> </div> </a> <button aria-controls="toc-Properties_of_complexity_classes-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle Properties of complexity classes subsection</span> </button> <ul id="toc-Properties_of_complexity_classes-sublist" class="vector-toc-list"> <li id="toc-Closure" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Closure"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.1</span> <span>Closure</span> </div> </a> <ul id="toc-Closure-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Reductions" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Reductions"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.2</span> <span>Reductions</span> </div> </a> <ul id="toc-Reductions-sublist" class="vector-toc-list"> <li id="toc-Hardness" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Hardness"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.2.1</span> <span>Hardness</span> </div> </a> <ul id="toc-Hardness-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Completeness" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Completeness"> <div class="vector-toc-text"> <span class="vector-toc-numb">3.2.2</span> <span>Completeness</span> </div> </a> <ul id="toc-Completeness-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> </ul> </li> <li id="toc-Relationships_between_complexity_classes" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Relationships_between_complexity_classes"> <div class="vector-toc-text"> <span class="vector-toc-numb">4</span> <span>Relationships between complexity classes</span> </div> </a> <button aria-controls="toc-Relationships_between_complexity_classes-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle Relationships between complexity classes subsection</span> </button> <ul id="toc-Relationships_between_complexity_classes-sublist" class="vector-toc-list"> <li id="toc-Savitch's_theorem" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Savitch's_theorem"> <div class="vector-toc-text"> <span class="vector-toc-numb">4.1</span> <span>Savitch's theorem</span> </div> </a> <ul id="toc-Savitch's_theorem-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Hierarchy_theorems" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Hierarchy_theorems"> <div class="vector-toc-text"> <span class="vector-toc-numb">4.2</span> <span>Hierarchy theorems</span> </div> </a> <ul id="toc-Hierarchy_theorems-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Other_models_of_computation" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Other_models_of_computation"> <div class="vector-toc-text"> <span class="vector-toc-numb">5</span> <span>Other models of computation</span> </div> </a> <button aria-controls="toc-Other_models_of_computation-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle Other models of computation subsection</span> </button> <ul id="toc-Other_models_of_computation-sublist" class="vector-toc-list"> <li id="toc-Randomized_computation" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Randomized_computation"> <div class="vector-toc-text"> <span class="vector-toc-numb">5.1</span> <span>Randomized computation</span> </div> </a> <ul id="toc-Randomized_computation-sublist" class="vector-toc-list"> <li id="toc-Important_complexity_classes" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Important_complexity_classes"> <div class="vector-toc-text"> <span class="vector-toc-numb">5.1.1</span> <span>Important complexity classes</span> </div> </a> <ul id="toc-Important_complexity_classes-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Interactive_proof_systems" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Interactive_proof_systems"> <div class="vector-toc-text"> <span class="vector-toc-numb">5.2</span> <span>Interactive proof systems</span> </div> </a> <ul id="toc-Interactive_proof_systems-sublist" class="vector-toc-list"> <li id="toc-Important_complexity_classes_2" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Important_complexity_classes_2"> <div class="vector-toc-text"> <span class="vector-toc-numb">5.2.1</span> <span>Important complexity classes</span> </div> </a> <ul id="toc-Important_complexity_classes_2-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Boolean_circuits" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Boolean_circuits"> <div class="vector-toc-text"> <span class="vector-toc-numb">5.3</span> <span>Boolean circuits</span> </div> </a> <ul id="toc-Boolean_circuits-sublist" class="vector-toc-list"> <li id="toc-Important_complexity_classes_3" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Important_complexity_classes_3"> <div class="vector-toc-text"> <span class="vector-toc-numb">5.3.1</span> <span>Important complexity classes</span> </div> </a> <ul id="toc-Important_complexity_classes_3-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Quantum_computation" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Quantum_computation"> <div class="vector-toc-text"> <span class="vector-toc-numb">5.4</span> <span>Quantum computation</span> </div> </a> <ul id="toc-Quantum_computation-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Other_types_of_problems" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Other_types_of_problems"> <div class="vector-toc-text"> <span class="vector-toc-numb">6</span> <span>Other types of problems</span> </div> </a> <button aria-controls="toc-Other_types_of_problems-sublist" class="cdx-button cdx-button--weight-quiet cdx-button--icon-only vector-toc-toggle"> <span class="vector-icon mw-ui-icon-wikimedia-expand"></span> <span>Toggle Other types of problems subsection</span> </button> <ul id="toc-Other_types_of_problems-sublist" class="vector-toc-list"> <li id="toc-Counting_problems" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Counting_problems"> <div class="vector-toc-text"> <span class="vector-toc-numb">6.1</span> <span>Counting problems</span> </div> </a> <ul id="toc-Counting_problems-sublist" class="vector-toc-list"> <li id="toc-Important_complexity_classes_4" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Important_complexity_classes_4"> <div class="vector-toc-text"> <span class="vector-toc-numb">6.1.1</span> <span>Important complexity classes</span> </div> </a> <ul id="toc-Important_complexity_classes_4-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Function_problems" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Function_problems"> <div class="vector-toc-text"> <span class="vector-toc-numb">6.2</span> <span>Function problems</span> </div> </a> <ul id="toc-Function_problems-sublist" class="vector-toc-list"> <li id="toc-Important_complexity_classes_5" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Important_complexity_classes_5"> <div class="vector-toc-text"> <span class="vector-toc-numb">6.2.1</span> <span>Important complexity classes</span> </div> </a> <ul id="toc-Important_complexity_classes_5-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> <li id="toc-Promise_problems" class="vector-toc-list-item vector-toc-level-2"> <a class="vector-toc-link" href="#Promise_problems"> <div class="vector-toc-text"> <span class="vector-toc-numb">6.3</span> <span>Promise problems</span> </div> </a> <ul id="toc-Promise_problems-sublist" class="vector-toc-list"> <li id="toc-Relation_to_complexity_classes" class="vector-toc-list-item vector-toc-level-3"> <a class="vector-toc-link" href="#Relation_to_complexity_classes"> <div class="vector-toc-text"> <span class="vector-toc-numb">6.3.1</span> <span>Relation to complexity classes</span> </div> </a> <ul id="toc-Relation_to_complexity_classes-sublist" class="vector-toc-list"> </ul> </li> </ul> </li> </ul> </li> <li id="toc-Summary_of_relationships_between_complexity_classes" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Summary_of_relationships_between_complexity_classes"> <div class="vector-toc-text"> <span class="vector-toc-numb">7</span> <span>Summary of relationships between complexity classes</span> </div> </a> <ul id="toc-Summary_of_relationships_between_complexity_classes-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-See_also" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#See_also"> <div class="vector-toc-text"> <span class="vector-toc-numb">8</span> <span>See also</span> </div> </a> <ul id="toc-See_also-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Notes" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Notes"> <div class="vector-toc-text"> <span class="vector-toc-numb">9</span> <span>Notes</span> </div> </a> <ul id="toc-Notes-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-References" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#References"> <div class="vector-toc-text"> <span class="vector-toc-numb">10</span> <span>References</span> </div> </a> <ul id="toc-References-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Bibliography" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Bibliography"> <div class="vector-toc-text"> <span class="vector-toc-numb">11</span> <span>Bibliography</span> </div> </a> <ul id="toc-Bibliography-sublist" class="vector-toc-list"> </ul> </li> <li id="toc-Further_reading" class="vector-toc-list-item vector-toc-level-1"> <a class="vector-toc-link" href="#Further_reading"> <div class="vector-toc-text"> <span class="vector-toc-numb">12</span> <span>Further reading</span> </div> </a> <ul id="toc-Further_reading-sublist" class="vector-toc-list"> </ul> </li> </ul> </div> </div> </nav> </div> </div> <div class="mw-content-container"> <main id="content" class="mw-body"> <header class="mw-body-header vector-page-titlebar"> <nav aria-label="Contents" class="vector-toc-landmark"> <div id="vector-page-titlebar-toc" class="vector-dropdown vector-page-titlebar-toc vector-button-flush-left" > <input type="checkbox" id="vector-page-titlebar-toc-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-titlebar-toc" class="vector-dropdown-checkbox " aria-label="Toggle the table of contents" > <label id="vector-page-titlebar-toc-label" for="vector-page-titlebar-toc-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--icon-only " aria-hidden="true" ><span class="vector-icon mw-ui-icon-listBullet mw-ui-icon-wikimedia-listBullet"></span> <span class="vector-dropdown-label-text">Toggle the table of contents</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-titlebar-toc-unpinned-container" class="vector-unpinned-container"> </div> </div> </div> </nav> <h1 id="firstHeading" class="firstHeading mw-first-heading"><span class="mw-page-title-main">Complexity class</span></h1> <div id="p-lang-btn" class="vector-dropdown mw-portlet mw-portlet-lang" > <input type="checkbox" id="p-lang-btn-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-p-lang-btn" class="vector-dropdown-checkbox mw-interlanguage-selector" aria-label="Go to an article in another language. Available in 24 languages" > <label id="p-lang-btn-label" for="p-lang-btn-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet cdx-button--action-progressive mw-portlet-lang-heading-24" aria-hidden="true" ><span class="vector-icon mw-ui-icon-language-progressive mw-ui-icon-wikimedia-language-progressive"></span> <span class="vector-dropdown-label-text">24 languages</span> </label> <div class="vector-dropdown-content"> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li class="interlanguage-link interwiki-ar mw-list-item"><a href="https://ar.wikipedia.org/wiki/%D9%82%D8%B3%D9%85_%D8%AA%D8%B9%D9%82%D9%8A%D8%AF" title="قسم تعقيد – Arabic" lang="ar" hreflang="ar" data-title="قسم تعقيد" data-language-autonym="العربية" data-language-local-name="Arabic" class="interlanguage-link-target"><span>العربية</span></a></li><li class="interlanguage-link interwiki-ca mw-list-item"><a href="https://ca.wikipedia.org/wiki/Classe_de_complexitat" title="Classe de complexitat – Catalan" lang="ca" hreflang="ca" data-title="Classe de complexitat" data-language-autonym="Català" data-language-local-name="Catalan" class="interlanguage-link-target"><span>Català</span></a></li><li class="interlanguage-link interwiki-de mw-list-item"><a href="https://de.wikipedia.org/wiki/Komplexit%C3%A4tsklasse" title="Komplexitätsklasse – German" lang="de" hreflang="de" data-title="Komplexitätsklasse" data-language-autonym="Deutsch" data-language-local-name="German" class="interlanguage-link-target"><span>Deutsch</span></a></li><li class="interlanguage-link interwiki-es mw-list-item"><a href="https://es.wikipedia.org/wiki/Clase_de_complejidad" title="Clase de complejidad – Spanish" lang="es" hreflang="es" data-title="Clase de complejidad" data-language-autonym="Español" data-language-local-name="Spanish" class="interlanguage-link-target"><span>Español</span></a></li><li class="interlanguage-link interwiki-fa mw-list-item"><a href="https://fa.wikipedia.org/wiki/%DA%A9%D9%84%D8%A7%D8%B3_%D9%BE%DB%8C%DA%86%DB%8C%D8%AF%DA%AF%DB%8C" title="کلاس پیچیدگی – Persian" lang="fa" hreflang="fa" data-title="کلاس پیچیدگی" data-language-autonym="فارسی" data-language-local-name="Persian" class="interlanguage-link-target"><span>فارسی</span></a></li><li class="interlanguage-link interwiki-fr mw-list-item"><a href="https://fr.wikipedia.org/wiki/Classe_de_complexit%C3%A9" title="Classe de complexité – French" lang="fr" hreflang="fr" data-title="Classe de complexité" data-language-autonym="Français" data-language-local-name="French" class="interlanguage-link-target"><span>Français</span></a></li><li class="interlanguage-link interwiki-ko mw-list-item"><a href="https://ko.wikipedia.org/wiki/%EB%B3%B5%EC%9E%A1%EB%8F%84_%EC%A2%85%EB%A5%98" title="복잡도 종류 – Korean" lang="ko" hreflang="ko" data-title="복잡도 종류" data-language-autonym="한국어" data-language-local-name="Korean" class="interlanguage-link-target"><span>한국어</span></a></li><li class="interlanguage-link interwiki-hr mw-list-item"><a href="https://hr.wikipedia.org/wiki/Klasa_slo%C5%BEenosti" title="Klasa složenosti – Croatian" lang="hr" hreflang="hr" data-title="Klasa složenosti" data-language-autonym="Hrvatski" data-language-local-name="Croatian" class="interlanguage-link-target"><span>Hrvatski</span></a></li><li class="interlanguage-link interwiki-it mw-list-item"><a href="https://it.wikipedia.org/wiki/Classe_di_complessit%C3%A0" title="Classe di complessità – Italian" lang="it" hreflang="it" data-title="Classe di complessità" data-language-autonym="Italiano" data-language-local-name="Italian" class="interlanguage-link-target"><span>Italiano</span></a></li><li class="interlanguage-link interwiki-he mw-list-item"><a href="https://he.wikipedia.org/wiki/%D7%9E%D7%97%D7%9C%D7%A7%D7%AA_%D7%A1%D7%99%D7%91%D7%95%D7%9B%D7%99%D7%95%D7%AA" title="מחלקת סיבוכיות – Hebrew" lang="he" hreflang="he" data-title="מחלקת סיבוכיות" data-language-autonym="עברית" data-language-local-name="Hebrew" class="interlanguage-link-target"><span>עברית</span></a></li><li class="interlanguage-link interwiki-nl mw-list-item"><a href="https://nl.wikipedia.org/wiki/Complexiteitsgraad" title="Complexiteitsgraad – Dutch" lang="nl" hreflang="nl" data-title="Complexiteitsgraad" data-language-autonym="Nederlands" data-language-local-name="Dutch" class="interlanguage-link-target"><span>Nederlands</span></a></li><li class="interlanguage-link interwiki-ja mw-list-item"><a href="https://ja.wikipedia.org/wiki/%E8%A4%87%E9%9B%91%E6%80%A7%E3%82%AF%E3%83%A9%E3%82%B9" title="複雑性クラス – Japanese" lang="ja" hreflang="ja" data-title="複雑性クラス" data-language-autonym="日本語" data-language-local-name="Japanese" class="interlanguage-link-target"><span>日本語</span></a></li><li class="interlanguage-link interwiki-no mw-list-item"><a href="https://no.wikipedia.org/wiki/Kompleksitetsklasse" title="Kompleksitetsklasse – Norwegian Bokmål" lang="nb" hreflang="nb" data-title="Kompleksitetsklasse" data-language-autonym="Norsk bokmål" data-language-local-name="Norwegian Bokmål" class="interlanguage-link-target"><span>Norsk bokmål</span></a></li><li class="interlanguage-link interwiki-nn mw-list-item"><a href="https://nn.wikipedia.org/wiki/Kompleksitetsklasse" title="Kompleksitetsklasse – Norwegian Nynorsk" lang="nn" hreflang="nn" data-title="Kompleksitetsklasse" data-language-autonym="Norsk nynorsk" data-language-local-name="Norwegian Nynorsk" class="interlanguage-link-target"><span>Norsk nynorsk</span></a></li><li class="interlanguage-link interwiki-pl mw-list-item"><a href="https://pl.wikipedia.org/wiki/Klasa_z%C5%82o%C5%BCono%C5%9Bci" title="Klasa złożoności – Polish" lang="pl" hreflang="pl" data-title="Klasa złożoności" data-language-autonym="Polski" data-language-local-name="Polish" class="interlanguage-link-target"><span>Polski</span></a></li><li class="interlanguage-link interwiki-pt mw-list-item"><a href="https://pt.wikipedia.org/wiki/Classe_de_complexidade" title="Classe de complexidade – Portuguese" lang="pt" hreflang="pt" data-title="Classe de complexidade" data-language-autonym="Português" data-language-local-name="Portuguese" class="interlanguage-link-target"><span>Português</span></a></li><li class="interlanguage-link interwiki-ro mw-list-item"><a href="https://ro.wikipedia.org/wiki/Clas%C4%83_de_complexitate" title="Clasă de complexitate – Romanian" lang="ro" hreflang="ro" data-title="Clasă de complexitate" data-language-autonym="Română" data-language-local-name="Romanian" class="interlanguage-link-target"><span>Română</span></a></li><li class="interlanguage-link interwiki-ru mw-list-item"><a href="https://ru.wikipedia.org/wiki/%D0%9A%D0%BB%D0%B0%D1%81%D1%81_%D1%81%D0%BB%D0%BE%D0%B6%D0%BD%D0%BE%D1%81%D1%82%D0%B8" title="Класс сложности – Russian" lang="ru" hreflang="ru" data-title="Класс сложности" data-language-autonym="Русский" data-language-local-name="Russian" class="interlanguage-link-target"><span>Русский</span></a></li><li class="interlanguage-link interwiki-simple mw-list-item"><a href="https://simple.wikipedia.org/wiki/Complexity_class" title="Complexity class – Simple English" lang="en-simple" hreflang="en-simple" data-title="Complexity class" data-language-autonym="Simple English" data-language-local-name="Simple English" class="interlanguage-link-target"><span>Simple English</span></a></li><li class="interlanguage-link interwiki-sr mw-list-item"><a href="https://sr.wikipedia.org/wiki/%D0%9A%D0%BB%D0%B0%D1%81%D0%B0_%D1%81%D0%BB%D0%BE%D0%B6%D0%B5%D0%BD%D0%BE%D1%81%D1%82%D0%B8" title="Класа сложености – Serbian" lang="sr" hreflang="sr" data-title="Класа сложености" data-language-autonym="Српски / srpski" data-language-local-name="Serbian" class="interlanguage-link-target"><span>Српски / srpski</span></a></li><li class="interlanguage-link interwiki-sh mw-list-item"><a href="https://sh.wikipedia.org/wiki/Klasa_slo%C5%BEenosti" title="Klasa složenosti – Serbo-Croatian" lang="sh" hreflang="sh" data-title="Klasa složenosti" data-language-autonym="Srpskohrvatski / српскохрватски" data-language-local-name="Serbo-Croatian" class="interlanguage-link-target"><span>Srpskohrvatski / српскохрватски</span></a></li><li class="interlanguage-link interwiki-sv mw-list-item"><a href="https://sv.wikipedia.org/wiki/Komplexitetsklass" title="Komplexitetsklass – Swedish" lang="sv" hreflang="sv" data-title="Komplexitetsklass" data-language-autonym="Svenska" data-language-local-name="Swedish" class="interlanguage-link-target"><span>Svenska</span></a></li><li class="interlanguage-link interwiki-zh-yue mw-list-item"><a href="https://zh-yue.wikipedia.org/wiki/%E8%A4%87%E9%9B%9C%E5%BA%A6%E9%A1%9E%E5%88%A5" title="複雜度類別 – Cantonese" lang="yue" hreflang="yue" data-title="複雜度類別" data-language-autonym="粵語" data-language-local-name="Cantonese" class="interlanguage-link-target"><span>粵語</span></a></li><li class="interlanguage-link interwiki-zh mw-list-item"><a href="https://zh.wikipedia.org/wiki/%E8%A4%87%E9%9B%9C%E5%BA%A6%E9%A1%9E" title="複雜度類 – Chinese" lang="zh" hreflang="zh" data-title="複雜度類" data-language-autonym="中文" data-language-local-name="Chinese" class="interlanguage-link-target"><span>中文</span></a></li> </ul> <div class="after-portlet after-portlet-lang"><span class="wb-langlinks-edit wb-langlinks-link"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q908207#sitelinks-wikipedia" title="Edit interlanguage links" class="wbc-editpage">Edit links</a></span></div> </div> </div> </div> </header> <div class="vector-page-toolbar"> <div class="vector-page-toolbar-container"> <div id="left-navigation"> <nav aria-label="Namespaces"> <div id="p-associated-pages" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-associated-pages" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-nstab-main" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/Complexity_class" title="View the content page [c]" accesskey="c"><span>Article</span></a></li><li id="ca-talk" class="vector-tab-noicon mw-list-item"><a href="/wiki/Talk:Complexity_class" rel="discussion" title="Discuss improvements to the content page [t]" accesskey="t"><span>Talk</span></a></li> </ul> </div> </div> <div id="vector-variants-dropdown" class="vector-dropdown emptyPortlet" > <input type="checkbox" id="vector-variants-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-variants-dropdown" class="vector-dropdown-checkbox " aria-label="Change language variant" > <label id="vector-variants-dropdown-label" for="vector-variants-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">English</span> </label> <div class="vector-dropdown-content"> <div id="p-variants" class="vector-menu mw-portlet mw-portlet-variants emptyPortlet" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> </ul> </div> </div> </div> </div> </nav> </div> <div id="right-navigation" class="vector-collapsible"> <nav aria-label="Views"> <div id="p-views" class="vector-menu vector-menu-tabs mw-portlet mw-portlet-views" > <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-view" class="selected vector-tab-noicon mw-list-item"><a href="/wiki/Complexity_class"><span>Read</span></a></li><li id="ca-edit" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Complexity_class&action=edit" title="Edit this page [e]" accesskey="e"><span>Edit</span></a></li><li id="ca-history" class="vector-tab-noicon mw-list-item"><a href="/w/index.php?title=Complexity_class&action=history" title="Past revisions of this page [h]" accesskey="h"><span>View history</span></a></li> </ul> </div> </div> </nav> <nav class="vector-page-tools-landmark" aria-label="Page tools"> <div id="vector-page-tools-dropdown" class="vector-dropdown vector-page-tools-dropdown" > <input type="checkbox" id="vector-page-tools-dropdown-checkbox" role="button" aria-haspopup="true" data-event-name="ui.dropdown-vector-page-tools-dropdown" class="vector-dropdown-checkbox " aria-label="Tools" > <label id="vector-page-tools-dropdown-label" for="vector-page-tools-dropdown-checkbox" class="vector-dropdown-label cdx-button cdx-button--fake-button cdx-button--fake-button--enabled cdx-button--weight-quiet" aria-hidden="true" ><span class="vector-dropdown-label-text">Tools</span> </label> <div class="vector-dropdown-content"> <div id="vector-page-tools-unpinned-container" class="vector-unpinned-container"> <div id="vector-page-tools" class="vector-page-tools vector-pinnable-element"> <div class="vector-pinnable-header vector-page-tools-pinnable-header vector-pinnable-header-unpinned" data-feature-name="page-tools-pinned" data-pinnable-element-id="vector-page-tools" data-pinned-container-id="vector-page-tools-pinned-container" data-unpinned-container-id="vector-page-tools-unpinned-container" > <div class="vector-pinnable-header-label">Tools</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-page-tools.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-page-tools.unpin">hide</button> </div> <div id="p-cactions" class="vector-menu mw-portlet mw-portlet-cactions emptyPortlet vector-has-collapsible-items" title="More options" > <div class="vector-menu-heading"> Actions </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="ca-more-view" class="selected vector-more-collapsible-item mw-list-item"><a href="/wiki/Complexity_class"><span>Read</span></a></li><li id="ca-more-edit" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Complexity_class&action=edit" title="Edit this page [e]" accesskey="e"><span>Edit</span></a></li><li id="ca-more-history" class="vector-more-collapsible-item mw-list-item"><a href="/w/index.php?title=Complexity_class&action=history"><span>View history</span></a></li> </ul> </div> </div> <div id="p-tb" class="vector-menu mw-portlet mw-portlet-tb" > <div class="vector-menu-heading"> General </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-whatlinkshere" class="mw-list-item"><a href="/wiki/Special:WhatLinksHere/Complexity_class" title="List of all English Wikipedia pages containing links to this page [j]" accesskey="j"><span>What links here</span></a></li><li id="t-recentchangeslinked" class="mw-list-item"><a href="/wiki/Special:RecentChangesLinked/Complexity_class" rel="nofollow" title="Recent changes in pages linked from this page [k]" accesskey="k"><span>Related changes</span></a></li><li id="t-upload" class="mw-list-item"><a href="/wiki/Wikipedia:File_Upload_Wizard" title="Upload files [u]" accesskey="u"><span>Upload file</span></a></li><li id="t-specialpages" class="mw-list-item"><a href="/wiki/Special:SpecialPages" title="A list of all special pages [q]" accesskey="q"><span>Special pages</span></a></li><li id="t-permalink" class="mw-list-item"><a href="/w/index.php?title=Complexity_class&oldid=1251434113" title="Permanent link to this revision of this page"><span>Permanent link</span></a></li><li id="t-info" class="mw-list-item"><a href="/w/index.php?title=Complexity_class&action=info" title="More information about this page"><span>Page information</span></a></li><li id="t-cite" class="mw-list-item"><a href="/w/index.php?title=Special:CiteThisPage&page=Complexity_class&id=1251434113&wpFormIdentifier=titleform" title="Information on how to cite this page"><span>Cite this page</span></a></li><li id="t-urlshortener" class="mw-list-item"><a href="/w/index.php?title=Special:UrlShortener&url=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FComplexity_class"><span>Get shortened URL</span></a></li><li id="t-urlshortener-qrcode" class="mw-list-item"><a href="/w/index.php?title=Special:QrCode&url=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FComplexity_class"><span>Download QR code</span></a></li> </ul> </div> </div> <div id="p-coll-print_export" class="vector-menu mw-portlet mw-portlet-coll-print_export" > <div class="vector-menu-heading"> Print/export </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="coll-download-as-rl" class="mw-list-item"><a href="/w/index.php?title=Special:DownloadAsPdf&page=Complexity_class&action=show-download-screen" title="Download this page as a PDF file"><span>Download as PDF</span></a></li><li id="t-print" class="mw-list-item"><a href="/w/index.php?title=Complexity_class&printable=yes" title="Printable version of this page [p]" accesskey="p"><span>Printable version</span></a></li> </ul> </div> </div> <div id="p-wikibase-otherprojects" class="vector-menu mw-portlet mw-portlet-wikibase-otherprojects" > <div class="vector-menu-heading"> In other projects </div> <div class="vector-menu-content"> <ul class="vector-menu-content-list"> <li id="t-wikibase" class="wb-otherproject-link wb-otherproject-wikibase-dataitem mw-list-item"><a href="https://www.wikidata.org/wiki/Special:EntityPage/Q908207" title="Structured data on this page hosted by Wikidata [g]" accesskey="g"><span>Wikidata item</span></a></li> </ul> </div> </div> </div> </div> </div> </div> </nav> </div> </div> </div> <div class="vector-column-end"> <div class="vector-sticky-pinned-container"> <nav class="vector-page-tools-landmark" aria-label="Page tools"> <div id="vector-page-tools-pinned-container" class="vector-pinned-container"> </div> </nav> <nav class="vector-appearance-landmark" aria-label="Appearance"> <div id="vector-appearance-pinned-container" class="vector-pinned-container"> <div id="vector-appearance" class="vector-appearance vector-pinnable-element"> <div class="vector-pinnable-header vector-appearance-pinnable-header vector-pinnable-header-pinned" data-feature-name="appearance-pinned" data-pinnable-element-id="vector-appearance" data-pinned-container-id="vector-appearance-pinned-container" data-unpinned-container-id="vector-appearance-unpinned-container" > <div class="vector-pinnable-header-label">Appearance</div> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-pin-button" data-event-name="pinnable-header.vector-appearance.pin">move to sidebar</button> <button class="vector-pinnable-header-toggle-button vector-pinnable-header-unpin-button" data-event-name="pinnable-header.vector-appearance.unpin">hide</button> </div> </div> </div> </nav> </div> </div> <div id="bodyContent" class="vector-body" aria-labelledby="firstHeading" data-mw-ve-target-container> <div class="vector-body-before-content"> <div class="mw-indicators"> </div> <div id="siteSub" class="noprint">From Wikipedia, the free encyclopedia</div> </div> <div id="contentSub"><div id="mw-content-subtitle"><span class="mw-redirectedfrom">(Redirected from <a href="/w/index.php?title=Complexity_classes&redirect=no" class="mw-redirect" title="Complexity classes">Complexity classes</a>)</span></div></div> <div id="mw-content-text" class="mw-body-content"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr"><div class="shortdescription nomobile noexcerpt noprint searchaux" style="display:none">Set of problems in computational complexity theory</div> <figure class="mw-default-size mw-halign-right" typeof="mw:File/Thumb"><a href="/wiki/File:Complexity_subsets_pspace.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/6/6e/Complexity_subsets_pspace.svg/220px-Complexity_subsets_pspace.svg.png" decoding="async" width="220" height="200" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/6/6e/Complexity_subsets_pspace.svg/330px-Complexity_subsets_pspace.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/6/6e/Complexity_subsets_pspace.svg/440px-Complexity_subsets_pspace.svg.png 2x" data-file-width="485" data-file-height="441" /></a><figcaption>A representation of the relationships between several important complexity classes</figcaption></figure> <p>In <a href="/wiki/Computational_complexity_theory" title="Computational complexity theory">computational complexity theory</a>, a <b>complexity class</b> is a <a href="/wiki/Set_(mathematics)" title="Set (mathematics)">set</a> of <a href="/wiki/Computational_problem" title="Computational problem">computational problems</a> "of related resource-based <a href="/wiki/Computational_complexity" title="Computational complexity">complexity</a>".<sup id="cite_ref-FOOTNOTEJohnson1990_1-0" class="reference"><a href="#cite_note-FOOTNOTEJohnson1990-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> The two most commonly analyzed resources are <a href="/wiki/Time_complexity" title="Time complexity">time</a> and <a href="/wiki/Space_complexity" title="Space complexity">memory</a>. </p><p>In general, a complexity class is defined in terms of a type of computational problem, a <a href="/wiki/Model_of_computation" title="Model of computation">model of computation</a>, and a bounded resource like <a href="/wiki/Time_complexity" title="Time complexity">time</a> or <a href="/wiki/Space_complexity" title="Space complexity">memory</a>. In particular, most complexity classes consist of <a href="/wiki/Decision_problem" title="Decision problem">decision problems</a> that are solvable with a <a href="/wiki/Turing_machine" title="Turing machine">Turing machine</a>, and are differentiated by their time or space (memory) requirements. For instance, the class <b><a href="/wiki/P_(complexity)" title="P (complexity)">P</a></b> is the set of decision problems solvable by a deterministic Turing machine in <a href="/wiki/Polynomial_time" class="mw-redirect" title="Polynomial time">polynomial time</a>. There are, however, many complexity classes defined in terms of other types of problems (e.g. <a href="/wiki/Counting_problem_(complexity)" title="Counting problem (complexity)">counting problems</a> and <a href="/wiki/Function_problem" title="Function problem">function problems</a>) and using other models of computation (e.g. <a href="/wiki/Probabilistic_Turing_machine" title="Probabilistic Turing machine">probabilistic Turing machines</a>, <a href="/wiki/Interactive_proof_system" title="Interactive proof system">interactive proof systems</a>, <a href="/wiki/Boolean_circuit" title="Boolean circuit">Boolean circuits</a>, and <a href="/wiki/Quantum_computer" class="mw-redirect" title="Quantum computer">quantum computers</a>). </p><p>The study of the relationships between complexity classes is a major area of research in theoretical computer science. There are often general hierarchies of complexity classes; for example, it is known that a number of fundamental time and space complexity classes relate to each other in the following way: <a href="/wiki/L_(complexity)" title="L (complexity)"><b>L</b></a>⊆<b><a href="/wiki/NL_(complexity)" title="NL (complexity)">NL</a></b>⊆<b><a href="/wiki/P_(complexity)" title="P (complexity)">P</a></b>⊆<b><a href="/wiki/NP_(complexity)" title="NP (complexity)">NP</a></b>⊆<b><a href="/wiki/PSPACE" title="PSPACE">PSPACE</a></b>⊆<b><a href="/wiki/EXPTIME" title="EXPTIME">EXPTIME</a></b>⊆<b><a href="/wiki/NEXPTIME" title="NEXPTIME">NEXPTIME</a></b>⊆<b><a href="/wiki/EXPSPACE" title="EXPSPACE">EXPSPACE</a></b> (where ⊆ denotes the <a href="/wiki/Subset" title="Subset">subset</a> relation). However, many relationships are not yet known; for example, one of the most famous <a href="/wiki/Open_problem" title="Open problem">open problems</a> in computer science concerns whether <a href="/wiki/P_versus_NP" class="mw-redirect" title="P versus NP"><b>P</b> equals <b>NP</b></a>. The relationships between classes often answer questions about the fundamental nature of computation. The <b>P</b> versus <b>NP</b> problem, for instance, is directly related to questions of whether <a href="/wiki/Nondeterministic_algorithm" title="Nondeterministic algorithm">nondeterminism</a> adds any computational power to computers and whether problems having solutions that can be quickly checked for correctness can also be quickly solved. </p> <meta property="mw:PageProp/toc" /> <div class="mw-heading mw-heading2"><h2 id="Background">Background</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=1" title="Edit section: Background"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Complexity classes are <a href="/wiki/Set_(mathematics)" title="Set (mathematics)">sets</a> of related <a href="/wiki/Computational_problem" title="Computational problem">computational problems</a>. They are defined in terms of the computational difficulty of solving the problems contained within them with respect to particular computational resources like time or memory. More formally, the definition of a complexity class consists of three things: a type of computational problem, a model of computation, and a bounded computational resource. In particular, most complexity classes consist of <a href="/wiki/Decision_problem" title="Decision problem">decision problems</a> that can be solved by a <a href="/wiki/Turing_machine" title="Turing machine">Turing machine</a> with bounded <a href="/wiki/Time_complexity" title="Time complexity">time</a> or <a href="/wiki/Space_complexity" title="Space complexity">space</a> resources. For example, the complexity class <b><a href="/wiki/P_(complexity)" title="P (complexity)">P</a></b> is defined as the set of <a href="/wiki/Decision_problem" title="Decision problem">decision problems</a> that can be solved by a <a href="/wiki/Deterministic_Turing_machine" class="mw-redirect" title="Deterministic Turing machine">deterministic Turing machine</a> in <a href="/wiki/Polynomial_time" class="mw-redirect" title="Polynomial time">polynomial time</a>. </p> <div class="mw-heading mw-heading3"><h3 id="Computational_problems">Computational problems</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=2" title="Edit section: Computational problems"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Intuitively, a <a href="/wiki/Computational_problem" title="Computational problem">computational problem</a> is just a question that can be solved by an <a href="/wiki/Algorithm" title="Algorithm">algorithm</a>. For example, "is the <a href="/wiki/Natural_number" title="Natural number">natural number</a> <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>n</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle n}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a601995d55609f2d9f5e233e36fbe9ea26011b3b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.395ex; height:1.676ex;" alt="{\displaystyle n}"></span> <a href="/wiki/Prime_number" title="Prime number">prime</a>?" is a computational problem. A computational problem is mathematically represented as the <a href="/wiki/Set_(mathematics)" title="Set (mathematics)">set</a> of answers to the problem. In the primality example, the problem (call it <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\texttt {PRIME}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mtext mathvariant="monospace">PRIME</mtext> </mrow> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\texttt {PRIME}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/111e812b68c6403ac3dc28b8cb9cb49566f40e3a" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:6.103ex; height:2.009ex;" alt="{\displaystyle {\texttt {PRIME}}}"></span>) is represented by the set of all natural numbers that are prime: <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\texttt {PRIME}}=\{n\in \mathbb {N} |n{\text{ is prime}}\}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mtext mathvariant="monospace">PRIME</mtext> </mrow> </mrow> <mo>=</mo> <mo fence="false" stretchy="false">{</mo> <mi>n</mi> <mo>∈<!-- ∈ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="double-struck">N</mi> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mo stretchy="false">|</mo> </mrow> <mi>n</mi> <mrow class="MJX-TeXAtom-ORD"> <mtext> is prime</mtext> </mrow> <mo fence="false" stretchy="false">}</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\texttt {PRIME}}=\{n\in \mathbb {N} |n{\text{ is prime}}\}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/e56dfe16668795ae48bfdd449d5b9400ea36106c" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:28.025ex; height:2.843ex;" alt="{\displaystyle {\texttt {PRIME}}=\{n\in \mathbb {N} |n{\text{ is prime}}\}}"></span>. In the theory of computation, these answers are represented as <a href="/wiki/String_(computer_science)" title="String (computer science)">strings</a>; for example, in the primality example the natural numbers could be represented as strings of <a href="/wiki/Bit" title="Bit">bits</a> that represent <a href="/wiki/Binary_number" title="Binary number">binary numbers</a>. For this reason, computational problems are often synonymously referred to as languages, since strings of bits represent <a href="/wiki/Formal_language" title="Formal language">formal languages</a> (a concept borrowed from <a href="/wiki/Linguistics" title="Linguistics">linguistics</a>); for example, saying that the <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\texttt {PRIME}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mtext mathvariant="monospace">PRIME</mtext> </mrow> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\texttt {PRIME}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/111e812b68c6403ac3dc28b8cb9cb49566f40e3a" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:6.103ex; height:2.009ex;" alt="{\displaystyle {\texttt {PRIME}}}"></span> problem is in the complexity class <b><a href="/wiki/NP_(complexity)" title="NP (complexity)">NP</a></b> is equivalent to saying that the language <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\texttt {PRIME}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mtext mathvariant="monospace">PRIME</mtext> </mrow> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\texttt {PRIME}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/111e812b68c6403ac3dc28b8cb9cb49566f40e3a" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:6.103ex; height:2.009ex;" alt="{\displaystyle {\texttt {PRIME}}}"></span> is in <b>NP</b>. </p> <div class="mw-heading mw-heading4"><h4 id="Decision_problems">Decision problems</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=3" title="Edit section: Decision problems"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <figure class="mw-default-size" typeof="mw:File/Thumb"><a href="/wiki/File:Decision_Problem.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/0/06/Decision_Problem.svg/220px-Decision_Problem.svg.png" decoding="async" width="220" height="274" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/0/06/Decision_Problem.svg/330px-Decision_Problem.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/0/06/Decision_Problem.svg/440px-Decision_Problem.svg.png 2x" data-file-width="247" data-file-height="308" /></a><figcaption>A <a href="/wiki/Decision_problem" title="Decision problem">decision problem</a> has only two possible outputs, <i>yes</i> or <i>no</i> (alternatively, 1 or 0) on any input.</figcaption></figure> <p>The most commonly analyzed problems in theoretical computer science are <a href="/wiki/Decision_problem" title="Decision problem">decision problems</a>—the kinds of problems that can be posed as <a href="/wiki/Yes%E2%80%93no_question" title="Yes–no question">yes–no questions</a>. The primality example above, for instance, is an example of a decision problem as it can be represented by the yes–no question "is the <a href="/wiki/Natural_number" title="Natural number">natural number</a> <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>n</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle n}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a601995d55609f2d9f5e233e36fbe9ea26011b3b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.395ex; height:1.676ex;" alt="{\displaystyle n}"></span> <a href="/wiki/Prime_number" title="Prime number">prime</a>". In terms of the theory of computation, a decision problem is represented as the set of input strings that a computer running a correct <a href="/wiki/Algorithm" title="Algorithm">algorithm</a> would answer "yes" to. In the primality example, <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\texttt {PRIME}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mtext mathvariant="monospace">PRIME</mtext> </mrow> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\texttt {PRIME}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/111e812b68c6403ac3dc28b8cb9cb49566f40e3a" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:6.103ex; height:2.009ex;" alt="{\displaystyle {\texttt {PRIME}}}"></span> is the set of strings representing natural numbers that, when input into a computer running an algorithm that correctly <a href="/wiki/Primality_testing" class="mw-redirect" title="Primality testing">tests for primality</a>, the algorithm answers "yes, this number is prime". This "yes-no" format is often equivalently stated as "accept-reject"; that is, an algorithm "accepts" an input string if the answer to the decision problem is "yes" and "rejects" if the answer is "no". </p><p>While some problems cannot easily be expressed as decision problems, they nonetheless encompass a broad range of computational problems.<sup id="cite_ref-FOOTNOTEAroraBarak200928_2-0" class="reference"><a href="#cite_note-FOOTNOTEAroraBarak200928-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> Other types of problems that certain complexity classes are defined in terms of include: </p> <ul><li><a href="/wiki/Function_problem" title="Function problem">Function problems</a> (e.g. <b><a href="/wiki/FP_(complexity)" title="FP (complexity)">FP</a></b>)</li> <li><a href="/wiki/Counting_problem_(complexity)" title="Counting problem (complexity)">Counting problems</a> (e.g. <b><a href="/wiki/Sharp-P" class="mw-redirect" title="Sharp-P">#P</a></b>)</li> <li><a href="/wiki/Optimization_problem" title="Optimization problem">Optimization problems</a></li> <li><a href="/wiki/Promise_problem" title="Promise problem">Promise problems</a> (see section "Other types of problems")</li></ul> <div class="mw-heading mw-heading3"><h3 id="Computational_models">Computational models</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=4" title="Edit section: Computational models"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>To make concrete the notion of a "computer", in theoretical computer science problems are analyzed in the context of a <a href="/wiki/Computational_model" title="Computational model">computational model</a>. Computational models make exact the notions of computational resources like "time" and "memory". In <a href="/wiki/Computational_complexity_theory" title="Computational complexity theory">computational complexity theory</a>, complexity classes deal with the <i>inherent</i> resource requirements of problems and not the resource requirements that depend upon how a physical computer is constructed. For example, in the real world different computers may require different amounts of time and memory to solve the same problem because of the way that they have been engineered. By providing an abstract mathematical representations of computers, computational models abstract away superfluous complexities of the real world (like differences in <a href="/wiki/Processor_(computing)" title="Processor (computing)">processor</a> speed) that obstruct an understanding of fundamental principles. </p><p>The most commonly used computational model is the <a href="/wiki/Turing_machine" title="Turing machine">Turing machine</a>. While other models exist and many complexity classes are defined in terms of them (see section <a class="mw-selflink-fragment" href="#Other_models_of_computation">"Other models of computation"</a>), the Turing machine is used to define most basic complexity classes. With the Turing machine, instead of using standard units of time like the second (which make it impossible to disentangle running time from the speed of physical hardware) and standard units of memory like <a href="/wiki/Byte" title="Byte">bytes</a>, the notion of time is abstracted as the number of elementary steps that a Turing machine takes to solve a problem and the notion of memory is abstracted as the number of cells that are used on the machine's tape. These are explained in greater detail below. </p><p>It is also possible to use the <a href="/wiki/Blum_axioms" title="Blum axioms">Blum axioms</a> to define complexity classes without referring to a concrete <a href="/wiki/Computational_model" title="Computational model">computational model</a>, but this approach is less frequently used in complexity theory. </p> <div class="mw-heading mw-heading4"><h4 id="Deterministic_Turing_machines">Deterministic Turing machines</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=5" title="Edit section: Deterministic Turing machines"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <style data-mw-deduplicate="TemplateStyles:r1236090951">.mw-parser-output .hatnote{font-style:italic}.mw-parser-output div.hatnote{padding-left:1.6em;margin-bottom:0.5em}.mw-parser-output .hatnote i{font-style:normal}.mw-parser-output .hatnote+link+.hatnote{margin-top:-0.5em}@media print{body.ns-0 .mw-parser-output .hatnote{display:none!important}}</style><div role="note" class="hatnote navigation-not-searchable">Main article: <a href="/wiki/Turing_machine" title="Turing machine">Turing machine</a></div> <figure class="mw-default-size mw-halign-right" typeof="mw:File/Thumb"><a href="/wiki/File:Turing_machine_2b.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/a/a2/Turing_machine_2b.svg/220px-Turing_machine_2b.svg.png" decoding="async" width="220" height="52" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/a/a2/Turing_machine_2b.svg/330px-Turing_machine_2b.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/a/a2/Turing_machine_2b.svg/440px-Turing_machine_2b.svg.png 2x" data-file-width="550" data-file-height="130" /></a><figcaption>An illustration of a Turing machine. The "B" indicates the blank symbol.</figcaption></figure> <p>A <b>Turing machine</b> is a mathematical model of a general computing machine. It is the most commonly used model in complexity theory, owing in large part to the fact that it is believed to be as powerful as any other model of computation and is easy to analyze mathematically. Importantly, it is believed that if there exists an algorithm that solves a particular problem then there also exists a Turing machine that solves that same problem (this is known as the <a href="/wiki/Church%E2%80%93Turing_thesis" title="Church–Turing thesis">Church–Turing thesis</a>); this means that it is believed that <i>every</i> algorithm can be represented as a Turing machine. </p><p>Mechanically, a Turing machine (TM) manipulates symbols (generally restricted to the bits 0 and 1 to provide an intuitive connection to real-life computers) contained on an infinitely long strip of tape. The TM can read and write, one at a time, using a tape head. Operation is fully determined by a finite set of elementary instructions such as "in state 42, if the symbol seen is 0, write a 1; if the symbol seen is 1, change into state 17; in state 17, if the symbol seen is 0, write a 1 and change to state 6". The Turing machine starts with only the input string on its tape and blanks everywhere else. The TM accepts the input if it enters a designated accept state and rejects the input if it enters a reject state. The deterministic Turing machine (DTM) is the most basic type of Turing machine. It uses a fixed set of rules to determine its future actions (which is why it is called "<a href="/wiki/Deterministic" class="mw-redirect" title="Deterministic">deterministic</a>"). </p><p>A computational problem can then be defined in terms of a Turing machine as the set of input strings that a particular Turing machine accepts. For example, the primality problem <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\texttt {PRIME}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mtext mathvariant="monospace">PRIME</mtext> </mrow> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\texttt {PRIME}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/111e812b68c6403ac3dc28b8cb9cb49566f40e3a" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:6.103ex; height:2.009ex;" alt="{\displaystyle {\texttt {PRIME}}}"></span> from above is the set of strings (representing natural numbers) that a Turing machine running an algorithm that correctly <a href="/wiki/Primality_test" title="Primality test">tests for primality</a> accepts. A Turing machine is said to <b>recognize</b> a language (recall that "problem" and "language" are largely synonymous in computability and complexity theory) if it accepts all inputs that are in the language and is said to <b>decide</b> a language if it additionally rejects all inputs that are not in the language (certain inputs may cause a Turing machine to run forever, so <a href="/wiki/Recursive_set" class="mw-redirect" title="Recursive set">decidability</a> places the additional constraint over <a href="/wiki/Recursively_enumerable_set" class="mw-redirect" title="Recursively enumerable set">recognizability</a> that the Turing machine must halt on all inputs). A Turing machine that "solves" a problem is generally meant to mean one that decides the language. </p><p>Turing machines enable intuitive notions of "time" and "space". The <a href="/wiki/Time_complexity" title="Time complexity">time complexity</a> of a TM on a particular input is the number of elementary steps that the Turing machine takes to reach either an accept or reject state. The <a href="/wiki/Space_complexity" title="Space complexity">space complexity</a> is the number of cells on its tape that it uses to reach either an accept or reject state. </p> <div class="mw-heading mw-heading4"><h4 id="Nondeterministic_Turing_machines">Nondeterministic Turing machines</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=6" title="Edit section: Nondeterministic Turing machines"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1236090951"><div role="note" class="hatnote navigation-not-searchable">Main article: <a href="/wiki/Nondeterministic_Turing_machine" title="Nondeterministic Turing machine">Nondeterministic Turing machine</a></div> <figure class="mw-halign-right" typeof="mw:File/Thumb"><a href="/wiki/File:Difference_between_deterministic_and_Nondeterministic.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/1/16/Difference_between_deterministic_and_Nondeterministic.svg/350px-Difference_between_deterministic_and_Nondeterministic.svg.png" decoding="async" width="350" height="207" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/1/16/Difference_between_deterministic_and_Nondeterministic.svg/525px-Difference_between_deterministic_and_Nondeterministic.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/1/16/Difference_between_deterministic_and_Nondeterministic.svg/700px-Difference_between_deterministic_and_Nondeterministic.svg.png 2x" data-file-width="775" data-file-height="458" /></a><figcaption> A comparison of deterministic and nondeterministic computation. If any branch on the nondeterministic computation accepts then the NTM accepts.</figcaption></figure> <p>The deterministic Turing machine (DTM) is a variant of the nondeterministic Turing machine (NTM). Intuitively, an NTM is just a regular Turing machine that has the added capability of being able to explore multiple possible future actions from a given state, and "choosing" a branch that accepts (if any accept). That is, while a DTM must follow only one branch of computation, an NTM can be imagined as a computation tree, branching into many possible computational pathways at each step (see image). If at least one branch of the tree halts with an "accept" condition, then the NTM accepts the input. In this way, an NTM can be thought of as simultaneously exploring all computational possibilities in parallel and selecting an accepting branch.<sup id="cite_ref-FOOTNOTESipser200648,_150_3-0" class="reference"><a href="#cite_note-FOOTNOTESipser200648,_150-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> NTMs are not meant to be physically realizable models, they are simply theoretically interesting abstract machines that give rise to a number of interesting complexity classes (which often do have physically realizable equivalent definitions). </p><p>The <a href="/wiki/Time_complexity" title="Time complexity">time complexity</a> of an NTM is the maximum number of steps that the NTM uses on <i>any</i> branch of its computation.<sup id="cite_ref-FOOTNOTESipser2006255_4-0" class="reference"><a href="#cite_note-FOOTNOTESipser2006255-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup> Similarly, the <a href="/wiki/Space_complexity" title="Space complexity">space complexity</a> of an NTM is the maximum number of cells that the NTM uses on any branch of its computation. </p><p>DTMs can be viewed as a special case of NTMs that do not make use of the power of nondeterminism. Hence, every computation that can be carried out by a DTM can also be carried out by an equivalent NTM. It is also possible to simulate any NTM using a DTM (the DTM will simply compute every possible computational branch one-by-one). Hence, the two are equivalent in terms of computability. However, simulating an NTM with a DTM often requires greater time and/or memory resources; as will be seen, how significant this slowdown is for certain classes of computational problems is an important question in computational complexity theory. </p> <div class="mw-heading mw-heading3"><h3 id="Resource_bounds">Resource bounds</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=7" title="Edit section: Resource bounds"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Complexity classes group computational problems by their resource requirements. To do this, computational problems are differentiated by <a href="/wiki/Upper_bound" class="mw-redirect" title="Upper bound">upper bounds</a> on the maximum amount of resources that the most efficient algorithm takes to solve them. More specifically, complexity classes are concerned with the <i>rate of growth</i> in the resources required to solve particular computational problems as the input size increases. For example, the amount of time it takes to solve problems in the complexity class <b><a href="/wiki/P_(complexity)" title="P (complexity)">P</a></b> grows at a <a href="/wiki/Polynomial" title="Polynomial">polynomial</a> rate as the input size increases, which is comparatively slow compared to problems in the exponential complexity class <b><a href="/wiki/EXPTIME" title="EXPTIME">EXPTIME</a></b> (or more accurately, for problems in <b>EXPTIME</b> that are outside of <b>P</b>, since <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathsf {P}}\subseteq {\mathsf {EXPTIME}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">P</mi> </mrow> </mrow> <mo>⊆<!-- ⊆ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">E</mi> <mi mathvariant="sans-serif">X</mi> <mi mathvariant="sans-serif">P</mi> <mi mathvariant="sans-serif">T</mi> <mi mathvariant="sans-serif">I</mi> <mi mathvariant="sans-serif">M</mi> <mi mathvariant="sans-serif">E</mi> </mrow> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\mathsf {P}}\subseteq {\mathsf {EXPTIME}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/83dd9f27ccd64eab8769f872629fe0f5496110df" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.505ex; width:14.658ex; height:2.343ex;" alt="{\displaystyle {\mathsf {P}}\subseteq {\mathsf {EXPTIME}}}"></span>). </p><p>Note that the study of complexity classes is intended primarily to understand the <i>inherent</i> complexity required to solve computational problems. Complexity theorists are thus generally concerned with finding the smallest complexity class that a problem falls into and are therefore concerned with identifying which class a computational problem falls into using the <i>most efficient</i> algorithm. There may be an algorithm, for instance, that solves a particular problem in exponential time, but if the most efficient algorithm for solving this problem runs in polynomial time then the inherent time complexity of that problem is better described as polynomial. </p> <div class="mw-heading mw-heading4"><h4 id="Time_bounds">Time bounds</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=8" title="Edit section: Time bounds"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1236090951"><div role="note" class="hatnote navigation-not-searchable">Main article: <a href="/wiki/Time_complexity" title="Time complexity">Time complexity</a></div> <p>The <a href="/wiki/Time_complexity" title="Time complexity">time complexity</a> of an algorithm with respect to the Turing machine model is the number of steps it takes for a Turing machine to run an algorithm on a given input size. Formally, the time complexity for an algorithm implemented with a Turing machine <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle M}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>M</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle M}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f82cade9898ced02fdd08712e5f0c0151758a0dd" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.442ex; height:2.176ex;" alt="{\displaystyle M}"></span> is defined as the function <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle t_{M}:\mathbb {N} \to \mathbb {N} }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>t</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>M</mi> </mrow> </msub> <mo>:</mo> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="double-struck">N</mi> </mrow> <mo stretchy="false">→<!-- → --></mo> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="double-struck">N</mi> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle t_{M}:\mathbb {N} \to \mathbb {N} }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/58268c9a48194cc3938da62869307c1319a96a89" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:11.706ex; height:2.509ex;" alt="{\displaystyle t_{M}:\mathbb {N} \to \mathbb {N} }"></span>, where <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle t_{M}(n)}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>t</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>M</mi> </mrow> </msub> <mo stretchy="false">(</mo> <mi>n</mi> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle t_{M}(n)}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/2b12d538219a9867f42062451df84e7a546af432" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:6.003ex; height:2.843ex;" alt="{\displaystyle t_{M}(n)}"></span> is the maximum number of steps that <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle M}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>M</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle M}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f82cade9898ced02fdd08712e5f0c0151758a0dd" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.442ex; height:2.176ex;" alt="{\displaystyle M}"></span> takes on any input of length <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>n</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle n}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a601995d55609f2d9f5e233e36fbe9ea26011b3b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.395ex; height:1.676ex;" alt="{\displaystyle n}"></span>. </p><p>In computational complexity theory, theoretical computer scientists are concerned less with particular runtime values and more with the general class of functions that the time complexity function falls into. For instance, is the time complexity function a <a href="/wiki/Polynomial" title="Polynomial">polynomial</a>? A <a href="/wiki/Logarithmic_function" class="mw-redirect" title="Logarithmic function">logarithmic function</a>? An <a href="/wiki/Exponential_function" title="Exponential function">exponential function</a>? Or another kind of function? </p> <div class="mw-heading mw-heading4"><h4 id="Space_bounds">Space bounds</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=9" title="Edit section: Space bounds"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1236090951"><div role="note" class="hatnote navigation-not-searchable">Main article: <a href="/wiki/Space_complexity" title="Space complexity">Space complexity</a></div> <p>The <a href="/wiki/Space_complexity" title="Space complexity">space complexity</a> of an algorithm with respect to the Turing machine model is the number of cells on the Turing machine's tape that are required to run an algorithm on a given input size. Formally, the space complexity of an algorithm implemented with a Turing machine <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle M}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>M</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle M}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f82cade9898ced02fdd08712e5f0c0151758a0dd" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.442ex; height:2.176ex;" alt="{\displaystyle M}"></span> is defined as the function <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle s_{M}:\mathbb {N} \to \mathbb {N} }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>s</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>M</mi> </mrow> </msub> <mo>:</mo> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="double-struck">N</mi> </mrow> <mo stretchy="false">→<!-- → --></mo> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="double-struck">N</mi> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle s_{M}:\mathbb {N} \to \mathbb {N} }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/dc0f4a8fa2bf925ef0e6183fe6d72839ce6a2665" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:11.957ex; height:2.509ex;" alt="{\displaystyle s_{M}:\mathbb {N} \to \mathbb {N} }"></span>, where <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle s_{M}(n)}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>s</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>M</mi> </mrow> </msub> <mo stretchy="false">(</mo> <mi>n</mi> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle s_{M}(n)}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/2ce3dc71277c6a5a05147cb235fceb20cc07f459" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:6.254ex; height:2.843ex;" alt="{\displaystyle s_{M}(n)}"></span> is the maximum number of cells that <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle M}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>M</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle M}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f82cade9898ced02fdd08712e5f0c0151758a0dd" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.442ex; height:2.176ex;" alt="{\displaystyle M}"></span> uses on any input of length <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>n</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle n}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a601995d55609f2d9f5e233e36fbe9ea26011b3b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.395ex; height:1.676ex;" alt="{\displaystyle n}"></span>. </p> <div class="mw-heading mw-heading2"><h2 id="Basic_complexity_classes">Basic complexity classes</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=10" title="Edit section: Basic complexity classes"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1236090951"><div role="note" class="hatnote navigation-not-searchable">See also: <a href="/wiki/List_of_complexity_classes" title="List of complexity classes">List of complexity classes</a></div> <div class="mw-heading mw-heading3"><h3 id="Basic_definitions">Basic definitions</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=11" title="Edit section: Basic definitions"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Complexity classes are often defined using granular sets of complexity classes called <b>DTIME</b> and <b>NTIME</b> (for time complexity) and <b>DSPACE</b> and <b>NSPACE</b> (for space complexity). Using <a href="/wiki/Big_O_notation" title="Big O notation">big O notation</a>, they are defined as follows: </p> <ul><li>The time complexity class <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathsf {DTIME}}(t(n))}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">D</mi> <mi mathvariant="sans-serif">T</mi> <mi mathvariant="sans-serif">I</mi> <mi mathvariant="sans-serif">M</mi> <mi mathvariant="sans-serif">E</mi> </mrow> </mrow> <mo stretchy="false">(</mo> <mi>t</mi> <mo stretchy="false">(</mo> <mi>n</mi> <mo stretchy="false">)</mo> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\mathsf {DTIME}}(t(n))}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/82ca926f35748a54da02822264430bd150c35a79" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:13.182ex; height:2.843ex;" alt="{\displaystyle {\mathsf {DTIME}}(t(n))}"></span> is the set of all problems that are decided by an <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle O(t(n))}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>O</mi> <mo stretchy="false">(</mo> <mi>t</mi> <mo stretchy="false">(</mo> <mi>n</mi> <mo stretchy="false">)</mo> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle O(t(n))}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/909c058062dc4f44608d0cdd99d909d48ecc542b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:7.626ex; height:2.843ex;" alt="{\displaystyle O(t(n))}"></span> time deterministic Turing machine.</li> <li>The time complexity class <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathsf {NTIME}}(t(n))}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">N</mi> <mi mathvariant="sans-serif">T</mi> <mi mathvariant="sans-serif">I</mi> <mi mathvariant="sans-serif">M</mi> <mi mathvariant="sans-serif">E</mi> </mrow> </mrow> <mo stretchy="false">(</mo> <mi>t</mi> <mo stretchy="false">(</mo> <mi>n</mi> <mo stretchy="false">)</mo> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\mathsf {NTIME}}(t(n))}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/ed543ee7897db37f104c4fa9cfac18de4ffe789a" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:13.149ex; height:2.843ex;" alt="{\displaystyle {\mathsf {NTIME}}(t(n))}"></span> is the set of all problems that are decided by an <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle O(t(n))}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>O</mi> <mo stretchy="false">(</mo> <mi>t</mi> <mo stretchy="false">(</mo> <mi>n</mi> <mo stretchy="false">)</mo> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle O(t(n))}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/909c058062dc4f44608d0cdd99d909d48ecc542b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:7.626ex; height:2.843ex;" alt="{\displaystyle O(t(n))}"></span> time nondeterministic Turing machine.</li> <li>The space complexity class <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathsf {DSPACE}}(s(n))}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">D</mi> <mi mathvariant="sans-serif">S</mi> <mi mathvariant="sans-serif">P</mi> <mi mathvariant="sans-serif">A</mi> <mi mathvariant="sans-serif">C</mi> <mi mathvariant="sans-serif">E</mi> </mrow> </mrow> <mo stretchy="false">(</mo> <mi>s</mi> <mo stretchy="false">(</mo> <mi>n</mi> <mo stretchy="false">)</mo> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\mathsf {DSPACE}}(s(n))}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/29fb4d30a891eeb458a2ad6a2e76cd2d83f27412" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:14.983ex; height:2.843ex;" alt="{\displaystyle {\mathsf {DSPACE}}(s(n))}"></span> is the set of all problems that are decided by an <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle O(s(n))}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>O</mi> <mo stretchy="false">(</mo> <mi>s</mi> <mo stretchy="false">(</mo> <mi>n</mi> <mo stretchy="false">)</mo> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle O(s(n))}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/3b014c6f2b23284ce91d9bd7976e181b757b3c38" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:7.877ex; height:2.843ex;" alt="{\displaystyle O(s(n))}"></span> space deterministic Turing machine.</li> <li>The space complexity class <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathsf {NSPACE}}(s(n))}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">N</mi> <mi mathvariant="sans-serif">S</mi> <mi mathvariant="sans-serif">P</mi> <mi mathvariant="sans-serif">A</mi> <mi mathvariant="sans-serif">C</mi> <mi mathvariant="sans-serif">E</mi> </mrow> </mrow> <mo stretchy="false">(</mo> <mi>s</mi> <mo stretchy="false">(</mo> <mi>n</mi> <mo stretchy="false">)</mo> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\mathsf {NSPACE}}(s(n))}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/cfd69e71594b51d86148af32b14baa8a3d7d9d7c" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:14.951ex; height:2.843ex;" alt="{\displaystyle {\mathsf {NSPACE}}(s(n))}"></span> is the set of all problems that are decided by an <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle O(s(n))}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>O</mi> <mo stretchy="false">(</mo> <mi>s</mi> <mo stretchy="false">(</mo> <mi>n</mi> <mo stretchy="false">)</mo> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle O(s(n))}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/3b014c6f2b23284ce91d9bd7976e181b757b3c38" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:7.877ex; height:2.843ex;" alt="{\displaystyle O(s(n))}"></span> space nondeterministic Turing machine.</li></ul> <div class="mw-heading mw-heading3"><h3 id="Time_complexity_classes">Time complexity classes</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=12" title="Edit section: Time complexity classes"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1236090951"><div role="note" class="hatnote navigation-not-searchable">Main article: <a href="/wiki/Time_complexity" title="Time complexity">Time complexity</a></div> <div class="mw-heading mw-heading4"><h4 id="P_and_NP">P and NP</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=13" title="Edit section: P and NP"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1236090951"><div role="note" class="hatnote navigation-not-searchable">Main articles: <a href="/wiki/P_(complexity)" title="P (complexity)">P (complexity)</a> and <a href="/wiki/NP_(complexity)" title="NP (complexity)">NP (complexity)</a></div> <p><b>P</b> is the class of problems that are solvable by a <a href="/wiki/Deterministic_Turing_machine" class="mw-redirect" title="Deterministic Turing machine">deterministic Turing machine</a> in <a href="/wiki/Polynomial_time" class="mw-redirect" title="Polynomial time">polynomial time</a> and <b>NP</b> is the class of problems that are solvable by a <a href="/wiki/Nondeterministic_Turing_machine" title="Nondeterministic Turing machine">nondeterministic Turing machine</a> in polynomial time. Or more formally, </p> <dl><dd><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathsf {P}}=\bigcup _{k\in \mathbb {N} }{\mathsf {DTIME}}(n^{k})}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">P</mi> </mrow> </mrow> <mo>=</mo> <munder> <mo>⋃<!-- ⋃ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mi>k</mi> <mo>∈<!-- ∈ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="double-struck">N</mi> </mrow> </mrow> </munder> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">D</mi> <mi mathvariant="sans-serif">T</mi> <mi mathvariant="sans-serif">I</mi> <mi mathvariant="sans-serif">M</mi> <mi mathvariant="sans-serif">E</mi> </mrow> </mrow> <mo stretchy="false">(</mo> <msup> <mi>n</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>k</mi> </mrow> </msup> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\mathsf {P}}=\bigcup _{k\in \mathbb {N} }{\mathsf {DTIME}}(n^{k})}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/c11435ccef8eb1072d17d99ced51b803e3627431" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.171ex; width:19.732ex; height:5.676ex;" alt="{\displaystyle {\mathsf {P}}=\bigcup _{k\in \mathbb {N} }{\mathsf {DTIME}}(n^{k})}"></span></dd> <dd><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathsf {NP}}=\bigcup _{k\in \mathbb {N} }{\mathsf {NTIME}}(n^{k})}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">N</mi> <mi mathvariant="sans-serif">P</mi> </mrow> </mrow> <mo>=</mo> <munder> <mo>⋃<!-- ⋃ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mi>k</mi> <mo>∈<!-- ∈ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="double-struck">N</mi> </mrow> </mrow> </munder> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">N</mi> <mi mathvariant="sans-serif">T</mi> <mi mathvariant="sans-serif">I</mi> <mi mathvariant="sans-serif">M</mi> <mi mathvariant="sans-serif">E</mi> </mrow> </mrow> <mo stretchy="false">(</mo> <msup> <mi>n</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>k</mi> </mrow> </msup> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\mathsf {NP}}=\bigcup _{k\in \mathbb {N} }{\mathsf {NTIME}}(n^{k})}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/3753fc46abcb1dd9e174c22923b2643f259f9eb1" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.171ex; width:21.345ex; height:5.676ex;" alt="{\displaystyle {\mathsf {NP}}=\bigcup _{k\in \mathbb {N} }{\mathsf {NTIME}}(n^{k})}"></span></dd></dl> <p><b>P</b> is often said to be the class of problems that can be solved "quickly" or "efficiently" by a deterministic computer, since the <a href="/wiki/Time_complexity" title="Time complexity">time complexity</a> of solving a problem in <b>P</b> increases relatively slowly with the input size. </p><p>An important characteristic of the class <b>NP</b> is that it can be equivalently defined as the class of problems whose solutions are <i>verifiable</i> by a deterministic Turing machine in polynomial time. That is, a language is in <b>NP</b> if there exists a <i>deterministic</i> polynomial time Turing machine, referred to as the verifier, that takes as input a string <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle w}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>w</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle w}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/88b1e0c8e1be5ebe69d18a8010676fa42d7961e6" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.664ex; height:1.676ex;" alt="{\displaystyle w}"></span> <i>and</i> a polynomial-size <a href="/wiki/Certificate_(complexity)" title="Certificate (complexity)">certificate</a> string <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle c}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>c</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle c}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/86a67b81c2de995bd608d5b2df50cd8cd7d92455" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.007ex; height:1.676ex;" alt="{\displaystyle c}"></span>, and accepts <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle w}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>w</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle w}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/88b1e0c8e1be5ebe69d18a8010676fa42d7961e6" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.664ex; height:1.676ex;" alt="{\displaystyle w}"></span> if <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle w}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>w</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle w}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/88b1e0c8e1be5ebe69d18a8010676fa42d7961e6" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.664ex; height:1.676ex;" alt="{\displaystyle w}"></span> is in the language and rejects <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle w}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>w</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle w}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/88b1e0c8e1be5ebe69d18a8010676fa42d7961e6" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.664ex; height:1.676ex;" alt="{\displaystyle w}"></span> if <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle w}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>w</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle w}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/88b1e0c8e1be5ebe69d18a8010676fa42d7961e6" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.664ex; height:1.676ex;" alt="{\displaystyle w}"></span> is not in the language. Intuitively, the certificate acts as a <a href="/wiki/Mathematical_proof" title="Mathematical proof">proof</a> that the input <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle w}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>w</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle w}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/88b1e0c8e1be5ebe69d18a8010676fa42d7961e6" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.664ex; height:1.676ex;" alt="{\displaystyle w}"></span> is in the language. Formally:<sup id="cite_ref-FOOTNOTEAaronson201712_5-0" class="reference"><a href="#cite_note-FOOTNOTEAaronson201712-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup> </p> <dl><dd><b>NP</b> is the class of languages <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle L}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>L</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle L}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/103168b86f781fe6e9a4a87b8ea1cebe0ad4ede8" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.583ex; height:2.176ex;" alt="{\displaystyle L}"></span> for which there exists a polynomial-time deterministic Turing machine <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle M}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>M</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle M}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f82cade9898ced02fdd08712e5f0c0151758a0dd" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.442ex; height:2.176ex;" alt="{\displaystyle M}"></span> and a polynomial <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle p}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>p</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle p}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/81eac1e205430d1f40810df36a0edffdc367af36" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; margin-left: -0.089ex; width:1.259ex; height:2.009ex;" alt="{\displaystyle p}"></span> such that for all <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle w\in \{0,1\}^{*}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>w</mi> <mo>∈<!-- ∈ --></mo> <mo fence="false" stretchy="false">{</mo> <mn>0</mn> <mo>,</mo> <mn>1</mn> <msup> <mo fence="false" stretchy="false">}</mo> <mrow class="MJX-TeXAtom-ORD"> <mo>∗<!-- ∗ --></mo> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle w\in \{0,1\}^{*}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/6d5d657c831519a1023a467dd89af3db0bff411a" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:11.243ex; height:2.843ex;" alt="{\displaystyle w\in \{0,1\}^{*}}"></span>, <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle w}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>w</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle w}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/88b1e0c8e1be5ebe69d18a8010676fa42d7961e6" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.664ex; height:1.676ex;" alt="{\displaystyle w}"></span> is in <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle L}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>L</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle L}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/103168b86f781fe6e9a4a87b8ea1cebe0ad4ede8" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.583ex; height:2.176ex;" alt="{\displaystyle L}"></span> <i>if and only if</i> there exists some <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle c\in \{0,1\}^{p(|w|)}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>c</mi> <mo>∈<!-- ∈ --></mo> <mo fence="false" stretchy="false">{</mo> <mn>0</mn> <mo>,</mo> <mn>1</mn> <msup> <mo fence="false" stretchy="false">}</mo> <mrow class="MJX-TeXAtom-ORD"> <mi>p</mi> <mo stretchy="false">(</mo> <mrow class="MJX-TeXAtom-ORD"> <mo stretchy="false">|</mo> </mrow> <mi>w</mi> <mrow class="MJX-TeXAtom-ORD"> <mo stretchy="false">|</mo> </mrow> <mo stretchy="false">)</mo> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle c\in \{0,1\}^{p(|w|)}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/81ca381c433186ea118a246b03ef50bd47cb1da7" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:13.961ex; height:3.343ex;" alt="{\displaystyle c\in \{0,1\}^{p(|w|)}}"></span> such that <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle M(w,c)}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>M</mi> <mo stretchy="false">(</mo> <mi>w</mi> <mo>,</mo> <mi>c</mi> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle M(w,c)}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/3c04b4b6c97bdcd0154d8cd75a7cd8ac82f4656a" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:7.956ex; height:2.843ex;" alt="{\displaystyle M(w,c)}"></span> accepts.</dd></dl> <p>This equivalence between the nondeterministic definition and the verifier definition highlights a fundamental connection between <a href="/wiki/Nondeterministic_algorithm" title="Nondeterministic algorithm">nondeterminism</a> and solution verifiability. Furthermore, it also provides a useful method for proving that a language is in <b>NP</b>—simply identify a suitable certificate and show that it can be verified in polynomial time. </p> <div class="mw-heading mw-heading5"><h5 id="The_P_versus_NP_problem">The P versus NP problem</h5><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=14" title="Edit section: The P versus NP problem"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>While there might seem to be an obvious difference between the class of problems that are efficiently solvable and the class of problems whose solutions are merely efficiently checkable, <b>P</b> and <b>NP</b> are actually at the center of one of the most famous unsolved problems in computer science: the <a href="/wiki/P_versus_NP" class="mw-redirect" title="P versus NP"><b>P</b> versus <b>NP</b></a> problem. While it is known that <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathsf {P}}\subseteq {\mathsf {NP}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">P</mi> </mrow> </mrow> <mo>⊆<!-- ⊆ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">N</mi> <mi mathvariant="sans-serif">P</mi> </mrow> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\mathsf {P}}\subseteq {\mathsf {NP}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f6b1b5cac4e232dff4550ef5280cc5a25c77b4e3" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.505ex; width:7.715ex; height:2.343ex;" alt="{\displaystyle {\mathsf {P}}\subseteq {\mathsf {NP}}}"></span> (intuitively, deterministic Turing machines are just a subclass of nondeterministic Turing machines that don't make use of their nondeterminism; or under the verifier definition, <b>P</b> is the class of problems whose polynomial time verifiers need only receive the empty string as their certificate), it is not known whether <b>NP</b> is strictly larger than <b>P</b>. If <b>P</b>=<b>NP</b>, then it follows that nondeterminism provides <i>no additional computational power</i> over determinism with regards to the ability to quickly find a solution to a problem; that is, being able to explore <i>all possible branches</i> of computation provides <i>at most</i> a polynomial speedup over being able to explore only a single branch. Furthermore, it would follow that if there exists a proof for a problem instance and that proof can be quickly be checked for correctness (that is, if the problem is in <b>NP</b>), then there also exists an algorithm that can quickly <i>construct</i> that proof (that is, the problem is in <b>P</b>).<sup id="cite_ref-FOOTNOTEAaronson20173_6-0" class="reference"><a href="#cite_note-FOOTNOTEAaronson20173-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup> However, the overwhelming majority of computer scientists believe that <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathsf {P}}\neq {\mathsf {NP}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">P</mi> </mrow> </mrow> <mo>≠<!-- ≠ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">N</mi> <mi mathvariant="sans-serif">P</mi> </mrow> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\mathsf {P}}\neq {\mathsf {NP}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/cf4d1c4bd5b96052ce46ef8d151571db700efa12" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:7.715ex; height:2.676ex;" alt="{\displaystyle {\mathsf {P}}\neq {\mathsf {NP}}}"></span>,<sup id="cite_ref-FOOTNOTEGasarch2019_7-0" class="reference"><a href="#cite_note-FOOTNOTEGasarch2019-7"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup> and most <a href="/wiki/Cryptography#Modern_cryptography" title="Cryptography">cryptographic schemes</a> employed today rely on the assumption that <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathsf {P}}\neq {\mathsf {NP}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">P</mi> </mrow> </mrow> <mo>≠<!-- ≠ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">N</mi> <mi mathvariant="sans-serif">P</mi> </mrow> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\mathsf {P}}\neq {\mathsf {NP}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/cf4d1c4bd5b96052ce46ef8d151571db700efa12" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:7.715ex; height:2.676ex;" alt="{\displaystyle {\mathsf {P}}\neq {\mathsf {NP}}}"></span>.<sup id="cite_ref-FOOTNOTEAaronson20174_8-0" class="reference"><a href="#cite_note-FOOTNOTEAaronson20174-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup> </p> <div class="mw-heading mw-heading4"><h4 id="EXPTIME_and_NEXPTIME">EXPTIME and NEXPTIME</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=15" title="Edit section: EXPTIME and NEXPTIME"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1236090951"><div role="note" class="hatnote navigation-not-searchable">Main articles: <a href="/wiki/EXPTIME" title="EXPTIME">EXPTIME</a> and <a href="/wiki/NEXPTIME" title="NEXPTIME">NEXPTIME</a></div> <p><b>EXPTIME</b> (sometimes shortened to <b>EXP</b>) is the class of decision problems solvable by a deterministic Turing machine in exponential time and <b>NEXPTIME</b> (sometimes shortened to <b>NEXP</b>) is the class of decision problems solvable by a nondeterministic Turing machine in exponential time. Or more formally, </p> <dl><dd><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathsf {EXPTIME}}=\bigcup _{k\in \mathbb {N} }{\mathsf {DTIME}}(2^{n^{k}})}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">E</mi> <mi mathvariant="sans-serif">X</mi> <mi mathvariant="sans-serif">P</mi> <mi mathvariant="sans-serif">T</mi> <mi mathvariant="sans-serif">I</mi> <mi mathvariant="sans-serif">M</mi> <mi mathvariant="sans-serif">E</mi> </mrow> </mrow> <mo>=</mo> <munder> <mo>⋃<!-- ⋃ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mi>k</mi> <mo>∈<!-- ∈ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="double-struck">N</mi> </mrow> </mrow> </munder> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">D</mi> <mi mathvariant="sans-serif">T</mi> <mi mathvariant="sans-serif">I</mi> <mi mathvariant="sans-serif">M</mi> <mi mathvariant="sans-serif">E</mi> </mrow> </mrow> <mo stretchy="false">(</mo> <msup> <mn>2</mn> <mrow class="MJX-TeXAtom-ORD"> <msup> <mi>n</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>k</mi> </mrow> </msup> </mrow> </msup> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\mathsf {EXPTIME}}=\bigcup _{k\in \mathbb {N} }{\mathsf {DTIME}}(2^{n^{k}})}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/afe719d551553351dd64eda44e0d3a26ebcd6f5f" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.171ex; width:29.078ex; height:5.843ex;" alt="{\displaystyle {\mathsf {EXPTIME}}=\bigcup _{k\in \mathbb {N} }{\mathsf {DTIME}}(2^{n^{k}})}"></span></dd> <dd><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathsf {NEXPTIME}}=\bigcup _{k\in \mathbb {N} }{\mathsf {NTIME}}(2^{n^{k}})}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">N</mi> <mi mathvariant="sans-serif">E</mi> <mi mathvariant="sans-serif">X</mi> <mi mathvariant="sans-serif">P</mi> <mi mathvariant="sans-serif">T</mi> <mi mathvariant="sans-serif">I</mi> <mi mathvariant="sans-serif">M</mi> <mi mathvariant="sans-serif">E</mi> </mrow> </mrow> <mo>=</mo> <munder> <mo>⋃<!-- ⋃ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mi>k</mi> <mo>∈<!-- ∈ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="double-struck">N</mi> </mrow> </mrow> </munder> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">N</mi> <mi mathvariant="sans-serif">T</mi> <mi mathvariant="sans-serif">I</mi> <mi mathvariant="sans-serif">M</mi> <mi mathvariant="sans-serif">E</mi> </mrow> </mrow> <mo stretchy="false">(</mo> <msup> <mn>2</mn> <mrow class="MJX-TeXAtom-ORD"> <msup> <mi>n</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>k</mi> </mrow> </msup> </mrow> </msup> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\mathsf {NEXPTIME}}=\bigcup _{k\in \mathbb {N} }{\mathsf {NTIME}}(2^{n^{k}})}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/e682e742839c507be6dc597b8f118208510c2361" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.171ex; width:30.691ex; height:5.843ex;" alt="{\displaystyle {\mathsf {NEXPTIME}}=\bigcup _{k\in \mathbb {N} }{\mathsf {NTIME}}(2^{n^{k}})}"></span></dd></dl> <p><b>EXPTIME</b> is a strict superset of <b>P</b> and <b>NEXPTIME</b> is a strict superset of <b>NP</b>. It is further the case that <b>EXPTIME</b><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \subseteq }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mo>⊆<!-- ⊆ --></mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \subseteq }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a924f8dcb2847bb8871edfdbf4c6b5cca0669228" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.505ex; width:1.808ex; height:2.176ex;" alt="{\displaystyle \subseteq }"></span><b>NEXPTIME</b>. It is not known whether this is proper, but if <b>P</b>=<b>NP</b> then <b>EXPTIME</b> must equal <b>NEXPTIME</b>. </p> <div class="mw-heading mw-heading3"><h3 id="Space_complexity_classes">Space complexity classes</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=16" title="Edit section: Space complexity classes"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1236090951"><div role="note" class="hatnote navigation-not-searchable">Main article: <a href="/wiki/Space_complexity" title="Space complexity">Space complexity</a></div> <div class="mw-heading mw-heading4"><h4 id="L_and_NL">L and NL</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=17" title="Edit section: L and NL"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1236090951"><div role="note" class="hatnote navigation-not-searchable">Main articles: <a href="/wiki/L_(complexity)" title="L (complexity)">L (complexity)</a> and <a href="/wiki/NL_(complexity)" title="NL (complexity)">NL (complexity)</a></div> <p>While it is possible to define <a href="/wiki/Logarithmic_growth" title="Logarithmic growth">logarithmic</a> time complexity classes, these are extremely narrow classes as sublinear times do not even enable a Turing machine to read the entire input (because <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \log n<n}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>log</mi> <mo>⁡<!-- --></mo> <mi>n</mi> <mo><</mo> <mi>n</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \log n<n}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/3cf3dee701217bbca3e102c998fd9a25c04eebd3" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:9.247ex; height:2.509ex;" alt="{\displaystyle \log n<n}"></span>).<sup id="cite_ref-9" class="reference"><a href="#cite_note-9"><span class="cite-bracket">[</span>a<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-FOOTNOTESipser2006320_10-0" class="reference"><a href="#cite_note-FOOTNOTESipser2006320-10"><span class="cite-bracket">[</span>9<span class="cite-bracket">]</span></a></sup> However, there are a meaningful number of problems that can be solved in logarithmic space. The definitions of these classes require a <a href="/wiki/Multitape_Turing_machine" title="Multitape Turing machine">two-tape Turing machine</a> so that it is possible for the machine to store the entire input (it can be shown that in terms of <a href="/wiki/Computability" title="Computability">computability</a> the two-tape Turing machine is equivalent to the single-tape Turing machine).<sup id="cite_ref-FOOTNOTESipser2006321_11-0" class="reference"><a href="#cite_note-FOOTNOTESipser2006321-11"><span class="cite-bracket">[</span>10<span class="cite-bracket">]</span></a></sup> In the two-tape Turing machine model, one tape is the input tape, which is read-only. The other is the work tape, which allows both reading and writing and is the tape on which the Turing machine performs computations. The space complexity of the Turing machine is measured as the number of cells that are used on the work tape. </p><p><b>L</b> (sometimes lengthened to <b>LOGSPACE</b>) is then defined as the class of problems solvable in logarithmic space on a deterministic Turing machine and <b>NL</b> (sometimes lengthened to <b>NLOGSPACE</b>) is the class of problems solvable in logarithmic space on a nondeterministic Turing machine. Or more formally,<sup id="cite_ref-FOOTNOTESipser2006321_11-1" class="reference"><a href="#cite_note-FOOTNOTESipser2006321-11"><span class="cite-bracket">[</span>10<span class="cite-bracket">]</span></a></sup> </p> <dl><dd><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathsf {L}}={\mathsf {DSPACE}}(\log n)}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">L</mi> </mrow> </mrow> <mo>=</mo> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">D</mi> <mi mathvariant="sans-serif">S</mi> <mi mathvariant="sans-serif">P</mi> <mi mathvariant="sans-serif">A</mi> <mi mathvariant="sans-serif">C</mi> <mi mathvariant="sans-serif">E</mi> </mrow> </mrow> <mo stretchy="false">(</mo> <mi>log</mi> <mo>⁡<!-- --></mo> <mi>n</mi> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\mathsf {L}}={\mathsf {DSPACE}}(\log n)}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/c198bb6f58b32a77226e3f8cdb1a7cf7e79fcb9a" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:19.801ex; height:2.843ex;" alt="{\displaystyle {\mathsf {L}}={\mathsf {DSPACE}}(\log n)}"></span></dd> <dd><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathsf {NL}}={\mathsf {NSPACE}}(\log n)}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">N</mi> <mi mathvariant="sans-serif">L</mi> </mrow> </mrow> <mo>=</mo> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">N</mi> <mi mathvariant="sans-serif">S</mi> <mi mathvariant="sans-serif">P</mi> <mi mathvariant="sans-serif">A</mi> <mi mathvariant="sans-serif">C</mi> <mi mathvariant="sans-serif">E</mi> </mrow> </mrow> <mo stretchy="false">(</mo> <mi>log</mi> <mo>⁡<!-- --></mo> <mi>n</mi> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\mathsf {NL}}={\mathsf {NSPACE}}(\log n)}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/7e62693773915dfb50b7e5b98a55f02afe8cf78f" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:21.414ex; height:2.843ex;" alt="{\displaystyle {\mathsf {NL}}={\mathsf {NSPACE}}(\log n)}"></span></dd></dl> <p>It is known that <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathsf {L}}\subseteq {\mathsf {NL}}\subseteq {\mathsf {P}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">L</mi> </mrow> </mrow> <mo>⊆<!-- ⊆ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">N</mi> <mi mathvariant="sans-serif">L</mi> </mrow> </mrow> <mo>⊆<!-- ⊆ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">P</mi> </mrow> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\mathsf {L}}\subseteq {\mathsf {NL}}\subseteq {\mathsf {P}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/8938939b2eda8b56182fdf75a1a1320c8fc91dfc" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.505ex; width:11.848ex; height:2.343ex;" alt="{\displaystyle {\mathsf {L}}\subseteq {\mathsf {NL}}\subseteq {\mathsf {P}}}"></span>. However, it is not known whether any of these relationships is proper. </p> <div class="mw-heading mw-heading4"><h4 id="PSPACE_and_NPSPACE">PSPACE and NPSPACE</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=18" title="Edit section: PSPACE and NPSPACE"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1236090951"><div role="note" class="hatnote navigation-not-searchable">Main article: <a href="/wiki/PSPACE_(complexity)" class="mw-redirect" title="PSPACE (complexity)">PSPACE (complexity)</a></div> <p>The complexity classes <b>PSPACE</b> and <b>NPSPACE</b> are the space analogues to <b><a href="/wiki/P_(complexity)" title="P (complexity)"> P</a></b> and <b><a href="/wiki/NP_(complexity)" title="NP (complexity)"> NP</a></b>. That is, <b>PSPACE</b> is the class of problems solvable in polynomial space by a deterministic Turing machine and <b>NPSPACE</b> is the class of problems solvable in polynomial space by a nondeterministic Turing machine. More formally, </p> <dl><dd><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathsf {PSPACE}}=\bigcup _{k\in \mathbb {N} }{\mathsf {DSPACE}}(n^{k})}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">P</mi> <mi mathvariant="sans-serif">S</mi> <mi mathvariant="sans-serif">P</mi> <mi mathvariant="sans-serif">A</mi> <mi mathvariant="sans-serif">C</mi> <mi mathvariant="sans-serif">E</mi> </mrow> </mrow> <mo>=</mo> <munder> <mo>⋃<!-- ⋃ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mi>k</mi> <mo>∈<!-- ∈ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="double-struck">N</mi> </mrow> </mrow> </munder> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">D</mi> <mi mathvariant="sans-serif">S</mi> <mi mathvariant="sans-serif">P</mi> <mi mathvariant="sans-serif">A</mi> <mi mathvariant="sans-serif">C</mi> <mi mathvariant="sans-serif">E</mi> </mrow> </mrow> <mo stretchy="false">(</mo> <msup> <mi>n</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>k</mi> </mrow> </msup> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\mathsf {PSPACE}}=\bigcup _{k\in \mathbb {N} }{\mathsf {DSPACE}}(n^{k})}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/62550103841fa003376c349bc69f3364e5c53951" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.171ex; width:28.483ex; height:5.676ex;" alt="{\displaystyle {\mathsf {PSPACE}}=\bigcup _{k\in \mathbb {N} }{\mathsf {DSPACE}}(n^{k})}"></span></dd> <dd><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathsf {NPSPACE}}=\bigcup _{k\in \mathbb {N} }{\mathsf {NSPACE}}(n^{k})}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">N</mi> <mi mathvariant="sans-serif">P</mi> <mi mathvariant="sans-serif">S</mi> <mi mathvariant="sans-serif">P</mi> <mi mathvariant="sans-serif">A</mi> <mi mathvariant="sans-serif">C</mi> <mi mathvariant="sans-serif">E</mi> </mrow> </mrow> <mo>=</mo> <munder> <mo>⋃<!-- ⋃ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mi>k</mi> <mo>∈<!-- ∈ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="double-struck">N</mi> </mrow> </mrow> </munder> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">N</mi> <mi mathvariant="sans-serif">S</mi> <mi mathvariant="sans-serif">P</mi> <mi mathvariant="sans-serif">A</mi> <mi mathvariant="sans-serif">C</mi> <mi mathvariant="sans-serif">E</mi> </mrow> </mrow> <mo stretchy="false">(</mo> <msup> <mi>n</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>k</mi> </mrow> </msup> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\mathsf {NPSPACE}}=\bigcup _{k\in \mathbb {N} }{\mathsf {NSPACE}}(n^{k})}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/5221b3690dd0b5d35671069c25939891de7bb3e2" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.171ex; width:30.096ex; height:5.676ex;" alt="{\displaystyle {\mathsf {NPSPACE}}=\bigcup _{k\in \mathbb {N} }{\mathsf {NSPACE}}(n^{k})}"></span></dd></dl> <p>While it is not known whether <b>P</b>=<b>NP</b>, <a href="/wiki/Savitch%27s_theorem" title="Savitch's theorem">Savitch's theorem </a> famously showed that <b>PSPACE</b>=<b>NPSPACE</b>. It is also known that <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathsf {P}}\subseteq {\mathsf {PSPACE}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">P</mi> </mrow> </mrow> <mo>⊆<!-- ⊆ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">P</mi> <mi mathvariant="sans-serif">S</mi> <mi mathvariant="sans-serif">P</mi> <mi mathvariant="sans-serif">A</mi> <mi mathvariant="sans-serif">C</mi> <mi mathvariant="sans-serif">E</mi> </mrow> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\mathsf {P}}\subseteq {\mathsf {PSPACE}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/d79bf5a27ad099c7f38c11e744d5345afda77109" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.505ex; width:13.27ex; height:2.343ex;" alt="{\displaystyle {\mathsf {P}}\subseteq {\mathsf {PSPACE}}}"></span>, which follows intuitively from the fact that, since writing to a cell on a Turing machine's tape is defined as taking one unit of time, a Turing machine operating in polynomial time can only write to polynomially many cells. It is suspected that <b>P</b> is strictly smaller than <b>PSPACE</b>, but this has not been proven. </p> <div class="mw-heading mw-heading4"><h4 id="EXPSPACE_and_NEXPSPACE">EXPSPACE and NEXPSPACE</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=19" title="Edit section: EXPSPACE and NEXPSPACE"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1236090951"><div role="note" class="hatnote navigation-not-searchable">Main article: <a href="/wiki/EXPSPACE" title="EXPSPACE">EXPSPACE</a></div> <p>The complexity classes <b>EXPSPACE</b> and <b>NEXPSPACE</b> are the space analogues to <b><a href="/wiki/EXPTIME" title="EXPTIME">EXPTIME</a></b> and <b><a href="/wiki/NEXPTIME" title="NEXPTIME">NEXPTIME</a></b>. That is, <b>EXPSPACE</b> is the class of problems solvable in exponential space by a deterministic Turing machine and <b>NEXPSPACE</b> is the class of problems solvable in exponential space by a nondeterministic Turing machine. Or more formally, </p> <dl><dd><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathsf {EXPSPACE}}=\bigcup _{k\in \mathbb {N} }{\mathsf {DSPACE}}(2^{n^{k}})}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">E</mi> <mi mathvariant="sans-serif">X</mi> <mi mathvariant="sans-serif">P</mi> <mi mathvariant="sans-serif">S</mi> <mi mathvariant="sans-serif">P</mi> <mi mathvariant="sans-serif">A</mi> <mi mathvariant="sans-serif">C</mi> <mi mathvariant="sans-serif">E</mi> </mrow> </mrow> <mo>=</mo> <munder> <mo>⋃<!-- ⋃ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mi>k</mi> <mo>∈<!-- ∈ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="double-struck">N</mi> </mrow> </mrow> </munder> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">D</mi> <mi mathvariant="sans-serif">S</mi> <mi mathvariant="sans-serif">P</mi> <mi mathvariant="sans-serif">A</mi> <mi mathvariant="sans-serif">C</mi> <mi mathvariant="sans-serif">E</mi> </mrow> </mrow> <mo stretchy="false">(</mo> <msup> <mn>2</mn> <mrow class="MJX-TeXAtom-ORD"> <msup> <mi>n</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>k</mi> </mrow> </msup> </mrow> </msup> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\mathsf {EXPSPACE}}=\bigcup _{k\in \mathbb {N} }{\mathsf {DSPACE}}(2^{n^{k}})}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/d76fe8371aaa642adabcfff8b055748694ebed46" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.171ex; width:32.178ex; height:5.843ex;" alt="{\displaystyle {\mathsf {EXPSPACE}}=\bigcup _{k\in \mathbb {N} }{\mathsf {DSPACE}}(2^{n^{k}})}"></span></dd> <dd><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathsf {NEXPSPACE}}=\bigcup _{k\in \mathbb {N} }{\mathsf {NSPACE}}(2^{n^{k}})}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">N</mi> <mi mathvariant="sans-serif">E</mi> <mi mathvariant="sans-serif">X</mi> <mi mathvariant="sans-serif">P</mi> <mi mathvariant="sans-serif">S</mi> <mi mathvariant="sans-serif">P</mi> <mi mathvariant="sans-serif">A</mi> <mi mathvariant="sans-serif">C</mi> <mi mathvariant="sans-serif">E</mi> </mrow> </mrow> <mo>=</mo> <munder> <mo>⋃<!-- ⋃ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mi>k</mi> <mo>∈<!-- ∈ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="double-struck">N</mi> </mrow> </mrow> </munder> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">N</mi> <mi mathvariant="sans-serif">S</mi> <mi mathvariant="sans-serif">P</mi> <mi mathvariant="sans-serif">A</mi> <mi mathvariant="sans-serif">C</mi> <mi mathvariant="sans-serif">E</mi> </mrow> </mrow> <mo stretchy="false">(</mo> <msup> <mn>2</mn> <mrow class="MJX-TeXAtom-ORD"> <msup> <mi>n</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>k</mi> </mrow> </msup> </mrow> </msup> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\mathsf {NEXPSPACE}}=\bigcup _{k\in \mathbb {N} }{\mathsf {NSPACE}}(2^{n^{k}})}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/c31dbd5b982f84dc05332d624e473adf52fcdfd0" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.171ex; width:33.791ex; height:5.843ex;" alt="{\displaystyle {\mathsf {NEXPSPACE}}=\bigcup _{k\in \mathbb {N} }{\mathsf {NSPACE}}(2^{n^{k}})}"></span></dd></dl> <p><a href="/wiki/Savitch%27s_theorem" title="Savitch's theorem">Savitch's theorem</a> showed that <b>EXPSPACE</b>=<b>NEXPSPACE</b>. This class is extremely broad: it is known to be a strict superset of <b>PSPACE</b>, <b>NP</b>, and <b>P</b>, and is believed to be a strict superset of <b>EXPTIME</b>. </p> <div class="mw-heading mw-heading2"><h2 id="Properties_of_complexity_classes">Properties of complexity classes</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=20" title="Edit section: Properties of complexity classes"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <div class="mw-heading mw-heading3"><h3 id="Closure">Closure</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=21" title="Edit section: Closure"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Complexity classes have a variety of <a href="/wiki/Closure_(mathematics)" title="Closure (mathematics)">closure</a> properties. For example, decision classes may be closed under <a href="/wiki/Negation" title="Negation">negation</a>, <a href="/wiki/Disjunction" class="mw-redirect" title="Disjunction">disjunction</a>, <a href="/wiki/Logical_conjunction" title="Logical conjunction">conjunction</a>, or even under all <a href="/wiki/Logical_connective" title="Logical connective">Boolean operations</a>. Moreover, they might also be closed under a variety of quantification schemes. <b>P</b>, for instance, is closed under all Boolean operations, and under quantification over polynomially sized domains. Closure properties can be helpful in separating classes—one possible route to separating two complexity classes is to find some closure property possessed by one class but not by the other. </p><p>Each class <b>X</b> that is not closed under negation has a complement class <b>co-X</b>, which consists of the complements of the languages contained in <b>X</b> (i.e. <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\textsf {co-X}}=\{L|{\overline {L}}\in {\mathsf {X}}\}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mtext mathvariant="sans-serif">co-X</mtext> </mrow> </mrow> <mo>=</mo> <mo fence="false" stretchy="false">{</mo> <mi>L</mi> <mrow class="MJX-TeXAtom-ORD"> <mo stretchy="false">|</mo> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mover> <mi>L</mi> <mo accent="false">¯<!-- ¯ --></mo> </mover> </mrow> <mo>∈<!-- ∈ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">X</mi> </mrow> </mrow> <mo fence="false" stretchy="false">}</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\textsf {co-X}}=\{L|{\overline {L}}\in {\mathsf {X}}\}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/e22ff3ece3a1c339178b6ed3e938966b48e24ca7" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:18.262ex; height:3.509ex;" alt="{\displaystyle {\textsf {co-X}}=\{L|{\overline {L}}\in {\mathsf {X}}\}}"></span>). <b><a href="/wiki/Co-NP" title="Co-NP">co-NP</a></b>, for instance, is one important complement complexity class, and sits at the center of the unsolved problem over whether <b>co-NP</b>=<b>NP</b>. </p><p>Closure properties are one of the key reasons many complexity classes are defined in the way that they are.<sup id="cite_ref-FOOTNOTEAaronson20177_12-0" class="reference"><a href="#cite_note-FOOTNOTEAaronson20177-12"><span class="cite-bracket">[</span>11<span class="cite-bracket">]</span></a></sup> Take, for example, a problem that can be solved in <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle O(n)}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>O</mi> <mo stretchy="false">(</mo> <mi>n</mi> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle O(n)}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/34109fe397fdcff370079185bfdb65826cb5565a" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:4.977ex; height:2.843ex;" alt="{\displaystyle O(n)}"></span> time (that is, in linear time) and one that can be solved in, at best, <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle O(n^{1000})}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>O</mi> <mo stretchy="false">(</mo> <msup> <mi>n</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1000</mn> </mrow> </msup> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle O(n^{1000})}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/594404d98509684933ada86a9a6292092fdd40f8" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:8.497ex; height:3.176ex;" alt="{\displaystyle O(n^{1000})}"></span> time. Both of these problems are in <b>P</b>, yet the runtime of the second grows considerably faster than the runtime of the first as the input size increases. One might ask whether it would be better to define the class of "efficiently solvable" problems using some smaller polynomial bound, like <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle O(n^{3})}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>O</mi> <mo stretchy="false">(</mo> <msup> <mi>n</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>3</mn> </mrow> </msup> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle O(n^{3})}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/6b04f5c5cfea38f43406d9442387ad28555e2609" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:6.032ex; height:3.176ex;" alt="{\displaystyle O(n^{3})}"></span>, rather than all polynomials, which allows for such large discrepancies. It turns out, however, that the set of all polynomials is the smallest class of functions containing the linear functions that is also closed under addition, multiplication, and composition (for instance, <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle O(n^{3})\circ O(n^{2})=O(n^{6})}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>O</mi> <mo stretchy="false">(</mo> <msup> <mi>n</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>3</mn> </mrow> </msup> <mo stretchy="false">)</mo> <mo>∘<!-- ∘ --></mo> <mi>O</mi> <mo stretchy="false">(</mo> <msup> <mi>n</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msup> <mo stretchy="false">)</mo> <mo>=</mo> <mi>O</mi> <mo stretchy="false">(</mo> <msup> <mi>n</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>6</mn> </mrow> </msup> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle O(n^{3})\circ O(n^{2})=O(n^{6})}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/1865b7fd21f019e90f8f1544a7435558eca4f540" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:23.388ex; height:3.176ex;" alt="{\displaystyle O(n^{3})\circ O(n^{2})=O(n^{6})}"></span>, which is a polynomial but <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle O(n^{6})>O(n^{3})}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>O</mi> <mo stretchy="false">(</mo> <msup> <mi>n</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>6</mn> </mrow> </msup> <mo stretchy="false">)</mo> <mo>></mo> <mi>O</mi> <mo stretchy="false">(</mo> <msup> <mi>n</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>3</mn> </mrow> </msup> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle O(n^{6})>O(n^{3})}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a085b55b8a86ac54a8f4babdb088a00f7a9ab10b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:15.162ex; height:3.176ex;" alt="{\displaystyle O(n^{6})>O(n^{3})}"></span>).<sup id="cite_ref-FOOTNOTEAaronson20177_12-1" class="reference"><a href="#cite_note-FOOTNOTEAaronson20177-12"><span class="cite-bracket">[</span>11<span class="cite-bracket">]</span></a></sup> Since we would like composing one efficient algorithm with another efficient algorithm to still be considered efficient, the polynomials are the smallest class that ensures composition of "efficient algorithms".<sup id="cite_ref-FOOTNOTEAaronson20175_13-0" class="reference"><a href="#cite_note-FOOTNOTEAaronson20175-13"><span class="cite-bracket">[</span>12<span class="cite-bracket">]</span></a></sup> (Note that the definition of <b>P</b> is also useful because, empirically, almost all problems in <b>P</b> that are practically useful do in fact have low order polynomial runtimes, and almost all problems outside of <b>P</b> that are practically useful do not have any known algorithms with small exponential runtimes, i.e. with <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle O(c^{n})}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>O</mi> <mo stretchy="false">(</mo> <msup> <mi>c</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>n</mi> </mrow> </msup> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle O(c^{n})}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/cab28ca44589e77de77ab8cc55cdbd4a63f7ef8d" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:5.808ex; height:2.843ex;" alt="{\displaystyle O(c^{n})}"></span> runtimes where <span class="texhtml mvar" style="font-style:italic;">c</span> is close to 1.<sup id="cite_ref-FOOTNOTEAaronson20176_14-0" class="reference"><a href="#cite_note-FOOTNOTEAaronson20176-14"><span class="cite-bracket">[</span>13<span class="cite-bracket">]</span></a></sup>) </p> <div class="mw-heading mw-heading3"><h3 id="Reductions">Reductions</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=22" title="Edit section: Reductions"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1236090951"><div role="note" class="hatnote navigation-not-searchable">See also: <a href="/wiki/Reduction_(complexity)" title="Reduction (complexity)">Reduction (complexity)</a></div> <p>Many complexity classes are defined using the concept of a <b>reduction</b>. A reduction is a transformation of one problem into another problem, i.e. a reduction takes inputs from one problem and transforms them into inputs of another problem. For instance, you can reduce ordinary base-10 addition <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle x+y}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>x</mi> <mo>+</mo> <mi>y</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle x+y}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/ffb4441dccedb5ede51a213408b17cf83eec9a27" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:5.326ex; height:2.343ex;" alt="{\displaystyle x+y}"></span> to base-2 addition by transforming <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle x}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>x</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle x}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/87f9e315fd7e2ba406057a97300593c4802b53e4" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.33ex; height:1.676ex;" alt="{\displaystyle x}"></span> and <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle y}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>y</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle y}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/b8a6208ec717213d4317e666f1ae872e00620a0d" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:1.155ex; height:2.009ex;" alt="{\displaystyle y}"></span> to their base-2 notation (e.g. 5+7 becomes 101+111). Formally, a problem <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle X}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>X</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle X}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/68baa052181f707c662844a465bfeeb135e82bab" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.98ex; height:2.176ex;" alt="{\displaystyle X}"></span> reduces to a problem <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle Y}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>Y</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle Y}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/961d67d6b454b4df2301ac571808a3538b3a6d3f" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.171ex; width:1.773ex; height:2.009ex;" alt="{\displaystyle Y}"></span> if there exists a function <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>f</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle f}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/132e57acb643253e7810ee9702d9581f159a1c61" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:1.279ex; height:2.509ex;" alt="{\displaystyle f}"></span> such that for every <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle x\in \Sigma ^{*}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>x</mi> <mo>∈<!-- ∈ --></mo> <msup> <mi mathvariant="normal">Σ<!-- Σ --></mi> <mrow class="MJX-TeXAtom-ORD"> <mo>∗<!-- ∗ --></mo> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle x\in \Sigma ^{*}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/075eb8da700827174d5f09fa9064d4d3542397f3" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:6.903ex; height:2.343ex;" alt="{\displaystyle x\in \Sigma ^{*}}"></span>, <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle x\in X}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>x</mi> <mo>∈<!-- ∈ --></mo> <mi>X</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle x\in X}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/3e580967f68f36743e894aa7944f032dda6ea01d" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:6.15ex; height:2.176ex;" alt="{\displaystyle x\in X}"></span> <i>if and only if</i> <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f(x)\in Y}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>f</mi> <mo stretchy="false">(</mo> <mi>x</mi> <mo stretchy="false">)</mo> <mo>∈<!-- ∈ --></mo> <mi>Y</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle f(x)\in Y}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/959a48d7bbac6f7fc2304c25f4997e6224d582cd" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:9.032ex; height:2.843ex;" alt="{\displaystyle f(x)\in Y}"></span>. </p><p>Generally, reductions are used to capture the notion of a problem being at least as difficult as another problem. Thus we are generally interested in using a polynomial-time reduction, since any problem <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle X}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>X</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle X}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/68baa052181f707c662844a465bfeeb135e82bab" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.98ex; height:2.176ex;" alt="{\displaystyle X}"></span> that can be efficiently reduced to another problem <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle Y}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>Y</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle Y}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/961d67d6b454b4df2301ac571808a3538b3a6d3f" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.171ex; width:1.773ex; height:2.009ex;" alt="{\displaystyle Y}"></span> is no more difficult than <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle Y}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>Y</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle Y}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/961d67d6b454b4df2301ac571808a3538b3a6d3f" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.171ex; width:1.773ex; height:2.009ex;" alt="{\displaystyle Y}"></span>. Formally, a problem <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle X}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>X</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle X}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/68baa052181f707c662844a465bfeeb135e82bab" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.98ex; height:2.176ex;" alt="{\displaystyle X}"></span> is polynomial-time reducible to a problem <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle Y}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>Y</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle Y}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/961d67d6b454b4df2301ac571808a3538b3a6d3f" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.171ex; width:1.773ex; height:2.009ex;" alt="{\displaystyle Y}"></span> if there exists a <i>polynomial-time</i> computable function <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle p}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>p</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle p}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/81eac1e205430d1f40810df36a0edffdc367af36" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; margin-left: -0.089ex; width:1.259ex; height:2.009ex;" alt="{\displaystyle p}"></span> such that for all <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle x\in \Sigma ^{*}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>x</mi> <mo>∈<!-- ∈ --></mo> <msup> <mi mathvariant="normal">Σ<!-- Σ --></mi> <mrow class="MJX-TeXAtom-ORD"> <mo>∗<!-- ∗ --></mo> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle x\in \Sigma ^{*}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/075eb8da700827174d5f09fa9064d4d3542397f3" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:6.903ex; height:2.343ex;" alt="{\displaystyle x\in \Sigma ^{*}}"></span>, <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle x\in X}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>x</mi> <mo>∈<!-- ∈ --></mo> <mi>X</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle x\in X}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/3e580967f68f36743e894aa7944f032dda6ea01d" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:6.15ex; height:2.176ex;" alt="{\displaystyle x\in X}"></span> <i>if and only if</i> <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle p(x)\in Y}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>p</mi> <mo stretchy="false">(</mo> <mi>x</mi> <mo stretchy="false">)</mo> <mo>∈<!-- ∈ --></mo> <mi>Y</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle p(x)\in Y}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/497852930c255950fcfeae4ea488758894cab8a5" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; margin-left: -0.089ex; width:9.012ex; height:2.843ex;" alt="{\displaystyle p(x)\in Y}"></span>. </p><p>Note that reductions can be defined in many different ways. Common reductions are <a href="/wiki/Cook_reduction" class="mw-redirect" title="Cook reduction">Cook reductions</a>, <a href="/wiki/Karp_reduction" class="mw-redirect" title="Karp reduction">Karp reductions</a> and <a href="/wiki/Levin_reduction" class="mw-redirect" title="Levin reduction">Levin reductions</a>, and can vary based on resource bounds, such as <a href="/wiki/Polynomial-time_reduction" title="Polynomial-time reduction">polynomial-time reductions</a> and <a href="/wiki/Log-space_reduction" title="Log-space reduction">log-space reductions</a>. </p> <div class="mw-heading mw-heading4"><h4 id="Hardness">Hardness</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=23" title="Edit section: Hardness"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Reductions motivate the concept of a problem being <b>hard</b> for a complexity class. A problem <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle X}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>X</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle X}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/68baa052181f707c662844a465bfeeb135e82bab" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.98ex; height:2.176ex;" alt="{\displaystyle X}"></span> is hard for a class of problems <b>C</b> if every problem in <b>C</b> can be polynomial-time reduced to <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle X}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>X</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle X}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/68baa052181f707c662844a465bfeeb135e82bab" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.98ex; height:2.176ex;" alt="{\displaystyle X}"></span>. Thus no problem in <b>C</b> is harder than <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle X}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>X</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle X}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/68baa052181f707c662844a465bfeeb135e82bab" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.98ex; height:2.176ex;" alt="{\displaystyle X}"></span>, since an algorithm for <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle X}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>X</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle X}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/68baa052181f707c662844a465bfeeb135e82bab" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.98ex; height:2.176ex;" alt="{\displaystyle X}"></span> allows us to solve any problem in <b>C</b> with at most polynomial slowdown. Of particular importance, the set of problems that are hard for <b>NP</b> is called the set of <b><a href="/wiki/NP-hard" class="mw-redirect" title="NP-hard">NP-hard</a></b> problems. </p> <div class="mw-heading mw-heading4"><h4 id="Completeness">Completeness</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=24" title="Edit section: Completeness"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>If a problem <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle X}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>X</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle X}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/68baa052181f707c662844a465bfeeb135e82bab" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.98ex; height:2.176ex;" alt="{\displaystyle X}"></span> is hard for <b>C</b> and is also in <b>C</b>, then <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle X}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>X</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle X}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/68baa052181f707c662844a465bfeeb135e82bab" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.98ex; height:2.176ex;" alt="{\displaystyle X}"></span> is said to be <b><a href="/wiki/Complete_(complexity)" title="Complete (complexity)">complete</a></b> for <b>C</b>. This means that <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle X}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>X</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle X}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/68baa052181f707c662844a465bfeeb135e82bab" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.98ex; height:2.176ex;" alt="{\displaystyle X}"></span> is the hardest problem in <b>C</b> (since there could be many problems that are equally hard, more precisely <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle X}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>X</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle X}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/68baa052181f707c662844a465bfeeb135e82bab" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.98ex; height:2.176ex;" alt="{\displaystyle X}"></span> is as hard as the hardest problems in <b>C</b>). </p><p>Of particular importance is the class of <a href="/wiki/NP-complete" class="mw-redirect" title="NP-complete"><b>NP</b>-complete</a> problems—the most difficult problems in <b>NP</b>. Because all problems in <b>NP</b> can be polynomial-time reduced to <b>NP</b>-complete problems, finding an <b>NP</b>-complete problem that can be solved in polynomial time would mean that <b>P</b> = <b>NP</b>. </p> <div class="mw-heading mw-heading2"><h2 id="Relationships_between_complexity_classes">Relationships between complexity classes</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=25" title="Edit section: Relationships between complexity classes"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <div class="mw-heading mw-heading3"><h3 id="Savitch's_theorem"><span id="Savitch.27s_theorem"></span>Savitch's theorem</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=26" title="Edit section: Savitch's theorem"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1236090951"><div role="note" class="hatnote navigation-not-searchable">Main article: <a href="/wiki/Savitch%27s_theorem" title="Savitch's theorem">Savitch's theorem</a></div> <p>Savitch's theorem establishes the relationship between deterministic and nondetermistic space resources. It shows that if a nondeterministic Turing machine can solve a problem using <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f(n)}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>f</mi> <mo stretchy="false">(</mo> <mi>n</mi> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle f(n)}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/c1c49fad1eccc4e9af1e4f23f32efdc3ac4da973" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:4.483ex; height:2.843ex;" alt="{\displaystyle f(n)}"></span> space, then a deterministic Turing machine can solve the same problem in <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f(n)^{2}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>f</mi> <mo stretchy="false">(</mo> <mi>n</mi> <msup> <mo stretchy="false">)</mo> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle f(n)^{2}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/5d4c73b3f43231424946747ba032cb43794e5662" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:5.537ex; height:3.176ex;" alt="{\displaystyle f(n)^{2}}"></span> space, i.e. in the square of the space. Formally, Savitch's theorem states that for any <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f(n)>n}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>f</mi> <mo stretchy="false">(</mo> <mi>n</mi> <mo stretchy="false">)</mo> <mo>></mo> <mi>n</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle f(n)>n}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/73bbe3fb9251d4273f960b71eb2afd64de2bf442" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:8.976ex; height:2.843ex;" alt="{\displaystyle f(n)>n}"></span>,<sup id="cite_ref-FOOTNOTELee2014_15-0" class="reference"><a href="#cite_note-FOOTNOTELee2014-15"><span class="cite-bracket">[</span>14<span class="cite-bracket">]</span></a></sup> </p> <dl><dd><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathsf {NSPACE}}\left(f\left(n\right)\right)\subseteq {\mathsf {DSPACE}}\left(f\left(n\right)^{2}\right).}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">N</mi> <mi mathvariant="sans-serif">S</mi> <mi mathvariant="sans-serif">P</mi> <mi mathvariant="sans-serif">A</mi> <mi mathvariant="sans-serif">C</mi> <mi mathvariant="sans-serif">E</mi> </mrow> </mrow> <mrow> <mo>(</mo> <mrow> <mi>f</mi> <mrow> <mo>(</mo> <mi>n</mi> <mo>)</mo> </mrow> </mrow> <mo>)</mo> </mrow> <mo>⊆<!-- ⊆ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">D</mi> <mi mathvariant="sans-serif">S</mi> <mi mathvariant="sans-serif">P</mi> <mi mathvariant="sans-serif">A</mi> <mi mathvariant="sans-serif">C</mi> <mi mathvariant="sans-serif">E</mi> </mrow> </mrow> <mrow> <mo>(</mo> <mrow> <mi>f</mi> <msup> <mrow> <mo>(</mo> <mi>n</mi> <mo>)</mo> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msup> </mrow> <mo>)</mo> </mrow> <mo>.</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\mathsf {NSPACE}}\left(f\left(n\right)\right)\subseteq {\mathsf {DSPACE}}\left(f\left(n\right)^{2}\right).}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a6752d6fb2b2f26428514fce85c652bd751e306f" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.838ex; width:37.624ex; height:4.843ex;" alt="{\displaystyle {\mathsf {NSPACE}}\left(f\left(n\right)\right)\subseteq {\mathsf {DSPACE}}\left(f\left(n\right)^{2}\right).}"></span></dd></dl> <p>Important corollaries of Savitch's theorem are that <b>PSPACE</b> = <b>NPSPACE</b> (since the square of a polynomial is still a polynomial) and <b>EXPSPACE</b> = <b>NEXPSPACE</b> (since the square of an exponential is still an exponential). </p><p>These relationships answer fundamental questions about the power of nondeterminism compared to determinism. Specifically, Savitch's theorem shows that any problem that a nondeterministic Turing machine can solve in polynomial space, a deterministic Turing machine can also solve in polynomial space. Similarly, any problem that a nondeterministic Turing machine can solve in exponential space, a deterministic Turing machine can also solve in exponential space. </p> <div class="mw-heading mw-heading3"><h3 id="Hierarchy_theorems">Hierarchy theorems</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=27" title="Edit section: Hierarchy theorems"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1236090951"><div role="note" class="hatnote navigation-not-searchable">Main articles: <a href="/wiki/Time_hierarchy_theorem" title="Time hierarchy theorem">Time hierarchy theorem</a> and <a href="/wiki/Space_hierarchy_theorem" title="Space hierarchy theorem">Space hierarchy theorem</a></div> <p>By definition of <b>DTIME</b>, it follows that <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathsf {DTIME}}(n^{k_{1}})}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">D</mi> <mi mathvariant="sans-serif">T</mi> <mi mathvariant="sans-serif">I</mi> <mi mathvariant="sans-serif">M</mi> <mi mathvariant="sans-serif">E</mi> </mrow> </mrow> <mo stretchy="false">(</mo> <msup> <mi>n</mi> <mrow class="MJX-TeXAtom-ORD"> <msub> <mi>k</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> </mrow> </msup> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\mathsf {DTIME}}(n^{k_{1}})}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/aff8490b804fb7d0223a9e63cc518c18a5810f07" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:12.453ex; height:3.176ex;" alt="{\displaystyle {\mathsf {DTIME}}(n^{k_{1}})}"></span> is contained in <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathsf {DTIME}}(n^{k_{2}})}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">D</mi> <mi mathvariant="sans-serif">T</mi> <mi mathvariant="sans-serif">I</mi> <mi mathvariant="sans-serif">M</mi> <mi mathvariant="sans-serif">E</mi> </mrow> </mrow> <mo stretchy="false">(</mo> <msup> <mi>n</mi> <mrow class="MJX-TeXAtom-ORD"> <msub> <mi>k</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> </mrow> </msup> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\mathsf {DTIME}}(n^{k_{2}})}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/b4661d72930a630c989ec0a0e8c9412419353ff6" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:12.453ex; height:3.176ex;" alt="{\displaystyle {\mathsf {DTIME}}(n^{k_{2}})}"></span> if <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle k_{1}\leq k_{2}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>k</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo>≤<!-- ≤ --></mo> <msub> <mi>k</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle k_{1}\leq k_{2}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/aa511fb6f3e8d163c68ac83b628dd6a2c154ae28" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:7.629ex; height:2.509ex;" alt="{\displaystyle k_{1}\leq k_{2}}"></span>, since <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle O(n^{k_{1}})\subseteq O(n^{k_{2}})}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>O</mi> <mo stretchy="false">(</mo> <msup> <mi>n</mi> <mrow class="MJX-TeXAtom-ORD"> <msub> <mi>k</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> </mrow> </msup> <mo stretchy="false">)</mo> <mo>⊆<!-- ⊆ --></mo> <mi>O</mi> <mo stretchy="false">(</mo> <msup> <mi>n</mi> <mrow class="MJX-TeXAtom-ORD"> <msub> <mi>k</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> </mrow> </msup> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle O(n^{k_{1}})\subseteq O(n^{k_{2}})}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/0385ab1b811dc7302d181e54c893077f5a73d97c" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:16.894ex; height:3.176ex;" alt="{\displaystyle O(n^{k_{1}})\subseteq O(n^{k_{2}})}"></span> if <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle k_{1}\leq k_{2}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>k</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo>≤<!-- ≤ --></mo> <msub> <mi>k</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle k_{1}\leq k_{2}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/aa511fb6f3e8d163c68ac83b628dd6a2c154ae28" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:7.629ex; height:2.509ex;" alt="{\displaystyle k_{1}\leq k_{2}}"></span>. However, this definition gives no indication of whether this inclusion is strict. For time and space requirements, the conditions under which the inclusion is strict are given by the time and space hierarchy theorems, respectively. They are called hierarchy theorems because they induce a proper hierarchy on the classes defined by constraining the respective resources. The hierarchy theorems enable one to make quantitative statements about how much more additional time or space is needed in order to increase the number of problems that can be solved. </p><p>The <a href="/wiki/Time_hierarchy_theorem" title="Time hierarchy theorem">time hierarchy theorem</a> states that </p> <dl><dd><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathsf {DTIME}}{\big (}f(n){\big )}\subsetneq {\mathsf {DTIME}}{\big (}f(n)\cdot \log ^{2}(f(n)){\big )}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">D</mi> <mi mathvariant="sans-serif">T</mi> <mi mathvariant="sans-serif">I</mi> <mi mathvariant="sans-serif">M</mi> <mi mathvariant="sans-serif">E</mi> </mrow> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mo maxsize="1.2em" minsize="1.2em">(</mo> </mrow> </mrow> <mi>f</mi> <mo stretchy="false">(</mo> <mi>n</mi> <mo stretchy="false">)</mo> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mo maxsize="1.2em" minsize="1.2em">)</mo> </mrow> </mrow> <mo>⊊<!-- ⊊ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">D</mi> <mi mathvariant="sans-serif">T</mi> <mi mathvariant="sans-serif">I</mi> <mi mathvariant="sans-serif">M</mi> <mi mathvariant="sans-serif">E</mi> </mrow> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mo maxsize="1.2em" minsize="1.2em">(</mo> </mrow> </mrow> <mi>f</mi> <mo stretchy="false">(</mo> <mi>n</mi> <mo stretchy="false">)</mo> <mo>⋅<!-- ⋅ --></mo> <msup> <mi>log</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msup> <mo>⁡<!-- --></mo> <mo stretchy="false">(</mo> <mi>f</mi> <mo stretchy="false">(</mo> <mi>n</mi> <mo stretchy="false">)</mo> <mo stretchy="false">)</mo> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mo maxsize="1.2em" minsize="1.2em">)</mo> </mrow> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\mathsf {DTIME}}{\big (}f(n){\big )}\subsetneq {\mathsf {DTIME}}{\big (}f(n)\cdot \log ^{2}(f(n)){\big )}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/1e54fb253309fa456b690af18ac762d45e46da46" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:42.978ex; height:3.343ex;" alt="{\displaystyle {\mathsf {DTIME}}{\big (}f(n){\big )}\subsetneq {\mathsf {DTIME}}{\big (}f(n)\cdot \log ^{2}(f(n)){\big )}}"></span>.</dd></dl> <p>The <a href="/wiki/Space_hierarchy_theorem" title="Space hierarchy theorem">space hierarchy theorem</a> states that </p> <dl><dd><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathsf {DSPACE}}{\big (}f(n){\big )}\subsetneq {\mathsf {DSPACE}}{\big (}f(n)\cdot \log(f(n)){\big )}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">D</mi> <mi mathvariant="sans-serif">S</mi> <mi mathvariant="sans-serif">P</mi> <mi mathvariant="sans-serif">A</mi> <mi mathvariant="sans-serif">C</mi> <mi mathvariant="sans-serif">E</mi> </mrow> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mo maxsize="1.2em" minsize="1.2em">(</mo> </mrow> </mrow> <mi>f</mi> <mo stretchy="false">(</mo> <mi>n</mi> <mo stretchy="false">)</mo> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mo maxsize="1.2em" minsize="1.2em">)</mo> </mrow> </mrow> <mo>⊊<!-- ⊊ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">D</mi> <mi mathvariant="sans-serif">S</mi> <mi mathvariant="sans-serif">P</mi> <mi mathvariant="sans-serif">A</mi> <mi mathvariant="sans-serif">C</mi> <mi mathvariant="sans-serif">E</mi> </mrow> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mo maxsize="1.2em" minsize="1.2em">(</mo> </mrow> </mrow> <mi>f</mi> <mo stretchy="false">(</mo> <mi>n</mi> <mo stretchy="false">)</mo> <mo>⋅<!-- ⋅ --></mo> <mi>log</mi> <mo>⁡<!-- --></mo> <mo stretchy="false">(</mo> <mi>f</mi> <mo stretchy="false">(</mo> <mi>n</mi> <mo stretchy="false">)</mo> <mo stretchy="false">)</mo> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mo maxsize="1.2em" minsize="1.2em">)</mo> </mrow> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\mathsf {DSPACE}}{\big (}f(n){\big )}\subsetneq {\mathsf {DSPACE}}{\big (}f(n)\cdot \log(f(n)){\big )}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/24f22cf002f3783aaa1356f68a31f8b34a8e89b9" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:45.025ex; height:3.176ex;" alt="{\displaystyle {\mathsf {DSPACE}}{\big (}f(n){\big )}\subsetneq {\mathsf {DSPACE}}{\big (}f(n)\cdot \log(f(n)){\big )}}"></span>.</dd></dl> <p>The time and space hierarchy theorems form the basis for most separation results of complexity classes. For instance, the time hierarchy theorem establishes that <b>P</b> is strictly contained in <b>EXPTIME</b>, and the space hierarchy theorem establishes that <b>L</b> is strictly contained in <b>PSPACE</b>. </p> <div class="mw-heading mw-heading2"><h2 id="Other_models_of_computation">Other models of computation</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=28" title="Edit section: Other models of computation"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>While deterministic and non-deterministic <a href="/wiki/Turing_machine" title="Turing machine">Turing machines</a> are the most commonly used models of computation, many complexity classes are defined in terms of other computational models. In particular, </p> <ul><li>A number of classes are defined using <a href="/wiki/Probabilistic_Turing_machine" title="Probabilistic Turing machine">probabilistic Turing machines</a>, including the classes <b><a href="/wiki/Bounded-error_probabilistic_polynomial" class="mw-redirect" title="Bounded-error probabilistic polynomial">BPP</a></b>, <b><a href="/wiki/PP_(complexity)" title="PP (complexity)">PP</a></b>, <b><a href="/wiki/RP_(complexity)" title="RP (complexity)">RP</a></b>, and <b><a href="/wiki/ZPP_(complexity)" title="ZPP (complexity)">ZPP</a></b></li> <li>A number of classes are defined using <a href="/wiki/Interactive_proof_system" title="Interactive proof system">interactive proof systems</a>, including the classes <b><a href="/wiki/IP_(complexity)" title="IP (complexity)">IP</a></b>, <b><a href="/wiki/MA_(complexity)" class="mw-redirect" title="MA (complexity)">MA</a></b>, and <b><a href="/wiki/AM_(complexity)" class="mw-redirect" title="AM (complexity)">AM</a></b></li> <li>A number of classes are defined using <a href="/wiki/Boolean_circuit" title="Boolean circuit">Boolean circuits</a>, including the classes <b><a href="/wiki/P/poly" title="P/poly">P/poly</a></b> and its subclasses <b><a href="/wiki/NC_(complexity)" title="NC (complexity)">NC</a></b> and <b><a href="/wiki/AC_(complexity)" title="AC (complexity)">AC</a></b></li> <li>A number of classes are defined using <a href="/wiki/Quantum_Turing_machine" title="Quantum Turing machine">quantum Turing machines</a>, including the classes <b><a href="/wiki/BQP" title="BQP">BQP</a></b> and <b><a href="/wiki/QMA" title="QMA">QMA</a></b></li></ul> <p>These are explained in greater detail below. </p> <div class="mw-heading mw-heading3"><h3 id="Randomized_computation">Randomized computation</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=29" title="Edit section: Randomized computation"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1236090951"><div role="note" class="hatnote navigation-not-searchable">Main article: <a href="/wiki/Randomized_computation" class="mw-redirect" title="Randomized computation">Randomized computation</a></div> <p>A number of important complexity classes are defined using the <b><a href="/wiki/Probabilistic_Turing_machine" title="Probabilistic Turing machine">probabilistic Turing machine</a></b>, a variant of the <a href="/wiki/Turing_machine" title="Turing machine">Turing machine</a> that can toss random coins. These classes help to better describe the complexity of <a href="/wiki/Randomized_algorithm" title="Randomized algorithm">randomized algorithms</a>. </p><p>A probabilistic Turing machine is similar to a deterministic Turing machine, except rather than following a single transition function (a set of rules for how to proceed at each step of the computation) it probabilistically selects between multiple transition functions at each step. The standard definition of a probabilistic Turing machine specifies two transition functions, so that the selection of transition function at each step resembles a coin flip. The randomness introduced at each step of the computation introduces the potential for error; that is, strings that the Turing machine is meant to accept may on some occasions be rejected and strings that the Turing machine is meant to reject may on some occasions be accepted. As a result, the complexity classes based on the probabilistic Turing machine are defined in large part around the amount of error that is allowed. Formally, they are defined using an error probability <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \epsilon }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>ϵ<!-- ϵ --></mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \epsilon }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/c3837cad72483d97bcdde49c85d3b7b859fb3fd2" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:0.944ex; height:1.676ex;" alt="{\displaystyle \epsilon }"></span>. A probabilistic Turing machine <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle M}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>M</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle M}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f82cade9898ced02fdd08712e5f0c0151758a0dd" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.442ex; height:2.176ex;" alt="{\displaystyle M}"></span> is said to recognize a language <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle L}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>L</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle L}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/103168b86f781fe6e9a4a87b8ea1cebe0ad4ede8" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.583ex; height:2.176ex;" alt="{\displaystyle L}"></span> with error probability <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \epsilon }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>ϵ<!-- ϵ --></mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \epsilon }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/c3837cad72483d97bcdde49c85d3b7b859fb3fd2" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:0.944ex; height:1.676ex;" alt="{\displaystyle \epsilon }"></span> if: </p> <ol><li>a string <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle w}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>w</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle w}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/88b1e0c8e1be5ebe69d18a8010676fa42d7961e6" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.664ex; height:1.676ex;" alt="{\displaystyle w}"></span> in <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle L}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>L</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle L}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/103168b86f781fe6e9a4a87b8ea1cebe0ad4ede8" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.583ex; height:2.176ex;" alt="{\displaystyle L}"></span> implies that <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\text{Pr}}[M{\text{ accepts }}w]\geq 1-\epsilon }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mtext>Pr</mtext> </mrow> <mo stretchy="false">[</mo> <mi>M</mi> <mrow class="MJX-TeXAtom-ORD"> <mtext> accepts </mtext> </mrow> <mi>w</mi> <mo stretchy="false">]</mo> <mo>≥<!-- ≥ --></mo> <mn>1</mn> <mo>−<!-- − --></mo> <mi>ϵ<!-- ϵ --></mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\text{Pr}}[M{\text{ accepts }}w]\geq 1-\epsilon }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/61aa9670ae2247c28c0c1c5711d868458fb9b51c" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:24.474ex; height:2.843ex;" alt="{\displaystyle {\text{Pr}}[M{\text{ accepts }}w]\geq 1-\epsilon }"></span></li> <li>a string <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle w}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>w</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle w}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/88b1e0c8e1be5ebe69d18a8010676fa42d7961e6" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.664ex; height:1.676ex;" alt="{\displaystyle w}"></span> not in <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle L}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>L</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle L}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/103168b86f781fe6e9a4a87b8ea1cebe0ad4ede8" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.583ex; height:2.176ex;" alt="{\displaystyle L}"></span> implies that <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\text{Pr}}[M{\text{ rejects }}w]\geq 1-\epsilon }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mtext>Pr</mtext> </mrow> <mo stretchy="false">[</mo> <mi>M</mi> <mrow class="MJX-TeXAtom-ORD"> <mtext> rejects </mtext> </mrow> <mi>w</mi> <mo stretchy="false">]</mo> <mo>≥<!-- ≥ --></mo> <mn>1</mn> <mo>−<!-- − --></mo> <mi>ϵ<!-- ϵ --></mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\text{Pr}}[M{\text{ rejects }}w]\geq 1-\epsilon }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/1f14e45a79d6166c55216f4af41da0d6a3760ed1" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:23.643ex; height:2.843ex;" alt="{\displaystyle {\text{Pr}}[M{\text{ rejects }}w]\geq 1-\epsilon }"></span></li></ol> <div class="mw-heading mw-heading4"><h4 id="Important_complexity_classes">Important complexity classes</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=30" title="Edit section: Important complexity classes"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <figure class="mw-default-size" typeof="mw:File/Thumb"><a href="/wiki/File:Randomized_Complexity_Classes.svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/d/d2/Randomized_Complexity_Classes.svg/220px-Randomized_Complexity_Classes.svg.png" decoding="async" width="220" height="155" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/d/d2/Randomized_Complexity_Classes.svg/330px-Randomized_Complexity_Classes.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/d/d2/Randomized_Complexity_Classes.svg/440px-Randomized_Complexity_Classes.svg.png 2x" data-file-width="744" data-file-height="524" /></a><figcaption>The relationships between the fundamental probabilistic complexity classes. BQP is a probabilistic <a href="/wiki/Quantum_complexity_theory" title="Quantum complexity theory">quantum complexity</a> class and is described in the quantum computing section.</figcaption></figure> <p>The fundamental randomized time complexity classes are <b><a href="/wiki/ZPP_(complexity)" title="ZPP (complexity)">ZPP</a></b>, <b><a href="/wiki/RP_(complexity)" title="RP (complexity)">RP</a></b>, <b><a href="/wiki/Co-RP" class="mw-redirect" title="Co-RP">co-RP</a></b>, <b><a href="/wiki/BPP_(complexity)" title="BPP (complexity)">BPP</a></b>, and <b><a href="/wiki/PP_(complexity)" title="PP (complexity)">PP</a></b>. </p><p>The strictest class is <b><a href="/wiki/ZPP_(complexity)" title="ZPP (complexity)">ZPP</a></b> (zero-error probabilistic polynomial time), the class of problems solvable in polynomial time by a probabilistic Turing machine with error probability 0. Intuitively, this is the strictest class of probabilistic problems because it demands <i>no error whatsoever</i>. </p><p>A slightly looser class is <b><a href="/wiki/RP_(complexity)" title="RP (complexity)">RP</a></b> (randomized polynomial time), which maintains no error for strings not in the language but allows bounded error for strings in the language. More formally, a language is in <b>RP</b> if there is a probabilistic polynomial-time Turing machine <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle M}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>M</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle M}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f82cade9898ced02fdd08712e5f0c0151758a0dd" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.442ex; height:2.176ex;" alt="{\displaystyle M}"></span> such that if a string is not in the language then <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle M}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>M</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle M}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f82cade9898ced02fdd08712e5f0c0151758a0dd" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.442ex; height:2.176ex;" alt="{\displaystyle M}"></span> always rejects and if a string is in the language then <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle M}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>M</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle M}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f82cade9898ced02fdd08712e5f0c0151758a0dd" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.442ex; height:2.176ex;" alt="{\displaystyle M}"></span> accepts with a probability at least 1/2. The class <b><a href="/wiki/Co-RP" class="mw-redirect" title="Co-RP">co-RP</a></b> is similarly defined except the roles are flipped: error is not allowed for strings in the language but is allowed for strings not in the language. Taken together, the classes <b>RP</b> and <b>co-RP</b> encompass all of the problems that can be solved by probabilistic Turing machines with <a href="/wiki/One-sided_error" class="mw-redirect" title="One-sided error">one-sided error</a>. </p><p>Loosening the error requirements further to allow for <a href="/wiki/Two-sided_error" class="mw-redirect" title="Two-sided error">two-sided error</a> yields the class <b><a href="/wiki/BPP_(complexity)" title="BPP (complexity)">BPP</a></b> (bounded-error probabilistic polynomial time), the class of problems solvable in polynomial time by a probabilistic Turing machine with error probability less than 1/3 (for both strings in the language and not in the language). <b>BPP</b> is the most practically relevant of the probabilistic complexity classes—problems in <b>BPP</b> have efficient <a href="/wiki/Randomized_algorithm" title="Randomized algorithm">randomized algorithms</a> that can be run quickly on real computers. <b>BPP</b> is also at the center of the important unsolved problem in computer science over whether <b><a href="/wiki/BPP_(complexity)#Problems" title="BPP (complexity)">P=BPP</a></b>, which if true would mean that randomness does not increase the computational power of computers, i.e. any probabilistic Turing machine could be simulated by a deterministic Turing machine with at most polynomial slowdown. </p><p>The broadest class of efficiently-solvable probabilistic problems is <b><a href="/wiki/PP_(complexity)" title="PP (complexity)">PP</a></b> (probabilistic polynomial time), the set of languages solvable by a probabilistic Turing machine in polynomial time with an error probability of less than 1/2 for all strings. </p><p><b>ZPP</b>, <b>RP</b> and <b>co-RP</b> are all subsets of <b>BPP</b>, which in turn is a subset of <b>PP</b>. The reason for this is intuitive: the classes allowing zero error and only one-sided error are all contained within the class that allows two-sided error, and <b>PP</b> simply relaxes the error probability of <b>BPP</b>. <b>ZPP</b> relates to <b>RP</b> and <b>co-RP</b> in the following way: <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\textsf {ZPP}}={\textsf {RP}}\cap {\textsf {co-RP}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mtext mathvariant="sans-serif">ZPP</mtext> </mrow> </mrow> <mo>=</mo> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mtext mathvariant="sans-serif">RP</mtext> </mrow> </mrow> <mo>∩<!-- ∩ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mtext mathvariant="sans-serif">co-RP</mtext> </mrow> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\textsf {ZPP}}={\textsf {RP}}\cap {\textsf {co-RP}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/9223c18ceef162a448a54bc3ede774a5371f92aa" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:19.015ex; height:2.176ex;" alt="{\displaystyle {\textsf {ZPP}}={\textsf {RP}}\cap {\textsf {co-RP}}}"></span>. That is, <b>ZPP</b> consists exactly of those problems that are in both <b>RP</b> and <b>co-RP</b>. Intuitively, this follows from the fact that <b>RP</b> and <b>co-RP</b> allow only one-sided error: <b>co-RP</b> does not allow error for strings in the language and <b>RP</b> does not allow error for strings not in the language. Hence, if a problem is in both <b>RP</b> and <b>co-RP</b>, then there must be no error for strings both in <i>and</i> not in the language (i.e. no error whatsoever), which is exactly the definition of <b>ZPP</b>. </p><p>Important randomized space complexity classes include <b><a href="/wiki/BPL_(complexity)" title="BPL (complexity)">BPL</a></b>, <b><a href="/wiki/RL_(complexity)" title="RL (complexity)">RL</a></b>, and <b><a href="/wiki/Randomized_Logarithmic-space_Polynomial-time" class="mw-redirect" title="Randomized Logarithmic-space Polynomial-time">RLP</a></b>. </p> <div class="mw-heading mw-heading3"><h3 id="Interactive_proof_systems">Interactive proof systems</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=31" title="Edit section: Interactive proof systems"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1236090951"><div role="note" class="hatnote navigation-not-searchable">Main article: <a href="/wiki/Interactive_proof_system" title="Interactive proof system">Interactive proof system</a></div> <p>A number of complexity classes are defined using <b><a href="/wiki/Interactive_proof_systems" class="mw-redirect" title="Interactive proof systems">interactive proof systems</a></b>. Interactive proofs generalize the proofs definition of the complexity class <b><a href="/wiki/NP_(complexity)" title="NP (complexity)">NP</a></b> and yield insights into <a href="/wiki/Cryptography" title="Cryptography">cryptography</a>, <a href="/wiki/Approximation_algorithm" title="Approximation algorithm">approximation algorithms</a>, and <a href="/wiki/Formal_verification" title="Formal verification">formal verification</a>. </p> <figure typeof="mw:File/Thumb"><a href="/wiki/File:Interactive_proof_(complexity).svg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/thumb/b/b0/Interactive_proof_%28complexity%29.svg/300px-Interactive_proof_%28complexity%29.svg.png" decoding="async" width="300" height="198" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/b/b0/Interactive_proof_%28complexity%29.svg/450px-Interactive_proof_%28complexity%29.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/b/b0/Interactive_proof_%28complexity%29.svg/600px-Interactive_proof_%28complexity%29.svg.png 2x" data-file-width="248" data-file-height="164" /></a><figcaption>General representation of an interactive proof protocol</figcaption></figure> <p>Interactive proof systems are <a href="/wiki/Abstract_machine" title="Abstract machine">abstract machines</a> that model computation as the exchange of messages between two parties: a prover <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle P}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>P</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle P}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/b4dc73bf40314945ff376bd363916a738548d40a" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.745ex; height:2.176ex;" alt="{\displaystyle P}"></span> and a verifier <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle V}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>V</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle V}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/af0f6064540e84211d0ffe4dac72098adfa52845" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.787ex; height:2.176ex;" alt="{\displaystyle V}"></span>. The parties interact by exchanging messages, and an input string is accepted by the system if the verifier decides to accept the input on the basis of the messages it has received from the prover. The prover <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle P}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>P</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle P}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/b4dc73bf40314945ff376bd363916a738548d40a" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.745ex; height:2.176ex;" alt="{\displaystyle P}"></span> has unlimited computational power while the verifier has bounded computational power (the standard definition of interactive proof systems defines the verifier to be polynomially-time bounded). The prover, however, is untrustworthy (this prevents all languages from being trivially recognized by the proof system by having the computationally unbounded prover solve for whether a string is in a language and then sending a trustworthy "YES" or "NO" to the verifier), so the verifier must conduct an "interrogation" of the prover by "asking it" successive rounds of questions, accepting only if it develops a high degree of confidence that the string is in the language.<sup id="cite_ref-FOOTNOTEAroraBarak2009144_16-0" class="reference"><a href="#cite_note-FOOTNOTEAroraBarak2009144-16"><span class="cite-bracket">[</span>15<span class="cite-bracket">]</span></a></sup> </p> <div class="mw-heading mw-heading4"><h4 id="Important_complexity_classes_2">Important complexity classes</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=32" title="Edit section: Important complexity classes"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>The class <b><a href="/wiki/NP_(complexity)" title="NP (complexity)">NP</a></b> is a simple proof system in which the verifier is restricted to being a deterministic polynomial-time <a href="/wiki/Turing_machine" title="Turing machine">Turing machine</a> and the procedure is restricted to one round (that is, the prover sends only a single, full proof—typically referred to as the <a href="/wiki/Certificate_(complexity)" title="Certificate (complexity)">certificate</a>—to the verifier). Put another way, in the definition of the class <b>NP</b> (the set of decision problems for which the problem instances, when the answer is "YES", have proofs verifiable in polynomial time by a deterministic Turing machine) is a proof system in which the proof is constructed by an unmentioned prover and the deterministic Turing machine is the verifier. For this reason, <b>NP</b> can also be called <b>dIP</b> (deterministic interactive proof), though it is rarely referred to as such. </p><p>It turns out that <b>NP</b> captures the full power of interactive proof systems with deterministic (polynomial-time) verifiers because it can be shown that for any proof system with a deterministic verifier it is never necessary to need more than a single round of messaging between the prover and the verifier. Interactive proof systems that provide greater computational power over standard complexity classes thus require <i>probabilistic</i> verifiers, which means that the verifier's questions to the prover are computed using <a href="/wiki/Probabilistic_algorithm" class="mw-redirect" title="Probabilistic algorithm">probabilistic algorithms</a>. As noted in the section above on <a href="/wiki/Randomized_computation" class="mw-redirect" title="Randomized computation">randomized computation</a>, probabilistic algorithms introduce error into the system, so complexity classes based on probabilistic proof systems are defined in terms of an error probability <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \epsilon }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>ϵ<!-- ϵ --></mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \epsilon }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/c3837cad72483d97bcdde49c85d3b7b859fb3fd2" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:0.944ex; height:1.676ex;" alt="{\displaystyle \epsilon }"></span>. </p><p>The most general complexity class arising out of this characterization is the class <b><a href="/wiki/IP_(complexity)" title="IP (complexity)">IP</a></b> (interactive polynomial time), which is the class of all problems solvable by an interactive proof system <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle (P,V)}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mo stretchy="false">(</mo> <mi>P</mi> <mo>,</mo> <mi>V</mi> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle (P,V)}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/307f51b1872e93f061ce4b7ac4c08e396842a707" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:6.376ex; height:2.843ex;" alt="{\displaystyle (P,V)}"></span>, where <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle V}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>V</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle V}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/af0f6064540e84211d0ffe4dac72098adfa52845" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.787ex; height:2.176ex;" alt="{\displaystyle V}"></span> is probabilistic polynomial-time and the proof system satisfies two properties: for a language <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle L\in {\mathsf {IP}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>L</mi> <mo>∈<!-- ∈ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">I</mi> <mi mathvariant="sans-serif">P</mi> </mrow> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle L\in {\mathsf {IP}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/bf3767d2b139ab46357ce56bd8f4cb7278233e7a" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:6.556ex; height:2.176ex;" alt="{\displaystyle L\in {\mathsf {IP}}}"></span> </p> <ol><li>(Completeness) a string <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle w}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>w</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle w}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/88b1e0c8e1be5ebe69d18a8010676fa42d7961e6" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.664ex; height:1.676ex;" alt="{\displaystyle w}"></span> in <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle L}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>L</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle L}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/103168b86f781fe6e9a4a87b8ea1cebe0ad4ede8" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.583ex; height:2.176ex;" alt="{\displaystyle L}"></span> implies <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \Pr[V{\text{ accepts }}w{\text{ after interacting with }}P]\geq {\tfrac {2}{3}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mo movablelimits="true" form="prefix">Pr</mo> <mo stretchy="false">[</mo> <mi>V</mi> <mrow class="MJX-TeXAtom-ORD"> <mtext> accepts </mtext> </mrow> <mi>w</mi> <mrow class="MJX-TeXAtom-ORD"> <mtext> after interacting with </mtext> </mrow> <mi>P</mi> <mo stretchy="false">]</mo> <mo>≥<!-- ≥ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="false" scriptlevel="0"> <mfrac> <mn>2</mn> <mn>3</mn> </mfrac> </mstyle> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \Pr[V{\text{ accepts }}w{\text{ after interacting with }}P]\geq {\tfrac {2}{3}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/b26c6e9f7b3a1460dec9fd7a2e1f93245117b635" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.338ex; width:44.833ex; height:3.676ex;" alt="{\displaystyle \Pr[V{\text{ accepts }}w{\text{ after interacting with }}P]\geq {\tfrac {2}{3}}}"></span></li> <li>(Soundness) a string <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle w}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>w</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle w}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/88b1e0c8e1be5ebe69d18a8010676fa42d7961e6" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.664ex; height:1.676ex;" alt="{\displaystyle w}"></span> not in <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle L}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>L</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle L}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/103168b86f781fe6e9a4a87b8ea1cebe0ad4ede8" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.583ex; height:2.176ex;" alt="{\displaystyle L}"></span> implies <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \Pr[V{\text{ accepts }}w{\text{ after interacting with }}P]\leq {\tfrac {1}{3}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mo movablelimits="true" form="prefix">Pr</mo> <mo stretchy="false">[</mo> <mi>V</mi> <mrow class="MJX-TeXAtom-ORD"> <mtext> accepts </mtext> </mrow> <mi>w</mi> <mrow class="MJX-TeXAtom-ORD"> <mtext> after interacting with </mtext> </mrow> <mi>P</mi> <mo stretchy="false">]</mo> <mo>≤<!-- ≤ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="false" scriptlevel="0"> <mfrac> <mn>1</mn> <mn>3</mn> </mfrac> </mstyle> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \Pr[V{\text{ accepts }}w{\text{ after interacting with }}P]\leq {\tfrac {1}{3}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/74ea4c0e3cf31898c337ccc76f219ebd1bf146d3" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.338ex; width:44.833ex; height:3.676ex;" alt="{\displaystyle \Pr[V{\text{ accepts }}w{\text{ after interacting with }}P]\leq {\tfrac {1}{3}}}"></span></li></ol> <p>An important feature of <b>IP</b> is that it equals <b><a href="/wiki/PSPACE" title="PSPACE">PSPACE</a></b>. In other words, any problem that can be solved by a polynomial-time interactive proof system can also be solved by a <a href="/wiki/Deterministic_Turing_machine" class="mw-redirect" title="Deterministic Turing machine">deterministic Turing machine</a> with polynomial space resources, and vice versa. </p><p>A modification of the protocol for <b>IP</b> produces another important complexity class: <b><a href="/wiki/AM_(complexity)" class="mw-redirect" title="AM (complexity)">AM</a></b> (Arthur–Merlin protocol). In the definition of interactive proof systems used by <b>IP</b>, the prover was not able to see the coins utilized by the verifier in its probabilistic computation—it was only able to see the messages that the verifier produced with these coins. For this reason, the coins are called <i>private random coins</i>. The interactive proof system can be constrained so that the coins used by the verifier are <i>public random coins</i>; that is, the prover is able to see the coins. Formally, <b>AM</b> is defined as the class of languages with an interactive proof in which the verifier sends a random string to the prover, the prover responds with a message, and the verifier either accepts or rejects by applying a deterministic polynomial-time function to the message from the prover. <b>AM</b> can be generalized to <b>AM</b>[<i>k</i>], where <i>k</i> is the number of messages exchanged (so in the generalized form the standard <b>AM</b> defined above is <b>AM</b>[2]). However, it is the case that for all <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle k\geq 2}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>k</mi> <mo>≥<!-- ≥ --></mo> <mn>2</mn> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle k\geq 2}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/c797a67c0a51167d373c013a9a020f4568a11754" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.505ex; width:5.472ex; height:2.343ex;" alt="{\displaystyle k\geq 2}"></span>, <b>AM</b>[<i>k</i>]=<b>AM</b>[2]. It is also the case that <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathsf {AM}}[k]\subseteq {\mathsf {IP}}[k]}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">A</mi> <mi mathvariant="sans-serif">M</mi> </mrow> </mrow> <mo stretchy="false">[</mo> <mi>k</mi> <mo stretchy="false">]</mo> <mo>⊆<!-- ⊆ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">I</mi> <mi mathvariant="sans-serif">P</mi> </mrow> </mrow> <mo stretchy="false">[</mo> <mi>k</mi> <mo stretchy="false">]</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\mathsf {AM}}[k]\subseteq {\mathsf {IP}}[k]}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/9f385b1c52743c6b32ef065e903d052f1c47e197" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:13.824ex; height:2.843ex;" alt="{\displaystyle {\mathsf {AM}}[k]\subseteq {\mathsf {IP}}[k]}"></span>. </p><p>Other complexity classes defined using interactive proof systems include <b><a href="/wiki/Interactive_proof_system#MIP" title="Interactive proof system">MIP</a></b> (multiprover interactive polynomial time) and <b><a href="/wiki/QIP_(complexity)" title="QIP (complexity)">QIP</a></b> (quantum interactive polynomial time). </p> <div class="mw-heading mw-heading3"><h3 id="Boolean_circuits">Boolean circuits</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=33" title="Edit section: Boolean circuits"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1236090951"><div role="note" class="hatnote navigation-not-searchable">Main article: <a href="/wiki/Circuit_complexity" title="Circuit complexity">Circuit complexity</a></div> <figure class="mw-halign-right" typeof="mw:File/Thumb"><a href="/wiki/File:Three_input_Boolean_circuit.jpg" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/en/thumb/d/df/Three_input_Boolean_circuit.jpg/350px-Three_input_Boolean_circuit.jpg" decoding="async" width="350" height="311" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/en/thumb/d/df/Three_input_Boolean_circuit.jpg/525px-Three_input_Boolean_circuit.jpg 1.5x, //upload.wikimedia.org/wikipedia/en/thumb/d/df/Three_input_Boolean_circuit.jpg/700px-Three_input_Boolean_circuit.jpg 2x" data-file-width="1038" data-file-height="921" /></a><figcaption>Example Boolean circuit computing the Boolean function <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f_{C}(x_{1},x_{2},x_{3})=\neg (x_{1}\wedge x_{2})\wedge ((x_{2}\wedge x_{3})\vee \neg x_{3})}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>f</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>C</mi> </mrow> </msub> <mo stretchy="false">(</mo> <msub> <mi>x</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo>,</mo> <msub> <mi>x</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> <mo>,</mo> <msub> <mi>x</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>3</mn> </mrow> </msub> <mo stretchy="false">)</mo> <mo>=</mo> <mi mathvariant="normal">¬<!-- ¬ --></mi> <mo stretchy="false">(</mo> <msub> <mi>x</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo>∧<!-- ∧ --></mo> <msub> <mi>x</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> <mo stretchy="false">)</mo> <mo>∧<!-- ∧ --></mo> <mo stretchy="false">(</mo> <mo stretchy="false">(</mo> <msub> <mi>x</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> <mo>∧<!-- ∧ --></mo> <msub> <mi>x</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>3</mn> </mrow> </msub> <mo stretchy="false">)</mo> <mo>∨<!-- ∨ --></mo> <mi mathvariant="normal">¬<!-- ¬ --></mi> <msub> <mi>x</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>3</mn> </mrow> </msub> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle f_{C}(x_{1},x_{2},x_{3})=\neg (x_{1}\wedge x_{2})\wedge ((x_{2}\wedge x_{3})\vee \neg x_{3})}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/5763c19b1d112c3db11451621dcad294588d32bb" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:47.526ex; height:2.843ex;" alt="{\displaystyle f_{C}(x_{1},x_{2},x_{3})=\neg (x_{1}\wedge x_{2})\wedge ((x_{2}\wedge x_{3})\vee \neg x_{3})}"></span>, with example input <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle x_{1}=0}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>x</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo>=</mo> <mn>0</mn> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle x_{1}=0}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/29d278bb750c26d4220fe951a98423a8e9cf354b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:6.645ex; height:2.509ex;" alt="{\displaystyle x_{1}=0}"></span>, <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle x_{2}=1}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>x</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> <mo>=</mo> <mn>1</mn> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle x_{2}=1}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/6de2266252ccb9bbd9eb1d743cea1d6ad10d9ef4" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:6.645ex; height:2.509ex;" alt="{\displaystyle x_{2}=1}"></span>, and <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle x_{3}=0}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>x</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>3</mn> </mrow> </msub> <mo>=</mo> <mn>0</mn> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle x_{3}=0}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/55547972561662fda8d82465866be57f729271c9" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:6.645ex; height:2.509ex;" alt="{\displaystyle x_{3}=0}"></span>. The <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \wedge }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mo>∧<!-- ∧ --></mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \wedge }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/1caa4004cb216ef2930bb12fe805a76870caed94" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.55ex; height:2.009ex;" alt="{\displaystyle \wedge }"></span> nodes are <a href="/wiki/AND_gate" title="AND gate">AND gates</a>, the <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \vee }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mo>∨<!-- ∨ --></mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \vee }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/7b76220c6805c9b465d6efbc7686c624f49f3023" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.55ex; height:2.009ex;" alt="{\displaystyle \vee }"></span> nodes are <a href="/wiki/OR_gate" title="OR gate">OR gates</a>, and the <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \neg }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi mathvariant="normal">¬<!-- ¬ --></mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \neg }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/fa78fd02085d39aa58c9e47a6d4033ce41e02fad" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: 0.204ex; margin-bottom: -0.376ex; width:1.55ex; height:1.176ex;" alt="{\displaystyle \neg }"></span> nodes are <a href="/wiki/NOT_gate" class="mw-redirect" title="NOT gate">NOT gates</a>.</figcaption></figure> <p>An alternative model of computation to the <a href="/wiki/Turing_machine" title="Turing machine">Turing machine</a> is the <b><a href="/wiki/Boolean_circuit" title="Boolean circuit">Boolean circuit</a></b>, a simplified model of the <a href="/wiki/Digital_circuit" class="mw-redirect" title="Digital circuit">digital circuits</a> used in modern <a href="/wiki/Computer" title="Computer">computers</a>. Not only does this model provide an intuitive connection between computation in theory and computation in practice, but it is also a natural model for <a href="/w/index.php?title=Non-uniform_computation&action=edit&redlink=1" class="new" title="Non-uniform computation (page does not exist)">non-uniform computation</a> (computation in which different input sizes within the same problem use different algorithms). </p><p>Formally, a Boolean circuit <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle C}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>C</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle C}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/4fc55753007cd3c18576f7933f6f089196732029" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.766ex; height:2.176ex;" alt="{\displaystyle C}"></span> is a <a href="/wiki/Directed_acyclic_graph" title="Directed acyclic graph">directed acyclic graph</a> in which edges represent wires (which carry the <a href="/wiki/Bit" title="Bit">bit</a> values 0 and 1), the input bits are represented by source vertices (vertices with no incoming edges), and all non-source vertices represent <a href="/wiki/Logic_gate" title="Logic gate">logic gates</a> (generally the <a href="/wiki/AND_gate" title="AND gate">AND</a>, <a href="/wiki/OR_gate" title="OR gate">OR</a>, and <a href="/wiki/NOT_gate" class="mw-redirect" title="NOT gate">NOT gates</a>). One logic gate is designated the output gate, and represents the end of the computation. The input/output behavior of a circuit <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle C}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>C</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle C}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/4fc55753007cd3c18576f7933f6f089196732029" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.766ex; height:2.176ex;" alt="{\displaystyle C}"></span> with <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>n</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle n}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a601995d55609f2d9f5e233e36fbe9ea26011b3b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.395ex; height:1.676ex;" alt="{\displaystyle n}"></span> input variables is represented by the <a href="/wiki/Boolean_function" title="Boolean function">Boolean function</a> <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f_{C}:\{0,1\}^{n}\to \{0,1\}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>f</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>C</mi> </mrow> </msub> <mo>:</mo> <mo fence="false" stretchy="false">{</mo> <mn>0</mn> <mo>,</mo> <mn>1</mn> <msup> <mo fence="false" stretchy="false">}</mo> <mrow class="MJX-TeXAtom-ORD"> <mi>n</mi> </mrow> </msup> <mo stretchy="false">→<!-- → --></mo> <mo fence="false" stretchy="false">{</mo> <mn>0</mn> <mo>,</mo> <mn>1</mn> <mo fence="false" stretchy="false">}</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle f_{C}:\{0,1\}^{n}\to \{0,1\}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/3fd15b9e1d3a93d10bd53e6040b67511e124111b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:20.758ex; height:2.843ex;" alt="{\displaystyle f_{C}:\{0,1\}^{n}\to \{0,1\}}"></span>; for example, on input bits <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle x_{1},x_{2},...,x_{n}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>x</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo>,</mo> <msub> <mi>x</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> <mo>,</mo> <mo>.</mo> <mo>.</mo> <mo>.</mo> <mo>,</mo> <msub> <mi>x</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>n</mi> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle x_{1},x_{2},...,x_{n}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/67ba2d5eca79eb4f7088ba3bd32c1800779d038a" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:13.52ex; height:2.009ex;" alt="{\displaystyle x_{1},x_{2},...,x_{n}}"></span>, the output bit <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle b}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>b</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle b}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f11423fbb2e967f986e36804a8ae4271734917c3" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:0.998ex; height:2.176ex;" alt="{\displaystyle b}"></span> of the circuit is represented mathematically as <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle b=f_{C}(x_{1},x_{2},...,x_{n})}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>b</mi> <mo>=</mo> <msub> <mi>f</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>C</mi> </mrow> </msub> <mo stretchy="false">(</mo> <msub> <mi>x</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo>,</mo> <msub> <mi>x</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> <mo>,</mo> <mo>.</mo> <mo>.</mo> <mo>.</mo> <mo>,</mo> <msub> <mi>x</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>n</mi> </mrow> </msub> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle b=f_{C}(x_{1},x_{2},...,x_{n})}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/933df525ef95ca765d09353fa2e7edc10b0ea41e" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:22.045ex; height:2.843ex;" alt="{\displaystyle b=f_{C}(x_{1},x_{2},...,x_{n})}"></span>. The circuit <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle C}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>C</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle C}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/4fc55753007cd3c18576f7933f6f089196732029" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.766ex; height:2.176ex;" alt="{\displaystyle C}"></span> is said to <i>compute</i> the Boolean function <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f_{C}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>f</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>C</mi> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle f_{C}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/ddea767aa91c0adedb766ba683ad5bc8e08ead4e" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.62ex; height:2.509ex;" alt="{\displaystyle f_{C}}"></span>. </p><p>Any particular circuit has a fixed number of input vertices, so it can only act on inputs of that size. <a href="/wiki/Formal_language" title="Formal language">Languages</a> (the formal representations of <a href="/wiki/Decision_problem" title="Decision problem">decision problems</a>), however, contain strings of differing lengths, so languages cannot be fully captured by a single circuit (this contrasts with the Turing machine model, in which a language is fully described by a single Turing machine that can act on any input size). A language is thus represented by a <b>circuit family</b>. A circuit family is an infinite list of circuits <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle (C_{0},C_{1},C_{2},...)}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mo stretchy="false">(</mo> <msub> <mi>C</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>0</mn> </mrow> </msub> <mo>,</mo> <msub> <mi>C</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo>,</mo> <msub> <mi>C</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> <mo>,</mo> <mo>.</mo> <mo>.</mo> <mo>.</mo> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle (C_{0},C_{1},C_{2},...)}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f6195ecb81918ab20567b4b7790fe7ba154f2ef7" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:16.161ex; height:2.843ex;" alt="{\displaystyle (C_{0},C_{1},C_{2},...)}"></span>, where <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle C_{n}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>C</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>n</mi> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle C_{n}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/0301812adb392070d834ca2df4ed97f1cf132f33" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.88ex; height:2.509ex;" alt="{\displaystyle C_{n}}"></span> is a circuit with <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>n</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle n}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a601995d55609f2d9f5e233e36fbe9ea26011b3b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.395ex; height:1.676ex;" alt="{\displaystyle n}"></span> input variables. A circuit family is said to decide a language <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle L}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>L</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle L}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/103168b86f781fe6e9a4a87b8ea1cebe0ad4ede8" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.583ex; height:2.176ex;" alt="{\displaystyle L}"></span> if, for every string <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle w}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>w</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle w}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/88b1e0c8e1be5ebe69d18a8010676fa42d7961e6" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.664ex; height:1.676ex;" alt="{\displaystyle w}"></span>, <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle w}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>w</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle w}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/88b1e0c8e1be5ebe69d18a8010676fa42d7961e6" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.664ex; height:1.676ex;" alt="{\displaystyle w}"></span> is in the language <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle L}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>L</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle L}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/103168b86f781fe6e9a4a87b8ea1cebe0ad4ede8" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.583ex; height:2.176ex;" alt="{\displaystyle L}"></span> if and only if <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle C_{n}(w)=1}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>C</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>n</mi> </mrow> </msub> <mo stretchy="false">(</mo> <mi>w</mi> <mo stretchy="false">)</mo> <mo>=</mo> <mn>1</mn> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle C_{n}(w)=1}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/fd15b23a4d3d151d718ddbedf045d93e289e11de" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:10.615ex; height:2.843ex;" alt="{\displaystyle C_{n}(w)=1}"></span>, where <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>n</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle n}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a601995d55609f2d9f5e233e36fbe9ea26011b3b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.395ex; height:1.676ex;" alt="{\displaystyle n}"></span> is the length of <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle w}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>w</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle w}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/88b1e0c8e1be5ebe69d18a8010676fa42d7961e6" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.664ex; height:1.676ex;" alt="{\displaystyle w}"></span>. In other words, a string <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle w}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>w</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle w}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/88b1e0c8e1be5ebe69d18a8010676fa42d7961e6" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.664ex; height:1.676ex;" alt="{\displaystyle w}"></span> of size <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>n</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle n}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a601995d55609f2d9f5e233e36fbe9ea26011b3b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.395ex; height:1.676ex;" alt="{\displaystyle n}"></span> is in the language represented by the circuit family <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle (C_{0},C_{1},C_{2},...)}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mo stretchy="false">(</mo> <msub> <mi>C</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>0</mn> </mrow> </msub> <mo>,</mo> <msub> <mi>C</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo>,</mo> <msub> <mi>C</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> <mo>,</mo> <mo>.</mo> <mo>.</mo> <mo>.</mo> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle (C_{0},C_{1},C_{2},...)}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f6195ecb81918ab20567b4b7790fe7ba154f2ef7" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:16.161ex; height:2.843ex;" alt="{\displaystyle (C_{0},C_{1},C_{2},...)}"></span> if the circuit <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle C_{n}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>C</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>n</mi> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle C_{n}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/0301812adb392070d834ca2df4ed97f1cf132f33" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.88ex; height:2.509ex;" alt="{\displaystyle C_{n}}"></span> (the circuit with the same number of input vertices as the number of bits in <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle w}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>w</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle w}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/88b1e0c8e1be5ebe69d18a8010676fa42d7961e6" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.664ex; height:1.676ex;" alt="{\displaystyle w}"></span>) evaluates to 1 when <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle w}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>w</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle w}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/88b1e0c8e1be5ebe69d18a8010676fa42d7961e6" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.664ex; height:1.676ex;" alt="{\displaystyle w}"></span> is its input. </p><p>While complexity classes defined using Turing machines are described in terms of <a href="/wiki/Time_complexity" title="Time complexity">time complexity</a>, circuit complexity classes are defined in terms of circuit size — the number of vertices in the circuit. The size complexity of a circuit family <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle (C_{0},C_{1},C_{2},...)}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mo stretchy="false">(</mo> <msub> <mi>C</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>0</mn> </mrow> </msub> <mo>,</mo> <msub> <mi>C</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>1</mn> </mrow> </msub> <mo>,</mo> <msub> <mi>C</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msub> <mo>,</mo> <mo>.</mo> <mo>.</mo> <mo>.</mo> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle (C_{0},C_{1},C_{2},...)}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f6195ecb81918ab20567b4b7790fe7ba154f2ef7" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:16.161ex; height:2.843ex;" alt="{\displaystyle (C_{0},C_{1},C_{2},...)}"></span> is the function <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f:\mathbb {N} \to \mathbb {N} }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>f</mi> <mo>:</mo> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="double-struck">N</mi> </mrow> <mo stretchy="false">→<!-- → --></mo> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="double-struck">N</mi> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle f:\mathbb {N} \to \mathbb {N} }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/dfa847e103c9e2e5075b1b510f67aad8ceae9349" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:10.186ex; height:2.509ex;" alt="{\displaystyle f:\mathbb {N} \to \mathbb {N} }"></span>, where <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f(n)}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>f</mi> <mo stretchy="false">(</mo> <mi>n</mi> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle f(n)}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/c1c49fad1eccc4e9af1e4f23f32efdc3ac4da973" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:4.483ex; height:2.843ex;" alt="{\displaystyle f(n)}"></span> is the circuit size of <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle C_{n}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi>C</mi> <mrow class="MJX-TeXAtom-ORD"> <mi>n</mi> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle C_{n}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/0301812adb392070d834ca2df4ed97f1cf132f33" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.88ex; height:2.509ex;" alt="{\displaystyle C_{n}}"></span>. The familiar function classes follow naturally from this; for example, a polynomial-size circuit family is one such that the function <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>f</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle f}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/132e57acb643253e7810ee9702d9581f159a1c61" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:1.279ex; height:2.509ex;" alt="{\displaystyle f}"></span> is a <a href="/wiki/Polynomial" title="Polynomial">polynomial</a>. </p> <div class="mw-heading mw-heading4"><h4 id="Important_complexity_classes_3">Important complexity classes</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=34" title="Edit section: Important complexity classes"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>The complexity class <b><a href="/wiki/P/poly" title="P/poly">P/poly</a></b> is the set of languages that are decidable by polynomial-size circuit families. It turns out that there is a natural connection between circuit complexity and time complexity. Intuitively, a language with small time complexity (that is, requires relatively few sequential operations on a Turing machine), also has a small circuit complexity (that is, requires relatively few Boolean operations). Formally, it can be shown that if a language is in <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathsf {DTIME}}(t(n))}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">D</mi> <mi mathvariant="sans-serif">T</mi> <mi mathvariant="sans-serif">I</mi> <mi mathvariant="sans-serif">M</mi> <mi mathvariant="sans-serif">E</mi> </mrow> </mrow> <mo stretchy="false">(</mo> <mi>t</mi> <mo stretchy="false">(</mo> <mi>n</mi> <mo stretchy="false">)</mo> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\mathsf {DTIME}}(t(n))}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/82ca926f35748a54da02822264430bd150c35a79" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:13.182ex; height:2.843ex;" alt="{\displaystyle {\mathsf {DTIME}}(t(n))}"></span>, where <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle t}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>t</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle t}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/65658b7b223af9e1acc877d848888ecdb4466560" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:0.84ex; height:2.009ex;" alt="{\displaystyle t}"></span> is a function <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle t:\mathbb {N} \to \mathbb {N} }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>t</mi> <mo>:</mo> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="double-struck">N</mi> </mrow> <mo stretchy="false">→<!-- → --></mo> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="double-struck">N</mi> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle t:\mathbb {N} \to \mathbb {N} }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/397d58bb707cef2bc7e4f3a0c56c7a08192b6cf1" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:9.747ex; height:2.176ex;" alt="{\displaystyle t:\mathbb {N} \to \mathbb {N} }"></span>, then it has circuit complexity <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle O(t^{2}(n))}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>O</mi> <mo stretchy="false">(</mo> <msup> <mi>t</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msup> <mo stretchy="false">(</mo> <mi>n</mi> <mo stretchy="false">)</mo> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle O(t^{2}(n))}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/278bea9f672c7c6fbd558571d3c4cc3fe1ba1e69" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:8.68ex; height:3.176ex;" alt="{\displaystyle O(t^{2}(n))}"></span>.<sup id="cite_ref-FOOTNOTESipser2006355_17-0" class="reference"><a href="#cite_note-FOOTNOTESipser2006355-17"><span class="cite-bracket">[</span>16<span class="cite-bracket">]</span></a></sup> It follows directly from this fact that <a href="/wiki/P_(complexity)" title="P (complexity)"><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathsf {\color {Blue}P}}\subset {\textsf {P/poly}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mstyle mathcolor="#2D2F92"> <mi mathvariant="sans-serif">P</mi> </mstyle> </mrow> </mrow> <mo>⊂<!-- ⊂ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mtext mathvariant="sans-serif">P/poly</mtext> </mrow> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\mathsf {\color {Blue}P}}\subset {\textsf {P/poly}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/2cbfcadba77ca929107aa0286a22cf46258da9e4" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:11.224ex; height:2.843ex;" alt="{\displaystyle {\mathsf {\color {Blue}P}}\subset {\textsf {P/poly}}}"></span></a>. In other words, any problem that can be solved in polynomial time by a deterministic Turing machine can also be solved by a polynomial-size circuit family. It is further the case that the inclusion is proper, i.e. <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\textsf {P}}\subsetneq {\textsf {P/poly}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mtext mathvariant="sans-serif">P</mtext> </mrow> </mrow> <mo>⊊<!-- ⊊ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mtext mathvariant="sans-serif">P/poly</mtext> </mrow> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\textsf {P}}\subsetneq {\textsf {P/poly}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/bf181aa8ee78e3454c4ccfb749a9e9004a422623" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:11.224ex; height:2.843ex;" alt="{\displaystyle {\textsf {P}}\subsetneq {\textsf {P/poly}}}"></span> (for example, there are some <a href="/wiki/Undecidable_problem" title="Undecidable problem">undecidable problems</a> that are in <b>P/poly</b>). </p><p><b>P/poly</b> has a number of properties that make it highly useful in the study of the relationships between complexity classes. In particular, it is helpful in investigating problems related to <a href="/wiki/P_versus_NP" class="mw-redirect" title="P versus NP"><b>P</b> versus <b>NP</b></a>. For example, if there is any language in <b>NP</b> that is not in <b>P/poly</b>, then <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathsf {P}}\neq {\mathsf {NP}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">P</mi> </mrow> </mrow> <mo>≠<!-- ≠ --></mo> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">N</mi> <mi mathvariant="sans-serif">P</mi> </mrow> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\mathsf {P}}\neq {\mathsf {NP}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/cf4d1c4bd5b96052ce46ef8d151571db700efa12" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:7.715ex; height:2.676ex;" alt="{\displaystyle {\mathsf {P}}\neq {\mathsf {NP}}}"></span>.<sup id="cite_ref-FOOTNOTEAroraBarak2009286_18-0" class="reference"><a href="#cite_note-FOOTNOTEAroraBarak2009286-18"><span class="cite-bracket">[</span>17<span class="cite-bracket">]</span></a></sup> <b>P/poly</b> is also helpful in investigating properties of the <a href="/wiki/Polynomial_hierarchy" title="Polynomial hierarchy">polynomial hierarchy</a>. For example, if <b><a href="/wiki/NP_(complexity)" title="NP (complexity)">NP</a></b> ⊆ <b>P/poly</b>, then <b>PH</b> collapses to <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \Sigma _{2}^{\mathsf {P}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msubsup> <mi mathvariant="normal">Σ<!-- Σ --></mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="sans-serif">P</mi> </mrow> </mrow> </msubsup> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \Sigma _{2}^{\mathsf {P}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/64b8cf5332c651c3d918c556b7e82251b2f3b08d" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:2.961ex; height:3.176ex;" alt="{\displaystyle \Sigma _{2}^{\mathsf {P}}}"></span>. A full description of the relations between <b>P/poly</b> and other complexity classes is available at "<a href="/wiki/P/poly#Importance_of_P/poly" title="P/poly">Importance of P/poly</a>". <b>P/poly</b> is also helpful in the general study of the properties of <a href="/wiki/Turing_machine" title="Turing machine">Turing machines</a>, as the class can be equivalently defined as the class of languages recognized by a polynomial-time Turing machine with a polynomial-bounded <a href="/wiki/Advice_(complexity)" title="Advice (complexity)">advice function</a>. </p><p>Two subclasses of <b>P/poly</b> that have interesting properties in their own right are <b><a href="/wiki/NC_(complexity)" title="NC (complexity)">NC</a></b> and <b><a href="/wiki/AC_(complexity)" title="AC (complexity)">AC</a></b>. These classes are defined not only in terms of their circuit size but also in terms of their <b>depth</b>. The depth of a circuit is the length of the longest <a href="/wiki/Directed_path" class="mw-redirect" title="Directed path">directed path</a> from an input node to the output node. The class <b>NC</b> is the set of languages that can be solved by circuit families that are restricted not only to having polynomial-size but also to having polylogarithmic depth. The class <b>AC</b> is defined similarly to <b>NC</b>, however gates are allowed to have unbounded fan-in (that is, the AND and OR gates can be applied to more than two bits). <b>NC</b> is a notable class because it can be equivalently defined as the class of languages that have efficient <a href="/wiki/Parallel_algorithm" title="Parallel algorithm">parallel algorithms</a>. </p> <div class="mw-heading mw-heading3"><h3 id="Quantum_computation">Quantum computation</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=35" title="Edit section: Quantum computation"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <style data-mw-deduplicate="TemplateStyles:r1251242444">.mw-parser-output .ambox{border:1px solid #a2a9b1;border-left:10px solid #36c;background-color:#fbfbfb;box-sizing:border-box}.mw-parser-output .ambox+link+.ambox,.mw-parser-output .ambox+link+style+.ambox,.mw-parser-output .ambox+link+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+style+.ambox,.mw-parser-output .ambox+.mw-empty-elt+link+link+.ambox{margin-top:-1px}html body.mediawiki .mw-parser-output .ambox.mbox-small-left{margin:4px 1em 4px 0;overflow:hidden;width:238px;border-collapse:collapse;font-size:88%;line-height:1.25em}.mw-parser-output .ambox-speedy{border-left:10px solid #b32424;background-color:#fee7e6}.mw-parser-output .ambox-delete{border-left:10px solid #b32424}.mw-parser-output .ambox-content{border-left:10px solid #f28500}.mw-parser-output .ambox-style{border-left:10px solid #fc3}.mw-parser-output .ambox-move{border-left:10px solid #9932cc}.mw-parser-output .ambox-protection{border-left:10px solid #a2a9b1}.mw-parser-output .ambox .mbox-text{border:none;padding:0.25em 0.5em;width:100%}.mw-parser-output .ambox .mbox-image{border:none;padding:2px 0 2px 0.5em;text-align:center}.mw-parser-output .ambox .mbox-imageright{border:none;padding:2px 0.5em 2px 0;text-align:center}.mw-parser-output .ambox .mbox-empty-cell{border:none;padding:0;width:1px}.mw-parser-output .ambox .mbox-image-div{width:52px}@media(min-width:720px){.mw-parser-output .ambox{margin:0 10%}}@media print{body.ns-0 .mw-parser-output .ambox{display:none!important}}</style><table class="box-Expand_section plainlinks metadata ambox mbox-small-left ambox-content" role="presentation"><tbody><tr><td class="mbox-image"><span typeof="mw:File"><a href="/wiki/File:Wiki_letter_w_cropped.svg" class="mw-file-description"><img alt="[icon]" src="//upload.wikimedia.org/wikipedia/commons/thumb/1/1c/Wiki_letter_w_cropped.svg/20px-Wiki_letter_w_cropped.svg.png" decoding="async" width="20" height="14" class="mw-file-element" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/1/1c/Wiki_letter_w_cropped.svg/30px-Wiki_letter_w_cropped.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/1/1c/Wiki_letter_w_cropped.svg/40px-Wiki_letter_w_cropped.svg.png 2x" data-file-width="44" data-file-height="31" /></a></span></td><td class="mbox-text"><div class="mbox-text-span">This section <b>needs expansion</b>. You can help by <a class="external text" href="https://en.wikipedia.org/w/index.php?title=Complexity_class&action=edit&section=">adding to it</a>. <span class="date-container"><i>(<span class="date">April 2017</span>)</i></span></div></td></tr></tbody></table> <p>The classes <b><a href="/wiki/BQP" title="BQP">BQP</a></b> and <b><a href="/wiki/QMA" title="QMA">QMA</a></b>, which are of key importance in <a href="/wiki/Quantum_information_science" title="Quantum information science">quantum information science</a>, are defined using <b><a href="/wiki/Quantum_Turing_machine" title="Quantum Turing machine">quantum Turing machines</a></b>. </p> <div class="mw-heading mw-heading2"><h2 id="Other_types_of_problems">Other types of problems</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=36" title="Edit section: Other types of problems"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>While most complexity classes studied by computer scientists are sets of <a href="/wiki/Decision_problem" title="Decision problem">decision problems</a>, there are also a number of complexity classes defined in terms of other types of problems. In particular, there are complexity classes consisting of <a href="/wiki/Counting_problem_(complexity)" title="Counting problem (complexity)">counting problems</a>, <a href="/wiki/Function_problem" title="Function problem">function problems</a>, and <a href="/wiki/Promise_problem" title="Promise problem">promise problems</a>. These are explained in greater detail below. </p> <div class="mw-heading mw-heading3"><h3 id="Counting_problems">Counting problems</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=37" title="Edit section: Counting problems"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1236090951"><div role="note" class="hatnote navigation-not-searchable">Main article: <a href="/wiki/Counting_problem_(complexity)" title="Counting problem (complexity)">Counting problem (complexity)</a></div> <p>A <b>counting problem</b> asks not only <i>whether</i> a solution exists (as with a <a href="/wiki/Decision_problem" title="Decision problem">decision problem</a>), but asks <i>how many</i> solutions exist.<sup id="cite_ref-FOOTNOTEFortnow1997_19-0" class="reference"><a href="#cite_note-FOOTNOTEFortnow1997-19"><span class="cite-bracket">[</span>18<span class="cite-bracket">]</span></a></sup> For example, the decision problem <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\texttt {CYCLE}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mtext mathvariant="monospace">CYCLE</mtext> </mrow> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle {\texttt {CYCLE}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/473dd0ef62a4adbe3fc044a6cf3cacdaba8aa9e2" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:6.103ex; height:2.009ex;" alt="{\displaystyle {\texttt {CYCLE}}}"></span> asks <i>whether</i> a particular graph <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle G}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>G</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle G}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f5f3c8921a3b352de45446a6789b104458c9f90b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.827ex; height:2.176ex;" alt="{\displaystyle G}"></span> has a <a href="/wiki/Simple_cycle" class="mw-redirect" title="Simple cycle">simple cycle</a> (the answer is a simple yes/no); the corresponding counting problem <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \#{\texttt {CYCLE}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi mathvariant="normal">#<!-- # --></mi> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mtext mathvariant="monospace">CYCLE</mtext> </mrow> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \#{\texttt {CYCLE}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/d133df23ab78facc9502cde973439ac2b13abad9" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:8.038ex; height:2.509ex;" alt="{\displaystyle \#{\texttt {CYCLE}}}"></span> (pronounced "sharp cycle") asks <i>how many</i> simple cycles <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle G}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>G</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle G}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f5f3c8921a3b352de45446a6789b104458c9f90b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.827ex; height:2.176ex;" alt="{\displaystyle G}"></span> has.<sup id="cite_ref-FOOTNOTEArora2003_20-0" class="reference"><a href="#cite_note-FOOTNOTEArora2003-20"><span class="cite-bracket">[</span>19<span class="cite-bracket">]</span></a></sup> The output to a counting problem is thus a number, in contrast to the output for a decision problem, which is a simple yes/no (or accept/reject, 0/1, or other equivalent scheme).<sup id="cite_ref-FOOTNOTEAroraBarak2009342_21-0" class="reference"><a href="#cite_note-FOOTNOTEAroraBarak2009342-21"><span class="cite-bracket">[</span>20<span class="cite-bracket">]</span></a></sup> </p><p>Thus, whereas decision problems are represented mathematically as <a href="/wiki/Formal_language" title="Formal language">formal languages</a>, counting problems are represented mathematically as <a href="/wiki/Function_(mathematics)" title="Function (mathematics)">functions</a>: a counting problem is formalized as the function <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f:\{0,1\}^{*}\to \mathbb {N} }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>f</mi> <mo>:</mo> <mo fence="false" stretchy="false">{</mo> <mn>0</mn> <mo>,</mo> <mn>1</mn> <msup> <mo fence="false" stretchy="false">}</mo> <mrow class="MJX-TeXAtom-ORD"> <mo>∗<!-- ∗ --></mo> </mrow> </msup> <mo stretchy="false">→<!-- → --></mo> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="double-struck">N</mi> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle f:\{0,1\}^{*}\to \mathbb {N} }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/96d0b24aea005eb2faad4e0c254c420d9783fe02" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:15.246ex; height:2.843ex;" alt="{\displaystyle f:\{0,1\}^{*}\to \mathbb {N} }"></span> such that for every input <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle w\in \{0,1\}^{*}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>w</mi> <mo>∈<!-- ∈ --></mo> <mo fence="false" stretchy="false">{</mo> <mn>0</mn> <mo>,</mo> <mn>1</mn> <msup> <mo fence="false" stretchy="false">}</mo> <mrow class="MJX-TeXAtom-ORD"> <mo>∗<!-- ∗ --></mo> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle w\in \{0,1\}^{*}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/6d5d657c831519a1023a467dd89af3db0bff411a" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:11.243ex; height:2.843ex;" alt="{\displaystyle w\in \{0,1\}^{*}}"></span>, <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f(w)}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>f</mi> <mo stretchy="false">(</mo> <mi>w</mi> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle f(w)}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/6312ac96632caa8e075c33e027c310e501477135" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:4.752ex; height:2.843ex;" alt="{\displaystyle f(w)}"></span> is the number of solutions. For example, in the <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \#{\texttt {CYCLE}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi mathvariant="normal">#<!-- # --></mi> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mtext mathvariant="monospace">CYCLE</mtext> </mrow> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \#{\texttt {CYCLE}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/d133df23ab78facc9502cde973439ac2b13abad9" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:8.038ex; height:2.509ex;" alt="{\displaystyle \#{\texttt {CYCLE}}}"></span> problem, the input is a graph <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle G\in \{0,1\}^{*}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>G</mi> <mo>∈<!-- ∈ --></mo> <mo fence="false" stretchy="false">{</mo> <mn>0</mn> <mo>,</mo> <mn>1</mn> <msup> <mo fence="false" stretchy="false">}</mo> <mrow class="MJX-TeXAtom-ORD"> <mo>∗<!-- ∗ --></mo> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle G\in \{0,1\}^{*}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/118b1a158074ef76280484c6df67b84f22da46d3" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:11.405ex; height:2.843ex;" alt="{\displaystyle G\in \{0,1\}^{*}}"></span> (a graph represented as a string of <a href="/wiki/Bit" title="Bit">bits</a>) and <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f(G)}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>f</mi> <mo stretchy="false">(</mo> <mi>G</mi> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle f(G)}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/95f882728617aebf146f0e652c3ce5d62acc5368" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:4.915ex; height:2.843ex;" alt="{\displaystyle f(G)}"></span> is the number of simple cycles in <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle G}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>G</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle G}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f5f3c8921a3b352de45446a6789b104458c9f90b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.827ex; height:2.176ex;" alt="{\displaystyle G}"></span>. </p><p>Counting problems arise in a number of fields, including <a href="/wiki/Statistical_estimation" class="mw-redirect" title="Statistical estimation">statistical estimation</a>, <a href="/wiki/Statistical_physics" class="mw-redirect" title="Statistical physics">statistical physics</a>, <a href="/wiki/Network_design" class="mw-redirect" title="Network design">network design</a>, and <a href="/wiki/Economics" title="Economics">economics</a>.<sup id="cite_ref-FOOTNOTEAroraBarak2009341–342_22-0" class="reference"><a href="#cite_note-FOOTNOTEAroraBarak2009341–342-22"><span class="cite-bracket">[</span>21<span class="cite-bracket">]</span></a></sup> </p> <div class="mw-heading mw-heading4"><h4 id="Important_complexity_classes_4">Important complexity classes</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=38" title="Edit section: Important complexity classes"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1236090951"><div role="note" class="hatnote navigation-not-searchable">Main article: <a href="/wiki/%E2%99%AFP" title="♯P">♯P</a></div> <p><b>#P</b> (pronounced "sharp P") is an important class of counting problems that can be thought of as the counting version of <b>NP</b>.<sup id="cite_ref-FOOTNOTEBarak2006_23-0" class="reference"><a href="#cite_note-FOOTNOTEBarak2006-23"><span class="cite-bracket">[</span>22<span class="cite-bracket">]</span></a></sup> The connection to <b>NP</b> arises from the fact that the number of solutions to a problem equals the number of accepting branches in a <a href="/wiki/Nondeterministic_Turing_machine" title="Nondeterministic Turing machine">nondeterministic Turing machine</a>'s computation tree. <b>#P</b> is thus formally defined as follows: </p> <dl><dd><b>#P</b> is the set of all functions <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f:\{0,1\}^{*}\to \mathbb {N} }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>f</mi> <mo>:</mo> <mo fence="false" stretchy="false">{</mo> <mn>0</mn> <mo>,</mo> <mn>1</mn> <msup> <mo fence="false" stretchy="false">}</mo> <mrow class="MJX-TeXAtom-ORD"> <mo>∗<!-- ∗ --></mo> </mrow> </msup> <mo stretchy="false">→<!-- → --></mo> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="double-struck">N</mi> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle f:\{0,1\}^{*}\to \mathbb {N} }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/96d0b24aea005eb2faad4e0c254c420d9783fe02" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:15.246ex; height:2.843ex;" alt="{\displaystyle f:\{0,1\}^{*}\to \mathbb {N} }"></span> such that there is a polynomial time nondeterministic Turing machine <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle M}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>M</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle M}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f82cade9898ced02fdd08712e5f0c0151758a0dd" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.442ex; height:2.176ex;" alt="{\displaystyle M}"></span> such that for all <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle w\in \{0,1\}^{*}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>w</mi> <mo>∈<!-- ∈ --></mo> <mo fence="false" stretchy="false">{</mo> <mn>0</mn> <mo>,</mo> <mn>1</mn> <msup> <mo fence="false" stretchy="false">}</mo> <mrow class="MJX-TeXAtom-ORD"> <mo>∗<!-- ∗ --></mo> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle w\in \{0,1\}^{*}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/6d5d657c831519a1023a467dd89af3db0bff411a" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:11.243ex; height:2.843ex;" alt="{\displaystyle w\in \{0,1\}^{*}}"></span>, <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f(w)}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>f</mi> <mo stretchy="false">(</mo> <mi>w</mi> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle f(w)}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/6312ac96632caa8e075c33e027c310e501477135" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:4.752ex; height:2.843ex;" alt="{\displaystyle f(w)}"></span> equals the number of accepting branches in <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle M}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>M</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle M}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f82cade9898ced02fdd08712e5f0c0151758a0dd" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.442ex; height:2.176ex;" alt="{\displaystyle M}"></span>'s computation tree on <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle w}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>w</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle w}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/88b1e0c8e1be5ebe69d18a8010676fa42d7961e6" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.664ex; height:1.676ex;" alt="{\displaystyle w}"></span>.<sup id="cite_ref-FOOTNOTEBarak2006_23-1" class="reference"><a href="#cite_note-FOOTNOTEBarak2006-23"><span class="cite-bracket">[</span>22<span class="cite-bracket">]</span></a></sup></dd></dl> <p>And just as <b>NP</b> can be defined both in terms of nondeterminism and in terms of a verifier (i.e. as an <a href="/wiki/Interactive_proof_system" title="Interactive proof system">interactive proof system</a>), so too can <b>#P</b> be equivalently defined in terms of a verifier. Recall that a decision problem is in <b>NP</b> if there exists a polynomial-time checkable <a href="/wiki/Certificate_(complexity)" title="Certificate (complexity)">certificate</a> to a given problem instance—that is, <b>NP</b> asks whether there exists a proof of membership (a certificate) for the input that can be checked for correctness in polynomial time. The class <b>#P</b> asks <i>how many</i> such certificates exist.<sup id="cite_ref-FOOTNOTEBarak2006_23-2" class="reference"><a href="#cite_note-FOOTNOTEBarak2006-23"><span class="cite-bracket">[</span>22<span class="cite-bracket">]</span></a></sup> In this context, <b>#P</b> is defined as follows: </p> <dl><dd><b>#P</b> is the set of functions <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f:\{0,1\}^{*}\to \mathbb {N} }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>f</mi> <mo>:</mo> <mo fence="false" stretchy="false">{</mo> <mn>0</mn> <mo>,</mo> <mn>1</mn> <msup> <mo fence="false" stretchy="false">}</mo> <mrow class="MJX-TeXAtom-ORD"> <mo>∗<!-- ∗ --></mo> </mrow> </msup> <mo stretchy="false">→<!-- → --></mo> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="double-struck">N</mi> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle f:\{0,1\}^{*}\to \mathbb {N} }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/96d0b24aea005eb2faad4e0c254c420d9783fe02" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:15.246ex; height:2.843ex;" alt="{\displaystyle f:\{0,1\}^{*}\to \mathbb {N} }"></span> such that there exists a polynomial <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle p:\mathbb {N} \to \mathbb {N} }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>p</mi> <mo>:</mo> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="double-struck">N</mi> </mrow> <mo stretchy="false">→<!-- → --></mo> <mrow class="MJX-TeXAtom-ORD"> <mi mathvariant="double-struck">N</mi> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle p:\mathbb {N} \to \mathbb {N} }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/1e0a38728583c9962c38cd5888a3ef10d2aacf6f" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; margin-left: -0.089ex; width:10.166ex; height:2.509ex;" alt="{\displaystyle p:\mathbb {N} \to \mathbb {N} }"></span> and a polynomial-time Turing machine <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle V}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>V</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle V}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/af0f6064540e84211d0ffe4dac72098adfa52845" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.787ex; height:2.176ex;" alt="{\displaystyle V}"></span> (the verifier), such that for every <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle w\in \{0,1\}^{*}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>w</mi> <mo>∈<!-- ∈ --></mo> <mo fence="false" stretchy="false">{</mo> <mn>0</mn> <mo>,</mo> <mn>1</mn> <msup> <mo fence="false" stretchy="false">}</mo> <mrow class="MJX-TeXAtom-ORD"> <mo>∗<!-- ∗ --></mo> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle w\in \{0,1\}^{*}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/6d5d657c831519a1023a467dd89af3db0bff411a" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:11.243ex; height:2.843ex;" alt="{\displaystyle w\in \{0,1\}^{*}}"></span>, <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f(w)={\Big |}{\big \{}c\in \{0,1\}^{p(|w|)}:V(w,c)=1{\big \}}{\Big |}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>f</mi> <mo stretchy="false">(</mo> <mi>w</mi> <mo stretchy="false">)</mo> <mo>=</mo> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mo maxsize="1.623em" minsize="1.623em">|</mo> </mrow> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mo maxsize="1.2em" minsize="1.2em">{</mo> </mrow> </mrow> <mi>c</mi> <mo>∈<!-- ∈ --></mo> <mo fence="false" stretchy="false">{</mo> <mn>0</mn> <mo>,</mo> <mn>1</mn> <msup> <mo fence="false" stretchy="false">}</mo> <mrow class="MJX-TeXAtom-ORD"> <mi>p</mi> <mo stretchy="false">(</mo> <mrow class="MJX-TeXAtom-ORD"> <mo stretchy="false">|</mo> </mrow> <mi>w</mi> <mrow class="MJX-TeXAtom-ORD"> <mo stretchy="false">|</mo> </mrow> <mo stretchy="false">)</mo> </mrow> </msup> <mo>:</mo> <mi>V</mi> <mo stretchy="false">(</mo> <mi>w</mi> <mo>,</mo> <mi>c</mi> <mo stretchy="false">)</mo> <mo>=</mo> <mn>1</mn> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mo maxsize="1.2em" minsize="1.2em">}</mo> </mrow> </mrow> <mrow class="MJX-TeXAtom-ORD"> <mrow class="MJX-TeXAtom-ORD"> <mo maxsize="1.623em" minsize="1.623em">|</mo> </mrow> </mrow> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle f(w)={\Big |}{\big \{}c\in \{0,1\}^{p(|w|)}:V(w,c)=1{\big \}}{\Big |}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/06da67fdb1b610efe6700c12d89475d8080948a0" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.505ex; width:39.315ex; height:4.176ex;" alt="{\displaystyle f(w)={\Big |}{\big \{}c\in \{0,1\}^{p(|w|)}:V(w,c)=1{\big \}}{\Big |}}"></span>.<sup id="cite_ref-FOOTNOTEAroraBarak2009344_24-0" class="reference"><a href="#cite_note-FOOTNOTEAroraBarak2009344-24"><span class="cite-bracket">[</span>23<span class="cite-bracket">]</span></a></sup> In other words, <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f(w)}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>f</mi> <mo stretchy="false">(</mo> <mi>w</mi> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle f(w)}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/6312ac96632caa8e075c33e027c310e501477135" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:4.752ex; height:2.843ex;" alt="{\displaystyle f(w)}"></span> equals the size of the set containing all of the polynomial-size certificates for <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle w}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>w</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle w}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/88b1e0c8e1be5ebe69d18a8010676fa42d7961e6" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.664ex; height:1.676ex;" alt="{\displaystyle w}"></span>.</dd></dl> <div class="mw-heading mw-heading3"><h3 id="Function_problems">Function problems</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=39" title="Edit section: Function problems"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1236090951"><div role="note" class="hatnote navigation-not-searchable">Main article: <a href="/wiki/Function_problem" title="Function problem">Function problem</a></div> <p>Counting problems are a subset of a broader class of problems called <b>function problems</b>. A function problem is a type of problem in which the values of a <a href="/wiki/Function_(mathematics)" title="Function (mathematics)">function</a> <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f:A\to B}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>f</mi> <mo>:</mo> <mi>A</mi> <mo stretchy="false">→<!-- → --></mo> <mi>B</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle f:A\to B}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/20040a52d9391f2fe271f0aaa300bf7887a0c7b1" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:10.337ex; height:2.509ex;" alt="{\displaystyle f:A\to B}"></span> are computed. Formally, a function problem <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>f</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle f}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/132e57acb643253e7810ee9702d9581f159a1c61" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:1.279ex; height:2.509ex;" alt="{\displaystyle f}"></span> is defined as a relation <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle R}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>R</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle R}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/4b0bfb3769bf24d80e15374dc37b0441e2616e33" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.764ex; height:2.176ex;" alt="{\displaystyle R}"></span> over strings of an arbitrary <a href="/wiki/Alphabet_(formal_languages)" title="Alphabet (formal languages)">alphabet</a> <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \Sigma }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi mathvariant="normal">Σ<!-- Σ --></mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \Sigma }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/9e1f558f53cda207614abdf90162266c70bc5c1e" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.678ex; height:2.176ex;" alt="{\displaystyle \Sigma }"></span>: </p> <dl><dd><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle R\subseteq \Sigma ^{*}\times \Sigma ^{*}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>R</mi> <mo>⊆<!-- ⊆ --></mo> <msup> <mi mathvariant="normal">Σ<!-- Σ --></mi> <mrow class="MJX-TeXAtom-ORD"> <mo>∗<!-- ∗ --></mo> </mrow> </msup> <mo>×<!-- × --></mo> <msup> <mi mathvariant="normal">Σ<!-- Σ --></mi> <mrow class="MJX-TeXAtom-ORD"> <mo>∗<!-- ∗ --></mo> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle R\subseteq \Sigma ^{*}\times \Sigma ^{*}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/a53c83357aa1c3631c415182a64259fc01b180e5" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.505ex; width:13.167ex; height:2.509ex;" alt="{\displaystyle R\subseteq \Sigma ^{*}\times \Sigma ^{*}}"></span></dd></dl> <p>An algorithm solves <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>f</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle f}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/132e57acb643253e7810ee9702d9581f159a1c61" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:1.279ex; height:2.509ex;" alt="{\displaystyle f}"></span> if for every input <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle x}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>x</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle x}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/87f9e315fd7e2ba406057a97300593c4802b53e4" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.33ex; height:1.676ex;" alt="{\displaystyle x}"></span> such that there exists a <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle y}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>y</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle y}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/b8a6208ec717213d4317e666f1ae872e00620a0d" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:1.155ex; height:2.009ex;" alt="{\displaystyle y}"></span> satisfying <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle (x,y)\in R}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mo stretchy="false">(</mo> <mi>x</mi> <mo>,</mo> <mi>y</mi> <mo stretchy="false">)</mo> <mo>∈<!-- ∈ --></mo> <mi>R</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle (x,y)\in R}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/564266a1c3efe90b1974df60a445161fdf58f14e" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:9.933ex; height:2.843ex;" alt="{\displaystyle (x,y)\in R}"></span>, the algorithm produces one such <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle y}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>y</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle y}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/b8a6208ec717213d4317e666f1ae872e00620a0d" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:1.155ex; height:2.009ex;" alt="{\displaystyle y}"></span>. This is just another way of saying that <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>f</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle f}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/132e57acb643253e7810ee9702d9581f159a1c61" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:1.279ex; height:2.509ex;" alt="{\displaystyle f}"></span> is a <a href="/wiki/Function_(mathematics)" title="Function (mathematics)">function</a> and the algorithm solves <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f(x)}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>f</mi> <mo stretchy="false">(</mo> <mi>x</mi> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle f(x)}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/202945cce41ecebb6f643f31d119c514bec7a074" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:4.418ex; height:2.843ex;" alt="{\displaystyle f(x)}"></span> for all <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle x\in \Sigma ^{*}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>x</mi> <mo>∈<!-- ∈ --></mo> <msup> <mi mathvariant="normal">Σ<!-- Σ --></mi> <mrow class="MJX-TeXAtom-ORD"> <mo>∗<!-- ∗ --></mo> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle x\in \Sigma ^{*}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/075eb8da700827174d5f09fa9064d4d3542397f3" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:6.903ex; height:2.343ex;" alt="{\displaystyle x\in \Sigma ^{*}}"></span>. </p> <div class="mw-heading mw-heading4"><h4 id="Important_complexity_classes_5">Important complexity classes</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=40" title="Edit section: Important complexity classes"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>An important function complexity class is <b><a href="/wiki/FP_(complexity)" title="FP (complexity)">FP</a></b>, the class of efficiently solvable functions.<sup id="cite_ref-FOOTNOTEAroraBarak2009344_24-1" class="reference"><a href="#cite_note-FOOTNOTEAroraBarak2009344-24"><span class="cite-bracket">[</span>23<span class="cite-bracket">]</span></a></sup> More specifically, <b>FP</b> is the set of function problems that can be solved by a <a href="/wiki/Deterministic_Turing_machine" class="mw-redirect" title="Deterministic Turing machine">deterministic Turing machine</a> in <a href="/wiki/Polynomial_time" class="mw-redirect" title="Polynomial time">polynomial time</a>.<sup id="cite_ref-FOOTNOTEAroraBarak2009344_24-2" class="reference"><a href="#cite_note-FOOTNOTEAroraBarak2009344-24"><span class="cite-bracket">[</span>23<span class="cite-bracket">]</span></a></sup> <b>FP</b> can be thought of as the function problem equivalent of <b><a href="/wiki/P_(complexity)" title="P (complexity)">P</a></b>. Importantly, <b>FP</b> provides some insight into both counting problems and <a href="/wiki/P_versus_NP" class="mw-redirect" title="P versus NP"><b>P</b> versus <b>NP</b></a>. If <b>#P</b>=<b>FP</b>, then the functions that determine the number of certificates for problems in <b>NP</b> are efficiently solvable. And since computing the number of certificates is at least as hard as determining whether a certificate exists, it must follow that if <b>#P</b>=<b>FP</b> then <b>P</b>=<b>NP</b> (it is not known whether this holds in the reverse, i.e. whether <b>P</b>=<b>NP</b> implies <b>#P</b>=<b>FP</b>).<sup id="cite_ref-FOOTNOTEAroraBarak2009344_24-3" class="reference"><a href="#cite_note-FOOTNOTEAroraBarak2009344-24"><span class="cite-bracket">[</span>23<span class="cite-bracket">]</span></a></sup> </p><p>Just as <b>FP</b> is the function problem equivalent of <b>P</b>, <b><a href="/wiki/FNP_(complexity)" title="FNP (complexity)">FNP</a></b> is the function problem equivalent of <b><a href="/wiki/NP_(complexity)" title="NP (complexity)">NP</a></b>. Importantly, <b>FP</b>=<b>FNP</b> if and only if <b>P</b>=<b>NP</b>.<sup id="cite_ref-FOOTNOTERich2008689_(510_in_provided_PDF)_25-0" class="reference"><a href="#cite_note-FOOTNOTERich2008689_(510_in_provided_PDF)-25"><span class="cite-bracket">[</span>24<span class="cite-bracket">]</span></a></sup> </p> <div class="mw-heading mw-heading3"><h3 id="Promise_problems">Promise problems</h3><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=41" title="Edit section: Promise problems"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1236090951"><div role="note" class="hatnote navigation-not-searchable">Main article: <a href="/wiki/Promise_problem" title="Promise problem">Promise problem</a></div> <p><b>Promise problems</b> are a generalization of decision problems in which the input to a problem is guaranteed ("promised") to be from a particular subset of all possible inputs. Recall that with a decision problem <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle L\subseteq \{0,1\}^{*}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>L</mi> <mo>⊆<!-- ⊆ --></mo> <mo fence="false" stretchy="false">{</mo> <mn>0</mn> <mo>,</mo> <mn>1</mn> <msup> <mo fence="false" stretchy="false">}</mo> <mrow class="MJX-TeXAtom-ORD"> <mo>∗<!-- ∗ --></mo> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle L\subseteq \{0,1\}^{*}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/0981d8423f486f70f38681329b13d12381127872" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:11.419ex; height:2.843ex;" alt="{\displaystyle L\subseteq \{0,1\}^{*}}"></span>, an algorithm <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle M}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>M</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle M}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f82cade9898ced02fdd08712e5f0c0151758a0dd" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.442ex; height:2.176ex;" alt="{\displaystyle M}"></span> for <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle L}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>L</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle L}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/103168b86f781fe6e9a4a87b8ea1cebe0ad4ede8" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.583ex; height:2.176ex;" alt="{\displaystyle L}"></span> must act (correctly) on <i>every</i> <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle w\in \{0,1\}^{*}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>w</mi> <mo>∈<!-- ∈ --></mo> <mo fence="false" stretchy="false">{</mo> <mn>0</mn> <mo>,</mo> <mn>1</mn> <msup> <mo fence="false" stretchy="false">}</mo> <mrow class="MJX-TeXAtom-ORD"> <mo>∗<!-- ∗ --></mo> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle w\in \{0,1\}^{*}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/6d5d657c831519a1023a467dd89af3db0bff411a" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:11.243ex; height:2.843ex;" alt="{\displaystyle w\in \{0,1\}^{*}}"></span>. A promise problem loosens the input requirement on <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle M}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>M</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle M}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f82cade9898ced02fdd08712e5f0c0151758a0dd" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.442ex; height:2.176ex;" alt="{\displaystyle M}"></span> by restricting the input to some subset of <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \{0,1\}^{*}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mo fence="false" stretchy="false">{</mo> <mn>0</mn> <mo>,</mo> <mn>1</mn> <msup> <mo fence="false" stretchy="false">}</mo> <mrow class="MJX-TeXAtom-ORD"> <mo>∗<!-- ∗ --></mo> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \{0,1\}^{*}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/7c3eac9e230a7c68b89e70dd4ed545a3b2a80b1b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:6.738ex; height:2.843ex;" alt="{\displaystyle \{0,1\}^{*}}"></span>. </p><p>Specifically, a promise problem is defined as a pair of non-intersecting sets <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle (\Pi _{\text{ACCEPT}},\Pi _{\text{REJECT}})}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mo stretchy="false">(</mo> <msub> <mi mathvariant="normal">Π<!-- Π --></mi> <mrow class="MJX-TeXAtom-ORD"> <mtext>ACCEPT</mtext> </mrow> </msub> <mo>,</mo> <msub> <mi mathvariant="normal">Π<!-- Π --></mi> <mrow class="MJX-TeXAtom-ORD"> <mtext>REJECT</mtext> </mrow> </msub> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle (\Pi _{\text{ACCEPT}},\Pi _{\text{REJECT}})}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/3403ab9984e464c62e30629c8e9bb5931bb05d8b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:20.491ex; height:2.843ex;" alt="{\displaystyle (\Pi _{\text{ACCEPT}},\Pi _{\text{REJECT}})}"></span>, where:<sup id="cite_ref-FOOTNOTEWatrous20061_26-0" class="reference"><a href="#cite_note-FOOTNOTEWatrous20061-26"><span class="cite-bracket">[</span>25<span class="cite-bracket">]</span></a></sup> </p> <ul><li><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \Pi _{\text{ACCEPT}}\subseteq \{0,1\}^{*}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi mathvariant="normal">Π<!-- Π --></mi> <mrow class="MJX-TeXAtom-ORD"> <mtext>ACCEPT</mtext> </mrow> </msub> <mo>⊆<!-- ⊆ --></mo> <mo fence="false" stretchy="false">{</mo> <mn>0</mn> <mo>,</mo> <mn>1</mn> <msup> <mo fence="false" stretchy="false">}</mo> <mrow class="MJX-TeXAtom-ORD"> <mo>∗<!-- ∗ --></mo> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \Pi _{\text{ACCEPT}}\subseteq \{0,1\}^{*}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/46e2ad837f6ee0bcfd19649edc5c6d4ce952a48b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:18.843ex; height:2.843ex;" alt="{\displaystyle \Pi _{\text{ACCEPT}}\subseteq \{0,1\}^{*}}"></span> is the set of all inputs that are accepted.</li> <li><span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \Pi _{\text{REJECT}}\subseteq \{0,1\}^{*}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi mathvariant="normal">Π<!-- Π --></mi> <mrow class="MJX-TeXAtom-ORD"> <mtext>REJECT</mtext> </mrow> </msub> <mo>⊆<!-- ⊆ --></mo> <mo fence="false" stretchy="false">{</mo> <mn>0</mn> <mo>,</mo> <mn>1</mn> <msup> <mo fence="false" stretchy="false">}</mo> <mrow class="MJX-TeXAtom-ORD"> <mo>∗<!-- ∗ --></mo> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \Pi _{\text{REJECT}}\subseteq \{0,1\}^{*}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/aefb01c56cf7629e7828d433a4f9e1b691b192e2" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:18.478ex; height:2.843ex;" alt="{\displaystyle \Pi _{\text{REJECT}}\subseteq \{0,1\}^{*}}"></span> is the set of all inputs that are rejected.</li></ul> <p>The input to an algorithm <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle M}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>M</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle M}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f82cade9898ced02fdd08712e5f0c0151758a0dd" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.442ex; height:2.176ex;" alt="{\displaystyle M}"></span> for a promise problem <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle (\Pi _{\text{ACCEPT}},\Pi _{\text{REJECT}})}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mo stretchy="false">(</mo> <msub> <mi mathvariant="normal">Π<!-- Π --></mi> <mrow class="MJX-TeXAtom-ORD"> <mtext>ACCEPT</mtext> </mrow> </msub> <mo>,</mo> <msub> <mi mathvariant="normal">Π<!-- Π --></mi> <mrow class="MJX-TeXAtom-ORD"> <mtext>REJECT</mtext> </mrow> </msub> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle (\Pi _{\text{ACCEPT}},\Pi _{\text{REJECT}})}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/3403ab9984e464c62e30629c8e9bb5931bb05d8b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:20.491ex; height:2.843ex;" alt="{\displaystyle (\Pi _{\text{ACCEPT}},\Pi _{\text{REJECT}})}"></span> is thus <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \Pi _{\text{ACCEPT}}\cup \Pi _{\text{REJECT}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi mathvariant="normal">Π<!-- Π --></mi> <mrow class="MJX-TeXAtom-ORD"> <mtext>ACCEPT</mtext> </mrow> </msub> <mo>∪<!-- ∪ --></mo> <msub> <mi mathvariant="normal">Π<!-- Π --></mi> <mrow class="MJX-TeXAtom-ORD"> <mtext>REJECT</mtext> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \Pi _{\text{ACCEPT}}\cup \Pi _{\text{REJECT}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/1781c836d2b5cf6507e2b9ef7f47b4d3160c9cdc" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:20.23ex; height:2.509ex;" alt="{\displaystyle \Pi _{\text{ACCEPT}}\cup \Pi _{\text{REJECT}}}"></span>, which is called the <b>promise</b>. Strings in <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \Pi _{\text{ACCEPT}}\cup \Pi _{\text{REJECT}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi mathvariant="normal">Π<!-- Π --></mi> <mrow class="MJX-TeXAtom-ORD"> <mtext>ACCEPT</mtext> </mrow> </msub> <mo>∪<!-- ∪ --></mo> <msub> <mi mathvariant="normal">Π<!-- Π --></mi> <mrow class="MJX-TeXAtom-ORD"> <mtext>REJECT</mtext> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \Pi _{\text{ACCEPT}}\cup \Pi _{\text{REJECT}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/1781c836d2b5cf6507e2b9ef7f47b4d3160c9cdc" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:20.23ex; height:2.509ex;" alt="{\displaystyle \Pi _{\text{ACCEPT}}\cup \Pi _{\text{REJECT}}}"></span> are said to <i>satisfy the promise</i>.<sup id="cite_ref-FOOTNOTEWatrous20061_26-1" class="reference"><a href="#cite_note-FOOTNOTEWatrous20061-26"><span class="cite-bracket">[</span>25<span class="cite-bracket">]</span></a></sup> By definition, <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \Pi _{\text{ACCEPT}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi mathvariant="normal">Π<!-- Π --></mi> <mrow class="MJX-TeXAtom-ORD"> <mtext>ACCEPT</mtext> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \Pi _{\text{ACCEPT}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/3572e004391ab7fdf9b1c6b2c4749c3a834cb6ba" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:9.006ex; height:2.509ex;" alt="{\displaystyle \Pi _{\text{ACCEPT}}}"></span> and <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \Pi _{\text{REJECT}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi mathvariant="normal">Π<!-- Π --></mi> <mrow class="MJX-TeXAtom-ORD"> <mtext>REJECT</mtext> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \Pi _{\text{REJECT}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/bab03b12afb3b0c5677c698e8e1c894e4da79d2b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:8.642ex; height:2.509ex;" alt="{\displaystyle \Pi _{\text{REJECT}}}"></span> must be disjoint, i.e. <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \Pi _{\text{ACCEPT}}\cap \Pi _{\text{REJECT}}=\emptyset }"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi mathvariant="normal">Π<!-- Π --></mi> <mrow class="MJX-TeXAtom-ORD"> <mtext>ACCEPT</mtext> </mrow> </msub> <mo>∩<!-- ∩ --></mo> <msub> <mi mathvariant="normal">Π<!-- Π --></mi> <mrow class="MJX-TeXAtom-ORD"> <mtext>REJECT</mtext> </mrow> </msub> <mo>=</mo> <mi mathvariant="normal">∅<!-- ∅ --></mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \Pi _{\text{ACCEPT}}\cap \Pi _{\text{REJECT}}=\emptyset }</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/9fec9eba5dddb6ef53c1ea28d0042b27e9f6f51a" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:24.491ex; height:2.676ex;" alt="{\displaystyle \Pi _{\text{ACCEPT}}\cap \Pi _{\text{REJECT}}=\emptyset }"></span>. </p><p>Within this formulation, it can be seen that decision problems are just the subset of promise problems with the trivial promise <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \Pi _{\text{ACCEPT}}\cup \Pi _{\text{REJECT}}=\{0,1\}^{*}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi mathvariant="normal">Π<!-- Π --></mi> <mrow class="MJX-TeXAtom-ORD"> <mtext>ACCEPT</mtext> </mrow> </msub> <mo>∪<!-- ∪ --></mo> <msub> <mi mathvariant="normal">Π<!-- Π --></mi> <mrow class="MJX-TeXAtom-ORD"> <mtext>REJECT</mtext> </mrow> </msub> <mo>=</mo> <mo fence="false" stretchy="false">{</mo> <mn>0</mn> <mo>,</mo> <mn>1</mn> <msup> <mo fence="false" stretchy="false">}</mo> <mrow class="MJX-TeXAtom-ORD"> <mo>∗<!-- ∗ --></mo> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \Pi _{\text{ACCEPT}}\cup \Pi _{\text{REJECT}}=\{0,1\}^{*}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/cbc419a71de1d4fd623fbac8f9de3d79028bda65" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:30.067ex; height:2.843ex;" alt="{\displaystyle \Pi _{\text{ACCEPT}}\cup \Pi _{\text{REJECT}}=\{0,1\}^{*}}"></span>. With decision problems it is thus simpler to simply define the problem as only <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \Pi _{\text{ACCEPT}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi mathvariant="normal">Π<!-- Π --></mi> <mrow class="MJX-TeXAtom-ORD"> <mtext>ACCEPT</mtext> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \Pi _{\text{ACCEPT}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/3572e004391ab7fdf9b1c6b2c4749c3a834cb6ba" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:9.006ex; height:2.509ex;" alt="{\displaystyle \Pi _{\text{ACCEPT}}}"></span> (with <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \Pi _{\text{REJECT}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi mathvariant="normal">Π<!-- Π --></mi> <mrow class="MJX-TeXAtom-ORD"> <mtext>REJECT</mtext> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \Pi _{\text{REJECT}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/bab03b12afb3b0c5677c698e8e1c894e4da79d2b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:8.642ex; height:2.509ex;" alt="{\displaystyle \Pi _{\text{REJECT}}}"></span> implicitly being <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \{0,1\}^{*}/\Pi _{\text{ACCEPT}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mo fence="false" stretchy="false">{</mo> <mn>0</mn> <mo>,</mo> <mn>1</mn> <msup> <mo fence="false" stretchy="false">}</mo> <mrow class="MJX-TeXAtom-ORD"> <mo>∗<!-- ∗ --></mo> </mrow> </msup> <mrow class="MJX-TeXAtom-ORD"> <mo>/</mo> </mrow> <msub> <mi mathvariant="normal">Π<!-- Π --></mi> <mrow class="MJX-TeXAtom-ORD"> <mtext>ACCEPT</mtext> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \{0,1\}^{*}/\Pi _{\text{ACCEPT}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/36a8ed0864d2c06a12ddd95503ee8119c78d3e04" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:16.907ex; height:2.843ex;" alt="{\displaystyle \{0,1\}^{*}/\Pi _{\text{ACCEPT}}}"></span>), which throughout this page is denoted <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle L}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>L</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle L}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/103168b86f781fe6e9a4a87b8ea1cebe0ad4ede8" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.583ex; height:2.176ex;" alt="{\displaystyle L}"></span> to emphasize that <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \Pi _{\text{ACCEPT}}=L}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi mathvariant="normal">Π<!-- Π --></mi> <mrow class="MJX-TeXAtom-ORD"> <mtext>ACCEPT</mtext> </mrow> </msub> <mo>=</mo> <mi>L</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \Pi _{\text{ACCEPT}}=L}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/d4630b86b2c7745aa7c9e8acc723a88f0e3d5f1a" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:13.687ex; height:2.509ex;" alt="{\displaystyle \Pi _{\text{ACCEPT}}=L}"></span> is a <a href="/wiki/Formal_language" title="Formal language">formal language</a>. </p><p>Promise problems make for a more natural formulation of many computational problems. For instance, a computational problem could be something like "given a <a href="/wiki/Planar_graph" title="Planar graph">planar graph</a>, determine whether or not..."<sup id="cite_ref-FOOTNOTEGoldreich2006255_(2–3_in_provided_pdf)_27-0" class="reference"><a href="#cite_note-FOOTNOTEGoldreich2006255_(2–3_in_provided_pdf)-27"><span class="cite-bracket">[</span>26<span class="cite-bracket">]</span></a></sup> This is often stated as a decision problem, where it is assumed that there is some translation schema that takes <i>every</i> string <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle s\in \{0,1\}^{*}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>s</mi> <mo>∈<!-- ∈ --></mo> <mo fence="false" stretchy="false">{</mo> <mn>0</mn> <mo>,</mo> <mn>1</mn> <msup> <mo fence="false" stretchy="false">}</mo> <mrow class="MJX-TeXAtom-ORD"> <mo>∗<!-- ∗ --></mo> </mrow> </msup> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle s\in \{0,1\}^{*}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/187ec0e290b51cb618cc063a13c0bf72c625ea21" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:10.669ex; height:2.843ex;" alt="{\displaystyle s\in \{0,1\}^{*}}"></span> to a planar graph. However, it is more straightforward to define this as a promise problem in which the input is promised to be a planar graph. </p> <div class="mw-heading mw-heading4"><h4 id="Relation_to_complexity_classes">Relation to complexity classes</h4><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=42" title="Edit section: Relation to complexity classes"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>Promise problems provide an alternate definition for standard complexity classes of decision problems. <b>P</b>, for instance, can be defined as a promise problem:<sup id="cite_ref-FOOTNOTEGoldreich2006257_(4_in_provided_pdf)_28-0" class="reference"><a href="#cite_note-FOOTNOTEGoldreich2006257_(4_in_provided_pdf)-28"><span class="cite-bracket">[</span>27<span class="cite-bracket">]</span></a></sup> </p> <dl><dd><b>P</b> is the class of promise problems that are solvable in deterministic polynomial time. That is, the promise problem <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle (\Pi _{\text{ACCEPT}},\Pi _{\text{REJECT}})}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mo stretchy="false">(</mo> <msub> <mi mathvariant="normal">Π<!-- Π --></mi> <mrow class="MJX-TeXAtom-ORD"> <mtext>ACCEPT</mtext> </mrow> </msub> <mo>,</mo> <msub> <mi mathvariant="normal">Π<!-- Π --></mi> <mrow class="MJX-TeXAtom-ORD"> <mtext>REJECT</mtext> </mrow> </msub> <mo stretchy="false">)</mo> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle (\Pi _{\text{ACCEPT}},\Pi _{\text{REJECT}})}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/3403ab9984e464c62e30629c8e9bb5931bb05d8b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:20.491ex; height:2.843ex;" alt="{\displaystyle (\Pi _{\text{ACCEPT}},\Pi _{\text{REJECT}})}"></span> is in <b>P</b> if there exists a polynomial-time algorithm <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle M}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>M</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle M}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/f82cade9898ced02fdd08712e5f0c0151758a0dd" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.442ex; height:2.176ex;" alt="{\displaystyle M}"></span> such that: <ul><li>For every <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle x\in \Pi _{\text{ACCEPT}},M(x)=1}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>x</mi> <mo>∈<!-- ∈ --></mo> <msub> <mi mathvariant="normal">Π<!-- Π --></mi> <mrow class="MJX-TeXAtom-ORD"> <mtext>ACCEPT</mtext> </mrow> </msub> <mo>,</mo> <mi>M</mi> <mo stretchy="false">(</mo> <mi>x</mi> <mo stretchy="false">)</mo> <mo>=</mo> <mn>1</mn> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle x\in \Pi _{\text{ACCEPT}},M(x)=1}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/629cab32fa6a972e6bb061ee98c7f3080ed46ba8" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:24.053ex; height:2.843ex;" alt="{\displaystyle x\in \Pi _{\text{ACCEPT}},M(x)=1}"></span></li> <li>For ever <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle x\in \Pi _{\text{REJECT}},M(x)=0}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>x</mi> <mo>∈<!-- ∈ --></mo> <msub> <mi mathvariant="normal">Π<!-- Π --></mi> <mrow class="MJX-TeXAtom-ORD"> <mtext>REJECT</mtext> </mrow> </msub> <mo>,</mo> <mi>M</mi> <mo stretchy="false">(</mo> <mi>x</mi> <mo stretchy="false">)</mo> <mo>=</mo> <mn>0</mn> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle x\in \Pi _{\text{REJECT}},M(x)=0}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/c5ee3053a1f7b0ecebe637dee1d2903733b672be" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:23.688ex; height:2.843ex;" alt="{\displaystyle x\in \Pi _{\text{REJECT}},M(x)=0}"></span></li></ul></dd></dl> <p>Classes of decision problems—that is, classes of problems defined as formal languages—thus translate naturally to promise problems, where a language <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle L}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>L</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle L}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/103168b86f781fe6e9a4a87b8ea1cebe0ad4ede8" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.583ex; height:2.176ex;" alt="{\displaystyle L}"></span> in the class is simply <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle L=\Pi _{\text{ACCEPT}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>L</mi> <mo>=</mo> <msub> <mi mathvariant="normal">Π<!-- Π --></mi> <mrow class="MJX-TeXAtom-ORD"> <mtext>ACCEPT</mtext> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle L=\Pi _{\text{ACCEPT}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/b1ffe53b0ae0221ad5335a705197c9dc2bff08ee" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:13.687ex; height:2.509ex;" alt="{\displaystyle L=\Pi _{\text{ACCEPT}}}"></span> and <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \Pi _{\text{REJECT}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <msub> <mi mathvariant="normal">Π<!-- Π --></mi> <mrow class="MJX-TeXAtom-ORD"> <mtext>REJECT</mtext> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \Pi _{\text{REJECT}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/bab03b12afb3b0c5677c698e8e1c894e4da79d2b" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:8.642ex; height:2.509ex;" alt="{\displaystyle \Pi _{\text{REJECT}}}"></span> is implicitly <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \{0,1\}^{*}/\Pi _{\text{ACCEPT}}}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mo fence="false" stretchy="false">{</mo> <mn>0</mn> <mo>,</mo> <mn>1</mn> <msup> <mo fence="false" stretchy="false">}</mo> <mrow class="MJX-TeXAtom-ORD"> <mo>∗<!-- ∗ --></mo> </mrow> </msup> <mrow class="MJX-TeXAtom-ORD"> <mo>/</mo> </mrow> <msub> <mi mathvariant="normal">Π<!-- Π --></mi> <mrow class="MJX-TeXAtom-ORD"> <mtext>ACCEPT</mtext> </mrow> </msub> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \{0,1\}^{*}/\Pi _{\text{ACCEPT}}}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/36a8ed0864d2c06a12ddd95503ee8119c78d3e04" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:16.907ex; height:2.843ex;" alt="{\displaystyle \{0,1\}^{*}/\Pi _{\text{ACCEPT}}}"></span>. </p><p>Formulating many basic complexity classes like <b>P</b> as promise problems provides little additional insight into their nature. However, there are some complexity classes for which formulating them as promise problems have been useful to computer scientists. Promise problems have, for instance, played a key role in the study of <b>SZK</b> (statistical zero-knowledge).<sup id="cite_ref-FOOTNOTEGoldreich2006266_(11–12_in_provided_pdf)_29-0" class="reference"><a href="#cite_note-FOOTNOTEGoldreich2006266_(11–12_in_provided_pdf)-29"><span class="cite-bracket">[</span>28<span class="cite-bracket">]</span></a></sup> </p> <div class="mw-heading mw-heading2"><h2 id="Summary_of_relationships_between_complexity_classes">Summary of relationships between complexity classes</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=43" title="Edit section: Summary of relationships between complexity classes"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <p>The following table shows some of the classes of problems that are considered in complexity theory. If class <b>X</b> is a strict <a href="/wiki/Subset" title="Subset">subset</a> of <b>Y</b>, then <b>X</b> is shown below <b>Y</b> with a dark line connecting them. If <b>X</b> is a subset, but it is unknown whether they are equal sets, then the line is lighter and dotted. Technically, the breakdown into decidable and undecidable pertains more to the study of <a href="/wiki/Computability_theory" title="Computability theory">computability theory</a>, but is useful for putting the complexity classes in perspective. </p> <table cellpadding="0" cellspacing="0" border="0" style="margin:auto;"> <tbody><tr style="text-align:center;"> <td colspan="2"> </td> <td colspan="4"> <table cellpadding="0" cellspacing="0" border="1" style="background:lightBlue; width:100%; height:100%;"> <tbody><tr> <td style="text-align:center;"><a href="/wiki/Decision_problem" title="Decision problem">Decision Problem</a> </td></tr></tbody></table> </td></tr> <tr style="text-align:center;"> <td colspan="2"> </td> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:SolidLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/2/2d/SolidLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td> <td colspan="2"> </td> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:SolidLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/2/2d/SolidLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td></tr> <tr style="text-align:center;"> <td colspan="3"> <table cellpadding="0" cellspacing="0" border="1" style="background:lightBlue; width:100%; height:100%;"> <tbody><tr> <td style="text-align:center;"><a href="/wiki/Recursively_enumerable_language" title="Recursively enumerable language">Type 0 (Recursively enumerable)</a> </td></tr></tbody></table> </td> <td> </td> <td colspan="4"> <table cellpadding="0" cellspacing="0" border="1" style="background:lightBlue; width:100%; height:100%;"> <tbody><tr> <td style="text-align:center;"><a href="/wiki/List_of_undecidable_problems" title="List of undecidable problems">Undecidable</a> </td></tr></tbody></table> </td></tr> <tr style="text-align:center;"> <td colspan="3"><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:SolidLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/2/2d/SolidLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td></tr> <tr style="text-align:center;"> <td colspan="3"> <table cellpadding="0" cellspacing="0" border="1" style="background:lightBlue; width:100%; height:100%;"> <tbody><tr> <td style="text-align:center;"><a href="/wiki/Recursive_language" title="Recursive language">Decidable</a> </td></tr></tbody></table> </td></tr> <tr style="text-align:center;"> <td colspan="3"><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:SolidLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/2/2d/SolidLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td></tr> <tr style="text-align:center;"> <td colspan="3"> <table cellpadding="0" cellspacing="0" border="1" style="background:lightGreen; width:100%; height:100%;"> <tbody><tr> <td style="text-align:center;"><a href="/wiki/EXPSPACE" title="EXPSPACE">EXPSPACE</a> </td></tr></tbody></table> </td></tr> <tr style="text-align:center;"> <td colspan="3"><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:DottedLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/c/c7/DottedLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td></tr> <tr style="text-align:center;"> <td colspan="3"> <table cellpadding="0" cellspacing="0" border="1" style="background:lightGreen; width:100%; height:100%;"> <tbody><tr> <td style="text-align:center;"><a href="/wiki/NEXPTIME" title="NEXPTIME">NEXPTIME</a> </td></tr></tbody></table> </td></tr> <tr style="text-align:center;"> <td colspan="3"><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:DottedLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/c/c7/DottedLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td></tr> <tr style="text-align:center;"> <td colspan="3"> <table cellpadding="0" cellspacing="0" border="1" style="background:lightGreen; width:100%; height:100%;"> <tbody><tr> <td style="text-align:center;"><a href="/wiki/EXPTIME" title="EXPTIME">EXPTIME</a> </td></tr></tbody></table> </td></tr> <tr style="text-align:center;"> <td colspan="3"><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:DottedLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/c/c7/DottedLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td></tr> <tr style="text-align:center;"> <td colspan="8"> <table cellpadding="0" cellspacing="0" border="1" style="background:lightGreen; width:100%; height:100%;"> <tbody><tr> <td style="text-align:center;"><a href="/wiki/PSPACE" title="PSPACE">PSPACE</a> </td></tr></tbody></table> </td></tr> <tr style="text-align:center;"> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:SolidLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/2/2d/SolidLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td> <td width="40"><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:SolidLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/2/2d/SolidLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:DottedLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/c/c7/DottedLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:DottedLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/c/c7/DottedLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td> <td> </td> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:DottedLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/c/c7/DottedLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td></tr> <tr style="text-align:center;"> <td> <table cellpadding="0" cellspacing="0" border="1" style="background:lightBlue; width:100%; height:100%;"> <tbody><tr> <td style="text-align:center;"><a href="/wiki/Context-sensitive_grammar" title="Context-sensitive grammar">Type 1 (Context Sensitive)</a> </td></tr></tbody></table> </td> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:SolidLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/2/2d/SolidLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:DottedLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/c/c7/DottedLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:DottedLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/c/c7/DottedLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td> <td> </td> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:DottedLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/c/c7/DottedLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td></tr> <tr style="text-align:center;"> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:SolidLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/2/2d/SolidLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:SolidLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/2/2d/SolidLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:DottedLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/c/c7/DottedLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:DottedLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/c/c7/DottedLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td> <td> </td> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:DottedLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/c/c7/DottedLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td></tr> <tr style="text-align:center;"> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:SolidLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/2/2d/SolidLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:SolidLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/2/2d/SolidLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td> <td> <table cellpadding="0" cellspacing="0" border="1" style="background:lightGreen; width:100%; height:100%;"> <tbody><tr> <td style="text-align:center;"><a href="/wiki/Co-NP" title="Co-NP">co-NP</a> </td></tr></tbody></table> </td> <td> <table cellpadding="0" cellspacing="0" border="1" style="background:lightGreen; width:100%; height:100%;"> <tbody><tr> <td style="text-align:center;"><a href="/wiki/BQP" title="BQP">BQP</a> </td></tr></tbody></table> </td> <td> </td> <td colspan="2"> <table cellpadding="0" cellspacing="0" border="1" style="background:lightGreen; width:100%; height:100%;"> <tbody><tr> <td style="text-align:center;"><a href="/wiki/NP_(complexity)" title="NP (complexity)">NP</a> </td></tr></tbody></table> </td></tr> <tr style="text-align:center;"> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:SolidLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/2/2d/SolidLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:SolidLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/2/2d/SolidLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:DottedLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/c/c7/DottedLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:DottedLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/c/c7/DottedLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td> <td> </td> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:DottedLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/c/c7/DottedLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td></tr> <tr style="text-align:center;"> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:SolidLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/2/2d/SolidLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:SolidLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/2/2d/SolidLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:DottedLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/c/c7/DottedLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td> <td> <table cellpadding="0" cellspacing="0" border="1" style="background:lightGreen; width:100%; height:100%;"> <tbody><tr> <td style="text-align:center;"><a href="/wiki/Bounded-error_probabilistic_polynomial" class="mw-redirect" title="Bounded-error probabilistic polynomial">BPP</a> </td></tr></tbody></table> </td> <td width="10"> </td> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:DottedLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/c/c7/DottedLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td></tr> <tr style="text-align:center;"> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:SolidLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/2/2d/SolidLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:SolidLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/2/2d/SolidLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:DottedLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/c/c7/DottedLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:DottedLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/c/c7/DottedLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td> <td> </td> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:DottedLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/c/c7/DottedLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td></tr> <tr style="text-align:center;"> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:SolidLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/2/2d/SolidLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:SolidLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/2/2d/SolidLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td> <td colspan="5"> <table cellpadding="0" cellspacing="0" border="1" style="background:lightGreen; width:100%; height:100%;"> <tbody><tr> <td style="text-align:center;"><a href="/wiki/P_(complexity)" title="P (complexity)">P</a> </td></tr></tbody></table> </td></tr> <tr style="text-align:center;"> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:SolidLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/2/2d/SolidLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:SolidLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/2/2d/SolidLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:DottedLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/c/c7/DottedLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td></tr> <tr style="text-align:center;"> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:SolidLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/2/2d/SolidLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td> <td colspan="2"> <table cellpadding="0" cellspacing="0" border="1" style="background:lightGreen; width:100%; height:100%;"> <tbody><tr> <td style="text-align:center;"><a href="/wiki/NC_(complexity)" title="NC (complexity)">NC</a> </td></tr></tbody></table> </td></tr> <tr style="text-align:center;"> <td><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:SolidLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/2/2d/SolidLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td> <td colspan="2"><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:SolidLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/2/2d/SolidLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td></tr> <tr style="text-align:center;"> <td colspan="3"> <table cellpadding="0" cellspacing="0" border="1" style="background:lightBlue; width:100%; height:100%;"> <tbody><tr> <td style="text-align:center;"><a href="/wiki/Context-free_grammar" title="Context-free grammar">Type 2 (Context Free)</a> </td></tr></tbody></table> </td></tr> <tr style="text-align:center;"> <td colspan="3"><span class="mw-default-size" typeof="mw:File"><a href="/wiki/File:SolidLine.png" class="mw-file-description"><img src="//upload.wikimedia.org/wikipedia/commons/2/2d/SolidLine.png" decoding="async" width="4" height="40" class="mw-file-element" data-file-width="4" data-file-height="40" /></a></span> </td></tr> <tr style="text-align:center;"> <td colspan="3"> <table cellpadding="0" cellspacing="0" border="1" style="background:lightBlue; width:100%; height:100%;"> <tbody><tr> <td style="text-align:center;"><a href="/wiki/Regular_grammar" title="Regular grammar">Type 3 (Regular)</a> </td></tr></tbody></table> </td></tr></tbody></table> <div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=44" title="Edit section: See also"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li><a href="/wiki/List_of_complexity_classes" title="List of complexity classes">List of complexity classes</a></li></ul> <div class="mw-heading mw-heading2"><h2 id="Notes">Notes</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=45" title="Edit section: Notes"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <style data-mw-deduplicate="TemplateStyles:r1239543626">.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}</style><div class="reflist reflist-lower-alpha"> <div class="mw-references-wrap"><ol class="references"> <li id="cite_note-9"><span class="mw-cite-backlink"><b><a href="#cite_ref-9">^</a></b></span> <span class="reference-text">While a logarithmic runtime of <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle c\log n}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>c</mi> <mi>log</mi> <mo>⁡<!-- --></mo> <mi>n</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle c\log n}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/e02718bc6bf005fe0710fd8290d4cfbbbc76f5c9" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:6.148ex; height:2.509ex;" alt="{\displaystyle c\log n}"></span>, i.e. <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \log n}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>log</mi> <mo>⁡<!-- --></mo> <mi>n</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle \log n}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/317ab5292da7c7935aec01a570461fe0613b21d5" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:4.754ex; height:2.509ex;" alt="{\displaystyle \log n}"></span> multiplied by a constant <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle c}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>c</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle c}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/86a67b81c2de995bd608d5b2df50cd8cd7d92455" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.007ex; height:1.676ex;" alt="{\displaystyle c}"></span>, allows a Turing machine to read inputs of size <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n<c\log n}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>n</mi> <mo><</mo> <mi>c</mi> <mi>log</mi> <mo>⁡<!-- --></mo> <mi>n</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle n<c\log n}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/710dff6a3ac39427ed44958a945b74eb68bdeb06" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:10.641ex; height:2.509ex;" alt="{\displaystyle n<c\log n}"></span>, there will invariably reach a point where <span class="mwe-math-element"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n>c\log n}"> <semantics> <mrow class="MJX-TeXAtom-ORD"> <mstyle displaystyle="true" scriptlevel="0"> <mi>n</mi> <mo>></mo> <mi>c</mi> <mi>log</mi> <mo>⁡<!-- --></mo> <mi>n</mi> </mstyle> </mrow> <annotation encoding="application/x-tex">{\displaystyle n>c\log n}</annotation> </semantics> </math></span><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/dc914bffde178de0b01894589e3c589028f774ae" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:10.641ex; height:2.509ex;" alt="{\displaystyle n>c\log n}"></span>.</span> </li> </ol></div></div> <div class="mw-heading mw-heading2"><h2 id="References">References</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=46" title="Edit section: References"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1239543626"><div class="reflist"> <div class="mw-references-wrap mw-references-columns"><ol class="references"> <li id="cite_note-FOOTNOTEJohnson1990-1"><span class="mw-cite-backlink"><b><a href="#cite_ref-FOOTNOTEJohnson1990_1-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFJohnson1990">Johnson (1990)</a>.</span> </li> <li id="cite_note-FOOTNOTEAroraBarak200928-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-FOOTNOTEAroraBarak200928_2-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFAroraBarak2009">Arora & Barak 2009</a>, p. 28.</span> </li> <li id="cite_note-FOOTNOTESipser200648,_150-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-FOOTNOTESipser200648,_150_3-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFSipser2006">Sipser 2006</a>, p. 48, 150.</span> </li> <li id="cite_note-FOOTNOTESipser2006255-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-FOOTNOTESipser2006255_4-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFSipser2006">Sipser 2006</a>, p. 255.</span> </li> <li id="cite_note-FOOTNOTEAaronson201712-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-FOOTNOTEAaronson201712_5-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFAaronson2017">Aaronson 2017</a>, p. 12.</span> </li> <li id="cite_note-FOOTNOTEAaronson20173-6"><span class="mw-cite-backlink"><b><a href="#cite_ref-FOOTNOTEAaronson20173_6-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFAaronson2017">Aaronson 2017</a>, p. 3.</span> </li> <li id="cite_note-FOOTNOTEGasarch2019-7"><span class="mw-cite-backlink"><b><a href="#cite_ref-FOOTNOTEGasarch2019_7-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFGasarch2019">Gasarch 2019</a>.</span> </li> <li id="cite_note-FOOTNOTEAaronson20174-8"><span class="mw-cite-backlink"><b><a href="#cite_ref-FOOTNOTEAaronson20174_8-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFAaronson2017">Aaronson 2017</a>, p. 4.</span> </li> <li id="cite_note-FOOTNOTESipser2006320-10"><span class="mw-cite-backlink"><b><a href="#cite_ref-FOOTNOTESipser2006320_10-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFSipser2006">Sipser 2006</a>, p. 320.</span> </li> <li id="cite_note-FOOTNOTESipser2006321-11"><span class="mw-cite-backlink">^ <a href="#cite_ref-FOOTNOTESipser2006321_11-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-FOOTNOTESipser2006321_11-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><a href="#CITEREFSipser2006">Sipser 2006</a>, p. 321.</span> </li> <li id="cite_note-FOOTNOTEAaronson20177-12"><span class="mw-cite-backlink">^ <a href="#cite_ref-FOOTNOTEAaronson20177_12-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-FOOTNOTEAaronson20177_12-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><a href="#CITEREFAaronson2017">Aaronson 2017</a>, p. 7.</span> </li> <li id="cite_note-FOOTNOTEAaronson20175-13"><span class="mw-cite-backlink"><b><a href="#cite_ref-FOOTNOTEAaronson20175_13-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFAaronson2017">Aaronson 2017</a>, p. 5.</span> </li> <li id="cite_note-FOOTNOTEAaronson20176-14"><span class="mw-cite-backlink"><b><a href="#cite_ref-FOOTNOTEAaronson20176_14-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFAaronson2017">Aaronson 2017</a>, p. 6.</span> </li> <li id="cite_note-FOOTNOTELee2014-15"><span class="mw-cite-backlink"><b><a href="#cite_ref-FOOTNOTELee2014_15-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFLee2014">Lee 2014</a>.</span> </li> <li id="cite_note-FOOTNOTEAroraBarak2009144-16"><span class="mw-cite-backlink"><b><a href="#cite_ref-FOOTNOTEAroraBarak2009144_16-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFAroraBarak2009">Arora & Barak 2009</a>, p. 144.</span> </li> <li id="cite_note-FOOTNOTESipser2006355-17"><span class="mw-cite-backlink"><b><a href="#cite_ref-FOOTNOTESipser2006355_17-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFSipser2006">Sipser 2006</a>, p. 355.</span> </li> <li id="cite_note-FOOTNOTEAroraBarak2009286-18"><span class="mw-cite-backlink"><b><a href="#cite_ref-FOOTNOTEAroraBarak2009286_18-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFAroraBarak2009">Arora & Barak 2009</a>, p. 286.</span> </li> <li id="cite_note-FOOTNOTEFortnow1997-19"><span class="mw-cite-backlink"><b><a href="#cite_ref-FOOTNOTEFortnow1997_19-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFFortnow1997">Fortnow 1997</a>.</span> </li> <li id="cite_note-FOOTNOTEArora2003-20"><span class="mw-cite-backlink"><b><a href="#cite_ref-FOOTNOTEArora2003_20-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFArora2003">Arora 2003</a>.</span> </li> <li id="cite_note-FOOTNOTEAroraBarak2009342-21"><span class="mw-cite-backlink"><b><a href="#cite_ref-FOOTNOTEAroraBarak2009342_21-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFAroraBarak2009">Arora & Barak 2009</a>, p. 342.</span> </li> <li id="cite_note-FOOTNOTEAroraBarak2009341–342-22"><span class="mw-cite-backlink"><b><a href="#cite_ref-FOOTNOTEAroraBarak2009341–342_22-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFAroraBarak2009">Arora & Barak 2009</a>, p. 341–342.</span> </li> <li id="cite_note-FOOTNOTEBarak2006-23"><span class="mw-cite-backlink">^ <a href="#cite_ref-FOOTNOTEBarak2006_23-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-FOOTNOTEBarak2006_23-1"><sup><i><b>b</b></i></sup></a> <a href="#cite_ref-FOOTNOTEBarak2006_23-2"><sup><i><b>c</b></i></sup></a></span> <span class="reference-text"><a href="#CITEREFBarak2006">Barak 2006</a>.</span> </li> <li id="cite_note-FOOTNOTEAroraBarak2009344-24"><span class="mw-cite-backlink">^ <a href="#cite_ref-FOOTNOTEAroraBarak2009344_24-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-FOOTNOTEAroraBarak2009344_24-1"><sup><i><b>b</b></i></sup></a> <a href="#cite_ref-FOOTNOTEAroraBarak2009344_24-2"><sup><i><b>c</b></i></sup></a> <a href="#cite_ref-FOOTNOTEAroraBarak2009344_24-3"><sup><i><b>d</b></i></sup></a></span> <span class="reference-text"><a href="#CITEREFAroraBarak2009">Arora & Barak 2009</a>, p. 344.</span> </li> <li id="cite_note-FOOTNOTERich2008689_(510_in_provided_PDF)-25"><span class="mw-cite-backlink"><b><a href="#cite_ref-FOOTNOTERich2008689_(510_in_provided_PDF)_25-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFRich2008">Rich 2008</a>, p. 689 (510 in provided PDF).</span> </li> <li id="cite_note-FOOTNOTEWatrous20061-26"><span class="mw-cite-backlink">^ <a href="#cite_ref-FOOTNOTEWatrous20061_26-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-FOOTNOTEWatrous20061_26-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><a href="#CITEREFWatrous2006">Watrous 2006</a>, p. 1.</span> </li> <li id="cite_note-FOOTNOTEGoldreich2006255_(2–3_in_provided_pdf)-27"><span class="mw-cite-backlink"><b><a href="#cite_ref-FOOTNOTEGoldreich2006255_(2–3_in_provided_pdf)_27-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFGoldreich2006">Goldreich 2006</a>, p. 255 (2–3 in provided pdf).</span> </li> <li id="cite_note-FOOTNOTEGoldreich2006257_(4_in_provided_pdf)-28"><span class="mw-cite-backlink"><b><a href="#cite_ref-FOOTNOTEGoldreich2006257_(4_in_provided_pdf)_28-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFGoldreich2006">Goldreich 2006</a>, p. 257 (4 in provided pdf).</span> </li> <li id="cite_note-FOOTNOTEGoldreich2006266_(11–12_in_provided_pdf)-29"><span class="mw-cite-backlink"><b><a href="#cite_ref-FOOTNOTEGoldreich2006266_(11–12_in_provided_pdf)_29-0">^</a></b></span> <span class="reference-text"><a href="#CITEREFGoldreich2006">Goldreich 2006</a>, p. 266 (11–12 in provided pdf).</span> </li> </ol></div></div> <div class="mw-heading mw-heading2"><h2 id="Bibliography">Bibliography</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=47" title="Edit section: Bibliography"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li><style data-mw-deduplicate="TemplateStyles:r1238218222">.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("//upload.wikimedia.org/wikipedia/commons/6/65/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("//upload.wikimedia.org/wikipedia/commons/d/d6/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("//upload.wikimedia.org/wikipedia/commons/a/aa/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("//upload.wikimedia.org/wikipedia/commons/4/4c/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}</style><cite id="CITEREFAaronson2017" class="citation web cs1"><a href="/wiki/Scott_Aaronson" title="Scott Aaronson">Aaronson, Scott</a> (8 January 2017). <a rel="nofollow" class="external text" href="https://eccc.weizmann.ac.il/report/2017/004/">"P=?NP"</a>. <i>Electronic Colloquim on Computational Complexity</i>. Weizmann Institute of Science. <a rel="nofollow" class="external text" href="https://web.archive.org/web/20200617175017/https://eccc.weizmann.ac.il/report/2017/004/download/">Archived</a> from the original on June 17, 2020.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=unknown&rft.jtitle=Electronic+Colloquim+on+Computational+Complexity&rft.atitle=P%3D%3FNP&rft.date=2017-01-08&rft.aulast=Aaronson&rft.aufirst=Scott&rft_id=https%3A%2F%2Feccc.weizmann.ac.il%2Freport%2F2017%2F004%2F&rfr_id=info%3Asid%2Fen.wikipedia.org%3AComplexity+class" class="Z3988"></span></li> <li><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFAroraBarak2009" class="citation book cs1"><a href="/wiki/Sanjeev_Arora" title="Sanjeev Arora">Arora, Sanjeev</a>; <a href="/wiki/Boaz_Barak" title="Boaz Barak">Barak, Boaz</a> (2009). <span class="id-lock-limited" title="Free access subject to limited trial, subscription normally required"><a rel="nofollow" class="external text" href="https://archive.org/details/computationalcom00aror"><i>Computational Complexity: A Modern Approach</i></a></span>. Cambridge University Press. <a rel="nofollow" class="external text" href="http://theory.cs.princeton.edu/complexity/book.pdf">Draft</a>. <a rel="nofollow" class="external text" href="https://web.archive.org/web/20220223014316/https://theory.cs.princeton.edu/complexity/book.pdf">Archived</a> from the original on February 23, 2022. <a href="/wiki/ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <a href="/wiki/Special:BookSources/978-0-521-42426-4" title="Special:BookSources/978-0-521-42426-4"><bdi>978-0-521-42426-4</bdi></a>.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=book&rft.btitle=Computational+Complexity%3A+A+Modern+Approach&rft.pages=Draft.+Archived+from+the+original+on+February+23%2C+2022.&rft.pub=Cambridge+University+Press&rft.date=2009&rft.isbn=978-0-521-42426-4&rft.aulast=Arora&rft.aufirst=Sanjeev&rft.au=Barak%2C+Boaz&rft_id=https%3A%2F%2Farchive.org%2Fdetails%2Fcomputationalcom00aror&rfr_id=info%3Asid%2Fen.wikipedia.org%3AComplexity+class" class="Z3988"></span></li> <li><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFArora2003" class="citation web cs1">Arora, Sanjeev (Spring 2003). <a rel="nofollow" class="external text" href="https://www.cs.princeton.edu/courses/archive/spring03/cs522/book2.ps">"Complexity classes having to do with counting"</a>. <i>Computer Science 522: Computational Complexity Theory</i>. Princeton University. <a rel="nofollow" class="external text" href="https://web.archive.org/web/20220521204917/https://www.cs.princeton.edu/courses/archive/spring03/cs522/book2.ps">Archived</a> from the original on May 21, 2022.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=unknown&rft.jtitle=Computer+Science+522%3A+Computational+Complexity+Theory&rft.atitle=Complexity+classes+having+to+do+with+counting&rft.ssn=spring&rft.date=2003&rft.aulast=Arora&rft.aufirst=Sanjeev&rft_id=https%3A%2F%2Fwww.cs.princeton.edu%2Fcourses%2Farchive%2Fspring03%2Fcs522%2Fbook2.ps&rfr_id=info%3Asid%2Fen.wikipedia.org%3AComplexity+class" class="Z3988"></span></li> <li><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFBarak2006" class="citation web cs1"><a href="/wiki/Boaz_Barak" title="Boaz Barak">Barak, Boaz</a> (Spring 2006). <a rel="nofollow" class="external text" href="https://www.cs.princeton.edu/courses/archive/spring06/cos522/count.pdf">"Complexity of counting"</a> <span class="cs1-format">(PDF)</span>. <i>Computer Science 522: Computational Complexity</i>. <a href="/wiki/Princeton_University" title="Princeton University">Princeton University</a>. <a rel="nofollow" class="external text" href="https://web.archive.org/web/20210403191124/https://www.cs.princeton.edu/courses/archive/spring06/cos522/count.pdf">Archived</a> from the original on April 3, 2021.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=unknown&rft.jtitle=Computer+Science+522%3A+Computational+Complexity&rft.atitle=Complexity+of+counting&rft.ssn=spring&rft.pages=Archived+from+the+original+on+April+3%2C+2021.&rft.date=2006&rft.aulast=Barak&rft.aufirst=Boaz&rft_id=https%3A%2F%2Fwww.cs.princeton.edu%2Fcourses%2Farchive%2Fspring06%2Fcos522%2Fcount.pdf&rfr_id=info%3Asid%2Fen.wikipedia.org%3AComplexity+class" class="Z3988"></span></li> <li><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFFortnow1997" class="citation book cs1">Fortnow, Lance (1997). <a rel="nofollow" class="external text" href="https://web.archive.org/web/20220618222631/https://lance.fortnow.com/papers/files/counting.pdf">"Counting Complexity"</a> <span class="cs1-format">(PDF)</span>. In Hemaspaandra, Lane A.; Selman, Alan L. (eds.). <i>Complexity Theory Retrospective II</i>. Springer. pp. 81–106. <a href="/wiki/ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <a href="/wiki/Special:BookSources/9780387949734" title="Special:BookSources/9780387949734"><bdi>9780387949734</bdi></a>. Archived from <a rel="nofollow" class="external text" href="https://lance.fortnow.com/papers/files/counting.pdf">the original</a> <span class="cs1-format">(PDF)</span> on June 18, 2022.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=bookitem&rft.atitle=Counting+Complexity&rft.btitle=Complexity+Theory+Retrospective+II&rft.pages=81-106&rft.pub=Springer&rft.date=1997&rft.isbn=9780387949734&rft.aulast=Fortnow&rft.aufirst=Lance&rft_id=https%3A%2F%2Flance.fortnow.com%2Fpapers%2Ffiles%2Fcounting.pdf&rfr_id=info%3Asid%2Fen.wikipedia.org%3AComplexity+class" class="Z3988"></span></li> <li><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFGasarch2019" class="citation web cs1">Gasarch, William I. (2019). <a rel="nofollow" class="external text" href="https://www.cs.umd.edu/users/gasarch/BLOGPAPERS/pollpaper3.pdf">"Guest Column: The Third P =? NP Poll"</a> <span class="cs1-format">(PDF)</span>. <i><a href="/wiki/University_of_Maryland" class="mw-redirect" title="University of Maryland">University of Maryland</a></i>. <a rel="nofollow" class="external text" href="https://web.archive.org/web/20211102102656/https://www.cs.umd.edu/users/gasarch/BLOGPAPERS/pollpaper3.pdf">Archived</a> <span class="cs1-format">(PDF)</span> from the original on November 2, 2021.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=unknown&rft.jtitle=University+of+Maryland&rft.atitle=Guest+Column%3A+The+Third+P+%3D%3F+NP+Poll&rft.date=2019&rft.aulast=Gasarch&rft.aufirst=William+I.&rft_id=https%3A%2F%2Fwww.cs.umd.edu%2Fusers%2Fgasarch%2FBLOGPAPERS%2Fpollpaper3.pdf&rfr_id=info%3Asid%2Fen.wikipedia.org%3AComplexity+class" class="Z3988"></span></li> <li><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFGoldreich2006" class="citation book cs1"><a href="/wiki/Oded_Goldreich" title="Oded Goldreich">Goldreich, Oded</a> (2006). <a rel="nofollow" class="external text" href="https://www.wisdom.weizmann.ac.il/~oded/PSX/prpr-r.pdf">"On Promise Problems: A Survey"</a> <span class="cs1-format">(PDF)</span>. In Goldreich, Oded; Rosenberg, Arnold L.; Selman, Alen L. (eds.). <a rel="nofollow" class="external text" href="https://www.wisdom.weizmann.ac.il/~oded/PSX/prpr-r.pdf"><i>Theoretical Computer Science. Lecture Notes in Computer Science, vol 3895</i></a> <span class="cs1-format">(PDF)</span>. Lecture Notes in Computer Science. Vol. 3895. Springer. pp. 254–290. <a href="/wiki/Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1007%2F11685654_12">10.1007/11685654_12</a>. <a href="/wiki/ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <a href="/wiki/Special:BookSources/978-3-540-32881-0" title="Special:BookSources/978-3-540-32881-0"><bdi>978-3-540-32881-0</bdi></a>. <a rel="nofollow" class="external text" href="https://web.archive.org/web/20210506131638/https://www.wisdom.weizmann.ac.il/~oded/PSX/prpr-r.pdf">Archived</a> <span class="cs1-format">(PDF)</span> from the original on May 6, 2021.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=bookitem&rft.atitle=On+Promise+Problems%3A+A+Survey&rft.btitle=Theoretical+Computer+Science.+Lecture+Notes+in+Computer+Science%2C+vol+3895&rft.series=Lecture+Notes+in+Computer+Science&rft.pages=254-290&rft.pub=Springer&rft.date=2006&rft_id=info%3Adoi%2F10.1007%2F11685654_12&rft.isbn=978-3-540-32881-0&rft.aulast=Goldreich&rft.aufirst=Oded&rft_id=https%3A%2F%2Fwww.wisdom.weizmann.ac.il%2F~oded%2FPSX%2Fprpr-r.pdf&rfr_id=info%3Asid%2Fen.wikipedia.org%3AComplexity+class" class="Z3988"></span></li> <li><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFJohnson1990" class="citation encyclopaedia cs1">Johnson, David S. (1990). "A Catalog of Complexity Classes". <i>Algorithms and Complexity</i>. Handbook of Theoretical Computer Science. Elsevier. pp. 67–161. <a href="/wiki/Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1016%2Fb978-0-444-88071-0.50007-2">10.1016/b978-0-444-88071-0.50007-2</a>.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=bookitem&rft.atitle=A+Catalog+of+Complexity+Classes&rft.btitle=Algorithms+and+Complexity&rft.series=Handbook+of+Theoretical+Computer+Science&rft.pages=67-161&rft.pub=Elsevier&rft.date=1990&rft_id=info%3Adoi%2F10.1016%2Fb978-0-444-88071-0.50007-2&rft.aulast=Johnson&rft.aufirst=David+S.&rfr_id=info%3Asid%2Fen.wikipedia.org%3AComplexity+class" class="Z3988"></span></li> <li><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFLee2014" class="citation web cs1">Lee, James R. (May 22, 2014). <a rel="nofollow" class="external text" href="https://courses.cs.washington.edu/courses/cse431/14sp/scribes/lec16.pdf">"Lecture 16"</a> <span class="cs1-format">(PDF)</span>. <i>CSE431: Introduction to Theory of Computation</i>. <a href="/wiki/University_of_Washington" title="University of Washington">University of Washington</a>. <a rel="nofollow" class="external text" href="https://web.archive.org/web/20211129075858/https://courses.cs.washington.edu/courses/cse431/14sp/scribes/lec16.pdf">Archived</a> <span class="cs1-format">(PDF)</span> from the original on November 29, 2021<span class="reference-accessdate">. Retrieved <span class="nowrap">October 5,</span> 2022</span>.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=unknown&rft.jtitle=CSE431%3A+Introduction+to+Theory+of+Computation&rft.atitle=Lecture+16&rft.date=2014-05-22&rft.aulast=Lee&rft.aufirst=James+R.&rft_id=https%3A%2F%2Fcourses.cs.washington.edu%2Fcourses%2Fcse431%2F14sp%2Fscribes%2Flec16.pdf&rfr_id=info%3Asid%2Fen.wikipedia.org%3AComplexity+class" class="Z3988"></span></li> <li><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFRich2008" class="citation book cs1"><a href="/wiki/Elaine_Rich" title="Elaine Rich">Rich, Elaine</a> (2008). <a rel="nofollow" class="external text" href="https://www.cs.utexas.edu/~ear/cs341/automatabook/AutomataTheoryBook.pdf"><i>Automata, Computability and Complexity: Theory and Applications</i></a> <span class="cs1-format">(PDF)</span>. <a href="/wiki/Prentice_Hall" title="Prentice Hall">Prentice Hall</a>. <a href="/wiki/ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <a href="/wiki/Special:BookSources/978-0132288064" title="Special:BookSources/978-0132288064"><bdi>978-0132288064</bdi></a>. <a rel="nofollow" class="external text" href="https://web.archive.org/web/20220121174820/https://www.cs.utexas.edu/~ear/cs341/automatabook/AutomataTheoryBook.pdf">Archived</a> <span class="cs1-format">(PDF)</span> from the original on January 21, 2022.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=book&rft.btitle=Automata%2C+Computability+and+Complexity%3A+Theory+and+Applications&rft.pub=Prentice+Hall&rft.date=2008&rft.isbn=978-0132288064&rft.aulast=Rich&rft.aufirst=Elaine&rft_id=https%3A%2F%2Fwww.cs.utexas.edu%2F~ear%2Fcs341%2Fautomatabook%2FAutomataTheoryBook.pdf&rfr_id=info%3Asid%2Fen.wikipedia.org%3AComplexity+class" class="Z3988"></span></li> <li><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFSipser2006" class="citation book cs1"><a href="/wiki/Michael_Sipser" title="Michael Sipser">Sipser, Michael</a> (2006). <a rel="nofollow" class="external text" href="https://web.archive.org/web/20220207141236/http://fuuu.be/polytech/INFOF408/Introduction-To-The-Theory-Of-Computation-Michael-Sipser.pdf"><i>Introduction to the Theory of Computation</i></a> <span class="cs1-format">(PDF)</span> (2nd ed.). USA: Thomson Course Technology. <a href="/wiki/ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <a href="/wiki/Special:BookSources/0-534-95097-3" title="Special:BookSources/0-534-95097-3"><bdi>0-534-95097-3</bdi></a>. Archived from <a rel="nofollow" class="external text" href="http://fuuu.be/polytech/INFOF408/Introduction-To-The-Theory-Of-Computation-Michael-Sipser.pdf">the original</a> <span class="cs1-format">(PDF)</span> on February 7, 2022.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=book&rft.btitle=Introduction+to+the+Theory+of+Computation&rft.place=USA&rft.edition=2nd&rft.pub=Thomson+Course+Technology&rft.date=2006&rft.isbn=0-534-95097-3&rft.aulast=Sipser&rft.aufirst=Michael&rft_id=http%3A%2F%2Ffuuu.be%2Fpolytech%2FINFOF408%2FIntroduction-To-The-Theory-Of-Computation-Michael-Sipser.pdf&rfr_id=info%3Asid%2Fen.wikipedia.org%3AComplexity+class" class="Z3988"></span></li> <li><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFWatrous2006" class="citation web cs1"><a href="/wiki/John_Watrous_(computer_scientist)" title="John Watrous (computer scientist)">Watrous, John</a> (April 11, 2006). <a rel="nofollow" class="external text" href="https://cs.uwaterloo.ca/~watrous/QC-notes/QC-notes.22.pdf">"Lecture 22: Quantum computational complexity"</a> <span class="cs1-format">(PDF)</span>. <i><a href="/wiki/University_of_Waterloo" title="University of Waterloo">University of Waterloo</a></i>. <a rel="nofollow" class="external text" href="https://web.archive.org/web/20220618022421/https://cs.uwaterloo.ca/~watrous/QC-notes/QC-notes.22.pdf">Archived</a> <span class="cs1-format">(PDF)</span> from the original on June 18, 2022.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=unknown&rft.jtitle=University+of+Waterloo&rft.atitle=Lecture+22%3A+Quantum+computational+complexity&rft.date=2006-04-11&rft.aulast=Watrous&rft.aufirst=John&rft_id=https%3A%2F%2Fcs.uwaterloo.ca%2F~watrous%2FQC-notes%2FQC-notes.22.pdf&rfr_id=info%3Asid%2Fen.wikipedia.org%3AComplexity+class" class="Z3988"></span></li></ul> <div class="mw-heading mw-heading2"><h2 id="Further_reading">Further reading</h2><span class="mw-editsection"><span class="mw-editsection-bracket">[</span><a href="/w/index.php?title=Complexity_class&action=edit&section=48" title="Edit section: Further reading"><span>edit</span></a><span class="mw-editsection-bracket">]</span></span></div> <ul><li><a rel="nofollow" class="external text" href="https://complexityzoo.uwaterloo.ca/Complexity_Zoo">The Complexity Zoo</a> <a rel="nofollow" class="external text" href="https://web.archive.org/web/20190827233504/https://complexityzoo.uwaterloo.ca/Complexity_Zoo">Archived</a> 2019-08-27 at the <a href="/wiki/Wayback_Machine" title="Wayback Machine">Wayback Machine</a>: A huge list of complexity classes, a reference for experts.</li> <li><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1238218222"><cite id="CITEREFNeil_Immerman" class="citation web cs1"><a href="/wiki/Neil_Immerman" title="Neil Immerman">Neil Immerman</a>. <a rel="nofollow" class="external text" href="https://web.archive.org/web/20160416021243/https://people.cs.umass.edu/~immerman/complexity_theory.html">"Computational Complexity Theory"</a>. Archived from <a rel="nofollow" class="external text" href="http://www.cs.umass.edu/~immerman/complexity_theory.html">the original</a> on 2016-04-16.</cite><span title="ctx_ver=Z39.88-2004&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&rft.genre=unknown&rft.btitle=Computational+Complexity+Theory&rft.au=Neil+Immerman&rft_id=http%3A%2F%2Fwww.cs.umass.edu%2F~immerman%2Fcomplexity_theory.html&rfr_id=info%3Asid%2Fen.wikipedia.org%3AComplexity+class" class="Z3988"></span> Includes a diagram showing the hierarchy of complexity classes and how they fit together.</li> <li><a href="/wiki/Michael_Garey" title="Michael Garey">Michael Garey</a>, and <a href="/wiki/David_S._Johnson" title="David S. Johnson">David S. Johnson</a>: <i>Computers and Intractability: A Guide to the Theory of NP-Completeness.</i> New York: W. H. Freeman & Co., 1979. The standard reference on NP-Complete problems - an important category of problems whose solutions appear to require an impractically long time to compute.</li></ul> <div class="navbox-styles"><style data-mw-deduplicate="TemplateStyles:r1129693374">.mw-parser-output .hlist dl,.mw-parser-output .hlist ol,.mw-parser-output .hlist ul{margin:0;padding:0}.mw-parser-output .hlist dd,.mw-parser-output .hlist dt,.mw-parser-output .hlist li{margin:0;display:inline}.mw-parser-output .hlist.inline,.mw-parser-output .hlist.inline dl,.mw-parser-output .hlist.inline ol,.mw-parser-output .hlist.inline ul,.mw-parser-output .hlist dl dl,.mw-parser-output .hlist dl ol,.mw-parser-output .hlist dl ul,.mw-parser-output .hlist ol dl,.mw-parser-output .hlist ol ol,.mw-parser-output .hlist ol ul,.mw-parser-output .hlist ul dl,.mw-parser-output .hlist ul ol,.mw-parser-output .hlist ul ul{display:inline}.mw-parser-output .hlist .mw-empty-li{display:none}.mw-parser-output .hlist dt::after{content:": "}.mw-parser-output .hlist dd::after,.mw-parser-output .hlist li::after{content:" · ";font-weight:bold}.mw-parser-output .hlist dd:last-child::after,.mw-parser-output .hlist dt:last-child::after,.mw-parser-output .hlist li:last-child::after{content:none}.mw-parser-output .hlist dd dd:first-child::before,.mw-parser-output .hlist dd dt:first-child::before,.mw-parser-output .hlist dd li:first-child::before,.mw-parser-output .hlist dt dd:first-child::before,.mw-parser-output .hlist dt dt:first-child::before,.mw-parser-output .hlist dt li:first-child::before,.mw-parser-output .hlist li dd:first-child::before,.mw-parser-output .hlist li dt:first-child::before,.mw-parser-output .hlist li li:first-child::before{content:" (";font-weight:normal}.mw-parser-output .hlist dd dd:last-child::after,.mw-parser-output .hlist dd dt:last-child::after,.mw-parser-output .hlist dd li:last-child::after,.mw-parser-output .hlist dt dd:last-child::after,.mw-parser-output .hlist dt dt:last-child::after,.mw-parser-output .hlist dt li:last-child::after,.mw-parser-output .hlist li dd:last-child::after,.mw-parser-output .hlist li dt:last-child::after,.mw-parser-output .hlist li li:last-child::after{content:")";font-weight:normal}.mw-parser-output .hlist ol{counter-reset:listitem}.mw-parser-output .hlist ol>li{counter-increment:listitem}.mw-parser-output .hlist ol>li::before{content:" "counter(listitem)"\a0 "}.mw-parser-output .hlist dd ol>li:first-child::before,.mw-parser-output .hlist dt ol>li:first-child::before,.mw-parser-output .hlist li ol>li:first-child::before{content:" ("counter(listitem)"\a0 "}</style><style data-mw-deduplicate="TemplateStyles:r1236075235">.mw-parser-output .navbox{box-sizing:border-box;border:1px solid #a2a9b1;width:100%;clear:both;font-size:88%;text-align:center;padding:1px;margin:1em auto 0}.mw-parser-output .navbox .navbox{margin-top:0}.mw-parser-output .navbox+.navbox,.mw-parser-output .navbox+.navbox-styles+.navbox{margin-top:-1px}.mw-parser-output .navbox-inner,.mw-parser-output .navbox-subgroup{width:100%}.mw-parser-output .navbox-group,.mw-parser-output .navbox-title,.mw-parser-output .navbox-abovebelow{padding:0.25em 1em;line-height:1.5em;text-align:center}.mw-parser-output .navbox-group{white-space:nowrap;text-align:right}.mw-parser-output .navbox,.mw-parser-output .navbox-subgroup{background-color:#fdfdfd}.mw-parser-output .navbox-list{line-height:1.5em;border-color:#fdfdfd}.mw-parser-output .navbox-list-with-group{text-align:left;border-left-width:2px;border-left-style:solid}.mw-parser-output tr+tr>.navbox-abovebelow,.mw-parser-output tr+tr>.navbox-group,.mw-parser-output tr+tr>.navbox-image,.mw-parser-output tr+tr>.navbox-list{border-top:2px solid #fdfdfd}.mw-parser-output .navbox-title{background-color:#ccf}.mw-parser-output .navbox-abovebelow,.mw-parser-output .navbox-group,.mw-parser-output .navbox-subgroup .navbox-title{background-color:#ddf}.mw-parser-output .navbox-subgroup .navbox-group,.mw-parser-output .navbox-subgroup .navbox-abovebelow{background-color:#e6e6ff}.mw-parser-output .navbox-even{background-color:#f7f7f7}.mw-parser-output .navbox-odd{background-color:transparent}.mw-parser-output .navbox .hlist td dl,.mw-parser-output .navbox .hlist td ol,.mw-parser-output .navbox .hlist td ul,.mw-parser-output .navbox td.hlist dl,.mw-parser-output .navbox td.hlist ol,.mw-parser-output .navbox td.hlist ul{padding:0.125em 0}.mw-parser-output .navbox .navbar{display:block;font-size:100%}.mw-parser-output .navbox-title .navbar{float:left;text-align:left;margin-right:0.5em}body.skin--responsive .mw-parser-output .navbox-image img{max-width:none!important}@media print{body.ns-0 .mw-parser-output .navbox{display:none!important}}</style></div><div role="navigation" class="navbox" aria-labelledby="Complexity_classes" style="padding:3px"><table class="nowraplinks mw-collapsible autocollapse navbox-inner" style="border-spacing:0;background:transparent;color:inherit"><tbody><tr><th scope="col" class="navbox-title" colspan="2"><link rel="mw-deduplicated-inline-style" href="mw-data:TemplateStyles:r1129693374"><style data-mw-deduplicate="TemplateStyles:r1239400231">.mw-parser-output .navbar{display:inline;font-size:88%;font-weight:normal}.mw-parser-output .navbar-collapse{float:left;text-align:left}.mw-parser-output .navbar-boxtext{word-spacing:0}.mw-parser-output .navbar ul{display:inline-block;white-space:nowrap;line-height:inherit}.mw-parser-output .navbar-brackets::before{margin-right:-0.125em;content:"[ "}.mw-parser-output .navbar-brackets::after{margin-left:-0.125em;content:" ]"}.mw-parser-output .navbar li{word-spacing:-0.125em}.mw-parser-output .navbar a>span,.mw-parser-output .navbar a>abbr{text-decoration:inherit}.mw-parser-output .navbar-mini abbr{font-variant:small-caps;border-bottom:none;text-decoration:none;cursor:inherit}.mw-parser-output .navbar-ct-full{font-size:114%;margin:0 7em}.mw-parser-output .navbar-ct-mini{font-size:114%;margin:0 4em}html.skin-theme-clientpref-night .mw-parser-output .navbar li a abbr{color:var(--color-base)!important}@media(prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .navbar li a abbr{color:var(--color-base)!important}}@media print{.mw-parser-output .navbar{display:none!important}}</style><div class="navbar plainlinks hlist navbar-mini"><ul><li class="nv-view"><a href="/wiki/Template:Complexity_classes" title="Template:Complexity classes"><abbr title="View this template">v</abbr></a></li><li class="nv-talk"><a href="/wiki/Template_talk:Complexity_classes" title="Template talk:Complexity classes"><abbr title="Discuss this template">t</abbr></a></li><li class="nv-edit"><a href="/wiki/Special:EditPage/Template:Complexity_classes" title="Special:EditPage/Template:Complexity classes"><abbr title="Edit this template">e</abbr></a></li></ul></div><div id="Complexity_classes" style="font-size:114%;margin:0 4em"><a class="mw-selflink selflink">Complexity classes</a></div></th></tr><tr><th scope="row" class="navbox-group" style="width:1%">Considered feasible</th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/DLOGTIME" title="DLOGTIME">DLOGTIME</a></li> <li><a href="/wiki/AC0" title="AC0">AC<sup>0</sup></a></li> <li><a href="/wiki/ACC0" title="ACC0">ACC<sup>0</sup></a></li> <li><a href="/wiki/TC0" title="TC0">TC<sup>0</sup></a></li> <li><a href="/wiki/L_(complexity)" title="L (complexity)">L</a></li> <li><a href="/wiki/SL_(complexity)" title="SL (complexity)">SL</a></li> <li><a href="/wiki/RL_(complexity)" title="RL (complexity)">RL</a></li> <li><a href="/wiki/FL_(complexity)" title="FL (complexity)">FL</a></li> <li><a href="/wiki/NL_(complexity)" title="NL (complexity)">NL</a> <ul><li><a href="/wiki/NL-complete" title="NL-complete">NL-complete</a></li></ul></li> <li><a href="/wiki/NC_(complexity)" title="NC (complexity)">NC</a></li> <li><a href="/wiki/SC_(complexity)" title="SC (complexity)">SC</a></li> <li><a href="/wiki/CC_(complexity)" title="CC (complexity)">CC</a></li> <li><a href="/wiki/P_(complexity)" title="P (complexity)">P</a> <ul><li><a href="/wiki/P-complete" title="P-complete">P-complete</a></li></ul></li> <li><a href="/wiki/ZPP_(complexity)" title="ZPP (complexity)">ZPP</a></li> <li><a href="/wiki/RP_(complexity)" title="RP (complexity)">RP</a></li> <li><a href="/wiki/BPP_(complexity)" title="BPP (complexity)">BPP</a></li> <li><a href="/wiki/BQP" title="BQP">BQP</a></li> <li><a href="/wiki/APX" title="APX">APX</a></li> <li><a href="/wiki/FP_(complexity)" title="FP (complexity)">FP</a></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Suspected infeasible</th><td class="navbox-list-with-group navbox-list navbox-even hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/UP_(complexity)" title="UP (complexity)">UP</a></li> <li><a href="/wiki/NP_(complexity)" title="NP (complexity)">NP</a> <ul><li><a href="/wiki/NP-completeness" title="NP-completeness">NP-complete</a></li> <li><a href="/wiki/NP-hardness" title="NP-hardness">NP-hard</a></li> <li><a href="/wiki/Co-NP" title="Co-NP">co-NP</a></li> <li><a href="/wiki/Co-NP-complete" title="Co-NP-complete">co-NP-complete</a></li></ul></li> <li><a href="/wiki/TFNP" title="TFNP">TFNP</a></li> <li><a href="/wiki/FNP_(complexity)" title="FNP (complexity)">FNP</a></li> <li><a href="/wiki/Arthur%E2%80%93Merlin_protocol" title="Arthur–Merlin protocol">AM</a></li> <li><a href="/wiki/QMA" title="QMA">QMA</a></li> <li><a href="/wiki/PH_(complexity)" title="PH (complexity)">PH</a></li> <li><a href="/wiki/Parity_P" title="Parity P">⊕P</a></li> <li><a href="/wiki/PP_(complexity)" title="PP (complexity)">PP</a></li> <li><a href="/wiki/%E2%99%AFP" title="♯P">#P</a> <ul><li><a href="/wiki/%E2%99%AFP-complete" title="♯P-complete">#P-complete</a></li></ul></li> <li><a href="/wiki/IP_(complexity)" title="IP (complexity)">IP</a></li> <li><a href="/wiki/PSPACE" title="PSPACE">PSPACE</a> <ul><li><a href="/wiki/PSPACE-complete" title="PSPACE-complete">PSPACE-complete</a></li></ul></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Considered infeasible</th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/EXPTIME" title="EXPTIME">EXPTIME</a></li> <li><a href="/wiki/NEXPTIME" title="NEXPTIME">NEXPTIME</a></li> <li><a href="/wiki/EXPSPACE" title="EXPSPACE">EXPSPACE</a></li> <li><a href="/wiki/2-EXPTIME" title="2-EXPTIME">2-EXPTIME</a></li> <li><a href="/wiki/ELEMENTARY" title="ELEMENTARY">ELEMENTARY</a></li> <li><a href="/wiki/PR_(complexity)" title="PR (complexity)">PR</a></li> <li><a href="/wiki/R_(complexity)" title="R (complexity)">R</a></li> <li><a href="/wiki/RE_(complexity)" title="RE (complexity)">RE</a></li> <li><a href="/wiki/ALL_(complexity)" title="ALL (complexity)">ALL</a></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Class hierarchies</th><td class="navbox-list-with-group navbox-list navbox-even hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/Polynomial_hierarchy" title="Polynomial hierarchy">Polynomial hierarchy</a></li> <li><a href="/wiki/Exponential_hierarchy" title="Exponential hierarchy">Exponential hierarchy</a></li> <li><a href="/wiki/Grzegorczyk_hierarchy" title="Grzegorczyk hierarchy">Grzegorczyk hierarchy</a></li> <li><a href="/wiki/Arithmetical_hierarchy" title="Arithmetical hierarchy">Arithmetical hierarchy</a></li> <li><a href="/wiki/Boolean_hierarchy" title="Boolean hierarchy">Boolean hierarchy</a></li></ul> </div></td></tr><tr><th scope="row" class="navbox-group" style="width:1%">Families of classes</th><td class="navbox-list-with-group navbox-list navbox-odd hlist" style="width:100%;padding:0"><div style="padding:0 0.25em"> <ul><li><a href="/wiki/DTIME" title="DTIME">DTIME</a></li> <li><a href="/wiki/NTIME" title="NTIME">NTIME</a></li> <li><a href="/wiki/DSPACE" title="DSPACE">DSPACE</a></li> <li><a href="/wiki/NSPACE" title="NSPACE">NSPACE</a></li> <li><a href="/wiki/Probabilistically_checkable_proof" title="Probabilistically checkable proof">Probabilistically checkable proof</a></li> <li><a href="/wiki/Interactive_proof_system" title="Interactive proof system">Interactive proof system</a></li></ul> </div></td></tr><tr><td class="navbox-abovebelow" colspan="2"><div><a href="/wiki/List_of_complexity_classes" title="List of complexity classes">List of complexity classes</a></div></td></tr></tbody></table></div> <!-- NewPP limit report Parsed by mw‐api‐ext.codfw.main‐744c7589dd‐q45xq Cached time: 20241125135705 Cache expiry: 2592000 Reduced expiry: false Complications: [vary‐revision‐sha1, show‐toc] CPU time usage: 0.942 seconds Real time usage: 1.369 seconds Preprocessor visited node count: 5259/1000000 Post‐expand include size: 57496/2097152 bytes Template argument size: 3976/2097152 bytes Highest expansion depth: 10/100 Expensive parser function count: 27/500 Unstrip recursion depth: 1/20 Unstrip post‐expand size: 74251/5000000 bytes Lua time usage: 0.479/10.000 seconds Lua memory usage: 6780349/52428800 bytes Number of Wikibase entities loaded: 0/400 --> <!-- Transclusion expansion time report (%,ms,calls,template) 100.00% 742.351 1 -total 20.85% 154.778 7 Template:Cite_web 14.59% 108.344 1 Template:Short_description 13.40% 99.475 1 Template:ComplexityClasses 12.67% 94.087 1 Template:Navbox 12.66% 93.989 34 Template:Sfn 10.74% 79.728 2 Template:Pagetype 8.40% 62.337 1 Template:Expand_section 7.67% 56.957 1 Template:Ambox 7.65% 56.783 18 Template:Main --> <!-- Saved in parser cache with key enwiki:pcache:idhash:502426-0!canonical and timestamp 20241125135705 and revision id 1251434113. Rendering was triggered because: unknown --> </div><!--esi <esi:include src="/esitest-fa8a495983347898/content" /> --><noscript><img src="https://login.wikimedia.org/wiki/Special:CentralAutoLogin/start?type=1x1" alt="" width="1" height="1" style="border: none; position: absolute;"></noscript> <div class="printfooter" data-nosnippet="">Retrieved from "<a dir="ltr" href="https://en.wikipedia.org/w/index.php?title=Complexity_class&oldid=1251434113">https://en.wikipedia.org/w/index.php?title=Complexity_class&oldid=1251434113</a>"</div></div> <div id="catlinks" class="catlinks" data-mw="interface"><div id="mw-normal-catlinks" class="mw-normal-catlinks"><a href="/wiki/Help:Category" title="Help:Category">Categories</a>: <ul><li><a href="/wiki/Category:Complexity_classes" title="Category:Complexity classes">Complexity classes</a></li><li><a href="/wiki/Category:Computational_complexity_theory" title="Category:Computational complexity theory">Computational complexity theory</a></li><li><a href="/wiki/Category:Measures_of_complexity" title="Category:Measures of complexity">Measures of complexity</a></li><li><a href="/wiki/Category:Theoretical_computer_science" title="Category:Theoretical computer science">Theoretical computer science</a></li></ul></div><div id="mw-hidden-catlinks" class="mw-hidden-catlinks mw-hidden-cats-hidden">Hidden categories: <ul><li><a href="/wiki/Category:Articles_with_short_description" title="Category:Articles with short description">Articles with short description</a></li><li><a href="/wiki/Category:Short_description_is_different_from_Wikidata" title="Category:Short description is different from Wikidata">Short description is different from Wikidata</a></li><li><a href="/wiki/Category:Articles_to_be_expanded_from_April_2017" title="Category:Articles to be expanded from April 2017">Articles to be expanded from April 2017</a></li><li><a href="/wiki/Category:All_articles_to_be_expanded" title="Category:All articles to be expanded">All articles to be expanded</a></li><li><a href="/wiki/Category:Webarchive_template_wayback_links" title="Category:Webarchive template wayback links">Webarchive template wayback links</a></li></ul></div></div> </div> </main> </div> <div class="mw-footer-container"> <footer id="footer" class="mw-footer" > <ul id="footer-info"> <li id="footer-info-lastmod"> This page was last edited on 16 October 2024, at 03:10<span class="anonymous-show"> (UTC)</span>.</li> <li id="footer-info-copyright">Text is available under the <a href="/wiki/Wikipedia:Text_of_the_Creative_Commons_Attribution-ShareAlike_4.0_International_License" title="Wikipedia:Text of the Creative Commons Attribution-ShareAlike 4.0 International License">Creative Commons Attribution-ShareAlike 4.0 License</a>; additional terms may apply. By using this site, you agree to the <a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Terms_of_Use" class="extiw" title="foundation:Special:MyLanguage/Policy:Terms of Use">Terms of Use</a> and <a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy" class="extiw" title="foundation:Special:MyLanguage/Policy:Privacy policy">Privacy Policy</a>. Wikipedia® is a registered trademark of the <a rel="nofollow" class="external text" href="https://wikimediafoundation.org/">Wikimedia Foundation, Inc.</a>, a non-profit organization.</li> </ul> <ul id="footer-places"> <li id="footer-places-privacy"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Privacy_policy">Privacy policy</a></li> <li id="footer-places-about"><a href="/wiki/Wikipedia:About">About Wikipedia</a></li> <li id="footer-places-disclaimers"><a href="/wiki/Wikipedia:General_disclaimer">Disclaimers</a></li> <li id="footer-places-contact"><a href="//en.wikipedia.org/wiki/Wikipedia:Contact_us">Contact Wikipedia</a></li> <li id="footer-places-wm-codeofconduct"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Universal_Code_of_Conduct">Code of Conduct</a></li> <li id="footer-places-developers"><a href="https://developer.wikimedia.org">Developers</a></li> <li id="footer-places-statslink"><a href="https://stats.wikimedia.org/#/en.wikipedia.org">Statistics</a></li> <li id="footer-places-cookiestatement"><a href="https://foundation.wikimedia.org/wiki/Special:MyLanguage/Policy:Cookie_statement">Cookie statement</a></li> <li id="footer-places-mobileview"><a href="//en.m.wikipedia.org/w/index.php?title=Complexity_class&mobileaction=toggle_view_mobile" class="noprint stopMobileRedirectToggle">Mobile view</a></li> </ul> <ul id="footer-icons" class="noprint"> <li id="footer-copyrightico"><a href="https://wikimediafoundation.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/static/images/footer/wikimedia-button.svg" width="84" height="29" alt="Wikimedia Foundation" loading="lazy"></a></li> <li id="footer-poweredbyico"><a href="https://www.mediawiki.org/" class="cdx-button cdx-button--fake-button cdx-button--size-large cdx-button--fake-button--enabled"><img src="/w/resources/assets/poweredby_mediawiki.svg" alt="Powered by MediaWiki" width="88" height="31" loading="lazy"></a></li> </ul> </footer> </div> </div> </div> <div class="vector-settings" id="p-dock-bottom"> <ul></ul> </div><script>(RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgHostname":"mw-web.codfw.main-6df7948d6c-2vfms","wgBackendResponseTime":164,"wgPageParseReport":{"limitreport":{"cputime":"0.942","walltime":"1.369","ppvisitednodes":{"value":5259,"limit":1000000},"postexpandincludesize":{"value":57496,"limit":2097152},"templateargumentsize":{"value":3976,"limit":2097152},"expansiondepth":{"value":10,"limit":100},"expensivefunctioncount":{"value":27,"limit":500},"unstrip-depth":{"value":1,"limit":20},"unstrip-size":{"value":74251,"limit":5000000},"entityaccesscount":{"value":0,"limit":400},"timingprofile":["100.00% 742.351 1 -total"," 20.85% 154.778 7 Template:Cite_web"," 14.59% 108.344 1 Template:Short_description"," 13.40% 99.475 1 Template:ComplexityClasses"," 12.67% 94.087 1 Template:Navbox"," 12.66% 93.989 34 Template:Sfn"," 10.74% 79.728 2 Template:Pagetype"," 8.40% 62.337 1 Template:Expand_section"," 7.67% 56.957 1 Template:Ambox"," 7.65% 56.783 18 Template:Main"]},"scribunto":{"limitreport-timeusage":{"value":"0.479","limit":"10.000"},"limitreport-memusage":{"value":6780349,"limit":52428800},"limitreport-logs":"anchor_id_list = table#1 {\n [\"CITEREFAaronson2017\"] = 1,\n [\"CITEREFArora2003\"] = 1,\n [\"CITEREFAroraBarak2009\"] = 1,\n [\"CITEREFBarak2006\"] = 1,\n [\"CITEREFFortnow1997\"] = 1,\n [\"CITEREFGasarch2019\"] = 1,\n [\"CITEREFGoldreich2006\"] = 1,\n [\"CITEREFJohnson1990\"] = 1,\n [\"CITEREFLee2014\"] = 1,\n [\"CITEREFNeil_Immerman\"] = 1,\n [\"CITEREFRich2008\"] = 1,\n [\"CITEREFSipser2006\"] = 1,\n [\"CITEREFWatrous2006\"] = 1,\n}\ntemplate_list = table#1 {\n [\"Cite book\"] = 5,\n [\"Cite encyclopedia\"] = 1,\n [\"Cite web\"] = 7,\n [\"ComplexityClasses\"] = 1,\n [\"Efn\"] = 1,\n [\"Expand section\"] = 1,\n [\"Main\"] = 18,\n [\"Main article\"] = 2,\n [\"Mvar\"] = 1,\n [\"Notelist\"] = 1,\n [\"Reflist\"] = 1,\n [\"See also\"] = 2,\n [\"Sfn\"] = 34,\n [\"Sfnp\"] = 1,\n [\"Short description\"] = 1,\n [\"Snf\"] = 1,\n [\"Webarchive\"] = 1,\n}\narticle_whitelist = table#1 {\n}\n"},"cachereport":{"origin":"mw-api-ext.codfw.main-744c7589dd-q45xq","timestamp":"20241125135705","ttl":2592000,"transientcontent":false}}});});</script> <script type="application/ld+json">{"@context":"https:\/\/schema.org","@type":"Article","name":"Complexity class","url":"https:\/\/en.wikipedia.org\/wiki\/Complexity_class","sameAs":"http:\/\/www.wikidata.org\/entity\/Q908207","mainEntity":"http:\/\/www.wikidata.org\/entity\/Q908207","author":{"@type":"Organization","name":"Contributors to Wikimedia projects"},"publisher":{"@type":"Organization","name":"Wikimedia Foundation, Inc.","logo":{"@type":"ImageObject","url":"https:\/\/www.wikimedia.org\/static\/images\/wmf-hor-googpub.png"}},"datePublished":"2004-03-03T19:43:44Z","dateModified":"2024-10-16T03:10:13Z","image":"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/6\/6e\/Complexity_subsets_pspace.svg","headline":"set of problems in computational complexity theory of related resource-based complexity"}</script> </body> </html>