id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

andersoniii.edwin@cusd80.com > permutations
prev  |  next  |  chance

Permutations -- Remember from your algebra daze -- A Permutation is an ordered Combination (where you remind yourself that order matters. Sometimes you will see it written 7P5 or in function notation P(7,5). If you have SEVEN (distinguishable) objects and you want to order them in groups of FIVE. The "formula is 7!/5!" ... You can write a helper method to calculate factorial - call it twice and find the quotient ... OR you can recognize 7!/5! = (7*6*5*4*3*2*1)/(5*4*3*2*1) = 7*6 = 42


permutations(7, 5) → 42
permutations(3, 2) → 3
permutations(5, 1) → 120

...Save, Compile, Run (ctrl-enter)

public int permutations(int num1, int num2){ }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 101

Copyright Nick Parlante 2017 - privacy