« first day (775 days earlier)      last day (3699 days later) » 

2:49 AM
@rasher I am not saying that your answer doesn't demonstrate good practice. But generating a random number is not "doing nothing"--it changes the RNG state. Hoewever, precisely because of your insistence on re-seeding every time, BlockRandom becomes essentially pointless in the code and your answer fails to show clearly why it didn't work in the OP's example.
 
 
3 hours later…
5:41 AM
Ok, I added random movement and collision detection with the lakes to the current community game. Suggest what you want added next or add it and post a new version.
landscape =
  Map[If[# < .47, 2, 1] &,
   GaussianFilter[RandomReal[1, {100, 100}], 5], {2}];
people = RandomChoice[Position[landscape, 1], 200];
pos = RandomChoice[Position[landscape, 1]];

validQ[p : {x_, y_}] :=
  If[Clip[p, {1, Length@landscape}] == p && landscape[[x, y]] == 1,
   True, False];
move[p_, o_] := If[validQ[p + o], p + o, p];
randomMove[p_] :=
  If[RandomInteger[3] == 0,
   RandomChoice[move[p, #] & /@ {{1, 0}, {-1, 0}, {0, 1}, {0, -1}}],
   p];
plotLandscape[pos_] :=
 ArrayPlot[ReplacePart[ReplacePart[landscape, people -> 3], pos -> 4],
 
 
1 hour later…
7:11 AM
Oops. You don't need the Refresh.
Dynamic[people = randomMove /@ people; Dynamic@plotLandscape[pos],
 TrackedSymbols -> {}, UpdateInterval -> .1]
 
 
4 hours later…
11:06 AM
@MichaelHale, maybe we can add food sources and hunger. The goal would be to outsmart the randomly moving black dots to get to the food first.

Here is some nice lisp code, from the book land of lisp. There is no player there, but there are randomly moving animals that evolve as time goes by: http://landoflisp.com/evolution.lisp. A poor demonstration: http://www.youtube.com/watch?v=snsVmSjbKqQ. I believe an M is an animal and a * is a food source. The funky part is that basically two types of animals evolve, a horse and an elephant. Elephants try to stay near the jungle, where more food spa
 
 
2 hours later…
12:44 PM
@JacobAkkerboom I like it. Here's the part of the book describing the experiment: books.google.com/…
When I used Lisp in my AI class I hadn't been exposed to Mathematica yet. A lot of code to generate a weighted random integer, heh.
This:
(defun turn (animal)
  (let ((x (random (apply #'+ (animal-genes animal)))))
    (labels ((angle (genes x)
               (let ((xnu (- x (car genes))))
                 (if (< xnu 0)
                     0
                     (1+ (angle (cdr genes) xnu))))))
        (setf (animal-dir animal)
              (mod (+ (animal-dir animal) (angle (animal-genes animal) x)) 8)))))
To this:
turn[animal_] :=
 setTurn[animal, RandomChoice[genes@animal -> Range@8]]
I'm about to sleep, and then I have a visitor coming over during the afternoon, but I will have time tomorrow evening and night.
Maybe Pacman type controls (you keep moving until you change direction) would be better because Mathematica doesn't work well with holding down arrow keys and there is no reason with those rules to ever stand still.
So the score would be how long you could survive, while the others multiply and eventually food isn't produced fast enough so it gets harder and harder until you die?
 
1:22 PM
@MichaelHale ah, I like your response! First of all I was just trying to figure out how to work with the categorical distribution (http://en.wikipedia.org/wiki/Categorical_distribution) in Mathematica. That is a bit of a coincidence. Unfortunately RandomChoice does not help me, because I would like to use functions like Probability and Mean on a distribution. Maybe I will ask a question about it.

The pacman type controls are a good idea I think. It is unfortunate that Mathematica does not work well with holding down arrow keys, I did not know this.
 
 
2 hours later…
3:35 PM
What is the distribution of angles of in equilateral convex polygons?
 
@kirma I have the feeling the question suffers from the same problems as buffon's needle problem. It's important to state the problem formally so that there aren't multiple answers depending on how you choose to interpret the answer
 
@Searke I guess so... :)
 
Sorry. Multiple answers depending on how you choose to interpret the question.

In a sense, we need to know what it means to generate a random equilateral convex polygon. There are different ways of generating a random equilateral convex polygon which might favor some angles more than others. So interpreting the question is really asking, what is a "fair" way of generating random equilateral convex polygons.
This kind of nuance doesn't happen with most probability problems because there's a natural sense of what the fair (even) distribution of outcomes is.
 
I have been pondering about that for days. This is not professional interest, so I'm not awfully concerned of it all, but makes an interesting problem to think of.
 
For more complicated objects like graphs though, it becomes a problem. My experience has taught me to hold off on answering such a question till I can figure out what the intended application is.
It is an interesting problem. Even given a formal definition of it, I'm not sure how I would solve it.
 
3:47 PM
I'm absolutely certain I can't do it. :)
Related to this:
5
Q: Generating a (random) 2-dimensional cellular network

MehdiI want to generate a network of random cells like the following picture: The general idea is to generate some random points (x,y) as coordinate of a vertex and then randomly choose some of these points to connect them to achieve (almost) a random cellular network since there two constraints: ...

 
You could post the question to math.stackexchange's chat, but they'd likely say what I said and then throw you into the math dungeon to be eaten by the math wolfs.
 
That's the reason why I don't dare to trek there. :)
 
I would start by asking myself what I thought the problem meant and what it's solution was for a four sided figure like a rhombus or square.
 
"the volume is changing with respect to the user login height"
It deserves a thousand stars
 
My horribly informal intuition says that distribution for a triangle is single value, for rhombus it's uniform distribution, and beyond that point, it's something similar to normal distribution.
 
There are likely multiple reasonable answers that could be given
 
@Searke I have no idea where this intuition stems from.
 
buffon's needle problem has mutliple answers depending on what you mean by "randomly placed"
so too your question has multiple answers depending on "randomly selected"
Here. This is the classical example
The Bertrand paradox is a problem within the classical interpretation of probability theory. Joseph Bertrand introduced it in his work Calcul des probabilités (1889) as an example to show that probabilities may not be well defined if the mechanism or method that produces the random variable is not clearly defined. Bertrand's formulation of the problem The Bertrand paradox goes as follows: Consider an equilateral triangle inscribed in a circle. Suppose a chord of the circle is chosen at random. What is the probability that the chord is longer than a side of the triangle? Bertrand gave thr...
 
I think my logic is something like "if I assume all angles are uniformly distributed, but constrained by geometric constraint of equilateralness and convexness, observe real distribution of angles in such polygons, replace initial distribution by these, and repeat this forever, do distributions converge to a specific distribution?" Or something.
 
But the distribution of angles will be dependent on one another in some way. I'm not as confident that your specification is unambiguous.
 
3:59 PM
Of course, I sort of define the distribution in this case through the method I'm trying to hunt it, which is wrong.
 
An adequate description would be an algorithm which produced such a random equilateral convex polygon
 
At least I know the distribution for triangles. :)
 
And of course if you had such an algorithm, you could then always monte-carlo the problem and try to find a solution.
But I think you'll find that the problem mostly lies in trying to fully define the problem.
 
Yep.
 
 
1 hour later…
5:28 PM
After getting used to the rules in here, the sound design stackexchange beta seems a mess where all is allowed
Comments as answers. Question frowned upon because you can somewhat find something if you google.
One of the highest voted questions is "Where are you from and what do you do?"
 
@Rojo It didn't start out as an SE site... they were part of the SE 1.0 sites (like MathOverflow) which had a completely separate administration and rules. They pretty much allowed anything, including "wassup?" type of questions. It was only recently that they were made part of SE.
20
A: Did SE change its Q&A format to just-another-Internet-forum?

Robert CartainoThe Sound Design site was created outside the Stack Exchange Network by a third party before it was incorporated into the Stack Exchange Network. If you look at the content as a whole, the information being provided there is actually of pretty high quality. That's what we liked about the site. T...

 
@rm-rf Interesting
 
Several years ago, you could buy your own SE engine and start a site... they discontinued because very few (maybe like 5) actually survived and the rest (the dead, but zombied ones) was just starting to look like a bad name for SE, so they no longer offer it for sale. The only way now is through Area 51
 
Was the main site font changed recently?
 
6:27 PM
@JacobAkkerboom I wish you hadn't deleted your question about discrete distributions. I don't know the best solution to that problem and I would like to find out. So did you settle on ProbabilityDistribution with some piecewise function?
 
very idiotic questions being asked lately. This is becoming like the Matlab forum. This must mean Mathematica is becoming more popular with the masses. This is very good news.
 
@Szabolcs ah, yes I did. I guess I wasn't completely satisfied myself, I will reopen it :)
 
@nasser Getting close to midterms and students are realizing that they have projects due?
 
Wups, or is that impossible.. ai
 
I'm not sure. Never mind then.
It has happened to me that I deleted my own question and in a couple of hours I couldn't undelete it.
 
6:30 PM
What was the question?
 
Think they might be permanently gone if there was no input from others and you delete them yourself.
 
Link to the deleted one?
@Szabolcs You used the Combinatorica package, right?
 
@Rojo I'm not sure if the problem is that I cannot find the link or that the question has been "very deleted" :P. Either way.. em.. I don't know :P
 
@JacobAkkerboom Oh, ok
 
@Rojo How to define a distribution if you know the probability of each outcome? E.g. you have four-sided dice and the probabilities are {1/2, 1/4, 1/8, 1/8}. Is there some built-in distribution for this?
@Rojo A bit. I have the book here ...
 
6:32 PM
@Szabolcs I seem to recall there is
One of the empiricals
1 sec
 
There's HistogramDistribution which is similar but the input has to be a set of measurements, and it's continuous, not discrete. Jacob said he looked at ProbabilityDistribution with a piecewise function inside.
Did the font change in here?!
 
Empiricaldistribution works, it is quite clumsy, though. I prefered ProbabilityDistribution with a Switch
 
Yes, EmpiricalDistribution[probs -> data]
 
yeah Switch/Piecewise
 
I deleted some fonts today, I'm not sure if that's why everything is different, or they really changed.
 
6:34 PM
@JacobAkkerboom Why would piecewise be less clumsy?
You have a formula for the probs?
@Szabolcs I recognise font changes as much as haircuts, can't help
 
Ahh wait, no I was thinking of the other use of EmpiricalDistribution, where the frequency of occurence in a list determines the probability of that outcome. But the use with the rule is quite nice.
I thought ProbabilityDistribution might be better for use in TransformedDistribution, because of this Q&A:
3
Q: TransformedDistribution doesn't work

Fancier of MathematicaI'm trying to obtain a sum distribution of two discrete random variables. The function TransformedDistribution doesn't work for me in such case: Z = EmpiricalDistribution[{0.7, 0.3} -> {0, 1}]; Y = EmpiricalDistribution[{0.6, 0.4} -> {0, 1}]; TransformedDistribution[z+y,{z \[Distributed] Z, y \...

 
I looked at EmpiricalDistritbution and I totally missed that ...
 
@Szabolcs Oh, do you know how the Backtrack function works? I mean, what's the format of the "states"
The docs don't say much but I haven't read it in depth. And it's all spelunkable, but you might save time. i'm wondering if it can be answer to my own peg solitaire and the (unique?) whuber's question
(background: I never used or read about combinatorica)
 
@Rojo No, I don't, but check email.
 
@Szabolcs Thanks
 
6:41 PM
@rm-rf Did the fonts change on the main site and here in the chatroom recently?
Those { and } are pretty characteristic.
I deleted some fonts today to remove duplicates and I'm worried I broke something.
 
Tea time, afk
 
@Szabolcs Hmm... I don't know. It looks like it always used to. You do seem to have different fonts...
 
Okay, thanks!
BRB
 
@Szabolcs Depending on the problem, there might be some relevant distributions that might be more efficient (example for picking balls from an urn)
 
6:57 PM
isn't annoying when someone ask a question, then you ask them something to explain, and they ignore you, then they make new question, with the same thing as the old one, keeping the same problem in the new question as the old one? I really do not understand this.
4
 
@MichaelHale 3D printing section in geometry pulldown on Wolfram language reference page has disappeared. I think it was there still yesterday.
Is it reorganization, or what?
 
@kirma hiding
 
I wonder what's the point, considering Mma has had 3D exports for ages. That section brought up only a popup, anyway.
 
Look at these 2 questions by the same person. They leave the first question hanging and start similar one: mathematica.stackexchange.com/questions/43282/… and mathematica.stackexchange.com/questions/43271/…
 
@Nasser Yes, it is annoying. It is even more annoying when you share a reliable resource explaining why it is the way it is and they still insist it is wrong :D
@Nasser flag; move on; :D
 
7:06 PM
@Szabolcs here it is again, thanks to rm-rf
1
Q: Categorical Distribution

Jacob AkkerboomSuppose I want to do calculations with a random variable $X$ that has a simple categorical distribution (a.k.a generalised Bernoulli distribution or discrete distribution). I was expecting to be able to work with a distribution "symbolically". That is, I was expecting that there would be a funct...

 
@Nasser I know exactly what you mean.
 
@rm-rf this code is an almost copypaste from the Backtrack function of the combinatorica package. That should be mentioned, right?
2
A: Efficient backtracking with Mathematica

M.R.Backtracking is never efficient so I would suggest always using C for this. However if you must do this in mathematica, here is an example of the generalized backtrack algorithm applied to graph coloring: backtrack[space_List, partialQ_, solutionQ_, flag_: 1] := Module[{n = Length[space], all ...

At least the first couple of functions
 
@kirma I do think some heavy reorganization is going on at the moment.
 
If they really intend to release next month and situation is what it is, I'm not surprised.
 
@kirma What do yo mean with situation is what it is?
 
7:25 PM
@rm-rf Thanks! I learned two things: 1. it doesn't seem to be possible to restore system folders like /Library/Fonts with TimeMachine. 2. OS X an run in single-user command line mode (which allowed me to restore it manually)
 
@Rojo Hmm.. looks like it. Yes, it should be mentioned. Please edit the citation in and leave them a comment.
On the same note... why would they (combinatorica) write Module[{i}, Table[..., {i, ...}]]?
@Szabolcs Really? I thought it would be possible...
btw, the way apple markets Time Machine, it seems like you would be able to restore your backup fairly quickly... this is not the case though. I tried restoring from my TM once and it estimated 80+ hrs for the restore! Not worth my time... it was easier for me to pull an all-nighter and install all my programs and pull my settings from online repos — this took me 98% of the way to a "full restore".
Technically, this is not unexpected... since TM only does delta saves, it means that for each file, it will have to walk through the history to reconstruct the file. For an entire OS, this can be O(millions) of files.
 
@Rojo Documentation looks... unpolished. Or rather, there's quite a bit of content missing entirely. It may be just a side effect of their process, of course.
 
7:43 PM
@kirma Yes, but it's a mystery to what extent that page reflects what they have for the MMA10 docs
 
@Rojo Definitely they removed "what's new in Mma 10" page quickly after I pasted the link here.
It's still in the search index, but not viewable.
 
@rm-rf Style I guess. There seem to be many that like to Module up everything
@kirma When was that?
 
Hmmh. Soon after the preview documentation was unveiled.
 
Did Leonid mention already what functionality of MMA10 he had been co-working on?
 
Undo
j/k... I don't know, but one of their top guns better be working on it =)
 
7:52 PM
@rm-rf A new kind of undo
 
It can do everything! At least in theory, the same way as a Turing tarpit made of a cellular automaton.
 
The only thing that could be worse than WRI's marketing and SW's blogposts would be the marketing specs for a product that's the illegitimate love child of WRI and Apple. At least, it would have a nice UI :P
 
@Szabolcs any chance you had a look at my response to your comment? Wondering if you think that makes sense.
 
@scottyaz Sorry, not yet, but I got the message.
 
@Szabolcs No problem.
 
7:55 PM
@rm-rf I'm beginning to think that Steve Jobs was actually keeping some part of SW's ego in the closet
 
Let's call it irreducible undoability.
 
Days after he's gone and
(°.°) M
(¬_¬) M
(╯°□°)╯︵ W
(ʘ‿ʘ) W
 
hehe
 
There's something in my shed. It was sticking out its paw under the door. This is un the upper floor, 3 m from ground level, on our terrace, and I thought there wasn't any way into the shed other than the door.
 
@Szabolcs That looks more like a nose than a paw... a dog/wolf.
 
7:57 PM
Yeah, I didn't get the paw with a telephoto lens.
Looked like it was about a cat's size.
By the time I opened the door it was gone.
 
@Rojo Honestly though, I'm kinda over the "undo" thing. I don't need it anymore... all the useful work, I do via an IDE and for the exploratory work, I've managed to evolve to not need an undo. If only they'll fix the horrible and unpredictable crashing...
 
@rm-rf I've said that exact same thing around here a few weeks ago
 
@Szabolcs Definitely bigger than a cat. That looks like a medium sized dog.
 
I'm guessing raccoon.
 
@Rojo Hehe, I now hope they don't introduce undo and break our workflow :D
 
8:03 PM
I would be happy mostly because it makes it less embarrassing to recommend MMA. The pains you endure until you learn to live without it aren't a selling point
 
@Szabolcs Ah, that might be it.
 
@Szabolcs The question now is, how did it teleport
 
I think it might have come through the attic, there might be a hole through there. But it must be a very good climber.
 
@Rojo bbut... the look on their face when you're all "Hahaaaahahahahahahahaa!!!11!11 There is no undo!"... that's priceless!
 
"With WolframConnect, Google+ does not allow general posting of messages through its API."
 
8:08 PM
@rm-rf Yeah. It's like they are birds bumping into a glass for the first time
 
Wonder what's "WolframConnect"...
 
They just never imagine ctrl+z not working
 
I'd like to try the Dataset thing soon
 
@kirma Hidden behind all the million lines of EULA is probably a clause where you agree to give WRI an unconditional and irrevokable license to use, store, modify and sell your data, your wife and your life...
 
8:12 PM
Furthermore, I would be happy connecting a midi controller as a controller. Perhaps it can already be done easily, not sure
@rm-rf I trust OleksardR will warn us
He seems to be to licenses as you are to SE
 
@Rojo I too would like to use all of these as long as there's a guarantee that one little thing won't fuck up the packedness of everything and blow up your RAM... yeah, I'm still bitter :D
 
@rm-rf "Guarantee"?
 
@Rojo Good call. I'll wait for @Oleksandr to download v10 before installing it myself :)
 
Are you new in this forum?
 
hehe
 
8:31 PM
 
9:04 PM
NMinimize[Hold[x^2], x] actually works.
 
 
2 hours later…
11:17 PM
And this works too: Plot[Hold[x], {x, 0, 10}].
What's going on? These functions must be using ReleaseHold internally.
0
Q: Why does Plot[Hold[x], {x,0,1}] work?

SzabolcsIt appears that, counter to my expectation, all of these (and probably many others) seem to work fine: Plot[Hold[x], {x, 0, 10}] FindRoot[Hold[x^2 == 2], {x, 1}] NMinimize[Hold[x^2], x] I would expect Plot or NMinimize to complain that e.g. Hold[0] is not a number. These were mentioned a fe...

more about drawing attention to the issue ...
 

« first day (775 days earlier)      last day (3699 days later) »