import java.util.*; public class Q133 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); Integer[] a = new Integer[N]; Integer[] b = new Integer[N]; for (int i = 0; i < N; i++) { a[i] = sc.nextInt(); } for (int i = 0; i < N; i++) { b[i] = sc.nextInt(); } Integer[] na = new Integer[N]; Integer[] nb = new Integer[N]; for (int i = 0; i < N; i++) { na[i] = i; nb[i] = i; } int cnt = 0; int win = 0; do { do { int awin = 0; int bwin = 0; for (int i = 0; i < N; i++) { if (a[na[i]] > b[nb[i]]) awin++; if (b[nb[i]] > a[na[i]]) bwin++; } if (awin > bwin) win++; cnt++; } while ((nb = (Integer[]) nextPermutation(nb)) != null); nb = new Integer[N]; for (int i = 0; i < N; i++) { nb[i] = i; } } while ((na = (Integer[]) nextPermutation(na)) != null); System.out.println(1.0 * win / cnt); } private static Comparable[] nextPermutation(final Comparable[] c) { int first = _getFirst(c); if (first == -1) return null; int toSwap = c.length - 1; while (c[first].compareTo(c[toSwap]) >= 0) { toSwap--; } swap(c, first++, toSwap); toSwap = c.length - 1; while (first < toSwap) { swap(c, first++, toSwap--); } return c; } private static void swap(final Comparable[] c, final int i, final int j) { final Comparable tmp = c[i]; c[i] = c[j]; c[j] = tmp; } private static int _getFirst(final Comparable[] c) { for (int i = c.length - 2; i >= 0; i--) { if (c[i].compareTo(c[i + 1]) < 0) { return i; } } return -1; } }