10,581 reputation
11558
bio website
location
age
visits member for 2 years, 7 months
seen 20 hours ago

Aug
8
comment Removing some data and replacing them with new ones
BTW, see Differences reference.wolfram.com/language/ref/Differences.html
Aug
8
comment Removing some data and replacing them with new ones
"remove the ones which are higher than a specific number"? Remove the differences? Or remove some elements? Or substitute some elements with new ones? Or add new elements?
Jul
11
comment Random numbers that sum up to specific value
george2079, Now I understand. Thanks for noting (and explaining).
Jul
10
comment Random numbers that sum up to specific value
@george2079 I'm unsure what you mean by "at the ends". RandomSample[Range[0, 5], 5 - 1] will often generate zero among the elements (at any position).
Jul
10
comment Random numbers that sum up to specific value
Strange about disfavoring zeros. Zeros occur due to the repetition of "cuts".
Jul
10
comment Random numbers that sum up to specific value
Oops. Parameter name change at last minute.... Fixed.
Jul
10
comment Random numbers that sum up to specific value
@Szabolcs, The constraint that the set sums to s seems to violate the normal sense of randomness that your reasoning appears to rely on. Assuming that the elements are understood to be non-negative, then the generation of each positive element further constrains the domain from which subsequent elements may be chosen. Of course, that doesn't justify using any method. One might approach the challenge by generating 4 random whole numbers between 0 and sum that would be used as 'cuts', in Dedekind's sense. The differences would be used as the random numbers.
Jul
10
comment Random numbers that sum up to specific value
Related: codegolf.stackexchange.com/questions/8574/…
Jul
10
comment Random numbers that sum up to specific value
+1 Nice and clean. You should perhaps wrap the function in RandomSample to avoid necessarily sorting from largest to smallest.
Jun
8
comment Graphing a network with state transition flows (of varying size)
BTW, I for one am disappointed that Wolfram Blog doesn't make the source code available and easily accessible, contrary to its earlier practice.
Jun
8
comment Graphing a network with state transition flows (of varying size)
Take a look also at GraphLayout (CircularEmbedding) reference.wolfram.com/mathematica/ref/GraphLayout.html and also at EdgeShapeFunction reference.wolfram.com/mathematica/ref/EdgeShapeFunction.html
May
26
comment Generating $n$ random samples every time
Thanks for the suggested shortening of code, which I will incorporate.
May
7
comment Counting the permuted forms of a list with repeated members under a permutation group
Would you explain more?
Apr
3
comment Accessing list elements by name
Very useful link. Thanks.
Apr
3
comment Accessing list elements by name
Interesting but I'm wondering whether there are any advantages over simply chem=Thread@[elements-> chemistry]; Ni/.chem ?
Mar
29
comment Morphological Components with periodic boundary conditions
The procedure now checks the horizontal and vertical borders.
Mar
29
comment Morphological Components with periodic boundary conditions
Ok. I now see it. I needed to remove the morphological components and look at the 1's and 0's to fully get the picture.
Mar
29
comment Morphological Components with periodic boundary conditions
Can you show an example of what you would like the output to look like? (even if using a smaller grid). I'm having trouble visualizing what you have in mind.
Mar
26
comment How can I close a gap in a bar chart?
Please include the data, if possible so we can reproduce your graph and inspect it.
Mar
19
comment Mathematica style (drawing cubes)
Without Cube: Coords[r_]:={#1,#2,Floor[Sqrt[r^2-#1^2-#2^2]]}&@@@With[{t=Sqrt[r^2-1]},Select[J‌​oin@@Table[{x,y},{x,t},{y,1,x}],Norm[#]<=t&]]; Cubes[r_]:=(Cuboid/@(Union@@(Permute[#,SymmetricGroup[3]]&/@Coords[r])-1));