Tumgik
booringdata · 10 years
Link
13 notes · View notes
booringdata · 11 years
Video
1 note · View note
booringdata · 11 years
Photo
Tumblr media Tumblr media Tumblr media
1 note · View note
booringdata · 11 years
Photo
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
0 notes
booringdata · 11 years
Photo
Tumblr media Tumblr media
1 note · View note
booringdata · 11 years
Text
Project Euler problem 82
For this problem I used Dynamic programming for the first time. We have a data set with 80 rows and 80 columns with seemingly random integers. The problem is to find the path from the leftmost column to the rightmost column with the smallest sum. I went through the cells from the topleft to the bottomright columnwise. In a new matrix, s, I wrote down the sum for the minimal path to the corresponding point in the original data matrix, m. The first column of s is the same as the first column m. In the second column, I write down the minimum of a group of points that include all the possible ways of getting to that point. so for the point in the ith row and the jth column I have to find the minimum of s[i,j-1] #getting to ij from above s[i-1,j] #getting to ij from the left s[i+1,j] #getting to ij from below and add it to m[i,j] and put that value in s[i,j] So s ends up being the sum of the shortest path to the corresponding point in m. The trick here is that the first two points of the three are computed but the third is not. I need to find the s value for the point before its regular order. This caused my algorithm to be a bit inefficient. It did work and in less than .3 seconds on my computer. Anyway, that is my first real application of Dynamic Programming.
1 note · View note
booringdata · 11 years
Photo
Tumblr media
vandana says it so right, always.  —nb
1K notes · View notes
booringdata · 11 years
Video
0 notes
booringdata · 11 years
Photo
Tumblr media Tumblr media Tumblr media Tumblr media
Processing: Color chip sorting (additionals.)
image via commons
Each chip is scored based on it’s internal channel variation and then sorted before rendering.
382 notes · View notes
booringdata · 11 years
Text
I would like to avoid politics here but....
Justice Scalia's discussion of why we don't need the Voting Rights Act's pre-clearance provision. I think he can speak for himself so Ill quote the transcript at length and only make a brief comment at the end. JUSTICE SCALIA: ... This Court doesn't like to get involved in -- in racial questions such as this one. It's something that can be left -- left to Congress. The problem here, however, is suggested by the comment I made earlier, that the initial enactment of this legislation in a -- in a time when the need for it was so much more abundantly clear was -- in the Senate, there -- it was double-digits against it. And that was only a 5-year term. Then, it is reenacted 5 years later, again for a 5-year term. Double-digits against it in the Senate. Then it was reenacted for 7 years. Single digits against it. Then enacted for 25 years, 8 Senate votes against it. And this last enactment, not a single vote in the Senate against it. And the House is pretty much Official - Subject to Final Review the same. Now, I don't think that's attributable to the fact that it is so much clearer now that we need this. I think it is attributable, very likely attributable, to a phenomenon that is called perpetuation of racial entitlement. It's been written about. Whenever a society adopts racial entitlements, it is very difficult to get out of them through the normal political processes. I don't think there is anything to be gained by any Senator to vote against continuation of this act. And I am fairly confident it will be reenacted in perpetuity unless -- unless a court can say it does not comport with the Constitution. You have to show, when you are treating different States differently, that there's a good reason for it. That's the -- that's the concern that those of us who -- who have some questions about this statute have. It's -- it's a concern that this is not the kind of a question you can leave to Congress. There are certain districts in the House that are black districts by law just about now. And even the Virginia Senators, they have no interest in voting against this. The State government is not their government, and they are going to lose -- they are going to lose votes if they do not reenact the Voting Rights Act. Even the name of it is wonderful: The Voting Rights Act. Who is going to vote against that in the future? So he makes a few points 1) He doesn't like laws that are about race. 2) He doesn't think the congress *really* liked it when they voted for it unanimously. 3) He doesn't think ability to vote is a good reason.
0 notes
booringdata · 11 years
Text
R function of the day 009
Using empty square brackets help populate matrices and lists see: http://rmazing.wordpress.com/2013/01/30/the-magic-empty-bracket/
0 notes
booringdata · 11 years
Text
Wildfire statistics.
Tumblr media
Came across this data today. Dunno what this is about. US fire data from here.. Why are fires bigger? Why are there fewer fires? Global warming effects? changes in fire fighting? Changes in proportion counted?
0 notes
booringdata · 11 years
Photo
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
2 notes · View notes
booringdata · 11 years
Photo
Tumblr media Tumblr media Tumblr media Tumblr media Tumblr media
0 notes
booringdata · 11 years
Text
R Function of the Day 008
venneuler is your friend! In order to make lovely venn diagrams where the size of the circles corresponds to their number of elements use venneuler package.
vd = venneuler(c("SCP"=0, "NCC"=2, "DPM"=6, "SCP&NCC"=49, "SCP&DPM"=0, "NCC&DPM"=9 , "SCP&NCC&DPM"=45)) plot(vd)
Tumblr media
This creates a very nice diagram as shown: To be completely accurate the yellow slice should not be there as well as two blue bits. But it is very close. I think this gives the main idea a venn diagram should. fn1: I used to call these Sven diagrams. Dunno where I got that idea.
0 notes
booringdata · 11 years
Text
Drawing subject to arbitrary and unknown constraints
See what you can come up with.
Please upgrade your browser to something new like Google Chrome.
///PUT YOUR PROCESSING SKETCH HERE!! int cx= 200; int cy= 200; void setup(){ size(800,500); background(#CBCFCA); stroke(1); noFill(); rect(1,1,799,499); stroke(#363636,23); } void draw(){ line(cx,cy,mouseX,mouseY); } void mouseClicked(){ cx=mouseX; cy=mouseY; }
Different constraints here:
Please upgrade your browser to something new like Google Chrome.
///PUT YOUR PROCESSING SKETCH HERE!! int cx= 200; int cy= 200; void setup(){ size(800,500); background(#CBCFCA); stroke(1); noFill(); rect(1,1,799,499); stroke(#363636,23); } void draw(){ rect(mouseX,mouseY,cx,cy); noFill(); stroke(mouseX,23); } void mouseClicked(){ cx=mouseX; cy=mouseY; }
0 notes
booringdata · 11 years
Text
Project Euler Problem iv (bleg)
I think I understand the concepts in this problem, and have coded it up most of the way. A smallish bug is frustrating me. If anybody can help, we could both check this problem off. Project Euler#23: A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the proper divisors of 28 would be 1 + 2 + 4 + 7 + 14 = 28, which means that 28 is a perfect number. A number n is called ...abundant if this sum exceeds n. As 12 is the smallest abundant number, 1 + 2 + 3 + 4 + 6 = 16, the smallest number that can be written as the sum of two abundant numbers is 24. By mathematical analysis, it can be shown that all integers greater than 28123 can be written as the sum of two abundant numbers. However, this upper limit cannot be reduced any further by analysis even though it is known that the greatest number that cannot be expressed as the sum of two abundant numbers is less than this limit. Find the sum of all the positive integers which cannot be written as the sum of two abundant numbers. to reproduce the example I:
n=12 sum(which(n/1:(n/2)==floor(n/1:(n/2)))) [1] 12
then with 26 it gives 28, so this seems to work So I need to go through all integers and collect the abundant ones.
abundant=12 for(n in 13:28123){ if(n<sum(which(n/1:(n/2)==floor(n/1:(n/2))))) abundant=c(abundant,n) }
# get the set of all integers that are the sum of two in my abundant list.
x=outer(abundant,abundant) tidy up a bit x=unique(c(x)) x=x[which(x < 28124)] notabundant= which( !(1: 28123 %in% x))) sum(notabundant)
But this gives the wrong answer and I can't figure out why. Is there a floating point error in with the inequalities? I am stumped.
0 notes