Main Content

그래픽 방식의 지수 함수 비교

이 예제에서는 재밌게도 그래픽 접근 방법으로 eππe보다 더 큰지를 알아봅니다.

여기서 풀 문제는 eππe 중 어느 것이 더 큰지입니다. MATLAB® 명령 프롬프트에 직접 입력하면 이 문제의 해답을 쉽게 알 수 있습니다. 이러한 상황을 분석하는 또 다른 방법은 다음과 같이 좀 더 일반적인 질문을 하는 것입니다. 함수 z(x,y)=xy-yx는 어떤 형태입니까?

z의 플롯은 다음과 같습니다.

% Define the mesh
x = 0:0.16:5;
y = 0:0.16:5;
[xx,yy] = meshgrid(x,y);

% The plot
zz = xx.^yy-yy.^xx;
h = surf(x,y,zz);
h.EdgeColor = [0.7 0.7 0.7];
view(20,50);
colormap(hsv);
title('$z = x^y-y^x$','Interpreter','latex')
xlabel('x')
ylabel('y')
hold on

Figure contains an axes object. The axes object with title z equals x toThePowerOf y baseline minus y toThePowerOf x baseline, xlabel x, ylabel y contains an object of type surface.

방정식 xy-yx=0의 해는 매우 흥미로운 형태이기 때문에 그림만 보아서는 원래 질문에 대한 답을 쉽게 얻을 수 없습니다. z=0을 생성하는 xy 값의 플롯은 다음과 같습니다.

c = contourc(x,y,zz,[0 0]);
list1Len = c(2,1);
xContour = [c(1,2:1+list1Len) NaN c(1,3+list1Len:size(c,2))];
yContour = [c(2,2:1+list1Len) NaN c(2,3+list1Len:size(c,2))];
% Note that the NAN above prevents the end of the first contour line from being
% connected to the beginning of the second line
line(xContour,yContour,'Color','k');

Figure contains an axes object. The axes object with title z equals x toThePowerOf y baseline minus y toThePowerOf x baseline, xlabel x, ylabel y contains 2 objects of type surface, line.

검은색 곡선을 따라 위치한 일부 xy의 조합은 정수입니다. 다음 플롯에는 방정식 xy-yx=0의 정수 해가 표시되어 있습니다. 24=42xy 경우에 대한 유일한 정수 해임을 알 수 있습니다.

plot([0:5 2 4],[0:5 4 2],'r.','MarkerSize',25);

Figure contains an axes object. The axes object with title z equals x toThePowerOf y baseline minus y toThePowerOf x baseline, xlabel x, ylabel y contains 3 objects of type surface, line. One or more of the lines displays its values using only markers

마지막으로 곡면에 점 (π,e)(e,π)를 플로팅합니다. 이 결과는 비록 큰 차이는 없지만 eππe보다 더 크다는 사실을 보여줍니다.

e = exp(1);
plot([e pi],[pi e],'r.','MarkerSize',25);
plot([e pi],[pi e],'y.','MarkerSize',10);
text(e,3.3,'(e,pi)','Color','k', ...
   'HorizontalAlignment','left','VerticalAlignment','bottom');
text(3.3,e,'(pi,e)','Color','k','HorizontalAlignment','left',...
   'VerticalAlignment','bottom');
hold off;

Figure contains an axes object. The axes object with title z equals x toThePowerOf y baseline minus y toThePowerOf x baseline, xlabel x, ylabel y contains 7 objects of type surface, line, text. One or more of the lines displays its values using only markers

결과를 확인합니다.

e = exp(1);
e^pi
ans = 23.1407
pi^e
ans = 22.4592

참고 항목

|