高校数学の質問スレ(医者・東大卒専用) Part438 (979レス)
高校数学の質問スレ(医者・東大卒専用) Part438 http://rio2016.5ch.net/test/read.cgi/math/1723152147/
上
下
前次
1-
新
通常表示
512バイト分割
レス栞
抽出解除
レス栞
240: 132人目の素数さん [sage] 2024/10/26(土) 09:11:01.76 ID:DYbBtbTY " ある政党に100人の議員がいる。 個々の議員が裏金議員である可能性には何の情報もないためその確率を一様分布と仮定する。 無作為に10人を選んで調べたところ9人が裏金議員であった。 100人中の裏金議員の数の期待値と95%信頼区間を算出せよ。 算出法は好みの手法でよい。 " rm(list=ls()) n100=100 n10=10 n9=9 m=n100/2 sd=sqrt(n100/12) fp=\(n) pnorm(n,m,sd)-pnorm(n-1,m,sd) pn=sapply(0:n100,fp) sim=\(){ u=sample(0:n100,1,prob=pn) u10=sum(sample(1:0,n10,replace=TRUE,prob=c(u,100-u))) c(u,u10) } k=1e6 res=t(replicate(k,sim())) ans=res[res[,2]==n9,][,1] BEST::plotPost(ans) http://rio2016.5ch.net/test/read.cgi/math/1723152147/240
241: 132人目の素数さん [sage] 2024/10/26(土) 11:11:45.76 ID:DYbBtbTY 中心極限定理を使わずに算出 rm(list=ls()) n100=100 n10=10 n9=9 sim=\(){ u=sum(runif(n100)) u10=sum(sample(0:1,n10,replace=TRUE,prob = c(n100-u,u))) c(u,u10) } k=1e6 res=t(replicate(k,sim())) ans=res[res[,2]==n9,][,1] hist(ans,freq=F,col=2,ann=F,axes=F) ; axis(1) summary(ans) HDInterval::hdi(ans) BEST::plotPost(ans,xlab='n',showMode = T) http://rio2016.5ch.net/test/read.cgi/math/1723152147/241
273: 132人目の素数さん [sage] 2024/10/30(水) 10:53:16.76 ID:1cUZWH52 バイト先で 最近の作業仮説 セクハラ認定したがるのはブサイク女か、持てない男である。 という話をして、 ここでセクハラ親父とか言われないのは美人揃いだからだね、と付言したら、 内視鏡スキルも容姿も高偏差値のナースから センセ、そんなこと言っちゃだめですよと言われた。 顔には「もっと言って」と書いてあった。 新年から勤務日を増やしてくれと言われた職場。 http://rio2016.5ch.net/test/read.cgi/math/1723152147/273
287: 132人目の素数さん [sage] 2024/10/31(木) 23:22:27.76 ID:19VVcDLX >>285 9レス全部スルーされてるねww http://rio2016.5ch.net/test/read.cgi/math/1723152147/287
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/math/1723152147/302
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
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
833: 132人目の素数さん [sage] 2025/05/11(日) 21:13:09.76 ID:2CgV4g4d # データ設定 n_placebo <- 1000; eff_placebo <- 24 n_old <- 1000; eff_old <- 40 n_new <- 1000; eff_new <- 25 # 有効率 p_placebo <- eff_placebo / n_placebo p_old <- eff_old / n_old p_new <- eff_new / n_new # 比較:旧薬 vs 偽薬(有意差) m1 <- matrix(c(eff_old, n_old - eff_old, eff_placebo, n_placebo - eff_placebo), nrow = 2) test1 <- prop.test(m1, correct = FALSE) # 比較:新薬 vs 偽薬(有意差なし) m2 <- matrix(c(eff_new, n_new - eff_new, eff_placebo, n_placebo - eff_placebo), nrow = 2) test2 <- prop.test(m2, correct = FALSE) # 比較:旧薬 vs 新薬(非劣性検定) # 非劣性マージン M <- -0.10 # 差(新薬 - 旧薬) diff <- p_new - p_old # 標準誤差(差の95%信頼区間に使用) se <- sqrt(p_new*(1 - p_new)/n_new + p_old*(1 - p_old)/n_old) z <- qnorm(0.025, lower.tail = FALSE) lower_CI <- diff - z * se # 非劣性判定 non_inferior <- lower_CI > M # 結果表示 cat("=== 旧薬 vs 偽薬 ===\n") print(test1) cat("\n=== 新薬 vs 偽薬 ===\n") print(test2) cat("\n=== 非劣性検定(旧薬 vs 新薬) ===\n") cat(sprintf("差(新薬 - 旧薬) = %.3f\n", diff)) cat(sprintf("95%% CI = [%.3f, %.3f]\n", diff - z*se, diff + z*se)) cat(sprintf("非劣性マージン = %.3f\n", M)) cat(sprintf("非劣性判定: %s\n", ifelse(non_inferior, "非劣性あり", "非劣性なし"))) http://rio2016.5ch.net/test/read.cgi/math/1723152147/833
850: 132人目の素数さん [sage] 2025/05/25(日) 06:42:37.76 ID:P4nhnL8B # If verbose flag is TRUE, plot the Beta distribution and annotate results if (verbose) { # Generate x values from 0 to 1 for plotting the density x <- seq(0, 1, length.out = 1000) # Compute Beta density values at x y <- dbeta(x, alpha, beta) # Color bars within the credible interval [lower, upper] as "lightcoral", # others as light gray ("gray70") col <- ifelse(x >= lower & x <= upper, "lightcoral", "gray70") # Plot histogram-like vertical lines representing the Beta density plot(x, y, type = "h", col = col, lwd = 2, main = sprintf("Beta(%.2f, %.2f) Distribution\n[%s, %s] with %.0f%% Probability Mass", alpha, beta, fractionStr(lower), fractionStr(upper), credMass * 100), xlab = "x", ylab = "Density", bty = "n") # Add vertical dashed line for the mean, colored skyblue abline(v = mean, col = "skyblue", lwd = 1, lty = 2) # Add vertical dashed line for the mode if defined, colored dark green if (!is.na(mode)) { abline(v = mode, col = "darkgreen", lwd = 1, lty = 2) } # Prepare legend labels for mean, mode (if exists), and credible interval labels <- c( paste0("Mean = ", round(mean, 3)), if (!is.na(mode)) paste0("Mode = ", round(mode, 3)) else NULL, paste0("95% Credible Interval [", fractionStr(lower), ", ", fractionStr(upper), "]") ) # Corresponding colors for legend items colors <- c( "skyblue", if (!is.na(mode)) "darkgreen" else NULL, "lightcoral" ) # Line types for legend items (dashed lines for mean and mode, none for credible interval) ltys <- c(2, if (!is.na(mode)) 2 else NULL, NA) # Plot characters for legend (none for lines, solid square for interval) pchs <- c(NA, if (!is.na(mode)) NA else NULL, 15) # Add legend at the top of the plot with no box, scaled text size legend("top", legend = labels, col = colors, bty = "n", cex = 0.9, lty = ltys, pch = pchs) } # Return a named vector of calculated parameters and statistics c(alpha = alpha, beta = beta, mean = mean, mode = mode) } http://rio2016.5ch.net/test/read.cgi/math/1723152147/850
970: 132人目の素数さん [] 2025/07/04(金) 16:51:52.76 ID:iaGT2Y/9 おーい尿瓶ジジイ生きてるかー? http://rio2016.5ch.net/test/read.cgi/math/1723152147/970
975: 132人目の素数さん [sage] 2025/07/12(土) 20:32:45.76 ID:gl7vYwO/ 次スレ誘導すらないのに早漏が過ぎる http://rio2016.5ch.net/test/read.cgi/math/1723152147/975
上
下
前次
1-
新
書
関
写
板
覧
索
設
栞
歴
スレ情報
赤レス抽出
画像レス抽出
歴の未読スレ
AAサムネイル
Google検索
Wikipedia
ぬこの手
ぬこTOP
1.621s*