[過去ログ]
高校数学の質問スレ(医者・東大卒専用) Part438 (1002レス)
高校数学の質問スレ(医者・東大卒専用) Part438 http://rio2016.5ch.net/test/read.cgi/math/1723152147/
上
下
前
次
1-
新
通常表示
512バイト分割
レス栞
このスレッドは過去ログ倉庫に格納されています。
次スレ検索
歴削→次スレ
栞削→次スレ
過去ログメニュー
295: 132人目の素数さん [sage] 2024/11/01(金) 11:42:21.71 ID:u3kBwXIx r1=4 n1=4798 n2=1e6 r2=r1*n2/n1 k=1e5 p4=rbeta(k,1+r1,1+n1-r1) p834=rbeta(k,1+r2,1+n2-r2) mean(p834>p4) hist(p834-p4) library(fmsb) hit=c(r1,r2) shot=c(n1,n2) mat=cbind(hit,missed=shot-hit) Epi::twoby2(mat) fisher.test(mat) oddsratio(r1,n1-r1,r2,n2-r2) http://rio2016.5ch.net/test/read.cgi/math/1723152147/295
296: 132人目の素数さん [sage] 2024/11/01(金) 11:57:00.31 ID:YYD9+mgY ずっと同じ事書いてるし書いた事すら忘れてんだから備忘録の意味無いじゃん 認知症患者は辛いな http://rio2016.5ch.net/test/read.cgi/math/1723152147/296
297: 132人目の素数さん [] 2024/11/01(金) 12:30:03.67 ID:6TbWLXwL >>289 ありがとうございます http://rio2016.5ch.net/test/read.cgi/math/1723152147/297
298: 132人目の素数さん [sage] 2024/11/03(日) 13:31:05.43 ID:M9AqfdYU >>295 認知症患者息してないのか http://rio2016.5ch.net/test/read.cgi/math/1723152147/298
299: 132人目の素数さん [] 2024/11/03(日) 20:44:46.89 ID:n3NWC9t5 https://i.imgur.com/eXpen7c.jpeg この(6)の3行目は正しく、(7)の3行目は間違いなのはなぜでしょうか? 同じような書き方に見えるのですが http://rio2016.5ch.net/test/read.cgi/math/1723152147/299
300: 132人目の素数さん [] 2024/11/03(日) 20:46:20.39 ID:n3NWC9t5 すいません、画像わかりやすく切り取ったものがこちらです https://i.imgur.com/VHHvFXn.jpeg http://rio2016.5ch.net/test/read.cgi/math/1723152147/300
301: 132人目の素数さん [sage] 2024/11/04(月) 07:56:10.80 ID:pGz/mTDl >>299 f(x)=0とa≦x≦<b から存在する(∃;Exists)xは示せるが、 f(x)=0とa<x<b から任意の(∀;for All)xは示せないから http://rio2016.5ch.net/test/read.cgi/math/1723152147/301
302: 132人目の素数さん [] 2024/11/08(金) 22:01:35.76 ID:cKORtqw5 >>300 ∃は存在さえ示せればいい(例外がいくらあっても1個でも該当すればいい) f(x) = 0 (何受け取っても0を返す関数) -2 < x < 4 , f(-1) = 0 -- OK -2 < x < 4 , f(-3) = 0 -- NG ∀は全てのなので、どんな場合も成り立たないといけない(1個でも例外があればNG) f(x) = -x (xの正負を逆転させる関数) -2 < x < 4 , f(-1) = 1 > 0 -- OK 1 < x < 4 , f(2) = -2 > 0 -- NG http://rio2016.5ch.net/test/read.cgi/m
ath/1723152147/302
303: 132人目の素数さん [sage] 2024/11/09(土) 05:08:56.85 ID:fDf6Btx5 1万(=n)人に一人起こる致死的副作用を検出したい。 見逃す確率の上限alphaが0.01とする 何人(=m)以上の治験参加者が必要か? " # (1-1/n)^m < alpha # m > log(alpha)/log(1-1/n) fn2m <- function(n,alpha) log(alpha)/log(1-1/n) http://rio2016.5ch.net/test/read.cgi/math/1723152147/303
304: 132人目の素数さん [] 2024/11/11(月) 00:31:59.92 ID:99G6ywRH >>302 そういうことでしたか!なるほど〜 ありがとうございました!! http://rio2016.5ch.net/test/read.cgi/math/1723152147/304
305: 132人目の素数さん [sage] 2024/11/11(月) 05:58:11.40 ID:BpvS87Le # 1-(1-1/n)^x >= cl cl=0.95 n=10000 x=log(1-cl)/log(1-1/n) ; x # log(alclha)/log(cl[no adverse effect]) "log(1-cl)=x*log(1-1/n) log((1-cl)^(1/x))=log(1-1/n) 1-1/n=(1-cl)^(1/x) 1/n=1-(1-cl)^(1/x) " x=40000 n=1/(1-(1-cl)^(1/x)) ; n x=n*y=log(1-0.95)/log(1-1/n) # solve n*y=log(1-0.95)/log(1-1/n) for y cl=0.95 n=1000 log(1/(1-cl))/(n*log(n/(n-1))) f=\(n,cl=0.95) log(1/(1-cl))/(n*log(n/(n-1))) n=10:10000 plot(n,f(n),bty='l',
type='l') abline(h=3,lty=3) http://rio2016.5ch.net/test/read.cgi/math/1723152147/305
306: 132人目の素数さん [sage] 2024/11/11(月) 10:23:15.93 ID:nC1dkxyC >>305 また朝から発狂してんのかよ尿瓶ジジイ http://rio2016.5ch.net/test/read.cgi/math/1723152147/306
307: 132人目の素数さん [sage] 2024/11/13(水) 12:44:06.50 ID:mLwXKDzl (* 日本人の血液型はAB:B:O:A=1:2:3:4であるという。 無作為に何人の血液型を調べて 調べた人にすべての血液型が含まれる確率を99%以上にしたい。 何人以上調べればよいか? *) calc[n_] :=( xyzw=Solve[{x + y + z + w == n, x >= 0, y >= 0, z >= 0,w >=0}, {x, y, z, w}, Integers]; pm={x,y,z,w} /. xyzw; re=Select[pm,FreeQ[#,0]&]; Total[Product[p[[i]]^#[[i]],{i,1,4}]*Binomial[n,#[[1]]]*Binomial[n-#[[1]],#[[2]]] *Binomial[n-#[[1]]-#[[2]]
,#[[3]]]& /@ re] ) calc[43] %// N calc[44] % //N DiscretePlot[calc[n],{n,41,50}] http://rio2016.5ch.net/test/read.cgi/math/1723152147/307
308: 132人目の素数さん [sage] 2024/11/13(水) 12:48:17.76 ID:mLwXKDzl 乱数発生によるシミュレーションで理論値を検証 f[n_] :=( b=Range[4]; Boole@ContainsAll[RandomChoice[b->b,n],b] ) sim[n_,k_:10^5] :=( N@Mean@Table[f[n],k] ) DiscretePlot[sim[n],{n,41,45}] http://rio2016.5ch.net/test/read.cgi/math/1723152147/308
309: 132人目の素数さん [sage] 2024/11/13(水) 19:45:41.70 ID:mLwXKDzl kuku=Union@Flatten@Table[a b,{a,1,9},{b,1,9}]; calc[n_] :=( pm=Permutations[Range[n],{n}]; Select[pm,ContainsAll[kuku,10 #[[1;;(n-1)]]+ #[[2;;n]]]&] ) (* 1〜9までの数字を1つずつ使って、 どの連続する2ケタをとっても九九の答えになるような9ケタの整数を答えよ。 *) calc[9] (* 1〜8までの数字を1つずつ使って、 どの連続する2桁をとっても九九の答えになるような8桁の整数をすべて列挙せよ *) calc[8] http://rio2016.5ch.net/test/read.cgi/math/
1723152147/309
310: 132人目の素数さん [sage] 2024/11/13(水) 20:25:07.08 ID:mLwXKDzl 1〜9までの数字を1つずつ使ってできる9桁の整数で どの連続する2つの数字の差の絶対値がすべて素数である整数は何個あるか。 該当する整数の最小値と最大値を求めよ。 pm=Permutations[Range[9],{9}]; ans=Select[pm,AllTrue[Abs@Differences[#],PrimeQ]&]; Length@ans Short[ans] http://rio2016.5ch.net/test/read.cgi/math/1723152147/310
311: 132人目の素数さん [sage] 2024/11/15(金) 08:05:31.65 ID:4Dzk4TZQ solve=\(p=3/100,cl=0.50){ # 1-(1-p)^x=cl log(1-cl)/log(1-p) } solve(1/10000,0.95) solve(3/100,0.50) http://rio2016.5ch.net/test/read.cgi/math/1723152147/311
312: 132人目の素数さん [sage] 2024/11/16(土) 06:59:43.21 ID:Si+9FQ0m # alphabet=c(letters,LETTERS) a2n=Vectorize(\(a) which(alphabet==a)) w2n=\(w){ y=unlist(strsplit(w,'')) a2n(y) } s="supercalifragilisticexpialidocious" n=w2n(s) k=1e3 p1=replicate(k,mean(replicate(k,all(diff(sample(n))!=0)))) hist(p1,freq=F,breaks='scott',main='',axes=F,ann=F,col=2) ; axis(1) mean(p1) mean(replicate(k^2,all(diff(sample(n))!=0))) s="Supercalifragilisticexpialidocious" n=w2n(s) k=1e3 p1=replicate(k,m
ean(replicate(k,all(diff(sample(n))!=0)))) hist(p1,freq=F,breaks='scott',main='',axes=F,ann=F,col=3) ; axis(1) mean(p1) mean(replicate(k^2,all(diff(sample(n))!=0))) http://rio2016.5ch.net/test/read.cgi/math/1723152147/312
313: 132人目の素数さん [sage] 2024/11/17(日) 19:57:55.21 ID:WmoqT3ZI 数直線上に動点Pがあり、 時刻0には原点に居て、速度が位置の関数としてv(x)= ax+b で与えられているときの 時刻tでのPの位置を求めよ。 https://i.imgur.com/MLycHUb.png http://rio2016.5ch.net/test/read.cgi/math/1723152147/313
314: 132人目の素数さん [sage] 2024/11/17(日) 20:28:28.87 ID:WtMlI/FM >>313 何この図 TeX使えませんってアピール? http://rio2016.5ch.net/test/read.cgi/math/1723152147/314
315: 132人目の素数さん [sage] 2024/11/17(日) 20:37:36.54 ID:WmoqT3ZI 数直線上に動点Pがあり、 時刻0には原点に居て、速度が位置の関数としてv(x)= ax^2+bx +c で与えられているときの 時刻tでのPの位置を求めよ。 http://rio2016.5ch.net/test/read.cgi/math/1723152147/315
316: 132人目の素数さん [sage] 2024/11/18(月) 04:58:31.69 ID:GrxPVQzd 数直線上に動点Pがあり、 時刻0には原点に居て、速度が位置の関数としてv(x)= (x-α)(x-β) で与えられているときの 時刻tでのPの位置を求めよ。 α=βのとき x[t]= tα^2/(1+tα) α≠βのとき 1/ (x-α)(x-β)= 1/(α-β)[1/(x-α) - 1/(x-β)]を使って x[t]=[e^(αt)-e^(βt)]/[αe^(αt)-βe^(βt)] http://rio2016.5ch.net/test/read.cgi/math/1723152147/316
317: 132人目の素数さん [sage] 2024/11/18(月) 07:21:58.06 ID:YOe2Q451 >>314 Wolfram使えませんってアピール? http://rio2016.5ch.net/test/read.cgi/math/1723152147/317
318: 132人目の素数さん [sage] 2024/11/18(月) 08:34:06.71 ID:6QQp5ohs >>317 なんだよ図星か 出題にしろスキルにしろ色々偏ってるな 大学で数学履修してないんだな http://rio2016.5ch.net/test/read.cgi/math/1723152147/318
319: 132人目の素数さん [sage] 2024/11/18(月) 12:07:07.18 ID:sriHacXi >>318 医学部だと必要なのは統計処理だな。 Rが使えれば事足りる。 http://rio2016.5ch.net/test/read.cgi/math/1723152147/319
320: 132人目の素数さん [sage] 2024/11/18(月) 12:27:57.97 ID:zvfCaBME Rなんぞ使えなくても医者が論文書くのに大概困らんやろ Rのコードが書けても統計の意味わからないならゴミ生産機にしかなれない http://rio2016.5ch.net/test/read.cgi/math/1723152147/320
321: 132人目の素数さん [sage] 2024/11/18(月) 13:24:25.94 ID:EFXQWzbV Let's approach this step-by-step: Let's make a substitution: t=−1nt=−n1 As n→∞n→∞, t→0−t→0− (approaching 0 from the negative side) With this substitution, our limit becomes: limt→0−(1+t)−1tlimt→0−(1+t)−t1 Now, we can rewrite this as: limt→0−((1+t)1t)−1limt→0−((1+t)t1)−1 We recognize that lim
289;t→0(1+t)1t=elimt→0(1+t)t1=e, which is the definition of Euler's number. This holds true whether t approaches 0 from the positive or negative side. Therefore, our limit becomes: (e)−1=1e(e)−1=e1 http://rio2016.5ch.net/test/read.cgi/math/1723152147/321
322: 132人目の素数さん [sage] 2024/11/18(月) 13:29:29.79 ID:qEGNxEm5 >>319 いくら能書き垂れようがここで無能扱いされてることに違いはないw http://rio2016.5ch.net/test/read.cgi/math/1723152147/322
323: 132人目の素数さん [sage] 2024/11/18(月) 13:33:45.84 ID:EFXQWzbV 底辺シリツ医でRが使える医師をみたことがないな。 R(PythonでもWolframでもいいけど)が使えると、こういう計算ができるので 必要なスピッツや試薬の数を準備できる。 日本人の血液型はAB:B:O:A=1:2:3:4であるという。 無作為に何人の血液型を調べて 調べた人にすべての血液型が含まれる確率を99%以上にしたい。 何人以上調べればよいか? 99%を越えたときの確率を分数で算出せよ。 http://rio2016.5ch.net/test/read.cgi/math/1723152147/323
324: 132人目の素数さん [sage] 2024/11/18(月) 14:02:42.46 ID:6QQp5ohs >>323 それを雇われ医師がやる必要はないけどな http://rio2016.5ch.net/test/read.cgi/math/1723152147/324
325: 132人目の素数さん [sage] 2024/11/18(月) 20:41:49.20 ID:qEGNxEm5 >>323 数学スレでも脳内医者バレバレみたいだねw http://rio2016.5ch.net/test/read.cgi/math/1723152147/325
326: 132人目の素数さん [sage] 2024/11/18(月) 23:30:41.67 ID:F0+pha6b 自分の設定と矛盾した事言ってても全く気づけないポンコツ http://rio2016.5ch.net/test/read.cgi/math/1723152147/326
327: 132人目の素数さん [sage] 2024/11/19(火) 03:57:43.79 ID:V8CHGcRI To evaluate the limit limn→∞(1−1n)n,\lim_{n \to \infty} \left(1 - \frac{1}{n}\right)^n,limn→∞(1−n1)n, we can recognize that this expression is related to the definition of the number eee. Specifically, we can rewrite the expression in a more convenient form. First, we can use the fact that (1−1n)n=((1−1n)−n)−1.\left(1 - \frac{1}{n}\right)^n = \left(\left(1 - \frac{1}{n}
\right)^{-n}\right)^{-1}.(1−n1)n=((1−n1)−n)−1. Now, we can take the natural logarithm of the expression to simplify the limit: ln((1−1n)n)=nln(1−1n).\ln\left(\left(1 - \frac{1}{n}\right)^n\right) = n \ln\left(1 - \frac{1}{n}\right).ln((1−n1)n)=nln(1−n1). Next, we can use the Taylor expansion of ln(1−x)\ln(1 - x)ln(1−x) around x=0x = 0x=0: ln(1−x)≈−x−x22
212;x33−…\ln(1 - x) \approx -x - \frac{x^2}{2} - \frac{x^3}{3} - \ldotsln(1−x)≈−x−2x2−3x3−… For small xxx, we can approximate ln(1−1n)\ln\left(1 - \frac{1}{n}\right)ln(1−n1): ln(1−1n)≈−1nas n→∞.\ln\left(1 - \frac{1}{n}\right) \approx -\frac{1}{n} \quad \text{as } n \to \infty.ln(1−n1)≈−n1as n→∞. Thus, nln(1−1n)≈n(−1n
)=−1.n \ln\left(1 - \frac{1}{n}\right) \approx n \left(-\frac{1}{n}\right) = -1.nln(1−n1)≈n(−n1)=−1. Now, we can take the limit: limn→∞nln(1−1n)=−1.\lim_{n \to \infty} n \ln\left(1 - \frac{1}{n}\right) = -1.limn→∞nln(1−n1)=−1. Exponentiating both sides gives us: limn→∞(1−1n)n=e−1=1e.\lim_{n \to \infty} \left(1 - \frac{1}{n}\right)^n = e^{-1} = \frac{1}{e}.limn→∞(1ȡ
2;n1)n=e−1=e1. Therefore, the final result is: limn→∞(1−1n)n=1e.\lim_{n \to \infty} \left(1 - \frac{1}{n}\right)^n = \frac{1}{e}.limn→∞(1−n1)n=e1. http://rio2016.5ch.net/test/read.cgi/math/1723152147/327
328: 132人目の素数さん [sage] 2024/11/19(火) 05:02:34.93 ID:V8CHGcRI Texコードを投稿しても表示されないなぁ。 http://rio2016.5ch.net/test/read.cgi/math/1723152147/328
329: 132人目の素数さん [sage] 2024/11/20(水) 08:10:08.39 ID:KnDPFD/I pick=\(x,one=1){ y=sample(x) picked=y[1:one] rest=y[-c(1:one)] list(picked=picked,rest=rest) } f=\(){ x=c('太郎','次郎','車','山羊') p='三郎' # p:picked item or player y=pick(x) count=1 while(y$picked!='車' & y$picked!='山羊'){ x=c(y$rest,p) p=y$picked y=pick(x) count=count+1 } list(player=p,picked=y$picked,count=count) } sim=\(n){ re=f() re$player=='太郎' & re$picked=='車' & re$count<=n } k=1e3 res=replicate(k,mean(replicate(k,
sim(8)))) hist(res,col=2,ann=F,axes=F);axis(1) summary(res) HDInterval::hdi(res) mean(replicate(k^2,sim(8))) http://rio2016.5ch.net/test/read.cgi/math/1723152147/329
330: 132人目の素数さん [sage] 2024/11/20(水) 08:10:15.92 ID:KnDPFD/I 4つのドアがあり、それぞれのドアの向こうには車、ヤギ、太郎くん、次郎くんががいます。 三郎くんはどれか1つドアを選び、それを開けて車が出たら当たりで、車をもらうことができます。 ヤギが出たらその時点でゲーム終了です。 人物(Xとする)が出たら、Xが新たな挑戦者となり、三郎くんは選んだドアに入り、ドアを閉め、 ドアの向こうで車、ヤギ、人物2人の位置をランダムにシャッフルします。 ここまでを1ターンとします。 その後はXが挑戦者となり、ゲームを続行
します。 以上の手順で車かヤギを誰かが当てるまで続けます。 太郎くんが8ターン以内に車を獲得する確率を求めなさい。 同様に確からしいというのは仮想なので概算(有効数字2桁)でよい。 http://rio2016.5ch.net/test/read.cgi/math/1723152147/330
331: 132人目の素数さん [sage] 2024/11/20(水) 18:44:00.29 ID:KZHv+5ER >>330 尿瓶ジジイまだ生き恥晒してたのかよ? http://rio2016.5ch.net/test/read.cgi/math/1723152147/331
332: 132人目の素数さん [sage] 2024/11/21(木) 18:36:44.68 ID:Ci8ztJhi 尿瓶ジジイって論破されて発狂してそれもまた論破されてダンマリ決め込んでまた復活の繰り返しだな http://rio2016.5ch.net/test/read.cgi/math/1723152147/332
333: 132人目の素数さん [sage] 2024/11/22(金) 16:33:49.76 ID:2M9XV7Pv " 西暦2025年から西暦10000年まで2月29日が日曜日になることは何回あるか? 現行のグレゴリオ暦を用いて計算せよ。 " library(lubridate) wday(ymd("2016-2-29"),label=TRUE) wday(ymd("2015-2-29"),label=TRUE) str=as.character(2025:10000) f=\(s) wday(ymd(paste0(s,"-2-29"))) re=sapply(str,f) sum(re[!is.na(re)]==1) http://rio2016.5ch.net/test/read.cgi/math/1723152147/333
334: 132人目の素数さん [sage] 2024/11/22(金) 17:18:10.41 ID:KGSQyV3C >>333 スレタイすら読めない医者でも東大卒でもないアホチンパンは消えてどうぞ http://rio2016.5ch.net/test/read.cgi/math/1723152147/334
335: 132人目の素数さん [sage] 2024/11/23(土) 03:28:36.32 ID:qyJPztJt WolframのDayName関数に 存在しない閏年の2月29日を引数として与えるとその年の3月1日の曜日を返す仕様のようである。俺にはバクに思えるのだが。 DayName[{2025,2,29}] DayName[{2025,3,1}] を実行してみるとよい。 問題 この仕様を利用して 西暦2025年から西暦10000年まで2月29日が日曜日になることは何回あるか?現行のグレゴリオ暦を用いて計算せよ。 を答を算出して、R言語での結果259回と合致するかを検証せよ。 f[x_,y_:Sunday] := DayName[{x,2,2
9}]!=DayName[{x,3,1}] && DayName[{x,2,29}]==y Table[Boole@f[x],{x,2025,10000}] // Total http://rio2016.5ch.net/test/read.cgi/math/1723152147/335
336: 132人目の素数さん [sage] 2024/11/23(土) 10:08:33.97 ID:qyJPztJt (1) 九九に現れる数字は1から81までである。何種類あるか? (2) 1から99までの数字を2つかけてできる数は何種類あるか? (3) 1から999までの数字を2つかけてできる数は何種類あるか? (4) 1から9999までの数字を2つかけてできる数は何種類あるか? R calc=\(n) outer(1:n,1:n)|>as.vector()|>unique()|>length() sapply(c(9,99,999,9999),calc) Wolfram solve[n_]:= Table[x y,{x,Range[n]},{y,Range[n]}] // Flatten // Union // Length Table[solve[n],{n,{9,
99,999,9999}}] http://rio2016.5ch.net/test/read.cgi/math/1723152147/336
337: 132人目の素数さん [sage] 2024/11/23(土) 14:11:53.97 ID:3sUy/oAC >>333 意味のない問題を出題して無知と恥をアピールwww http://rio2016.5ch.net/test/read.cgi/math/1723152147/337
338: 132人目の素数さん [sage] 2024/11/23(土) 16:01:29.80 ID:qyJPztJt 年賀状の3等は100枚に3枚が当たる確率である。 (1) 100枚の年賀状を無作為に購入したときの当たりの枚数の期待値を求めよ。 (2) 3等が当たっている年賀状の枚数が奇数の確率をPとする。Pは0.5より大きいか小さいか、直感で即答せよ。 (3) (2)の確率を分数で求めよ。 (4) (3)をシミュレーションで検証してみよ。 p=3/100; Table[Binomial[100,2n-1] p^(2n-1) (1-p)^(100-(2n-1)),{n,1,50}] // Total % // N Table[Boole@OddQ@RandomVariate[BinomialDistributio
n[100,3/100]],10^6] // Mean http://rio2016.5ch.net/test/read.cgi/math/1723152147/338
339: 132人目の素数さん [sage] 2024/11/23(土) 16:02:37.24 ID:qyJPztJt 意味のある問題(シリツ卒には解けないようだ) 採決スピッツや試薬をどれだけ準備すべきかが算出できる。 日本人の血液型はAB:B:O:A=1:2:3:4であるという。 無作為に何人かの血液型を調べて、 調べた人にすべての血液型が含まれる確率を99%以上にしたい。 (1) 何人以上調べればよいか? (2) 99%を越えたときの確率を分数で算出せよ。 http://rio2016.5ch.net/test/read.cgi/math/1723152147/339
340: 132人目の素数さん [sage] 2024/11/23(土) 16:15:55.46 ID:IPIzs9Xw >>339 ここでいくら発狂しても相手にされないみたいだねw 実に哀れ 自分でも解けないんだろ?というか問題として成立してないw http://rio2016.5ch.net/test/read.cgi/math/1723152147/340
341: 132人目の素数さん [sage] 2024/11/26(火) 20:42:38.86 ID:HQUgcf8k 意味のある問題と思い込めるってwww 並外れた低脳アピールwww http://rio2016.5ch.net/test/read.cgi/math/1723152147/341
342: 132人目の素数さん [sage] 2024/11/29(金) 06:08:12.87 ID:d3rJHsIX # 10桁のカプレカー数を列挙するプログラムを作り実行せよ n=10 library(RcppAlgos) is.kaprekar=\(m){ IntegerDigits=\(n) as.integer(unlist(strsplit(as.character(n),''))) le=length(m) mu=10^((le-1):0) min=sum(sort(m)*mu) max=sum(sort(m,decreasing = TRUE)*mu) n=sum(m*mu) d=max-min sum(sort(IntegerDigits(d))*mu)==min & min!=max } cm=comboGeneral(0:9,n,repetition = TRUE) re=cm[apply(cm,1,is.kaprekar),] kaprekar=\(m){ le=length(m) mu=10^((le-1
):0) min=sum(sort(m)*mu) max=sum(sort(m,decreasing = TRUE)*mu) n=sum(m*mu) max-min } apply(re,1,kaprekar) http://rio2016.5ch.net/test/read.cgi/math/1723152147/342
343: 132人目の素数さん [sage] 2024/11/29(金) 16:54:45.54 ID:a8qsJeEV https://i.imgur.com/4vCgmrg.png http://rio2016.5ch.net/test/read.cgi/math/1723152147/343
344: 132人目の素数さん [sage] 2024/11/30(土) 07:28:27.00 ID:L4mkprla hex[x_]:=ResourceFunction["HexConvert"][x]; start="100"; end="fff"; d=hex /@ Range[hex[start],hex[end]]; s=StringSplit[#,""]& /@ d; KaprekarHexQ[x_] := hex[hex@StringJoin@ReverseSort@x - hex@StringJoin@Sort@x] == StringJoin@x; StringJoin /@ Select[s,KaprekarHexQ] http://rio2016.5ch.net/test/read.cgi/math/1723152147/344
345: 132人目の素数さん [sage] 2024/11/30(土) 10:21:21.14 ID:L4mkprla (* 16進法でn桁のカプレカ数を求める *) n=6 hex[x_]:=ResourceFunction["HexConvert"][x]; s=ResourceFunction["OrderlessCombinations"][hex /@ Range[0,15],{n}]; KaprekarHexQ[x_] := ( d=hex@StringJoin@ReverseSort@x - hex@StringJoin@Sort@x; lid=StringSplit[hex@d,""]; hex[hex@StringJoin@ReverseSort@lid - hex@StringJoin@Sort@lid]==StringJoin@lid && d!=0 ) re=Select[s,KaprekarHexQ]; hex /@ (hex@StringJoin@ReverseSor
t@# - hex@StringJoin@Sort@# & /@re) // Union http://rio2016.5ch.net/test/read.cgi/math/1723152147/345
346: 132人目の素数さん [sage] 2024/11/30(土) 14:45:57.18 ID:L4mkprla b進法、n桁のカプレカ数を求めるように拡張 (* b進法でn桁のカプレカ数を返す b <= 36 *) solve[b_,n_]:=( dec2n[x_] :=( r=List@Mod[x,b]; q=Floor[x/b]; While[q > 0,PrependTo[r,Mod[q,b]];q=Floor[q/b]]; r ); DigitsInteger[x_] :=( le=Length@x; Table[(Reverse@x)[[i]]*b^(i-1),{i,1,le}]//Total ); digits=Flatten@{Range[0,9],Alphabet[]}; s=ResourceFunction["OrderlessCombinations"][digits[[Range[1,b]]],{n}]; KaprekarBinQ[x_]:=(
d=DigitsInteger@ReverseSort@x - DigitsInteger@Sort@x; lid=dec2n[d]; DigitsInteger@ReverseSort@lid - DigitsInteger@Sort@lid == DigitsInteger@lid && d!=0 ); re=Select[s,KaprekarBinQ]; ans10=Union@(DigitsInteger@ReverseSort@# - DigitsInteger@Sort@# & /@ re); ans2=dec2n /@ ans10; ans3=Table[digits[[i]],{i,ans2+1}]; Le=Length[ans3]; Table[StringJoin @ (ToString /@ ans3[[i]]),{i,1,Le}] ) solve[2,10] solve[16,6] http://rio2016.5ch.net/test/read.cgi/math/1723152147/346
347: 132人目の素数さん [sage] 2024/11/30(土) 16:16:40.90 ID:BMBeqwqc (* 疑似ヴァンパイア数(Pseudovampire numbers)は、「数字を2等分」という縛りを無くした数である。 例えば126 = 6×21など。 https://ja.wikipedia.org/wiki/ヴァンパイア数 問題 3桁の疑似ヴァンパイア数を列挙せよ。 *) f[n_]:=( p=Permutations[IntegerDigits[n],{3}]; prd=(10 #[[1]]+#[[2]])#[[3]]& /@ p; ContainsAny[prd,{n}] ) n=Select[Range[100,999],f] g[x_]:=( p=Permutations[IntegerDigits[x],{3}]; prd=(10 #[[1]]+#[[2]])#[[3]]& /@ p; i=Position
[prd,x][[1]][[1]]; {10p[[i]][[1]]+p[[i]][[2]],p[[i]][[3]]} ) g /@ n http://rio2016.5ch.net/test/read.cgi/math/1723152147/347
348: 132人目の素数さん [sage] 2024/11/30(土) 17:54:56.00 ID:L4mkprla (* 問題 5桁の疑似ヴァンパイア数を列挙せよ。 *) f14[n_]:=( d=IntegerDigits[n]; p=Permutations[d,{5}]; prd=#[[1]]*(1000 #[[2]]+100 #[[3]]+10 #[[4]]+#[[5]])& /@p; i=Position[prd,n]; ans={}; If[i!={}, idx=i[[1]][[1]]; re=p[[idx]]; AppendTo[ans,{re[[1]],1000re[[2]]+100re[[3]]+10re[[4]]+re[[5]]}] ]; ans ) res=Partition[Flatten@Table[f14[n],{n,10000,99999}],2]; {#[[1]],#[[2]],#[[1]]#[[2]]} & /@res http://rio2016.5ch.net/test/read.cgi/math/1
723152147/348
349: 132人目の素数さん [sage] 2024/11/30(土) 17:55:14.99 ID:L4mkprla {{5, 2051, 10255}, {5, 2105, 10525}, {9, 1251, 11259}, {8, 1481, 11848}, > {6, 2001, 12006}, {6, 2010, 12060}, {3, 4128, 12384}, {5, 2501, 12505}, > {5, 2510, 12550}, {5, 2519, 12595}, {6, 2100, 12600}, {6, 2127, 12762}, > {3, 4281, 12843}, {5, 2591, 12955}, {3, 4515, 13545}, {3, 5001, 15003}, > {3, 5010, 15030}, {6, 2541, 15246}, {3, 5100, 15300}, {3, 5145, 15435}, > {9, 1755, 15795}, {6, 2712, 16272}, {2
, 8714, 17428}, {2, 8741, 17482}, > {3, 7125, 21375}, {3, 7251, 21753}, {5, 5021, 25105}, {5, 5102, 25510}, > {9, 3501, 31509}, {9, 3510, 31590}, {8, 4730, 37840}, {8, 4973, 39784}, > {6, 7446, 44676}, {9, 5751, 51759}, {8, 6521, 52168}, {9, 6255, 56295}, > {9, 7461, 67149}, {8, 8600, 68800}, {9, 7911, 71199}, {9, 8775, 78975}} http://rio2016.5ch.net/test/read.cgi/math/1723152147/349
350: 132人目の素数さん [sage] 2024/11/30(土) 17:55:44.99 ID:L4mkprla f23[n_]:=( d=IntegerDigits[n]; p=Permutations[d,{5}]; prd=(10 #[[1]]+#[[2]])(100 #[[3]]+10 #[[4]]+#[[5]])& /@p; i=Position[prd,n]; ans={}; If[i!={}, idx=i[[1]][[1]]; re=p[[idx]]; AppendTo[ans,{10 re[[1]]+re[[2]],100re[[3]]+10re[[4]]+re[[5]]}] ]; ans ) res=Partition[Flatten@Table[f23[n],{n,10000,99999}],2]; {{51, 201, 10251}, {26, 401, 10426}, {21, 501, 10521}, {15, 705, 10575}, > {84, 141, 11844}, {60, 201, 12060}, {51, 246, 125
46}, {50, 251, 12550}, > {21, 600, 12600}, {14, 926, 12964}, {41, 323, 13243}, {15, 930, 13950}, > {35, 401, 14035}, {41, 350, 14350}, {30, 501, 15030}, {51, 300, 15300}, > {24, 651, 15624}, {75, 231, 17325}, {47, 371, 17437}, {81, 225, 18225}, > {65, 281, 18265}, {87, 210, 18270}, {21, 906, 19026}, {21, 915, 19215}, > {86, 251, 21586}, {27, 810, 21870}, {35, 725, 25375}, {47, 542, 25474}, > {42, 678, 28476}, {32, 926, 29632}, {90, 351, 31590}, {53, 635, 33655}, > {
36, 936, 33696}, {63, 585, 36855}, {80, 473, 37840}, {87, 435, 37845}, > {65, 641, 41665}, {89, 482, 42898}, {54, 846, 45684}, {65, 704, 45760}, > {84, 546, 45864}, {57, 834, 47538}, {78, 624, 48672}, {59, 845, 49855}, > {63, 855, 53865}, {65, 875, 56875}, {68, 926, 62968}, {65, 983, 63895}, > {72, 936, 67392}, {75, 906, 67950}, {86, 800, 68800}} {#[[1]],#[[2]],#[[1]]#[[2]]} & /@res http://rio2016.5ch.net/test/read.cgi/math/1723152147/350
351: 132人目の素数さん [sage] 2024/11/30(土) 19:19:39.71 ID:xA0BaYQb >>350これには完全ダンマリで草 954:卵の名無しさん:2024/11/30(土) 10:54:08.14 ID:Wtu16ESx >>951 まあお前と違って俺は一回200万ぐらい病院に入る治療出来るからそういうのなら病院にとって呼ぶ価値あるけどな 車で行ってるから交通費も貰ってないけど 一回10万でやってあげてるよ んで、お前は?GFで数件覗くだけ? 1件11400円を数件やるだけなのにわざわざ新幹線とタクシー使ってで来てもらうの? 生検やっても+3000円だぞ 採算取れるわけねーだろ 適
当にM3とかで近くの車持ってる奴雇った方が安いわwww http://rio2016.5ch.net/test/read.cgi/math/1723152147/351
352: 132人目の素数さん [sage] 2024/11/30(土) 20:02:31.66 ID:BMBeqwqc >>351 1日15件くらいやってますが? 昔は20件を超えることもあったな。 http://rio2016.5ch.net/test/read.cgi/math/1723152147/352
353: 132人目の素数さん [sage] 2024/11/30(土) 20:20:57.57 ID:xA0BaYQb >>352 一日15件やってもせいぜい十数万だからそんなコストかけて雇う価値ないだろうなww http://rio2016.5ch.net/test/read.cgi/math/1723152147/353
354: 132人目の素数さん [sage] 2024/11/30(土) 20:53:11.89 ID:xA0BaYQb >>352 なんで医者板で直接言えないのかな? 脳内医者ってまたボコボコにされるのが目に見えてるからかな?ww http://rio2016.5ch.net/test/read.cgi/math/1723152147/354
355: 132人目の素数さん [sage] 2024/11/30(土) 22:09:43.96 ID:7d0ZfVfE >>352 967:卵の名無しさん:[sage]:2024/11/30(土) 21:57:37.31 ID:7TzF2IEd 湘南鎌倉総合病院には元旭川医科大学勤務で国立大の弘前大学卒の元AV女優浅丘りなこと田中茉里子(旧姓古郡)がいるもんね https://www.skgh.jp/department/hbps/ https://www.suruga-ya.jp/product/detail/131150111 http://www.oma-aozora.jp/ikizama/kisamai/welcome_02.html はい、いつものコピペダンマリきたw http://rio2016.5ch.net/test/read.cgi/math/1723152147/355
356: 132人目の素数さん [sage] 2024/12/01(日) 08:47:17.63 ID:h0Y8DNCF >>352 この、偽医者なんか必死だな 何故か逆鱗に触れてしまったようだ http://rio2016.5ch.net/test/read.cgi/math/1723152147/356
357: 132人目の素数さん [sage] 2024/12/01(日) 10:07:47.95 ID:URtmhVxU f(x,y)= x^y+y^x 0 <= x <= 1 かつ 0 <= y <= 1 とする (1) z=f(x,y)を図示せよ 例 https://i.imgur.com/srMiE7B.gif (2) z=f(x,y)とx-y平面で囲まれた図形の体積を求めよ (3) z=f(x,y)の面積を求めよ(有効数字3桁の近似値でよい) http://rio2016.5ch.net/test/read.cgi/math/1723152147/357
358: 132人目の素数さん [sage] 2024/12/01(日) 10:09:48.53 ID:URtmhVxU f(x,y)= x^y+y^x 0 <= x <= 1 かつ 0 <= y <= 1 とする (1) z=f(x,y)を図示せよ 例 https://i.imgur.com/srMiE7B.gif (2) z=f(x,y)とx-y平面で囲まれた図形の体積を求めよ (3) z=f(x,y)の面積を求めよ(有効数字3桁の近似値でよい) R f=Vectorize(\(x,y) x^y + y^x) g=\(x) integrate(\(y) f(x,y),0,1)$value g=Vectorize(g) integrate(g,0,1) log(4) fx=D(expression(x^y+y^x),'x') fy=D(expression(x^y+y^x),'y') fa=\(x,y) sqrt(1+eval(fx)^2+eval(fy
)^2) fa=Vectorize(fa) ff=\(x) integrate(\(y) fa(x,y),0,1)$value ff=Vectorize(ff) integrate(ff,0,1) Wolfram f[x_,y_]:= x^y + y^x Integrate[f[x,y],{x,0,1},{y,0,1}] ff[x_,y_]:=Sqrt[1+D[f[x,y],x]^2+D[f[x,y],y]^2] NIntegrate[ff[x,y],{x,0,1},{y,0,1}] http://rio2016.5ch.net/test/read.cgi/math/1723152147/358
359: 132人目の素数さん [sage] 2024/12/01(日) 10:23:07.24 ID:rRY5OR0u >>357 https://egg.5ch.net/test/read.cgi/hosp/1723605276/ 968:卵の名無しさん:2024/11/30(土) 22:02:25.06 ID:dp7m04yN >>966 こっちだとフルボッコにされるからって情けないよな… 969:卵の名無しさん:2024/12/01(日) 01:00:00.23 ID:tCw/HuPn 1人で上部内視鏡1日15件はねーよ 1人で回すんなら入れ替えとか麻酔も含めて1件最低30分はかかるからどんだけ早くても10件が限度だよ 脳内医者はスピードが半端ないってことかな?スピード速すぎて癌見逃し
ちゃうねwww http://rio2016.5ch.net/test/read.cgi/math/1723152147/359
360: 132人目の素数さん [sage] 2024/12/01(日) 13:24:19.50 ID:URtmhVxU ナルシシスト数(ナルシシストすう、英: narcissistic number)とは、n 桁の自然数であって、その各桁の数の n 乗の和が、元の自然数に等しくなるような数をいう。 例えば、1^3 + 5^3 + 3^3 = 153 であるから、153 はナルシシスト数である。 .... 十進法に限らず、他の基数においても同様にナルシシスト数を定義できる 問題 16進法で4桁までのナルシスト数は何個あるか? すべて列挙せよ。 {1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f, 156, 173, 208, 248, 285, 4a
5, 5b0, 5b1, > 60b, 64b, 8c0, 8c1, 99a, aa9, ac3, ca8, e69, ea0, ea1, b8d2} hex[x_]:= ResourceFunction["HexConvert"][x] NaruQ[s_]:=( d=hex /@ StringSplit[s,""]; le=Length[d]; hex@Total[d^le] == s ) solve[start_:"1",end_:"fff"]:=( h=hex /@ Range[hex[start],hex[end]]; Select[h,NaruQ] ) solve["10000","fffff"] {13579, 2b702, 2b722, 5a07c, 5a47c, c00e0, c00e1, c04e0, c04e1, c60e7, c64e7, c80e0, > c80e1, c84e0, c84e1, de030, de031, de430, d
e431, eb7c2, fb06a, fb46a, fc276} http://rio2016.5ch.net/test/read.cgi/math/1723152147/360
361: 132人目の素数さん [sage] 2024/12/01(日) 16:43:54.21 ID:URtmhVxU (* decimal integer to b-based digits 10進法xをb進法表記の文字リストに返還*) i2d[x_,b_:16] :=( digits=Flatten@{"0","1","2","3","4","5","6","7","8","9",Alphabet[]}; r=List@Mod[x,b]; q=Floor[x/b]; While[q > 0,PrependTo[r,Mod[q,b]];q=Floor[q/b]]; digits[[r+1]] ) (* b-based digits to decimal integer b進法表記文字列xを10進法の数に返還 *
) d2i[x_,b_:16] :=( tonum[char_]:=( digits=Flatten@{"0","1","2","3","4","5","6","7","8","9",Alphabet[]}; Position[digits,char][[1]][[1]]-1 ); ss=StringSplit[x,""]; d10=tonum /@ ss; le=Length@ss; Table[(Reverse@d10)[[i]]*b^(i-1),{i,1,le}]//Total ) (* ハーシャッド数(ハーシャッドすう、英: harshad number)とは、自然数の各位の数字和が元の数の約数に含まれている自然数である。*) harshadQ[n_,b_] := Divisibl
e[n,Total[d2i[#,b]&/@i2d[n,b]]] solve[start_:"1",end_:"ff",b_] :=( li=Select[Range[d2i[start,b],d2i[end,b]],harshadQ[#,b]&]; re=i2d[#,b]& /@ li; StringJoin /@ re ) http://rio2016.5ch.net/test/read.cgi/math/1723152147/361
362: 132人目の素数さん [sage] 2024/12/01(日) 17:01:28.38 ID:rRY5OR0u >>361 どうせ高校生にすらバカにされてるからもう出てこなくていいよ http://rio2016.5ch.net/test/read.cgi/math/1723152147/362
363: 132人目の素数さん [sage] 2024/12/01(日) 19:45:01.45 ID:URtmhVxU https://ja.wikipedia.org/wiki/レイランド数 レイランド数(レイランドすう、英: Leyland number)は、数論において次の形で表される数 x^y + y^x x と y は1より大きい整数 .... また加算の交換性のために x ≥ y の条件は通常レイランド数の重複をさけるために加えられる。(よって 1 < y ≤ x を用いる) https://oeis.org/A076980に 8, 17, 32, 54, 57, 100, 145, 177, 320, 368, 512, 593, 945, 1124, 1649, 2169, 2530, 4240, 5392, 6250, 7073, 8361,
16580, 18785, 20412, 23401, 32993, 60049, 65792, 69632, 93312, 94932, 131361, 178478, 262468, 268705, 397585, 423393, 524649, 533169 が例示されている。 問題 各々のレイランド数についてx,yを求めよ。1 < y ≤ x とする。 想定解 {{2, 2, 8}, {3, 2, 17}, {4, 2, 32}, {3, 3, 54}, {5, 2, 57}, {6, 2, 100}, {4, 3, 145}, > {7, 2, 177}, {8, 2, 320}, {5, 3, 368}, {4, 4, 512}, {9, 2, 593}, {6, 3, 945}, > {10, 2, 1124}, {5, 4, 1649}, {11, 2, 2169}, {7, 3, 2530}, {12, 2, 4240}, > {6, 4, 5392}, {
5, 5, 6250}, {8, 3, 7073}, {13, 2, 8361}, {14, 2, 16580}, > {7, 4, 18785}, {9, 3, 20412}, {6, 5, 23401}, {15, 2, 32993}, {10, 3, 60049}, > {16, 2, 65792}, {8, 4, 69632}, {6, 6, 93312}, {7, 5, 94932}, {17, 2, 131361}, > {11, 3, 178478}, {18, 2, 262468}, {9, 4, 268705}, {7, 6, 397585}, {8, 5, 423393}, > {19, 2, 524649}, {12, 3, 533169}} http://rio2016.5ch.net/test/read.cgi/math/1723152147/363
364: 132人目の素数さん [sage] 2024/12/01(日) 20:07:42.63 ID:URtmhVxU >>363 レイランド素数はレイランド数でもあり素数でもある数。 https://oeis.org/A094133 に例示してある最大の数は 5052785737795758503064406447721934417290878968063369478337 である。 問題 (1) 次に続く数字を求めよ (2) その次に続く数字を求めよ。 http://rio2016.5ch.net/test/read.cgi/math/1723152147/364
365: 132人目の素数さん [sage] 2024/12/01(日) 20:08:38.16 ID:URtmhVxU 想定解 205688069665150755269371147819668813122841983204711281293004769, 3329896365316142756322307042065269797678257903507506764421250291562312417, おまけ 814539297859635326656252304265822609649892589675472598580095801187688932052096060144958129 http://rio2016.5ch.net/test/read.cgi/math/1723152147/365
366: 132人目の素数さん [sage] 2024/12/02(月) 06:58:51.71 ID:5RqvHzG8 Leyland[n_]:=( ymax=Floor@y /. NSolve[2 y^y == n && y>1,y,Reals][[1]]; xmax=Floor@x /. NSolve[x^2+2^x==n && x>1,x,Reals][[1]]; z=Flatten[Table[{x^y+y^x,x,y},{x,2,xmax},{y,2,ymax}],1]; Select[z,#[[1]]==n&] ) Leyland[42832853457545958193355601] http://rio2016.5ch.net/test/read.cgi/math/1723152147/366
367: 132人目の素数さん [sage] 2024/12/02(月) 07:11:43.77 ID:5RqvHzG8 レイランド数(レイランドすう、英: Leyland number)は、数論において次の形で表される数 x^y + y^x x と y は1より大きい整数 .... また加算の交換性のために x ≥ y の条件は通常レイランド数の重複をさけるために加えられる。(よって 1 < y ≤ x を用いる) ある数 nがレイランド数であるかを判定して、レイランド数であれば n = x^y + y^x (但し1 < y ≤ x)となる x,y を算出する 操作をレイランド分解と呼ぶことにする。 (1) 20241202はレイ
ランド分解できるか? (2) 20241202より大きいレイランド数で最小の数を求めよ (3)レイランド分解を実装せよ。言語は問わない。 理工系卒ならチンパフェチ以外ならWolframくらいつかえるでしょう。 尚、Rは不定長整数非対応なので無理。Python使いなら可能だろうが俺にはそのスキルはない。 http://rio2016.5ch.net/test/read.cgi/math/1723152147/367
368: 132人目の素数さん [sage] 2024/12/02(月) 07:28:59.26 ID:5RqvHzG8 LeylandQ[n_]:=( ymax=Floor@y /. NSolve[2 y^y == n && y>1,y,Reals][[1]]; xmax=Floor@x /. NSolve[x^2+2^x==n && x>1,x,Reals][[1]]; z=Flatten@Table[x^y+y^x,{x,2,xmax},{y,2,ymax}]; ContainsAny[z,{n}] ) LeylandQ[42832853457545958193355601] http://rio2016.5ch.net/test/read.cgi/math/1723152147/368
369: 132人目の素数さん [sage] 2024/12/02(月) 19:24:47.07 ID:530Brai+ 尿瓶ジジイ、医者板でダンマリ決め込むしかないw http://rio2016.5ch.net/test/read.cgi/math/1723152147/369
370: 132人目の素数さん [sage] 2024/12/03(火) 14:26:15.87 ID:xACthNhN Wolfram Language 14.0.0 Engine for Microsoft Windows (64-bit) Copyright 1988-2023 Wolfram Research, Inc. In[1]:= nn=1234; In[2]:= n=5; In[3]:= m=6; In[4]:= ass2list[ass_] := Select[Table[{key,ass[key]},{key,0,m}],IntegerQ[#[[2]]]&] (* assosiation to list ,key:[0,m] *) In[5]:= xyz=Solve[Mod[x+y+z,m]==0 && 0<=x<=y<=z<=(m-1),{x,y,z},Integers]; In[6]:= t1=Table[{x/.xyz[[n]],y/.xyz[[n]],z/.xyz[[n]]},{n,1,Length@xyz}]; In[
7]:= ass=Counts[#]& /@ t1; In[8]:= li=ass2list /@ ass; In[9]:= {q,r}=QuotientRemainder[nn,m]; In[10]:= c=Flatten@{Table[q+1,r],Table[q,m-r]}; In[11]:= m2c[x_] :=( (* mod to how many cases *) i=If[x[[1]]==0,m,x[[1]]]; Binomial[c[[i]],x[[2]]] ) In[12]:= prod[x_] := Product[tmp,{tmp,x}]; In[13]:= cases=Total[prod /@ (m2c /@ # & /@ li)]; In[14]:= cases/Binomial[nn,n] 126691 Out[14]= ----------- 57547841736 http://rio2016.5ch.net/test/read.cgi/math/1723152147/370
371: 132人目の素数さん [sage] 2024/12/04(水) 00:16:56.33 ID:FPvs5P9c 高校数学スレじゃ誰も構ってもらえず息絶えたみたいだね http://rio2016.5ch.net/test/read.cgi/math/1723152147/371
372: 132人目の素数さん [sage] 2024/12/04(水) 09:35:44.71 ID:M2J+bJMI (* 1から100までの整数から異なる10個を選び、その合計が5の倍数になる確率を求めなさい。 *) solve[nn_,n_,m_]:=( ass=Counts[#]& /@ Flatten[Table[Sort /@ IntegerPartitions[x,{n},Range[0,m-1]],{x,m*Range[0,n-1]}],1]; li=KeyValueMap[List,#]& /@ ass; {q,r}=QuotientRemainder[nn,m]; c=Flatten@{Table[q+1,r],Table[q,m-r]}; m2c[x_] :=( i=If[x[[1]]==0,m,x[[1]]]; Binomial[c[[i]],x[[2]]]); cases=Total[Times@@@ (m2c /@ # & /@ li)]; (* cases=Total[Times@
@ #&/@ (m2c /@ # & /@ li)];*) cases/Binomial[nn,n] ) solve[100,10,5] SetPrecision[%,50] http://rio2016.5ch.net/test/read.cgi/math/1723152147/372
373: 132人目の素数さん [sage] 2024/12/04(水) 16:35:44.55 ID:M2J+bJMI Wolfram Language 14.0.0 Engine for Microsoft Windows (64-bit) Copyright 1988-2023 Wolfram Research, Inc. In[1]:= solve[nn_,n_,m_]:=( ass=Counts[#]& /@ Flatten[Table[Sort /@ IntegerPartitions[x,{n},Range[0,m-1]],{x,m*Range[0,n-1]}],1]; li=KeyValueMap[List,#]& /@ ass; {q,r}=QuotientRemainder[nn,m]; c=Flatten@{Table[q+1,r],Table[q,m-r]}; m2c[x_] :=( i=If[x[[1]]==0,m,x[[1]]]; Binomial[c[[i]],x[[2]]]); cases=Total[Times@@@ (m2c /@ # & /@ l
i)]; (* cases=Total[Times@@ #&/@ (m2c /@ # & /@ li)];*) cases/Binomial[nn,n] ) In[2]:= solve[100,10,5] 4555344594 Out[2]= ----------- 22776722969 http://rio2016.5ch.net/test/read.cgi/math/1723152147/373
374: 132人目の素数さん [sage] 2024/12/05(木) 08:04:52.84 ID:eKN5wIeH >>373高校生相手にバカにされてそんなに楽しい? http://rio2016.5ch.net/test/read.cgi/math/1723152147/374
375: 132人目の素数さん [sage] 2024/12/05(木) 12:36:37.74 ID:YJ2FHyON (* 1から2024までの整数から12個を選び(同じ数があってもよい)その合計が5の倍数になる確率を求めなさい。 *) solve[nn_,n_,m_]:=( t1=Flatten[Table[Sort /@ IntegerPartitions[x,{n},Range[0,m-1]],{x,m*Range[0,n-1]}],1]; t2=Table[If[#==0,m,#]& /@ t1[[j]],{j,1,Length@t1}]; {q,r}=QuotientRemainder[nn,m]; c=Flatten@{Table[q+1,r],Table[q,m-r]}; Total@Table[n!/Times@@(Values@Counts@t2[[j]]!) Product[c[[i]],{i,t2[[j]]}],{j,1,Length@t2}]/nn^n ) http:/
/rio2016.5ch.net/test/read.cgi/math/1723152147/375
メモ帳
(0/65535文字)
上
下
前
次
1-
新
書
関
写
板
覧
索
設
栞
歴
あと 627 レスあります
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
AAサムネイル
Google検索
Wikipedia
ぬこの手
ぬこTOP
0.025s