#include <bits/stdc++.h>
                                        #include<iostream>
                                        #include<cstdio>
                                        #include<vector>
                                        #include<queue>
                                        #include<map>
                                        #include<cstring>
                                        #include<string>
                                        #include <math.h>
                                        #include<algorithm>
                                    //    #include <boost/multiprecision/cpp_int.hpp>
                                        #include<functional>
                                #define int long long
                                        #define inf  1000000007
                                        #define pa pair<int,int>
                                        #define ll long long
                                        #define pal pair<double,pa>
                                        #define ppa pair<int,int>
                                        #define ppap pair<int,pa>
                                        #define ssa pair<string,int>
                                        #define  mp make_pair
                                        #define  pb push_back
                                        #define EPS (1e-10)
                                        #define equals(a,b) (fabs((a)-(b))<EPS)
                                  #define VI vector<int>
                                        using namespace std;
                                        
                                  class pas{
                                    	public:
                                    	int x,y;
                                    	pas(int x=0,int y=0):x(x),y(y) {}
                                    	pas operator + (pas p) {return pas(x+p.x,y+p.y);}
                                    	pas operator - (pas p) {return pas(x-p.x,y-p.y);}
                                    	pas operator * (int a) {return pas(x*a,y*a);}
                                    	pas operator / (int a) {return pas(x/a,y/a);}
                                    //	double absv() {return sqrt(norm());}
                                    	int norm() {return x*x+y*y;}
                                    	bool operator < (const pas &p) const{
                                   		return x != p.x ? x<p.x: y<p.y;
                                   	}
                                  //		bool operator < (const pas &p) const{
                                    //		return y != p.y ? y<p.y: x<p.x;
                                    //	}
                                    	bool operator == (const pas &p) const{
                                    		return x==p.x && y==p.y;
                                    	}
                                    };
vector<int> gr[110];
double p[110];
int wf[110][110];
int num[110];
         signed main(){
	
	int n;
         	while(1){
         	cin>>n;
         		if(n==0) return 0;
         		for(int i=0;i<110;i++){
         			gr[i].clear();
         			p[i]=0.0;
         			num[i]=0;
         			for(int j=0;j<110;j++)wf[i][j]=inf;
         		}
         	
         	
         	for(int i=0;i<n;i++){
         		cin>>p[i];
         		int r;
         		cin>>r;
         		for(int j=0;j<r;j++){
         			int rr;
         			cin>>rr;
         			rr--;
         			wf[i][rr]=1;
         		}
         	}
         	
         	for(int k=0;k<n;k++)for(int i=0;i<n;i++)for(int j=0;j<n;j++){
         		wf[i][j]=min(wf[i][j],wf[i][k]+wf[k][j]);
         	}
         	int cn=0;
         	for(int i=0;i<n;i++){
         		bool bo=false;
         		for(int j=0;j<i;j++){
         			if(wf[i][j]<inf && wf[j][i]<inf){
         				bo=1;
         				num[i]=num[j];
         				gr[num[i]].pb(i);
         				break;
         			} 
         			
         		}
         		if(!bo){
         			num[i]=cn;
         			gr[cn].pb(i);
         			cn++;
         		}
         	}
         	double ans=1;
         	for(int i=0;i<cn;i++){
         		bool bo=false;
         		for(int j=0;j<cn;j++)if(i!=j)if(wf[gr[j][0]][gr[i][0]]<inf)bo=1;
         		if(!bo){
         			double r=1;
         			for(auto v:gr[i]) r*= p[v];
         			r=1-r;
         			
         			ans*=r;
         		}
         	}
         	printf("%.10lf\n",ans);
         	}
         	//cout<<ans<<endl;
           	return 0;
           }


Measured memory_bytes: 3316