#include <bits/stdc++.h>
using namespace std;

#define for_(i,a,b) for(int i=(a);i<(b);++i)
#define allof(a) (a).begin(),(a).end()

int N;
double p[111];
vector< vector< int > > adj, r_adj, dag;
vector< int > rev_order, topol;
vector< bool > used;

void dfs(int v) {
	used[v] = true;
	for (int u : adj[v]) if (!used[u]) dfs(u);
	rev_order.push_back(v);
}

void revDFS(int v, int k) {
	used[v] = true;
	topol[v] = k;
	for (int u : r_adj[v]) if (!used[u]) revDFS(u, k);
}

void scc() {
	rev_order.clear();
	topol.assign(N, -1);
	used.assign(N, false);
	
	for_(v,0,N) if (!used[v]) dfs(v);
	
	fill(allof(used), false);
	int k = 0;
	reverse(allof(rev_order));
	for (int v : rev_order) if (!used[v]) revDFS(v, k++);
	
	dag.assign(k, vector< int >());
	for_(v,0,N) {
		int top_v = topol[v];
		for (int u : adj[v]) if (top_v != topol[u]) dag[top_v].push_back(topol[u]);
	}
	
	for_(i,0,k) {
		sort(allof(dag[i]));
		dag[i].erase(unique(allof(dag[i])), dag[i].end());
	}
}

void solve() {
	scc();
	
	int n = dag.size();
	vector< int > in_deg(n, 0);
	for_(i,0,n) for (int x : dag[i]) ++in_deg[x];
	
	double ans = 1.0;
	for_(i,0,n) {
		if (in_deg[i] == 0) {
			double rate = 1.0;
			for_(v,0,N) if (topol[v] == i) rate *= p[v];
			ans *= (1.0 - rate);
		}
	}
	printf("%.9lf\n", ans);
}

int main() {
	while (cin >> N, N) {
		adj.assign(N, vector< int >());
		r_adj.assign(N, vector< int >());
		for_(v,0,N) {
			int m; cin >> p[v] >> m;
			for_(i,0,m) {
				int a; cin >> a; --a;
				adj[v].push_back(a);
				r_adj[a].push_back(v);
			}
		}		
		solve();
	}
}