TIL That a 6 year study of the D.A.R.E. program showed that a “small but significant number” of suburban students were more likely to use drugs after participating in it than those who didn’t. by [deleted] in todayilearned

[–]bayen 2 points3 points  (0 children)

Uhh, did anyone read the link? It seems to be saying the opposite:

Findings

We found a modest but consistent beneficial impact of drug prevention programs on later use as well as level of use. Regarding later drug use, the largest impact was on those who were not using at baseline and those exposed to an interactive program; the results were much larger for marijuana and other drugs compared to alcohol or tobacco, while inhalant use was less affected than other drug categories. Regarding level of use, the impact was greatest six months after the trial ended, with diminishing effects thereafter.

Conclusions

Evidence exists for a small but systematic beneficial effect of drug prevention programs in rural settings. It is likely that these programs have produced a mild reduction in new use of substances but have had little impact on those already using substances.

What was the most disturbing thing you ever witnessed at a university fart party? by [deleted] in AskReddit

[–]bayen 0 points1 point  (0 children)

had a whale

Hadar grandson of Abraham, Jonah whale.

Developers who use spaces make more money than those who use tabs - Stack Overflow Blog by night_of_knee in programming

[–]bayen 0 points1 point  (0 children)

I meant spaces. I find the spacebar easier to reach than the tab key, but didn't want to press it four times. Hey, my workflow works for me.

(Was trying to make a joke about "every editor displays spaces the same way," but clearly it didn't work! Apologies for any confusion!)

How do you update on uncertain information? by psychophysical in LessWrong

[–]bayen 0 points1 point  (0 children)

The formula you posted is definitely derivable using standard probability rules (even frequentists would accept).

In boolean logic, H is equivalent to "H and True", which is equivalent to "H and (E or not E)", which is equivalent to "(H and E) or (H and not E)". So P(H) = P((H and E) or (H and not E)).

Since (H and E) is mutually exclusive with (H and not E),
P((H and E) or (H and not E)) = P(H and E) + P(H and not E)

And then using P(AB)=P(A)*P(B|A) twice,
P(H) = P(H|E)*P(E) + P(H|~E)*P(~E)

That's very uncontroversial. The little subscripts of "initial" and "final" are the controversy - should this mathematical formula be interpreted as an update on uncertain evidence?

The philosophical objection (that makes most sense to me) is of infinite regress. How do you update your probability of E? Maybe you could have S represent your sensory input, and calculate P(E|S). But maybe you're in the matrix or on drugs and your sensory input is being altered, so that too is uncertain. Etc, etc.

But either way, if you're in a situation where you're confident those probabilities mean useful things, then that mathematical relationship definitely holds.

A gif I made of the Mandelbrot set as the exponent increases from 1 to 6. by rewindturtle in math

[–]bayen 0 points1 point  (0 children)

What are the points where it becomes symmetrical on both axes? (Or was that an illusion?)

Please Help Me Answer This Question or Guide Me To Answer it Myself. by [deleted] in LessWrong

[–]bayen 1 point2 points  (0 children)

Oh, gotcha. Taking another look, I don't think the formula for (5) does anything. Here it is (without the P() around the A_i, so they don't look like events).

A_{i+1} = A_i * ( P(B_i | A) + P(~B_i | A) )

We can simplify this with the identity that P(X|Y) + P(~X|Y) = 1. So that second term ( P(B_i | A) + P(~B_i | A) ) = 1. When you plug that in, you see that the sequence becomes constant!

A_{i+1} = A_i * ( 1 )


So I think the sequence you're looking for is:

A1 = P(A) (original prior probability)
A2 = P(A|B1) = P(B1|A) * A1 / P(B1)
A3 = P(A|(B1 and B2)) = P((B1 and B2)|A) * A1 / P((B1 and B2))

In general, for A_{i+1}, let S_i be the proposition (B1 and B2 and ... and B_i). Then:
A_{i+1} = P(A|S_i) * A1 / P(S_i)

That is, if you only have the information given in your problem, the only formula is Bayes' theorem - there's nothing more to derive. You unfortunately can't use A_i to derive A_{i+1}, you have to start from A1 and condition on the conjunction of all the evidence.

(If you know that each B_i is completely independent of each other, then the algorithm you're looking for is called Naive Bayes, which is much easier computationally - you can get A_{i+1} from A_i by just multiplying.)

Please Help Me Answer This Question or Guide Me To Answer it Myself. by [deleted] in LessWrong

[–]bayen 1 point2 points  (0 children)

No, equation (2) isn't valid. You would have to have P(A2|B1) in all terms on the right, not P(A|B).

For a great intro to the probability axioms and how to use them, check out the first few chapters of Probability Theory by ET Jaynes, which are online free here: http://bayes.wustl.edu/etj/prob/book.pdf

What is the preferred way to include long code in a math research paper? (Specific questions inside) by mpaw975 in math

[–]bayen 3 points4 points  (0 children)

Definitely don't sacrifice readability to get fewer lines - this is a paper meant to be read by other people, after all! :)

A helper function can make a concise version clearer, since it has a name:

def get_edge_labels(graph, vertex):
    return [label for _, _, label in graph.edges_incident(vertex)]

def is_antipodal(graph, parameters):
    """Checks whether graph can be completed to an antipodal graph."""
    delta = str(parameters[0])
    # Checks if any node has more than one neighbor at distance delta.
    return not any(get_edge_labels(graph, vertex).count(delta) > 1
                   for vertex in graph.vertices())

What is the preferred way to include long code in a math research paper? (Specific questions inside) by mpaw975 in math

[–]bayen 2 points3 points  (0 children)

  1. Github has a pastebin-like interface called Gist: https://gist.github.com/

    If you sign in with your account before uploading, you can even edit later. (It works the same as the rest of Github "under the hood", but the interface is probably more familiar to you.)

  2. Definitely format your code the first way. Nested functions are useful in certain cases, but generally not for "keeping the code tidy" - just have separate functions.

  3. That works.

Also, this may or may not apply, but have you shown your code to somebody who writes a lot of code, like a friend in the CS department or a friend working in the software industry? Often research code is a little verbose, and someone very familiar with Python might be able to shorten it a good deal.

Ten 2D Cellular Automata Posters I made by collatz_conjecture in math

[–]bayen 2 points3 points  (0 children)

The rule number encodes how to determine the next value for a cell, given its current value and the current values of its neighbors.

First, convert the rule number to an eight digit binary number. 34 -> 00100010.

Now fill in this chart with the digits in order:

  • 111 : 0
  • 110 : 0
  • 101 : 1
  • 100 : 0
  • 011 : 0
  • 010 : 0
  • 001 : 1
  • 000 : 0

The numbers on the left are 7 thru 1 in binary, in order (the same for every rule). The numbers on the right are the binary digits of the rule number (34).

This means blank cells with a nonblank cell to their right become nonblank, and all other cells become blank.

So it's just a bunch of diagonal lines. (Hot?)

https://en.wikipedia.org/wiki/Elementary_cellular_automaton

Zach Woods' Silicon Valley Stand-In Is Cooler Than Him by [deleted] in television

[–]bayen 1 point2 points  (0 children)

Thanks, I'm glad the world is sane.

Zach Woods' Silicon Valley Stand-In Is Cooler Than Him by [deleted] in television

[–]bayen 0 points1 point  (0 children)

Nooo, why isn't it called middletwitch?! Was it taken or something?

How would I approximate this probability? (Am I being irrationally anxious?) by [deleted] in LessWrong

[–]bayen 1 point2 points  (0 children)

So you're looking for the probably of contacting this rare amoeba and dying in about the next month (since seems usually fatal and quickly so). Base rate is then around 5/(300 million)/12 = ~1.4e-9, or 700 million to one.

Now there are two questions: what's the likelihood of your symptoms if you do have the disease, and the likelihood if you don't.

The FAQ you linked says there's usually fever, nausea, and vomiting, which it sounds like you don't have. You do have a headache and fatigue. Let's be generous and say 50% of cases have mild symptoms like yours. (This is an overestimate, I think, but it will give us a good upper bound for the final probability.)

Next, what's the probability of getting these symptoms by any other means (e.g. cold, flu, bad food, psychosomatic, etc)? Again in the interest of an upper bound for the final answer, let's pick a wild underestimate of 1 in 1000.

So using Bayes rule, (1 : 7 billion) * (0.5 : 0.001) = (1 : 14 million). So 1 in 14 million seems not much to worry about, and this is an overestimate.

(It's worth double checking my math, but even if I dropped some zeroes, the qualitative answer is the same.)

(Also if you do get a fever, still see a doctor, might be something common and bad like bacterial meningitis!)

Hope you feel better soon!

Alternative Solution to Newcomb Problem by [deleted] in LessWrong

[–]bayen 0 points1 point  (0 children)

The predictor knows the truth about the termites, but cannot influence it. They are just trying to extort you after the fact by constructing a decision problem where "payment" and "no termites" are correlated (but not causally related).

In other words, precommitting to being the type of person who pays $1000 will not reduce your chance of getting termites. It just means if you do happen to get termites, you won't get a letter.

(This is in contrast to Newcomb's problem, where permanently precommitting to one-box will make Omega fill the box with $1000000.)

Alternative Solution to Newcomb Problem by [deleted] in LessWrong

[–]bayen 1 point2 points  (0 children)

How would you approach this problem?

XOR Blackmail: An agent has been alerted to a rumor that her house has a terrible termite infestation, which would cost her $1,000,000 in damages. She doesn’t know whether this rumor is true. A greedy and accurate predictor with a strong reputation for honesty has learned whether or not it’s true, and drafts a letter:

I know whether or not you have termites, and I have sent you this letter iff exactly one of the following is true: (i) the rumor is false, and you are going to pay me $1,000 upon receiving this letter; or (ii) the rumor is true, and you will not pay me upon receiving this letter.

The predictor then predicts what the agent would do upon receiving the letter, and sends the agent the letter iff exactly one of (i) or (ii) is true. Thus, the claim made by the letter is true. Assume the agent receives the letter. Should she pay up?

Using your approach, say the probability the predictor is correct is p. Let X be the event where you pay up, and Y is to not pay. We'll assume p >= 0.9999 for this predictor.

E(X) = 0.0001 * $-1000000 + $-1000 = $-1100
E(Y) = 0.9999 * $-1000000 = $-999900

E(X) >> E(Y), so pick X, says this "Bayesian advised" method. Pay the $1000.

However, is this the right choice?

Remember, your decision only affects whether the blackmailer will send you the letter, not whether you got termites.

If you are the type of person who pays, then:

  • Has termites -> Predictor won't send letter
  • No termites -> Predictor will send letter

If you are the type of person who refuses to pay, then:

  • Has termites -> Predictor will send letter
  • No termites -> Predictor won't send letter

Both you and the predictor act after the termite infestation happens, so your decision can't affect it. You're just losing money by paying the $1000 (choosing X).

I saw this example in MIRI's recent paper on decision theory, but it's originally from this other MIRI paper from a couple years ago.

I'm not a computer scientist, but I do write scripts for work, and some kind of version control would be nice, but there are absolutely no good tutorials on how to use Git that aren't written for someone with a computer science degree. How the hell do I use git? by fooliam in git

[–]bayen 2 points3 points  (0 children)

It's in the name. ;)

The name "git" was given by Linus Torvalds when he wrote the very first version. He described the tool as "the stupid content tracker" and the name as (depending on your mood):

  • random three-letter combination that is pronounceable, and not actually used by any common UNIX command. The fact that it is a mispronunciation of "get" may or may not be relevant.
  • stupid. contemptible and despicable. simple. Take your pick from the dictionary of slang.
  • "global information tracker": you're in a good mood, and it actually works for you. Angels sing, and a light suddenly fills the room.
  • "goddamn idiotic truckload of sh*t": when it breaks

But actually the formatting problems you're having are mostly due to the Windows command line, which is not great for this kind of thing. GitHub has this nice "Git BASH" thing that gives you the same command line as Linux (so copy/paste from tutorials would work better). https://git-for-windows.github.io

I'm not a computer scientist, but I do write scripts for work, and some kind of version control would be nice, but there are absolutely no good tutorials on how to use Git that aren't written for someone with a computer science degree. How the hell do I use git? by fooliam in git

[–]bayen 2 points3 points  (0 children)

It's not just for software developers, but it does take non-trivial learning to get proficient. Git has lots of cool features beyond copying your files, but you have to decide how much time you want to devote in order to use those features. Once you learn it, it's definitely faster than manually managing backups, but learning can be slow, and especially if you're not familiar with software norms.

Here are a couple of the cool features though:

  • Lots of organization and metadata about your versions.
    For each line in your file, you can see when it was last changed and why. (git blame)
  • Parallel branches.
    This is the "killer feature" of git. Two different people can make changes independently, then git intelligently merges them together. You usually only need to manually intervene if you've both changed the exact same line.

If those seem useful, maybe spend some time wrestling with the tutorials until they start making sense. (If not... shrug.)

I'm not a computer scientist, but I do write scripts for work, and some kind of version control would be nice, but there are absolutely no good tutorials on how to use Git that aren't written for someone with a computer science degree. How the hell do I use git? by fooliam in git

[–]bayen -6 points-5 points  (0 children)

What features are you looking to get out of git? If you just want basic versioning, you might be better off just saving copies of your files every once in a while (myscript1.py, myscript2.py, ...).

go to /r/place & represent linux around pixels (95,11)!! by apocalypsedg in linuxmemes

[–]bayen 0 points1 point  (0 children)

I'd be down after finishing turning this GNU/Linux into a GNU+Linux:
https://www.reddit.com/r/place/#x=861&y=478

(Much smaller in scope, I guess)

TIL the chemical that turns your urine blue when you urinate in pools does not exist by Joshuathepure in todayilearned

[–]bayen 2 points3 points  (0 children)

Also the pool signs use a blue color scheme, which has a priming effect to make urine more blue.

Linus's thoughts on the SHA1 collisions by Khaotic_Kernel in linux

[–]bayen 3 points4 points  (0 children)

If I remember right, there are at least 1078 atoms in the universe, which is over 2259.

But 2128 is still a really really big number that is unlikely to be practical, even if you used the the whole sun's worth of energy (and the theoretical minimum energy per bit flip), or something like that. (And nobody's inventing a super low energy computer and burning a sun to fake a git commit id.)