"""Synthetic denominator exercise, NOT observed Litecoin pool or hashrate data. Counts match pool-example.csv. No network or wallet access. """ import json def coefficient(counts,total): cumulative=0 for k,count in enumerate(sorted(counts,reverse=True),1): cumulative+=count if cumulative*2>total:return k return None if __name__=='__main__': known=[420,200,100,80];unknown=200;total=sum(known)+unknown assert total==1000 assert coefficient(known,total)==2 assert coefficient(known,sum(known))==1 assert coefficient([500,200,300],1000)==2 assert coefficient([known[0]+unknown]+known[1:],total)==1 print(json.dumps({'kind':'SYNTHETIC_NOT_OBSERVED_LITECOIN_DATA','threshold':'strictly greater than 50 percent','total_window_blocks':total,'known_blocks':sum(known),'unknown_blocks':unknown,'full_window_named_group_coefficient':coefficient(known,total),'misleading_result_excluding_unknown':coefficient(known,sum(known)),'pool_a_share_full_percent':42,'pool_a_share_identified_only_percent':52.5,'hypothetical_result_all_unknown_belong_to_a':1},indent=2))