question: You have a portfolio of 50 assets with equal weights (w_i = 1/50). The return covariance matrix Σ ∈ ℝ^{50×50} is generated from seed=42: A = randn(50,50,seed=42); Σ = Aᵀ·A/50 + 0.01·I. Using 2,000,000 Monte Carlo scenarios (each of 20 workers generates 100,000 using seed WorkerIndex*1000+42 and the shared Cholesky factor L of Σ), estimate the 1-day 99% Value-at-Risk (VaR) and Conditional VaR (CVaR) of the portfolio loss distribution. Loss = –(portfolio return). Return {var_99, cvar_99} as floats.

answer: {"var_99_approx":0.294775,"cvar_99_approx":0.338588,"note":"Reference computed with 50k scenarios; full task uses 2M."}


question: Price 200 down-and-out European call options on a (S,σ,T) grid: S ∈ {80,85,90,95,100,105,110,115,120,125}, σ ∈ {0.10,0.15,0.20,0.25}, T ∈ {0.25,0.5,1.0,2.0,4.0} years. Parameters: K=100, r=0.05, B=0.85·S. Use 500,000 GBM paths per grid point; each of 20 workers prices 10 points using seed WorkerIndex*999+7. Compute delta and vega by central finite difference. Return a JSON array of {S,sigma,T,price,delta,vega} for all 200 points.

answer: {"reference_price_S100_sig020_T1":7.9153,"note":"Analytical barrier option price at S=100,σ=0.20,T=1."}


question: Find the shortest Hamiltonian tour through 300 cities. City coordinates: x[i]=rng()*1000, y[i]=rng()*1000 generated from seed=12345 (Mulberry32 PRNG). Run 20 independent Simulated Annealing trials (α=0.9995, T₀=1000, 500,000 iterations, 2-opt neighbourhood), each worker using seed WorkerIndex*777. Return {best_tour_length, best_worker_seed, all_trial_lengths}. The nearest-neighbour baseline is provided in the answer for reference.

answer: {"nearest_neighbour_tour_length":16018.84,"note":"SA with 20 trials should beat NN by 10–20%."}


question: Simulate a discrete-time SIR epidemic on N=1,000,000 individuals for 365 days across a 20×20 parameter grid: R₀ ∈ linspace(0.8,4.0,20), θ ∈ linspace(0.01,0.20,20). Parameters: γ=1/14, β=R₀·γ; when I/N ≥ θ apply 50% contact-rate reduction. Initial conditions: S₀=999900, I₀=100, R₀_init=0. Each of 20 workers simulates 20 parameter combinations. Return a JSON array of {R0,theta,peak_infected_frac,attack_rate,days_to_peak,intervention_days} for all 400 combinations.

answer: {"max_peak_infected_frac":0.254092,"min_attack_rate":0.000497}


question: Train a gradient boosting classifier on a synthetic dataset (80,000 rows, 25 features). Dataset: features X~N(0,1)^{80000×25} from seed=42, labels via logit(P(y=1))=X·β, β~N(0,1) from seed=42. Evaluate all 20 hyperparameter configs (learning_rate∈{0.01,0.05,0.1}, max_depth∈{3,5,7}, n_estimators∈{100,300}, subsample∈{0.8,1.0}) with 5-fold CV. Each worker trains one config. Return {best_config_index, best_auc_roc, ranked_configs:[{config_index,auc_roc}]}.

answer: {"note":"Best AUC-ROC typically 0.82–0.90 for max_depth≥5 configs."}


question: Fit a Cox proportional hazards model on a synthetic patient dataset (N=8,000; 5 covariates cov_0…cov_4; time; event) and compute 95% bootstrap confidence intervals for all 5 hazard ratios using B=10,000 resamples. Dataset: cov~N(0,1) seed=42; β=(0.5,−0.3,0.8,0.1,−0.6); event times~Exponential(exp(X·β)); 30% censoring. Each of 20 workers runs 500 resamples. Return {cov_i:{ci_lower,ci_upper,point_estimate}} for i=0..4.

answer: {"true_betas":[0.5,-0.3,0.8,0.1,-0.6],"note":"95% CIs should bracket true betas."}


question: Compute the 600×600 pairwise similarity matrix for 600 synthetic protein sequences using simplified Smith-Waterman (match=+2, mismatch=−1, gap=−2). Sequence i: length~Uniform(50,500) from seed=i, amino acids from 20-letter alphabet with biological frequencies from seed=i*31+17. Normalise scores to [0,1] by dividing by min(len_i,len_j)*2. Return {top_20_pairs:[{seq_i,seq_j,score}], matrix_checksum (sum of upper-triangular normalised scores, 4 d.p.), n_families_above_0p7}.

answer: {"n_pairs":179700,"note":"Expect 5–15 high-similarity family clusters."}


question: Train a random forest of 200 decision trees on a synthetic regression dataset (60,000 train rows, 30 features, 10,000 test rows). Dataset: X~N(0,1)^{70000×30} from seed=99; y=sin(X·β)+0.1·ε, β~N(0,1) seed=99. Each tree: bootstrap sample, √30≈5 features/split, max_depth=15, min_leaf=5. Each of 20 workers grows 10 trees using seeds WorkerIndex*200+treeIndex. Return {oob_rmse, test_rmse, feature_importances:[{feature,importance}] top 10}.

answer: {"target_variance_test":0.5114,"note":"Expect test_rmse << sqrt(target_variance)."}


question: Generate and test 10,000 candidate 512-bit odd integers for primality using Miller-Rabin (k=20 witness rounds, FP rate < 4^{−20}). For each confirmed prime p, check if (p−1)/2 is also prime (safe prime). Each of 20 workers tests 500 candidates using seed WorkerIndex*9973 to generate 512-bit odd numbers. Return {prime_count, safe_prime_count, empirical_prime_density, pnt_predicted_density (=1/ln(2^512)), iteration_histogram}.

answer: {"pnt_predicted_density":0.002818,"expected_primes_in_10000":28.2}


question: Reprice a portfolio of 300 instruments under 500 stress scenarios using delta-linear approximation: P&L_s = Σ_i w_i·(δ_i·shock_s). Portfolio: sensitivities δ∈ℝ^{300×15} and weights w from seed=77. Scenarios: 500 shock vectors∈ℝ^{15}, entries~N(0,0.03) from seed=99. Each of 20 workers prices the full portfolio under 25 scenarios. Return {worst_10_scenarios:[{scenario_id,pnl}], pnl_var_99 (1st percentile), pnl_std, top_3_loss_drivers per worst scenario}.

answer: {"pnl_var_99":-0.020224,"pnl_std":0.008591,"worst_10_scenario_ids":[16,50,408,43,34,332,317,173,480,330]}


question: Score 50,000 molecules against a reference kinase inhibitor fingerprint using Tanimoto similarity on 2048-bit Morgan fingerprints. Library: fps (bit-set prob 0.05 each bit) from seed=55; MW~N(350,80), HBD~Uniform(0,7), HBA~Uniform(0,11), logP~N(2.5,1.5). Reference fp from seed=0. Proxy score=0.7·Tanimoto+0.1·(1−MW/700)+0.1·(1−HBD/8)+0.1·(1−logP/7). Apply Lipinski filters: MW≤500, HBD≤5, HBA≤10, logP≤5. Each of 20 workers scores 2,500 molecules. Return {top_100_mol_ids, lipinski_pass_rate, mean_tanimoto}.


question: Simulate 2,000,000 policy years under a compound Poisson risk process: claim count N~Poisson(λ=200), severity X~Lognormal(μ=8,σ=1.5). Premium P=(1+0.2)·E[S]; initial surplus U=500,000. Each of 20 workers simulates 100,000 policy years using seed_counts=WorkerIndex*2053+1, seed_severities=WorkerIndex*3571+2. Return {ruin_prob_1yr, ruin_prob_5yr, ruin_prob_10yr, scr_995 (99.5th-percentile annual loss), expected_deficit_given_ruin}.

answer: {"annual_premium":2203679.28,"E_S":1836399.4,"note":"Cramér-Lundberg: ruin prob ≤ exp(−R·U) for θ=0.2."}


question: On a synthetic road-network graph (5,000 nodes, ~25,000 edges): compute shortest-path lengths from 400 sampled source nodes (Dijkstra), approximate betweenness centrality for all nodes, network diameter and average path length (hop count), and top-20 most critical edges by removal impact. Graph: nodes in [0,1]² from seed=314; edges between nodes within distance 0.055; weights~Uniform(1,30) minutes from seed=314. Each of 20 workers runs Dijkstra from 20 source nodes (WorkerIndex*20…WorkerIndex*20+19). Return {top_20_nodes_by_betweenness, top_20_critical_edges, avg_path_length_hops, diameter_hops}.

answer: {"n_edges":113877}


question: Simulate photon transport through a 50-layer plane-parallel atmosphere. Layer l: τ_scat[l]=0.1·exp(−0.05·l), τ_abs[l]=0.02·exp(−0.08·l), ω[l]=τ_scat/(τ_scat+τ_abs). Solar zenith θ=30°. Rayleigh phase function. Simulate 5,000,000 photons; each of 20 workers traces 250,000 using seed WorkerIndex*6271+3. Return {toa_radiance, surface_irradiance, heating_rates:[50 floats], ssa_retrieval_rmse}.

answer: {"total_optical_depth":2.1375}


question: Compute the k=8 frequency spectrum (4^8=65,536 k-mers) for each of 20 synthetic genomic sequences (500,000 bp, composition A:0.30,C:0.20,G:0.20,T:0.30, sequence i from seed=i*104729+1) and for the combined corpus. For each sequence: top-50 over/under-represented k-mers vs. null expectation; repeat regions (k-mer freq>100 in consecutive 10kb windows). Final layer: Jensen-Shannon divergence between each spectrum and corpus mean. Return {js_divergences:[20 floats], corpus_top_10_kmers, frequency_table_checksums:[20 ints], expected_checksum_per_seq:499993}.

answer: {"expected_checksum_per_seq":499993,"note":"checksum = seq_length − k + 1 = 499993."}