A list of puns related to "Infinite Sequence"
I have to write a test that takes as input an infinite sequence but I have no idea how to do that.
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 β‘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?
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?**
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
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:
Non Pedals:
WTTF:
Always down for reverb or delay. Good on dirt. Especially Fuzz!!
Edit: infinite and random
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!
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:
This is really breaking my brain, so I will love any commentary or links to discussions of the above!
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.
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.
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.
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.
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?
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:
Thanks everyone for helping me out! π
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?
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 ?
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
Thinking about it any number sequence is in Pi
Link: https://imgur.com/a/SCexPCg
Where is the error? Could you help me?
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
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
My w/o: http://prntscr.com/uzl2bd
How would I prove the last part has no solutions?
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 :-)
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.