Improving Least Recently Used implementation in Java
Bug
If the input consisted of the same page number over and over, your program would return multiple faults instead of 1, because you made this condition be first:

     if(arl.size()&lt;n)
     { ++pf;arl.add(f);}


You should switch the first and second conditions:
     if(arl.contains(f)) {
         arl.remove(arl.indexOf(f));
         arl.add(f);
     } else if(arl.size()&lt;n) {
         ++pf;
         arl.add(f);
     } else {
         arl.remove(0);
         arl.add(f);
         ++pf;
     }