How do I test an infinite sequence?

I have to write a test that takes as input an infinite sequence but I have no idea how to do that.

πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/crystalclear1312
πŸ“…︎ Jun 19 2021
🚨︎ report
Parameterized test with infinite sequence

The previous post I wrote about this was not clear enough.

This is the class I wrote:

public static class PrimeMethod
    {
        public static IEnumerable<T> TakePrime<T>(this IEnumerable<T> s, int count)
        {
            var result = new List<T>();
            if (s == null)
                throw new ArgumentNullException();
            if (count <= 0)
                throw new ArgumentOutOfRangeException();
            int x = 0; 
            int y = 0; 
            foreach (var i in s)
            {
                if (checkIfPrime(x) && y < count)
                {
                    result.Add(i);
                    y++;
                }
              
                x++;
            }
            
            return result;
        }

        public static bool checkIfPrime(int num)
        {
            if (num == 0 || num == 1)
                return false;
            bool flag = false;
            for (int i = 2; i < num; i++)
                if (num % i == 0)
                {
                    flag = true;
                    break;
                }

            if (!flag)
                return true;
            return false;
        }
}

Now I have to test the TakePrime method. The test I have to write is a parameterized test that takes an integer b. The sequence the method should be called on is an infinite sequence of the powers of b. I have no idea how to do this. I think I should use a yield return but I'm not sure how to do it. This is what I wrote so far (I know it's a mess and obviously there is a problem with the return type because it should be void but if I use void I can't use yield return):

[TestCase(7)]
[TestCase(-28)]
[TestCase(182)]
[TestCase(0)]
public void Check_Argument_Out_Of_Range(int b)
{
            var infiniteSeq = new List<double>();
            var i = 0;
            while (true)
            {
                var e = Math.Pow(b, i);
                i++;
                infiniteSeq.Add(e);
                yield return e;   //obviously not working because of return type!!!
            }

                      //no idea what to do here      
   Assert.That(()=>infiniteSeq.TakePrime(0),Throws.TypeOf<ArgumentOutOfRa
... keep reading on reddit ➑

πŸ‘︎ 7
πŸ’¬︎
πŸ‘€︎ u/crystalclear1312
πŸ“…︎ Jun 20 2021
🚨︎ report
The IB messed up the formula for the sum of an infinite geometric sequence. It should be 1-r in the denominator not r-1. Does anybody know if IB are aware of this or have said anything about this?
πŸ‘︎ 4
πŸ’¬︎
πŸ“…︎ May 24 2021
🚨︎ report
Are there an infinite number of sequences in the real numbers that converge to a certain number x, which is also in the real numbers?

I have been working my way through Courant's Differential and Integral Calculus to gain a better understanding of calculus/real analysis.

In Appendix I of Chapter 1, Courant discusses the concept of point of accumulation, which I believe is also called limit points. In that section Courant states that:

From every bounded inifite set of numbers, it is possible to choose an inifinte sequence a1, a2, a3, ... which converges to a definite limit L.

He gives an example of how to construct such a sequence:

Take a limit point/point of accumulation L of the given set of numbers, then to select a number a1 of the set whose distance from L is less than 1/10, then a second number a2 of the set whose distance from L is less than 1/100, and so on. We see at once that this sequence actually converges to the limit of L.

In other words, Courant is constructing the sequence using the following rule:

Choose aβ‚™ so that it satisfies the inequality |aβ‚™ - L| < 1/10ⁿ where n is an element of natural numbers

If we change the above rule to a more general one such as below:

Choose aβ‚™ so that it satisfies the inequality |aβ‚™ - L| < 1/xⁿ where n is an element of natural numbers and x is any positive real number

I believe that one can generate an infinite number of sequences that converge to a certain number L.

Is there any formal theorem/proof for this statement, or am I incorrect in making that statement?

πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/ravager01
πŸ“…︎ May 19 2021
🚨︎ report
Two of these sequences are infinite. Can there be any more?

Here are the rules to generate the sequence for some positive integer:

  • n starts at 1 (p*n* is the nth prime number)

  • If adding p*n* to the number results in a composite, add p*n* to the number and increment n.

  • If adding p*n* to the number would result in a prime, and the number is even, divide by 2 and reset n = 1.

  • If adding p*n* to the number would result in a prime, and the number is odd, the sequence ends.

Examples:

20, 22, 25, 30, 15. (Can't add p*4* =7 to 37 without resulting in a prime, so we half it. Can't add p*1* =2 to 15 without resulting in a prime, and can't half it, so sequence ends)

43, 45, 48, 24, 26, 13, 15, 18, 9. (9 terms)

82, 84, 87, 92, 99, 110, 123, 140, 159, 182, 91, 93, 96, 48, 50, 25, 27, 30, 35, 42, 21. (21 terms)

Fun facts:

  • a*1* = 4 results in a 91 term sequence which ends at a*91* = 41

  • 41 is by far the most common ending value (for a*1* values up to 20M), with around 10% of a*1* values terminating at 41.

  • 2 a*1* values cause never-ending sequences:

2, 4, 2, 4, 2, 4,...

100, 102, 105, 110, 117, 128, 141, 158, 177, 200, 100, 102,...

Is it possible for another a1 value to result in a periodic sequence like this?**

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/holdmahdick
πŸ“…︎ May 20 2021
🚨︎ report
WTT: Infinite Jets, Pitchfork Plus, Superego, Boss CE-5, Behringer Noise Gate WTTF: Dream Sequence, Ibanez Mini Chorus, anything weird

Group Photo

WTT:

  • Hologram Infinite Jets

  • EHX Pitchfork Plus

  • EHX Superego

  • EHX Voice Box

  • Boss CE-5

  • Digitech Dirty Robot

  • EQD Cloven Hoof V2

  • OBNE Minim

  • Hungry Robot LG

  • MXR Carbon Copy

  • EHX Nano Small Stone

  • Behringer US600 Ultra Shifter / Harmonizer

  • Behringer NR300 Noise Reducer

  • Behringer FX600 Multi FX

  • Behringer HD300 Heavy Distortion

  • Modtone Speedbox Dostortion

Non Pedals:

  • Sure SM57

  • Sennheiser e604 Drum Mic

  • Hercules Guitar Wall Hanger

  • Fender Tuners

WTTF:

  • Hologram Dream Sequence

  • CBA Mood (obviously like everyone else)

  • Empress Zoia

  • Caroline Shigeharu

  • Ibanez Mini Chorus for my Brothers all mini board

  • Anything Weird

πŸ‘︎ 6
πŸ’¬︎
πŸ‘€︎ u/joefraley
πŸ“…︎ Apr 09 2021
🚨︎ report
WTT: Infinite Jets, Pitchfork Plus, Wavelength, Kilobyte, Wampler Ethereal, DD-6 and more WTTF: Dream Sequence, Caroline , Red Panda

Sorry for all the feelers. Also just got a Blooper so if you want to try and talk me into trading it before I fall in love with it you can try. And please don't offer me fuzz! I have a problem and need to stop

WTT:

  • Hologram Infinite Jets (feeler)
  • EHX Pitchfork Plus (feeler)
  • EHX Attack Decay (feeler)
  • Alexander Wavelength (feeler)
  • Caroline Kilobyte
  • Wampler Ethereal
  • Boss DD-6
  • Boss CE-5
  • TC Helix Phaser
  • Behringer Slow Motion
  • Behringer Multi FX
  • Behringer Noise Reducer
  • Digitech FSX3

Non Pedals:

  • Seymour Duncan P90 Phat Cat Pickup
  • Soundstone Ebow
  • Hurcules Wall Guitar Hanger
  • Sure SM57

WTTF:

  • Hologram Dream Sequence
  • CBA Mood
  • Caroline Meteore
  • Red Panda (any)
  • Count to Five
  • Astronomer V2
  • Phase 95

Always down for reverb or delay. Good on dirt. Especially Fuzz!!

πŸ‘︎ 9
πŸ’¬︎
πŸ‘€︎ u/joefraley
πŸ“…︎ Apr 03 2021
🚨︎ report
Since the digits of Pi are infinite there is a sequence somewhere along the line that spells out β€œdivide the circumference by the diameter” in binary code.

Edit: infinite and random

πŸ‘︎ 21
πŸ’¬︎
πŸ‘€︎ u/TheNorselord
πŸ“…︎ Mar 30 2021
🚨︎ report
Is there an infinite sequence of nines in pi?

I came across the six nines in pi starting at the 762nd decimal place and it made me think: If there is a sequence of 6 nines in an infinite sequence there has to be a sequence of 7 nines somewhere, and a sequence of 8 nines, and 9 nines, and 362 nines, and so on up to infinity... This breaks my mind, please help!

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/Samdellert
πŸ“…︎ Mar 28 2021
🚨︎ report
Struggling to understand being at any point in a temporally infinite sequences with no start

Hey all

I was discussing this on another sub and I seemed to have run into a brick wall in regards to either my ability to communicate concepts, or just my ability to understand the counterpoints of other people. As such, I would love any references or answers on the below:

I was struggling with the idea of being at 'any' point of a temporal sequence without a start that is unbounded in duration. I am okay with the concepts of actual infinities and traversing infinite sequences that tend to some temporal limit...But I am struggling with the concept of temporally unbound sequences with no start. Two ways to frame my question are:

  • If the past is temporally infinite, then how can we 'be' in any particular moment? Surely this implies that the universe has finished completing a temporally unbounded process?
  • Maybe to use an analogy. Imagine a ball that is rolling across some infinite floor at some fixed speed. And has been for all time. I can't wrap my mind around saying that the ball is currently at some particular point?

This is really breaking my brain, so I will love any commentary or links to discussions of the above!

πŸ‘︎ 8
πŸ’¬︎
πŸ‘€︎ u/SilverStalker1
πŸ“…︎ Jan 28 2021
🚨︎ report
Representing integers by adding or subtracting numbers from an infinite sequence

Let (a_i) = (a_1, a_2, a_3, ... ) be a sequence of integers. We say an integer n is representable by the sequence (a_i) if there is a natural number k > 0 such that

n = e_1 * a_1 + ... + e_k * a_k

where e_i is -1 or 1.

Denote by S(a_i) the set of all integers representable by the sequence (a_i).

Q1) Suppose (a_i) is an arithmetic sequence. When is it true that S(a_i) = β„€? (Medium)

Q2) Let (a_i) = (1, 4, 9, ...) be the sequence of whole square numbers. Is it true that S(a_i) = β„€? (Medium)

Q3) Let P be a polynomial with integer coefficients and (a_i) = (P(1), P(2), P(3), ...). When is it true that S(a_i) = β„€? (Presumably hard)

Q4) Let (a_i) be an arbitrary sequence of positive integers. When is it true that S(a_i) = β„€? (Hard)

I was only able to solve Q1 and Q2 and have a partial solution for Q3. I do not know the complete solutions to Q3 and Q4.

πŸ‘︎ 31
πŸ’¬︎
πŸ‘€︎ u/NoPurposeReally
πŸ“…︎ Dec 28 2020
🚨︎ report
[Undergrad Calculus 2] What’s the best software for manipulating infinite series and sequences?

I’m thinking a Python environment (plus I know a little already), but I would love to learn about something new.

I’m trying to practice finding n^(th) term partial sums but I don’t have a good way to verify my answers. I know Wolfram Alpha (and by extension, Mathematica) sort of does this, but it’s a bit weird with recursive sequences.

πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/SomeNumbers98
πŸ“…︎ Feb 27 2021
🚨︎ report
[Infinite Sequences] if a sequence is diverges, can we say that the upper bound is infinity ?
πŸ‘︎ 7
πŸ’¬︎
πŸ‘€︎ u/saporro32
πŸ“…︎ Nov 27 2020
🚨︎ report
What are some actually finite sequences that long thought to be infinite?

Edit: For instance, we don't know if there are infinitely many twin primes, and if it turned out that there aren't, it would be a great example of such a sequence.

πŸ‘︎ 52
πŸ’¬︎
πŸ‘€︎ u/InalEgo
πŸ“…︎ Sep 12 2020
🚨︎ report
Are there languages with an infinite (or at least more than 3) sequence of once, twice, thrice, etc.?

For example, I can say:

I've been there twice

I've been there thrice

I've been there 4 times

As far as you know, are there languages that don't break this pattern after 3?

> Note: I know "frice" has some historical usage, but I'm mainly asking about mainstream usage.

πŸ‘︎ 4
πŸ’¬︎
πŸ‘€︎ u/5awaja
πŸ“…︎ Jan 11 2021
🚨︎ report
For AP Calc BC, do you need to know anything about Integrals to learn about Infinite Sequences and Series?

Currently in AP Calc AB and it’s going sooooooo slow (we’re on unit 5 / derivatives still). I got to learn Polar/Parametric/Vectors already but I know that I can’t learn it all because i haven’t learned Integrals yet. However is integrals necessary to learn infinite sequences or series or is it a concept all on its own? Can I just start self studying that already?

πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/iameverynoone
πŸ“…︎ Jan 11 2021
🚨︎ report
Can't leave Deciat, FSD launch sequence is infinite, game hangs...

Great Scott, I can't leave Deciat, even after relaunching the game, when I charge FSD and align with Escape Vector, it stays in an infinite launch sequence and even ESC doesn't bring me to menu, I have to kill the game.

Anyone experienced this, there's a fix/workaround?

EDIT: I could espace meanwhile, for everyone who has the same problem, this is what solved it for me: restarting the Steam launcher and boost away from the surface like 20 times. Not sure which one helped.

As a summary the suggestions of the kind Cmdrs who gave such valuable suggestions here:

  • High wake to another system that isn't obscured by the planet
  • switch to Solo to prevent matchmaking interferences
  • as a last resort if nothing helps, contact Frontier support to patch you out of the system.

Thanks everyone for helping me out! πŸ™Œ

πŸ‘︎ 14
πŸ’¬︎
πŸ‘€︎ u/Raven9ine
πŸ“…︎ Oct 08 2020
🚨︎ report
Is it possible to find the sum of an infinite geometric sequence when the probability of an event is constantly decreasing?

So, let's consider a game where one blue and one red alien take turns blasting each other with plasma-guns. The blue alien goes first and has a gun with a 50% chance of shooting, while the red alien has one with a 70% chance. The probability that the blue alien wins right off the bat is is 50%. But if it misses, to get another chance the red alien must miss as well. The probability that that happens is 0.4 x 0.3. Since both aliens could theoretically miss every shot indefinitely, this is an infinite geometric sequence.

To calculate the probability that the blue alien wins, you can use this formula:

A/(1-r)

where

A= probability of winning on the first shot

r= the probability that both miss

Now, let's say that the blue alien gets a new Plasma-gun whose probability of shooting decreases by a factor of 1/2 every time it misses.

Is it possible to find the probability of the blue alien winning now that the probability constantly changes?

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/TrojanskaHesst
πŸ“…︎ Dec 10 2020
🚨︎ report
[Infinite series] derivative test for (n+2)/e^-x to show the sequence is monotone ??

Help me. I know that we can differentiate the term which i get the answer e^n (n+3).

For the derivative test, f is increasing in interval l if its derivative is more that 0 and less than 0 if it is decreasing.

The problem is, i dont know how to conlude from the answer if it is increasing or decreasing.

Does the sequence converges or diverges ?

πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/saporro32
πŸ“…︎ Nov 27 2020
🚨︎ report
I TOLD MY SPOUSAL UNIT TO STICK ITS MALE INTO ITS OWN FEMALE FOR STORAGE AND SHE BEEPED AND BOOPED ON AN INFINITE LOOP. I FEAR I MISSED A HUMOR SEQUENCE.
πŸ‘︎ 14
πŸ’¬︎
πŸ‘€︎ u/tinglep
πŸ“…︎ Dec 29 2020
🚨︎ report
Flowrolljj.com offers a FREE interactive flow chart that organizes Jiu Jitsu positions and techniques then allows you to transition between them! The potential sequences are infinite! Check it out.
πŸ‘︎ 4
πŸ’¬︎
πŸ‘€︎ u/Ph1l0s0ph1lly
πŸ“…︎ Nov 18 2020
🚨︎ report
Boundary break just posted an interesting video, I particularly like the bio shock infinite entry as we find what looks like the remnants of a cut sequence in the game. youtu.be/jUsDrJ1fdEI
πŸ‘︎ 43
πŸ’¬︎
πŸ‘€︎ u/teskar2
πŸ“…︎ Dec 03 2020
🚨︎ report
Abominable Putridity - Non Infinite Sequence youtu.be/mFLnMo6gsSA
πŸ‘︎ 8
πŸ’¬︎
πŸ‘€︎ u/planetdeath4
πŸ“…︎ Nov 29 2020
🚨︎ report
Was the universe created "in an infinite sequence in an infinitesimally small amount of time"?
πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/ch1214ch
πŸ“…︎ Dec 15 2020
🚨︎ report
Why is the Infinite Geometric Sequence divergent when r=1?

I don't understand why when the common ratio of an inifinite geometric sequence is 1, the sum becomes inifinity. When considering 1 - r, wouldn't the sum be undefined?

I hope someone can help me understand this

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/LeSUTHU
πŸ“…︎ Oct 22 2020
🚨︎ report
Fibonacci Sequence in Aperiodic Tiling (from Veritasium's "The Infinite Pattern That Never Repeats") v.redd.it/byqgq9ixony51
πŸ‘︎ 41
πŸ’¬︎
πŸ‘€︎ u/peak-cool9
πŸ“…︎ Nov 11 2020
🚨︎ report
Because Pi is infinite, after all the numbers there will be a sequence that goes 6942066669420666

Thinking about it any number sequence is in Pi

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/NotToothpasteYT
πŸ“…︎ Sep 16 2020
🚨︎ report
I did this limit of a sequence, and the result should be 0, but to me it is infinite, and I can't find the error... Could you help me?

Link: https://imgur.com/a/SCexPCg

Where is the error? Could you help me?

πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/allexj
πŸ“…︎ Nov 24 2020
🚨︎ report
Euler's number and pi are both irrational numbers; they are also both infinite. Therefore, somewhere in pi is the same number sequence as Euler's number and somewhere in Euler's number there is the same number sequence as pi.
πŸ‘︎ 17
πŸ’¬︎
πŸ‘€︎ u/VBStrong_67
πŸ“…︎ Jul 08 2020
🚨︎ report
[Olympiad lvl 2 physics: Sequence question?] Question doesn't seem to make sense as a fly with infinite stopping power can turn around instantly.

A fly is going back and forth between two cyclists who are traveling towards each other at a constant speed vc = 10 km/h on a straight road. The initial distance between the cyclists is d=100 km. Assume that then fly starts from one of the cyclists, flies at a constant speed vf=20 km/h to the other cyclist, turns back, flies back to the first cyclist at the same speed vf, turns back and so on.

(a) How many times does the fly turn till the two cyclists meet? (2p)

(b) How much distance does the fly cover till the cyclists meet? (Give two solutions using different methods.) (4p+4p)

The problem with this is that its exponential and since the fly has infinite stopping force it will increasingly turn instantly basically infinite times. Am I right? If so how would u go about solving it? Please put the answer in your message as I dont know how to do it

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/-Nycter-
πŸ“…︎ Sep 10 2020
🚨︎ report
Since Pi is infinite, there is a a sequence of 42069 that repeats exactly four hundred and sixty nine times at some point.
πŸ‘︎ 31
πŸ’¬︎
πŸ‘€︎ u/BinaryPeach
πŸ“…︎ Jun 13 2020
🚨︎ report
ELI5: Since pi is infinite, is there any reason why it isn’t possible for there to be a sequence of 1’s and 0’s that recount your whole life in text?

I saw a video online that brought up the idea and that’s what brought me here. If someone could break this down for me that’d be great

πŸ‘︎ 11
πŸ’¬︎
πŸ‘€︎ u/wateredmark
πŸ“…︎ Jul 08 2020
🚨︎ report
Prove that no number in the infinite sequence 10, 110, 210, ... can be written in the form a^n where a is an integer & n is an integer >= 2.

My w/o: http://prntscr.com/uzl2bd

How would I prove the last part has no solutions?

πŸ‘︎ 2
πŸ’¬︎
πŸ‘€︎ u/SquareImagination
πŸ“…︎ Oct 15 2020
🚨︎ report
Avoid infinite recursion with lazy sequences youtube.com/watch?v=OsqJn…
πŸ‘︎ 30
πŸ’¬︎
πŸ‘€︎ u/JavaSuck
πŸ“…︎ May 22 2020
🚨︎ report
Since the number pi is infinite and irrational (meaning it doesn't repeat) then somewhere along that long strand of numbers is a sequence that, when converted to pixels, creates and image of yourself
πŸ‘︎ 20
πŸ’¬︎
πŸ‘€︎ u/bro--wtf
πŸ“…︎ Sep 04 2020
🚨︎ report
Apologies for very frequently posting, but I've just founden something I've been lookingfor for years: how the Riemann approximation to the prime-counting-function has an infinite sequence of zeros extremely (& _really really_ extremely!) near the origin.
πŸ‘︎ 7
πŸ’¬︎
πŸ‘€︎ u/Ooudhi_Fyooms
πŸ“…︎ Nov 02 2020
🚨︎ report
If Pi is an infinite number, then all the number sequences and possible combinations is encoded in the digits of pi.
πŸ‘︎ 16
πŸ’¬︎
πŸ‘€︎ u/AltruisticDrink
πŸ“…︎ Jun 03 2020
🚨︎ report
Because PI is infinite there is a 100% chance that somewhere in the sequence there is a set of numbers which can be converted into a Rick Roll.
πŸ‘︎ 4
πŸ’¬︎
πŸ‘€︎ u/RicardoMilossGoa
πŸ“…︎ Jul 05 2020
🚨︎ report
Infinite Geometric Sequences - how to see how many terms are below a threshold number?

Hi All

Hope everyone is well today. Having had some fantastic help on previous questions, I am a little stuck on how to approach a question regarding infinite geometric sequences. I have a sequence and I have calculated my recurrence system. It then asks me how many terms in the sequence are below a value, hypothetically in this example 2000.

Now I could work out each value using the recurrence system until I hit my threshold number but I wanted to see if there was a more elegant way of doing this? I can't find any reference to this in my text book so I thought I would tap into the LearnMath Hive Mind :-)

As always, thanks very much :-)

πŸ‘︎ 3
πŸ’¬︎
πŸ‘€︎ u/lonza-cat
πŸ“…︎ Jul 27 2020
🚨︎ report
If the number pi is infinite, then somewhere there is a sequence of numbers that resembles Rick Astley.
πŸ‘︎ 7
πŸ’¬︎
πŸ‘€︎ u/Erudos
πŸ“…︎ Sep 10 2020
🚨︎ report

Please note that this site uses cookies to personalise content and adverts, to provide social media features, and to analyse web traffic. Click here for more information.