This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// randomWalk.C | |
//////////////////////////////////////////////////// | |
// | |
// Simple Monte Carlo | |
// | |
/////////////////////////////////////////////////// | |
// Created by @visionlib.postach.io | |
{ | |
const Int_t kIteration = 1000000; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/gnuplot | |
################################### | |
# # | |
# @visionlib.postach.io # | |
# # | |
################################### | |
set term post enh color | |
set output "draft_lottery.eps" | |
set xlabel "Draft Number" | |
set ylabel "Day of year" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Day Month Mo.Number Day_of_year Draft_No. | |
1 Jan 1 1 305 | |
2 Jan 1 2 159 | |
3 Jan 1 3 251 | |
4 Jan 1 4 215 | |
5 Jan 1 5 101 | |
6 Jan 1 6 224 | |
7 Jan 1 7 306 | |
8 Jan 1 8 199 | |
9 Jan 1 9 194 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Apple 70 55 15 11 7 2 | |
Google 70 61 30 3 2 4 | |
Yahoo 63 50 39 2 4 2 | |
Facebook 69 57 34 4 2 3 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/gnuplot | |
# Redirect output to file | |
set terminal postscript enhanced eps color | |
set output "workforce_male_percent.eps" | |
set style data histogram | |
set yrange [0:100] | |
set key right top title '' | |
#set title "male workforce percentage" | |
set style fill solid border -1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//try to make a toy monte carlo | |
//waste calculation | |
void simpleProfitPrediction(){ | |
gBenchmark->Start("htrang"); | |
TH1 *hprofit = new TH1F("hprofit","hprofit",100,-2000,6000); | |
Int_t numUnit; | |
Float_t rentUnit=500; | |
Float_t monthlyExpense; | |
Float_t profit; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//try to make a toy monte carlo | |
//pi calculation | |
void pi(){ | |
TCanvas *c1 = new TCanvas("c1","pi",800,800); | |
gStyle->SetOptStat(0); | |
gStyle->SetLineWidth(2); | |
//c1->SetGrid(); | |
gBenchmark->Start("hpi"); | |
gSystem->Unlink("hpianim.gif"); // delete old file | |
NewerOlder