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

struct Edge {
	int src, dst;
	Edge() : src(0), dst(0) {}
	Edge(int s, int d) : src(s), dst(d) {}
};
using Edges = std::vector<Edge>;
using Graph = std::vector<Edges>;

vector<int> SCC(const Graph &g) {
	int n = g.size(), sz = 0; Graph rg(n);
	vector<int> stk, cmp(n, -1), added(n), visited(n), ord(n);
	for(auto &es : g) {
		sz += es.size();
		for(const Edge &e : es) rg[e.dst].emplace_back(e.dst, e.src);
	}
	stk.resize(n + sz); sz = 0;
	for(int i = 0; i < n; i++) {
		if(visited[i]) continue;
		int s = 0; stk[s++] = i;
		while(s != 0) {
			int v = stk[s - 1]; visited[v] = true;
			bool pushed = false;
			for(auto &e : g[v]) {
				int dst = e.dst;
				if(!visited[dst]) { stk[s++] = dst; pushed = true; }
			}
			if(pushed) continue;
			int t = stk[s - 1];
			if(!added[t]) { added[t] = true; ord[n - ++sz] = t; }
			--s;
		}
	}
	int k = 0;
	for(int &u : ord) {
		if(cmp[u] != -1) continue;
		int s = 0; stk[s++] = u;
		while(s != 0) {
			int v = stk[--s]; cmp[v] = k;
			for(auto &e : rg[v]) {
				int d = e.dst;
				if(cmp[d] == -1) stk[s++] = d;
			}
		}
		++k;
	}
	return cmp;
}


double pr[100];

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

	int N;
	while(cin >> N, N) {
		Graph G(N);
		for(int i = 0; i < N; i++) {
			cin >> pr[i];
			int m, x;
			cin >> m;
			while(m--) {
				cin >> x;
				x--;
				G[i].push_back({ i ,x });
			}
		}
		auto scc = SCC(G);

		int V = *max_element(scc.begin(), scc.end()) + 1;
		vector<vector<int>> vs(V);
		vector<int> deg(V);
		for(int i = 0; i < N; i++) {
			vs[scc[i]].push_back(i);
			for(auto e : G[i]) {
				if(scc[i] != scc[e.dst]) {
					deg[scc[e.dst]]++;
				}
			}
		}

		double ans = 1.0;
		for(int i = 0; i < V; i++) {
			if(deg[i] > 0) continue;
			double all_sleep = 1.0;
			for(auto v : vs[i]) {
				all_sleep *= pr[v];
			}
			ans *= 1.0 - all_sleep;
		}

		cout << fixed << setprecision(15) << ans << endl;
	}
}