from research import *
s=begin(1193,'Measure the gain from the second rounded component','How does a singleton arise from combining two individually ambiguous observations?',{},['C1192'])
d=json.loads((ROOT/'model/ordinary_joint_rounding_fibres.json').read_text());out=[]
for x in d['rows']:
 if x['count']==1:
  b_only=list(range(x['B']-2,x['B']+3));r_only=[x['L']-r for r in range(x['R']-2,x['R']+3)]
  out.append({'row':x['tradition']+':'+x['name'],'B_and_L_candidates':b_only,'R_and_L_candidates':sorted(r_only),'intersection':sorted(set(b_only)&set(r_only)),'exact_source_b':x['b']})
a=artifact('model/joint_rounding_singleton_intersections.json',json.dumps(out,indent=2)+'\n')
finish(s,{'intersections':a,'rows':len(out)},'Each singleton combines two five-choice observations whose candidate sets touch at one endpoint. The gain is genuine conditional information, although these current observations share the same source derivation.','Use LXX Lamech to show a nearby non-singleton and preserve the main753 state.',{'five_each':all(len(x['B_and_L_candidates'])==len(x['R_and_L_candidates'])==5 for x in out),'one_joint':all(x['intersection']==[x['exact_source_b']] for x in out)})
