#include <bits/stdc++.h>
#define rep(i,n) for(int i=(0);i<(n);i++)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);

	int n;
	cin >> n;

	vector<int> a(n), b(n);
	rep(i, n) cin >> a[i];
	rep(i, n) cin >> b[i];

	double won = 0.0;
	double tot = 0.0;

	vector<int> v(n), w(n);
	rep(i, n){
		v[i] = i;
		w[i] = i;
	}

	do{
		do{
			tot++;
			int acnt = 0, bcnt = 0;
			rep(i, n){
				if(a[v[i]] > b[w[i]]) acnt++;
				if(a[v[i]] < b[w[i]]) bcnt++;
			}

			if(acnt > bcnt) won++;
		}while(next_permutation(v.begin(), v.end()));
	}while(next_permutation(w.begin(), w.end()));

	cout << fixed << setprecision(10);
	cout << won / tot << endl;
}