Combinations and Permutations - 5 digts from 1-9 such that two are prime and two are square, no repeats












4












$begingroup$


A pin code is 5 digits long, using only the numbers 1-9 with no repeats. How many combinations are there if two of the numbers must be prime and two must be square.



The primes are 2, 3, 5 and 7 (so there must be two of these)
Squares are 1, 4, and 9 (two of these)
The remaining digit must be a 6 or 8



I think the right answer is 8640
What I think I've got so far is 4P2 * 3P2 * 5! = 8640
I'm not sure if that's correct. My thinking was you have 2 out of 4 primes and 2 out of 3 squares. The 5! for the different ordering of 5 digits. But I haven't done anything about the remaining digit (either 6 or 8).



Is anyone able to offer a better explanation of how to work this out.



Thank You



Edit: I realised I haven't clarified whether it is exactly 2 or at least 2 primes (same with squares). I don't have the question with me anymore so I don't remember. My hunch is it said exactly 2 primes and exactly 2 squares.










share|cite|improve this question











$endgroup$








  • 2




    $begingroup$
    $,^4 C_2 times ,^3 C_2 times ,^2 C_1 times 5! = 4320$ would be more plausible, but it is unclear to me whether $23549$ would satisfy the conditions in the question: if so there would be more
    $endgroup$
    – Henry
    Nov 30 '18 at 10:39










  • $begingroup$
    @Henry I updated the question. I realised I didn't clarify this point. I think 23549 wouldn't count.
    $endgroup$
    – NumberCruncher
    Nov 30 '18 at 10:43
















4












$begingroup$


A pin code is 5 digits long, using only the numbers 1-9 with no repeats. How many combinations are there if two of the numbers must be prime and two must be square.



The primes are 2, 3, 5 and 7 (so there must be two of these)
Squares are 1, 4, and 9 (two of these)
The remaining digit must be a 6 or 8



I think the right answer is 8640
What I think I've got so far is 4P2 * 3P2 * 5! = 8640
I'm not sure if that's correct. My thinking was you have 2 out of 4 primes and 2 out of 3 squares. The 5! for the different ordering of 5 digits. But I haven't done anything about the remaining digit (either 6 or 8).



Is anyone able to offer a better explanation of how to work this out.



Thank You



Edit: I realised I haven't clarified whether it is exactly 2 or at least 2 primes (same with squares). I don't have the question with me anymore so I don't remember. My hunch is it said exactly 2 primes and exactly 2 squares.










share|cite|improve this question











$endgroup$








  • 2




    $begingroup$
    $,^4 C_2 times ,^3 C_2 times ,^2 C_1 times 5! = 4320$ would be more plausible, but it is unclear to me whether $23549$ would satisfy the conditions in the question: if so there would be more
    $endgroup$
    – Henry
    Nov 30 '18 at 10:39










  • $begingroup$
    @Henry I updated the question. I realised I didn't clarify this point. I think 23549 wouldn't count.
    $endgroup$
    – NumberCruncher
    Nov 30 '18 at 10:43














4












4








4





$begingroup$


A pin code is 5 digits long, using only the numbers 1-9 with no repeats. How many combinations are there if two of the numbers must be prime and two must be square.



The primes are 2, 3, 5 and 7 (so there must be two of these)
Squares are 1, 4, and 9 (two of these)
The remaining digit must be a 6 or 8



I think the right answer is 8640
What I think I've got so far is 4P2 * 3P2 * 5! = 8640
I'm not sure if that's correct. My thinking was you have 2 out of 4 primes and 2 out of 3 squares. The 5! for the different ordering of 5 digits. But I haven't done anything about the remaining digit (either 6 or 8).



Is anyone able to offer a better explanation of how to work this out.



Thank You



Edit: I realised I haven't clarified whether it is exactly 2 or at least 2 primes (same with squares). I don't have the question with me anymore so I don't remember. My hunch is it said exactly 2 primes and exactly 2 squares.










share|cite|improve this question











$endgroup$




A pin code is 5 digits long, using only the numbers 1-9 with no repeats. How many combinations are there if two of the numbers must be prime and two must be square.



The primes are 2, 3, 5 and 7 (so there must be two of these)
Squares are 1, 4, and 9 (two of these)
The remaining digit must be a 6 or 8



I think the right answer is 8640
What I think I've got so far is 4P2 * 3P2 * 5! = 8640
I'm not sure if that's correct. My thinking was you have 2 out of 4 primes and 2 out of 3 squares. The 5! for the different ordering of 5 digits. But I haven't done anything about the remaining digit (either 6 or 8).



Is anyone able to offer a better explanation of how to work this out.



Thank You



Edit: I realised I haven't clarified whether it is exactly 2 or at least 2 primes (same with squares). I don't have the question with me anymore so I don't remember. My hunch is it said exactly 2 primes and exactly 2 squares.







combinatorics permutations






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Nov 30 '18 at 11:16









N. F. Taussig

43.7k93355




43.7k93355










asked Nov 30 '18 at 10:22









NumberCruncherNumberCruncher

967




967








  • 2




    $begingroup$
    $,^4 C_2 times ,^3 C_2 times ,^2 C_1 times 5! = 4320$ would be more plausible, but it is unclear to me whether $23549$ would satisfy the conditions in the question: if so there would be more
    $endgroup$
    – Henry
    Nov 30 '18 at 10:39










  • $begingroup$
    @Henry I updated the question. I realised I didn't clarify this point. I think 23549 wouldn't count.
    $endgroup$
    – NumberCruncher
    Nov 30 '18 at 10:43














  • 2




    $begingroup$
    $,^4 C_2 times ,^3 C_2 times ,^2 C_1 times 5! = 4320$ would be more plausible, but it is unclear to me whether $23549$ would satisfy the conditions in the question: if so there would be more
    $endgroup$
    – Henry
    Nov 30 '18 at 10:39










  • $begingroup$
    @Henry I updated the question. I realised I didn't clarify this point. I think 23549 wouldn't count.
    $endgroup$
    – NumberCruncher
    Nov 30 '18 at 10:43








2




2




$begingroup$
$,^4 C_2 times ,^3 C_2 times ,^2 C_1 times 5! = 4320$ would be more plausible, but it is unclear to me whether $23549$ would satisfy the conditions in the question: if so there would be more
$endgroup$
– Henry
Nov 30 '18 at 10:39




$begingroup$
$,^4 C_2 times ,^3 C_2 times ,^2 C_1 times 5! = 4320$ would be more plausible, but it is unclear to me whether $23549$ would satisfy the conditions in the question: if so there would be more
$endgroup$
– Henry
Nov 30 '18 at 10:39












$begingroup$
@Henry I updated the question. I realised I didn't clarify this point. I think 23549 wouldn't count.
$endgroup$
– NumberCruncher
Nov 30 '18 at 10:43




$begingroup$
@Henry I updated the question. I realised I didn't clarify this point. I think 23549 wouldn't count.
$endgroup$
– NumberCruncher
Nov 30 '18 at 10:43










1 Answer
1






active

oldest

votes


















4












$begingroup$

The P means you've already designated a first and a second prime, and a first and a second square. Thus $5!$ double-counts a lot of orderings. Use C instead, and this is fine.



And the $8$ or $6$ you take care of in exactly the same way: you can choose one of them in $_2C_1$ ways.



Thus the final answer is
$$
_4C_2{}cdot{} _3C_2cdot{} _2C_1cdot 5!
$$






share|cite|improve this answer









$endgroup$













  • $begingroup$
    This assumes that you need exactly two primes and exactly two squares. If you can have three, then count the number of codes with three primes, two squares and with two primes, three squares the same way and add them together.
    $endgroup$
    – Arthur
    Nov 30 '18 at 10:42












  • $begingroup$
    I clarified this in my edit. Sorry I overlooked this when I posted. Would the answer be 8640 if the question was at least 2 primes or at least 2 squares.
    $endgroup$
    – NumberCruncher
    Nov 30 '18 at 10:45










  • $begingroup$
    @NumberCruncher I get the same digits, but in a different order: $6480$.
    $endgroup$
    – Arthur
    Nov 30 '18 at 11:08










  • $begingroup$
    Yes, that's probably it. The answer must have been 6480 not 8640 as I misremembered it. How did you get that please? Is this for at least 2 primes and at least 2 squares?
    $endgroup$
    – NumberCruncher
    Nov 30 '18 at 13:10










  • $begingroup$
    @NumberCruncher I followed my first comment. The easiest way is to do all three cases separately.
    $endgroup$
    – Arthur
    Nov 30 '18 at 13:31











Your Answer





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

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

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

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3019931%2fcombinations-and-permutations-5-digts-from-1-9-such-that-two-are-prime-and-two%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









4












$begingroup$

The P means you've already designated a first and a second prime, and a first and a second square. Thus $5!$ double-counts a lot of orderings. Use C instead, and this is fine.



And the $8$ or $6$ you take care of in exactly the same way: you can choose one of them in $_2C_1$ ways.



Thus the final answer is
$$
_4C_2{}cdot{} _3C_2cdot{} _2C_1cdot 5!
$$






share|cite|improve this answer









$endgroup$













  • $begingroup$
    This assumes that you need exactly two primes and exactly two squares. If you can have three, then count the number of codes with three primes, two squares and with two primes, three squares the same way and add them together.
    $endgroup$
    – Arthur
    Nov 30 '18 at 10:42












  • $begingroup$
    I clarified this in my edit. Sorry I overlooked this when I posted. Would the answer be 8640 if the question was at least 2 primes or at least 2 squares.
    $endgroup$
    – NumberCruncher
    Nov 30 '18 at 10:45










  • $begingroup$
    @NumberCruncher I get the same digits, but in a different order: $6480$.
    $endgroup$
    – Arthur
    Nov 30 '18 at 11:08










  • $begingroup$
    Yes, that's probably it. The answer must have been 6480 not 8640 as I misremembered it. How did you get that please? Is this for at least 2 primes and at least 2 squares?
    $endgroup$
    – NumberCruncher
    Nov 30 '18 at 13:10










  • $begingroup$
    @NumberCruncher I followed my first comment. The easiest way is to do all three cases separately.
    $endgroup$
    – Arthur
    Nov 30 '18 at 13:31
















4












$begingroup$

The P means you've already designated a first and a second prime, and a first and a second square. Thus $5!$ double-counts a lot of orderings. Use C instead, and this is fine.



And the $8$ or $6$ you take care of in exactly the same way: you can choose one of them in $_2C_1$ ways.



Thus the final answer is
$$
_4C_2{}cdot{} _3C_2cdot{} _2C_1cdot 5!
$$






share|cite|improve this answer









$endgroup$













  • $begingroup$
    This assumes that you need exactly two primes and exactly two squares. If you can have three, then count the number of codes with three primes, two squares and with two primes, three squares the same way and add them together.
    $endgroup$
    – Arthur
    Nov 30 '18 at 10:42












  • $begingroup$
    I clarified this in my edit. Sorry I overlooked this when I posted. Would the answer be 8640 if the question was at least 2 primes or at least 2 squares.
    $endgroup$
    – NumberCruncher
    Nov 30 '18 at 10:45










  • $begingroup$
    @NumberCruncher I get the same digits, but in a different order: $6480$.
    $endgroup$
    – Arthur
    Nov 30 '18 at 11:08










  • $begingroup$
    Yes, that's probably it. The answer must have been 6480 not 8640 as I misremembered it. How did you get that please? Is this for at least 2 primes and at least 2 squares?
    $endgroup$
    – NumberCruncher
    Nov 30 '18 at 13:10










  • $begingroup$
    @NumberCruncher I followed my first comment. The easiest way is to do all three cases separately.
    $endgroup$
    – Arthur
    Nov 30 '18 at 13:31














4












4








4





$begingroup$

The P means you've already designated a first and a second prime, and a first and a second square. Thus $5!$ double-counts a lot of orderings. Use C instead, and this is fine.



And the $8$ or $6$ you take care of in exactly the same way: you can choose one of them in $_2C_1$ ways.



Thus the final answer is
$$
_4C_2{}cdot{} _3C_2cdot{} _2C_1cdot 5!
$$






share|cite|improve this answer









$endgroup$



The P means you've already designated a first and a second prime, and a first and a second square. Thus $5!$ double-counts a lot of orderings. Use C instead, and this is fine.



And the $8$ or $6$ you take care of in exactly the same way: you can choose one of them in $_2C_1$ ways.



Thus the final answer is
$$
_4C_2{}cdot{} _3C_2cdot{} _2C_1cdot 5!
$$







share|cite|improve this answer












share|cite|improve this answer



share|cite|improve this answer










answered Nov 30 '18 at 10:37









ArthurArthur

112k7107190




112k7107190












  • $begingroup$
    This assumes that you need exactly two primes and exactly two squares. If you can have three, then count the number of codes with three primes, two squares and with two primes, three squares the same way and add them together.
    $endgroup$
    – Arthur
    Nov 30 '18 at 10:42












  • $begingroup$
    I clarified this in my edit. Sorry I overlooked this when I posted. Would the answer be 8640 if the question was at least 2 primes or at least 2 squares.
    $endgroup$
    – NumberCruncher
    Nov 30 '18 at 10:45










  • $begingroup$
    @NumberCruncher I get the same digits, but in a different order: $6480$.
    $endgroup$
    – Arthur
    Nov 30 '18 at 11:08










  • $begingroup$
    Yes, that's probably it. The answer must have been 6480 not 8640 as I misremembered it. How did you get that please? Is this for at least 2 primes and at least 2 squares?
    $endgroup$
    – NumberCruncher
    Nov 30 '18 at 13:10










  • $begingroup$
    @NumberCruncher I followed my first comment. The easiest way is to do all three cases separately.
    $endgroup$
    – Arthur
    Nov 30 '18 at 13:31


















  • $begingroup$
    This assumes that you need exactly two primes and exactly two squares. If you can have three, then count the number of codes with three primes, two squares and with two primes, three squares the same way and add them together.
    $endgroup$
    – Arthur
    Nov 30 '18 at 10:42












  • $begingroup$
    I clarified this in my edit. Sorry I overlooked this when I posted. Would the answer be 8640 if the question was at least 2 primes or at least 2 squares.
    $endgroup$
    – NumberCruncher
    Nov 30 '18 at 10:45










  • $begingroup$
    @NumberCruncher I get the same digits, but in a different order: $6480$.
    $endgroup$
    – Arthur
    Nov 30 '18 at 11:08










  • $begingroup$
    Yes, that's probably it. The answer must have been 6480 not 8640 as I misremembered it. How did you get that please? Is this for at least 2 primes and at least 2 squares?
    $endgroup$
    – NumberCruncher
    Nov 30 '18 at 13:10










  • $begingroup$
    @NumberCruncher I followed my first comment. The easiest way is to do all three cases separately.
    $endgroup$
    – Arthur
    Nov 30 '18 at 13:31
















$begingroup$
This assumes that you need exactly two primes and exactly two squares. If you can have three, then count the number of codes with three primes, two squares and with two primes, three squares the same way and add them together.
$endgroup$
– Arthur
Nov 30 '18 at 10:42






$begingroup$
This assumes that you need exactly two primes and exactly two squares. If you can have three, then count the number of codes with three primes, two squares and with two primes, three squares the same way and add them together.
$endgroup$
– Arthur
Nov 30 '18 at 10:42














$begingroup$
I clarified this in my edit. Sorry I overlooked this when I posted. Would the answer be 8640 if the question was at least 2 primes or at least 2 squares.
$endgroup$
– NumberCruncher
Nov 30 '18 at 10:45




$begingroup$
I clarified this in my edit. Sorry I overlooked this when I posted. Would the answer be 8640 if the question was at least 2 primes or at least 2 squares.
$endgroup$
– NumberCruncher
Nov 30 '18 at 10:45












$begingroup$
@NumberCruncher I get the same digits, but in a different order: $6480$.
$endgroup$
– Arthur
Nov 30 '18 at 11:08




$begingroup$
@NumberCruncher I get the same digits, but in a different order: $6480$.
$endgroup$
– Arthur
Nov 30 '18 at 11:08












$begingroup$
Yes, that's probably it. The answer must have been 6480 not 8640 as I misremembered it. How did you get that please? Is this for at least 2 primes and at least 2 squares?
$endgroup$
– NumberCruncher
Nov 30 '18 at 13:10




$begingroup$
Yes, that's probably it. The answer must have been 6480 not 8640 as I misremembered it. How did you get that please? Is this for at least 2 primes and at least 2 squares?
$endgroup$
– NumberCruncher
Nov 30 '18 at 13:10












$begingroup$
@NumberCruncher I followed my first comment. The easiest way is to do all three cases separately.
$endgroup$
– Arthur
Nov 30 '18 at 13:31




$begingroup$
@NumberCruncher I followed my first comment. The easiest way is to do all three cases separately.
$endgroup$
– Arthur
Nov 30 '18 at 13:31


















draft saved

draft discarded




















































Thanks for contributing an answer to Mathematics Stack Exchange!


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

But avoid



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

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


Use MathJax to format equations. MathJax reference.


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




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3019931%2fcombinations-and-permutations-5-digts-from-1-9-such-that-two-are-prime-and-two%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Quarter-circle Tiles

build a pushdown automaton that recognizes the reverse language of a given pushdown automaton?

Mont Emei