12:03 AM
@Rojo Did you make a Manipulate version of that Munk Profile?

@AdamDreaver I got something, yep, but the notebook or code isn't easily shareable

can one paste an animated gif file here?

@AdamDreaver Just sent you a screenshot

2 hours later…
1:48 AM
Hi everyone, I'm getting bizarre behavior when using mesh in a regionplot
And then using Show to combine that with another plot
for some reason, some of my curves are becoming invisible

4 hours later…
6:13 AM
@Guillochon Yes, there was a question on that... In short, `Show` uses settings of the first plot and depending on which one you used first, the `"TransparentPolygonMesh" -> True` option must be interfering with your other plot. See this (probably the opposite of yours):
10

Let us first define two positive definite matrices: M1 = {{2, -6}, {4, 8}}; M2 = {{2, 3}, {4, 8}}; then set two points p1={-1,-1} and p2={1,1}. Finally we define an anisotropic distance function, namely: d[q1_, q2_, M_] := Sqrt[(q1 - q2).M.(q1 - q2)] When trying to plot the anisotropic Voro...

12 hours later…
6:32 PM
Hi. Someone here who knows the english language? ;-)
How is the turning point of a curve called mathematically?
I mean where the second derivative vanishes.

@halirutan It's called an inflection point
I believe inflexion is also an acceptable way to write it

@rm-rf Thanks. That's what we got. But there are so many words and we weren't sure.

6:49 PM
anyone else having hard time to login to Mathematica at Stackoverflow from Firefox? For some strange reason, using FF, I login via my account, but it keep saying page is being redirected and I never login. But I can login to Mathematica on stackexchange just fine. When I try Chrom, I can login to both site OK. Here is a screen shot
Then when I am redirected, I find I am not logged in at all. Say I keep doing this over and over, same result.

Is it a known behaviour that Simplify assumes 0 and 1 are booleans in logical expressions? Feature or bug?

Simplify[And[1, 2]] ==> 2

7:05 PM
@István Trick question: without looking in the docs, which commonly used operator has higher precedence than `[ ]`? I.e. `a OP b[]` would be `(a OP b)[]` ;-)
@IstvánZachar Interesting find. Even more interesting that it returns `2` and not `True`.

Why would it be 2? True && 2 returns 2 as expected

@IstvánZachar I think what happens is that M punted out. (is this the right word?). If you type And[2] you get 2, and if you type And[x] you get x. Basically, if it can't decide is a boolean, it returns it back. And[1, 2] gives 1&&2 and simplify just decided this is 2 :)

@Nasser Sorry, but this does not explain it for me: why only 0 and 1 are affected? E.g. Simplify[And[2,3]] works as expected.

@IstvánZachar Oh I understand now. So 1==True, 0==False, any other integer is just an integer. I thought 2 would be True as well.
I was looking at the set problem you posted and tried things like `set_ ? contains[{1,2}]`. But that is interpreted as `(set_ ? contains)[{1,2}]` ... surprise
Must go for lunch now, my wife is waiting

It looks like it takes 1 as TRUE then

7:11 PM
1

Here's what is happening; everytime I go to Stack Overflow (stackoverflow.com, NOT meta) with Firefox, it gives me the "Welcome back" tab that pops up from the top. Whenever I click in the "click here to refresh the page" link, all it does is refresh the page without logging me back in. Even if ...

@Nasser As I said it in my first line. 0 is assumed to be False, 1 is True, but only if inside logical expressions, wrapped in Symplify.

But Element[1, Booleans] gives False , so have no idea why

@Nasser This kind of inconsistency is why I think it is a bug. 1 is surely an Integer and not a Boolean.

@IstvánZachar, yes I agree something fishy here with this behaviour. May be a language laywer will have better insight. Why not post at the main board. it is a good question

@Szabolcs Oh, yes, the "?"-takover surprise : ) We all got that multiple times, I'm sure.
@Nasser Will do, thanks for the discussion!

7:16 PM
@IstvánZachar @Nasser I don't quite think it is a bug... it is not something that `And` does, rather it is `Simplify` that does this
I don't think it is unreasonable for a "simplify" function to assume that 1 inside a boolean and/or operation means True (and similarly for 0)

@rm-rf Agreed, but is quite unexpected
And then again: it is undocumented.

Not any more unexpected than `Simplify[Re[a + I b]]` not giving an `a`...
To be fair, I didn't know about this behaviour either... I would've been surprised had I encountered that, but would've been OK with it

@rm-rf Sorry: why should `Simplify[Re[a + I b]]` return `a` if there is no assumption about the domain?

Even if it's not a bug, I'd like to see it as a question just to draw more attention to it. It is something unexpected. It's another thing how to make it into an actual question ...

Also, please explain then this inconsistency: Simplify[And[0,1]] ==> False, Simplify[1] ==> 1

7:21 PM
Both 8 and 9 do that. Let me try in 6 & 7.

@IstvánZachar Simplify@1 is not 1? I don't see what is inconsistent there...

@István & @rm-rf Simplify does not do this in 7. It's new in 8.

@rm-rf Sorry, corrected! I first wrote True due to bad reflexes.

`And` says "last modified in 3" and `Simplify` says "last modified in 5". So where is this new behaviour coming from?

0

Per this chat discussion and this previous question where I encountered the strange behaviour: Simplify[1] ==> 1 And[0, 1] ==> 0 && 1 Simplify[And[2, 3]] ==> 2 && 3 Simplify[Not[0]] ==> !0 Simplify[And[0, 1]] ==> False (* expected 0 &a...

7:43 PM
This is where the Q/A format is not so convenient ... I very much want to hear about these unexpected things, but it's difficult to hammer this into an answerable question ...

Hello @Szabolcs

Hello @Mr.Wizard
@Mr.Wizard Are you here to scold me for encouraging posting a not-really-a-question ... ?

It hadn't crossed my mind. :-)
Do you have a few minutes for code review?
@Szabolcs

8:00 PM
@Mr.Wizard If it's not long, sure.

In a recent answer I used this:
```ikf[set_] := Array[MapAt[#~Prepend~s1 &, set, #] &, Length@set]
ikf[List /@ Range@5] // TableForm```

My bird just fell. It climbs climbs climbs in weird positions and upside down, but it's very clumsy. It falls all the time.

@Szabolcs Now that I didn't expect to read.
For the very short lists involved in the application this may well be the fastest way, but I'm wondering if this operation might be done better on longer lists. I can use `ArrayFlatten[{{s1, set}}]` to get the diagonal efficiently, but I cannot think of a good way to fill out the array.
Can you think of any better method to get the output shown above?
Same question for you @Oleksandr or anyone else lurking.
Hello @Michael

(I'm still here, looking at it)

@Mr.Wizard Hi.

8:07 PM
@Mr.Wizard Do you have a link to the answer? Is this is only output that is acceptable, or is there some flexibility?

@Mr.Wizard `MapAt` and `Prepend` are not a good formula for performance, granted, but I think they are probably the clearest solution if this is the output you need

@Szabolcs Use is inside `KSetP` here. In that application the order of the elements of each row are flexible; one could also `Delete` and `Prepend` the pairs (`{s1, x}`) which is actually the order of the Combinatorica function I believe.
I'm still (also) interested in this particular diagonal pattern for its own sake.
@OleksandrR. Ignoring "clearest" is there something faster?
By the way, I know `MapAt` and `Prepend` can be slow but I think for their specific uses they are competitive.

Can't really come up with anything better at the moment ...

@Mr.Wizard not sure. For this kind of thing I would usually go for something with `ConstantArray` and `Flatten`but since you need to operate on the diagonal it's not so easy

Okay, thanks guys.

8:44 PM
@Mr.Wizard This gives the same output that ikf[List /@ Range@5] does:
myikf[n_] := Transpose@Table[ConstantArray[{k}, n]~ReplacePart~{k -> {s1, k}}, {k, n}]
myikf[5]

Sweet, we can have overloaded functions!

9:20 PM
Is this a bug or do I don't know enough about `N`:

f[x_] = Piecewise[{{2 x, 0 <= x < 1/2}, {2 x - 1, 1/2 <= x <= 1}}];
Block[{\$MaxExtraPrecision = 500},
neworbit = NestList[Simplify[f[#]] &, 1/GoldenRatio, 1000];
Grid[{
{\$Version, SpanFromLeft},
{"(Machine) Min:", N[Min[neworbit]]},
{"Min:", N[Min[neworbit], 2]},
{"Max:", N[Max[neworbit], 2]},
{Histogram[N[neworbit, 10], 20]},
{Histogram[neworbit, 10]}},
Alignment -> {Right, Center}]
]

9:31 PM
@ssch I don't understand what this is supposed to show or what you were expecting?

Is there there a keyboard combination to bring up the last line of input?

@OleksandrR. Well in particular I'm confused because MachinePrecision is about 16, but even with N[number,2] it gives the correct value, (not some overflowing looking thing) And why only for the specific value MachinePrecision does N not keep track of its precision
@OleksandrR. nevermind, I read the docs again, missed this the first time: "N[e,p] works adaptively using arbitrary-precision numbers when p is not MachinePrecision:"

For a requested precision of 2 the actual working precision will be whatever turned out to be necessary to give you two correct digits. `MachinePrecision` is special because it is used for speed, and precision tracking is quite expensive... if you want the same precision but with precision tracking switched on, specify `\$MachinePrecision` instead

ah, thanks

10:12 PM
I have a two argument function, f[probability_,x_]:=...
I want to output what the probability passed to it was as well as the expression the function returns, i.e.
f[Random[],5]
Probability = 5
normal function output
I've come up with, f[...]:={prob,...} but it's ugly and I'd rather not want a list returned.
I'd like some textual output as well as the symbolic expression the function returns
err and probability would obv be a value = [0,1]

10:39 PM