#include<bits/stdc++.h>
#define rep(i,a) for(int i=0;i<(int)(a);i++)
#define rrep(i,a) for(int i=(int)(a)-1;i>=0;i--)
#define all(a) (a).begin(),(a).end()
#define chmax(a,b) (a) = max((a),(b))
#define pb push_back
#define sz size()
using namespace std;
typedef vector<int> vi;

struct SCC{
  int V;
  vector<vi> G,rG;
  vi order;

  int sccV;
  vector<vi> sccG, group;
  vi sccID;

  SCC(const vector<vi> &graph):G(graph){
    V = G.sz; rG.resize(V,vi());
    rep(i,V)for(int to : G[i]) rG[to].pb(i);

    vi use(V,0);
    order.clear();
    rep(i,V) if(!use[i]) fdfs(i,use);
    
    use = vi(V,0); sccID.resize(V);
    sccV = 0;
    rrep(i,order.sz) if(!use[order[i]]) rdfs(order[i], sccV++, use);

    group.resize(sccV,vi());
    rep(i,V) group[sccID[i]].pb(i);

    sccG.resize(sccV,vi());
    rep(i,V) for(int to : G[i]){
      if(sccID[i] != sccID[to]) sccG[sccID[i]].pb(sccID[to]);
    }
    rep(i,sccV){
      sort(all(sccG[i]));
      sccG[i].erase(unique(all(sccG[i])), sccG[i].end());
    }
  }

  void fdfs(int v, vi &use){
    use[v] = 1;
    for(int to : G[v]) if(!use[to]) fdfs(to,use);
    order.pb(v);
  }

  void rdfs(int v, int k, vi &use){
    use[v] = 1; sccID[v] = k;
    for(int to : rG[v]) if(!use[to]) rdfs(to, k, use);
  }
};

int main(){
  int n;
  while(cin >> n){
    if(n==0)break;

    vector<vi> g(n);
    vector<double> p(n);
    rep(i,n){
      int m, a;
      cin >> p[i] >> m;
      rep(j,m){
	cin >> a; a--;
	g[i].pb(a);
      }    
    }
    
    SCC scc(g);
    int nn = scc.sccV;
    vi deg(nn,0);
    rep(i,nn){
      for(int to : scc.sccG[i]){
	deg[to]++;
      }
    }

    double ans = 1;
    rep(i,nn){
      if(deg[i] == 0){
	double x = 1;
	for(int v : scc.group[i]){
	  x *= p[v];
	}
	ans *= 1-x;
      }
    }
    
    cout << fixed << setprecision(9) << ans << endl;
  }
}