Carl Love

Carl Love

28055 Reputation

25 Badges

12 years, 364 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@asa12 An equation of the form H(x) + H(y) = H(x+y) is called a functional equation. As far as I know, Maple has no facility whatsoever for solving functional equations. I also have not heard of any other software for it.

You erased your original Question after it was Answered. That is a major no-no. Major. Please put back the original Question and especially its title (or something close to them), and ask the above as a separate and new Question. I won't answer any of your questions until you take care of this.

Even if they're not ASCII, they're still printable characters; so, does it really matter?

If it does matter, then group them into groups of 7 bits instead of 8.

If you can find the algorithm for it, I'll code it in Maple.

Update: I've found an algorithm, and I'm working on it.

Update 2: I've finished coding the algorithm, but before I post it, please provide some two-dimensional data for me the test it on.

@peter2108 In the same place that there is the button to Vote Up the Answer, there is also a button that looks like a trophy cup. You can use that button to select an Answer as the Best Answer to your Question. I think that using that button doesn't require any reputation points.

@marc sancandi In the absence of any statement to the contrary, I think that it's reasonable to assume that the OP wanted a uniform distribution over all 21 pairs (x,y) such that 1 <= x < y <= 7. I don't see how you can say a priori that one distribution is "right" and the other "wrong"---it all depends on what is desired. 

@torabi Yes, Maple has no numeric solver for elliptic PDEs. You're out of luck.

@John Fredsted I think that it's the best option so far (for a small integer like 7). I didn't hold out any hope of the combinat:-randcomb being efficient.

Is f3(x) a known function? Can h3 be given a value before solving? On a quick read through, I don't see anything that makes this system nonlinear.

@Carl Love Here's a novel approach, and it's a short one-liner.

GenXY:= ()-> combinat:-randcomb(7, 2)[];

This generates a uniform distribution.

@Kitonum The distribution that you're sampling has the same problem as John's. See the histograms that I posted in a Reply to his Answer.

@John Fredsted 

The difference in the distributions being sampled is profound, as the following histograms show. Figuring out why this difference occurs might be a good problem for a junior- or senior-level probability course.


restart:

GenXY:= module()
local
     R:= RandomTools:-Generate(list(integer(range= 1..7), 2), makeproc),
     ModuleApply:= proc()
     local x:= 0, y:= 0;
          while x=y do  (x,y):= R()[]  end do;
          `if`(x<y, [x,y], [y,x])[]
     end proc
;
end module:
     

GenXY2:= proc()  local y:= rand(2..7)(); (rand(1..y-1)(), y)  end proc:

(A,B):= 'Matrix(7,7)'$2:

to 2^17 do
     (x,y):= GenXY();
     A[x,y]:= A[x,y]+1;
     (x,y):= GenXY2();
     B[x,y]:= B[x,y]+1
end do:

plotopts:=
     heights= histogram, gap= 1/3, axes= normal,
     tickmarks=[[seq(x+.5=x, x= 1..7)]$2, DEFAULT], labels= ['x','y',count]
:

#plots:-display(<plots:-matrixplot~([A,B], plotopts)>^+);

Side-by-side plots don't display on MaplePrimes, so here they are plotted individually.

plots:-matrixplot(A, plotopts); plots:-matrixplot(B, plotopts);

 

 

NULL


Download two_distributions.mw

@yongling93 In that case, you want to store your bits in a Matrix.  Then all your shifting (what you call "crossover") can be done with surprisingly simple indexing commands. Like this:

B:= Matrix([[0,0,1,1,0,0,1], [0,0,1,1,1,0,0],[0,1,0,1,0,1,0], [1,0,0,1,1,1,0]]):
Bnew:= copy(B):
Bnew[[4,1,2,3], 3..5]:= B[.., 3..5]:
Bnew;

B;

I converted this from a Question to a Post because the question asks for open-ended discussion and opinions rather than definite answers.

@Carl Love Please let me know the outcome of this assignment. I particularly want to know if my guess about the professor trying to stump you with a impossible n was correct.

First 431 432 433 434 435 436 437 Last Page 433 of 709