#include using namespace std; using ll = long long; template using V = std::vector; #define REP(i, n) for (ll i=(ll)0; i<(ll)(n); i++) #define REPS(i, s, n) for (ll i=(ll)(s); i<(ll)(n); i++) #define RREP(i, n) for (ll i=(ll)(n); i>(ll)0; i--) #define RREPS(i, s, n) for (ll i=(ll)(n); i>(ll)(s); i--) #define ALL(c) std::begin((c)), std::end((c)) struct io {io() {cin.tie(0); ios::sync_with_stdio(0);} } caller; int main(){ int n; cin >> n; V a(n), b(n); REP (i, n) cin >> a[i]; REP (i, n) cin >> b[i]; V order_a(n), order_b(n); iota(ALL(order_a), 0), iota(ALL(order_b), 0); int win = 0, cnt = 0; do{ do{ int pa = 0; REP (i, n){ if (a[order_a[i]] > b[order_b[i]]) pa++; } cnt++; if (2 * pa > n) win++; }while (next_permutation(ALL(order_a))); }while (next_permutation(ALL(order_b))); cout << (long double)win / cnt << endl; return 0; }