Sunday, December 5, 2021

Решение задачи 17 371 Вариант Ларина с помощью Python (numpy,matplotlib)

 Текст задачи





==============

Python code

==============

import matplotlib.pyplot as plt

import numpy as np

delta = 0.025

x = np.arange(-10, 10, delta)

y = np.arange(-10, 10, delta)

p, q = np.meshgrid(x, y)

plt.axhline(y = 5, color = 'red', linestyle = '-')

plt.axhline(y = 4, color = 'green', linestyle = '-')

plt.axhline(y = 1, color = 'green', linestyle = '-')

plt.axhline(y = 0, color = 'red', linestyle = '-')

plt.axvline(0, -10, 10, label='y axis')

# define some function f(x,y)

f = lambda x, y: x**4 - 2*x**3 - 4*x**2 + 10*x \

        - 5 - 2*x*y + 6*y - y**2

z=f(p,q)

# plot contour line of f(x,y)==0

plt.contour(p, q, z , [0], colors=["b"])

# make legend

proxy, = plt.plot([], color="b")

plt.legend(handles=[proxy], labels=["f(x,y) = 0"])

plt.show()




























Из плота нетрудно видеть при каких а горизонтальные линии имеют не более 3-ех точек пересения с графиком.

Ответ : а ∈ (-infinity ; 0] ∪ {1;4}∪[5 ; +infinity)





1 comment:

  1. best videos for playing in 1080p on youtube - Vimeo
    Videos on youtube · YouTube videos for live video games · Youtube youtube mp3 videos for free, Video Game Games · Youtube Video Game Design · Video Game Design.

    ReplyDelete