Plotting a random but continuous line

110 Views Asked by At

Hopefully my question makes sense. I would like to generate a function which is continuous at all points. The use of the word "random" is somewhat of a misnomer, since it is not truly random. It must be random within constraints, chiefly being, I assume, that each point cannot "create" a discontinuity. However, this reasoning is circular, and I can't find a way to either:

  1. Describe such a function mathematically
  2. Generate a list of points programmatically

My biggest issue so far seems to be a way of checking continuity. My intuition is that, in a set of sets containing randomly generated points, there must exist a set where the points form continuous lines. If I can check each set of lines for continuity, I would eventually find a "random" function.

Any thoughts on how best to move forward, or errors in my logic, are much appreciated! Thanks for your help.

1

There are 1 best solutions below

3
On

I think question's usage of the word continuous and discontinuous conflicts with the precise mathematical meaning the words... I believe you mean that you wish to generate a random set of points that would lie upon a line. In that case, you need to generate a set of points that adhere to

$$y=mx+b$$

Define some $m$ and $b$. Then loop a random number generator to create an array for $x$ for however many points you want. Apply the above definition for $y$, and you ought to have your random set of points $(x,y)$ that lie on a specific line.

If you wish to have a random set of points that lie on a random line, you first need to randomly generate $m$ and $b$.