Is exponentiation in P?
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
I think the following problem belong to class P, but I don't know how I can prove it, could somebody help me?
- Inputs: two numbers $(a,b) in mathbbN$
- Output: $a^b$
complexity-theory complexity-classes
add a comment |Â
up vote
3
down vote
favorite
I think the following problem belong to class P, but I don't know how I can prove it, could somebody help me?
- Inputs: two numbers $(a,b) in mathbbN$
- Output: $a^b$
complexity-theory complexity-classes
I don't really see the connection between your two questions, so I have removed the second one.
â Yuval Filmus
4 hours ago
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I think the following problem belong to class P, but I don't know how I can prove it, could somebody help me?
- Inputs: two numbers $(a,b) in mathbbN$
- Output: $a^b$
complexity-theory complexity-classes
I think the following problem belong to class P, but I don't know how I can prove it, could somebody help me?
- Inputs: two numbers $(a,b) in mathbbN$
- Output: $a^b$
complexity-theory complexity-classes
complexity-theory complexity-classes
edited 4 hours ago
Yuval Filmus
184k12175335
184k12175335
asked 5 hours ago
linkho
213
213
I don't really see the connection between your two questions, so I have removed the second one.
â Yuval Filmus
4 hours ago
add a comment |Â
I don't really see the connection between your two questions, so I have removed the second one.
â Yuval Filmus
4 hours ago
I don't really see the connection between your two questions, so I have removed the second one.
â Yuval Filmus
4 hours ago
I don't really see the connection between your two questions, so I have removed the second one.
â Yuval Filmus
4 hours ago
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
Your problem is not in P, for two different reasons:
P is a class of decision problems, but your problem is a function problem. Instead of P, you should consider its functional equivalent FP.
The output could be exponentially large in the input length: encoding $b$ takes about $log b$ bits, but encoding $a^b$ takes about $b log a$ bits.
This still leaves open the possibility that the following problem is in P:
Given natural numbers $a,b$ and an index $i$, determine the $i$th bit of $a^b$.
While I don't know what the answer to this question is, here is a related problem in FP:
Given natural numbers $a,b,c$, determine $a^b bmod c$.
This can be shown using the important technique of repeated squaring.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
Your problem is not in P, for two different reasons:
P is a class of decision problems, but your problem is a function problem. Instead of P, you should consider its functional equivalent FP.
The output could be exponentially large in the input length: encoding $b$ takes about $log b$ bits, but encoding $a^b$ takes about $b log a$ bits.
This still leaves open the possibility that the following problem is in P:
Given natural numbers $a,b$ and an index $i$, determine the $i$th bit of $a^b$.
While I don't know what the answer to this question is, here is a related problem in FP:
Given natural numbers $a,b,c$, determine $a^b bmod c$.
This can be shown using the important technique of repeated squaring.
add a comment |Â
up vote
3
down vote
Your problem is not in P, for two different reasons:
P is a class of decision problems, but your problem is a function problem. Instead of P, you should consider its functional equivalent FP.
The output could be exponentially large in the input length: encoding $b$ takes about $log b$ bits, but encoding $a^b$ takes about $b log a$ bits.
This still leaves open the possibility that the following problem is in P:
Given natural numbers $a,b$ and an index $i$, determine the $i$th bit of $a^b$.
While I don't know what the answer to this question is, here is a related problem in FP:
Given natural numbers $a,b,c$, determine $a^b bmod c$.
This can be shown using the important technique of repeated squaring.
add a comment |Â
up vote
3
down vote
up vote
3
down vote
Your problem is not in P, for two different reasons:
P is a class of decision problems, but your problem is a function problem. Instead of P, you should consider its functional equivalent FP.
The output could be exponentially large in the input length: encoding $b$ takes about $log b$ bits, but encoding $a^b$ takes about $b log a$ bits.
This still leaves open the possibility that the following problem is in P:
Given natural numbers $a,b$ and an index $i$, determine the $i$th bit of $a^b$.
While I don't know what the answer to this question is, here is a related problem in FP:
Given natural numbers $a,b,c$, determine $a^b bmod c$.
This can be shown using the important technique of repeated squaring.
Your problem is not in P, for two different reasons:
P is a class of decision problems, but your problem is a function problem. Instead of P, you should consider its functional equivalent FP.
The output could be exponentially large in the input length: encoding $b$ takes about $log b$ bits, but encoding $a^b$ takes about $b log a$ bits.
This still leaves open the possibility that the following problem is in P:
Given natural numbers $a,b$ and an index $i$, determine the $i$th bit of $a^b$.
While I don't know what the answer to this question is, here is a related problem in FP:
Given natural numbers $a,b,c$, determine $a^b bmod c$.
This can be shown using the important technique of repeated squaring.
answered 3 hours ago
Yuval Filmus
184k12175335
184k12175335
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcs.stackexchange.com%2fquestions%2f98881%2fis-exponentiation-in-p%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
I don't really see the connection between your two questions, so I have removed the second one.
â Yuval Filmus
4 hours ago