mmcdara

7037 Reputation

18 Badges

8 years, 230 days

MaplePrimes Activity


These are questions asked by mmcdara

I think the worksheet below is enough to define the problem I'm facing.

(question updated by adding a simple 2D case ; the expected value is about 0.67684)

restart

# How can I define CharFunc so that int(CharFunc, x=...) gives me the expected value?
#
# Motivation:
# Let Dom some 2D domain and Env another 2D domain which contains Dom.
# The interior of Dom is defined by a sequence L(x, y) of inequalities.
# The area of Dom can be expressed by the integral over Env of the characteristic function
# CharFunc(x, y) of Dom which returns 1 if (x, y) belongs to Dom and 0 otherwise.
#
# Here is a simple 1D example


CharFunc := proc(x)
  if x::numeric then
    piecewise(is(And(x >= 0, x <= 1)), 1, 0)
  else
    'procname( _passed )'
  end if:
end proc:


Env := -1..2:
plot(CharFunc(x), x=Env, thickness=5);

 

# Expected value = 1

int(CharFunc(x), x=Env);

int(CharFunc(x), x = -1 .. 2)

(1)

# Expected value = 1/2

int(CharFunc(x), x=1/4..3/4);

int(CharFunc(x), x = 1/4 .. 3/4)

(2)


Works with floats

# Expected value = 0.5

int(CharFunc(x), x=0.25..0.75);

.5000000000

(3)

# Expected value = 1

int(CharFunc(x), x=-1.0..2.0);

1.000000000

(4)


2D example

Env := x=0.8..3, y=0..1.3;

x = .8 .. 3, y = 0 .. 1.3

(5)

Dom := proc (x, y) options operator, arrow; And(y <= 1/(1+sinh(2*x)*ln(x)^2), .8 <= x, x <= 3, 0 <= y, y <= 1.1) end proc

proc (x, y) options operator, arrow; And(y <= 1/(1+sinh(2*x)*ln(x)^2), .8 <= x, x <= 3, 0 <= y, y <= 1.1) end proc

(6)

CharFunc := proc(x, y)
  piecewise(is(Dom(x, y)), 1, 0)
end proc:

plot3d(
  [0, 'CharFunc'(x, y)], Env
  , grid=[40, 40]
  , style=surface, color=[gray, blue], transparency=[0, 0]
  , title=typeset('CharFunc'(x, y))
);

 

int(CharFunc(x, y), Env)

0.

(7)
 

 

Download Integration_issue.mw

Thanks in advance


Does any one have any idea to demonstrate, using Maple, that for any couple (a, b) of strictly positive integers

(a*b)! / (a! * (b!)^a) 

is an integer?

It's becoming increasingly common for questions to be deleted, the most frequently evoked argument being that they duplicate earlier questions.
Usually it's the author of the question who complains, in this case it's the one who provided an answer.

I've always found this self-given freedom on the part of moderators somewhat inappropriate, especially given that these deletions are done on the sly, without even the courage to be explicitly claimed by their authors.

Couldn't these latter take the time to leave a message indicating what they've just done (and why) and where the deleted question, and any exchanges associated with it, can be found?
Otherwise, this attitude is more akin to contempt and censorship than to real management of this blog.

A few years ago, when I came to this site, these deletions were the exception and I can only deplore the fact that they have become commonplace.
They say that life is better elsewhere, I don't know, but what I do know is that I've never come across this on any Scilab, R, SageMath or OpenTurns user's blog.

Anyway, here's the reply I sent to @salim-barzani :  Hirota_derivative_KdV_equation.mw

Where can I found details about Statistics:-Sample(..., method=envelope).

It would be nice to have a link to a description of the envelope method Sample uses.
For instance does it share some features of the Cuba library for numeric integration? Does it use the same envelope method evalf/Int(..., method=_CubaSuave)) uses?

Thanks in advance.

Can anyone explain me the reason of the last result?
Thanks in advance

restart

kernelopts(version)

`Maple 2015.2, APPLE UNIVERSAL OSX, Dec 20 2015, Build ID 1097895`

(1)

a/n^b;
den := denom(%);
print(cat(`_`$50));

3/n^2;
den := denom(%);
print(cat(`_`$50));

1.23/n^1.65;
den := denom(%);
num := numer(%%);

a/n^b

 

n^b

 

__________________________________________________

 

3/n^2

 

n^2

 

__________________________________________________

 

1.23/n^1.65

 

1

 

1.23/n^1.65

(2)
 

 

Download What-does-happen-here.mw

1 2 3 4 5 6 7 Last Page 1 of 45