高校数学の質問スレ(医者・東大卒専用) Part438 (979レス)
高校数学の質問スレ(医者・東大卒専用) Part438 http://rio2016.5ch.net/test/read.cgi/math/1723152147/
上
下
前次
1-
新
通常表示
512バイト分割
レス栞
抽出解除
必死チェッカー(本家)
(べ)
自ID
レス栞
あぼーん
399: 132人目の素数さん [sage] 2024/12/08(日) 20:14:35.59 ID:jwOd3Bh7 (* 実験のために抗原陰性の血清2024検体を準備していたところ、手違いで抗原陽性の検体が1つ紛れて2025検体になった。 抗原陽性の検体を同定する *) solve[m_]:=( (* m:総数検体数 *) n=2^Ceiling[Log[2,m]]; t1=Table[Reverse@IntegerDigits[x,2],{x,1,n-1}]; ans=Table[{},Log[2,n]]; For[i=1,i<m,i++,AppendTo[ans[[#]],i]& /@ Flatten@Position[t1[[i]],1]]; Reverse[ans] (* 混合検体グループの構成 *) ) re=solve[2025]; Table[Short@re[[i]],{i,1,Length[re]}] (* 網羅して確認 *) samples=2025; re=solve[samples]; verify[x_]:=( bin=Table[Boole@MemberQ[re[[i]],x],{i,Length[re]}];(* グループ毎の結果 1:陽性 0:陰性 *) pos=Flatten@Position[bin,1]; neg=Flatten@Position[bin,0]; Complement[Intersection @@ re[[pos]],Flatten@re[[neg]]]=={x} ) AllTrue[Range[samples-1],verify] http://rio2016.5ch.net/test/read.cgi/math/1723152147/399
401: 132人目の素数さん [sage] 2024/12/08(日) 21:21:32.82 ID:jwOd3Bh7 >>396 同時並行すら理解できないのが裏口容疑者 http://rio2016.5ch.net/test/read.cgi/math/1723152147/401
メモ帳
(0/65535文字)
上
下
前次
1-
新
書
関
写
板
覧
索
設
栞
歴
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
AAサムネイル
Google検索
Wikipedia
ぬこの手
ぬこTOP
1.716s*