Defining a counting function in mathematica

Click For Summary

Discussion Overview

The discussion revolves around defining a counting function in Mathematica to determine the number of positive zeros of a family of functions, specifically f_n(x) = sin(x/n), that are less than a given number Z. Participants explore methods to compute the cardinality of the set of zeros for various values of Z.

Discussion Character

  • Exploratory
  • Technical explanation
  • Homework-related

Main Points Raised

  • One participant seeks a general method to count the positive zeros of the function f_n(x) = sin(x/n) for natural numbers n, specifically for values of Z like π + 1 and 2π + 1.
  • Another participant clarifies a notation issue regarding the expression "2\pi" and confirms the intended meaning of "x over n" in the function.
  • A suggestion is made to consider using MATLAB as an alternative to Mathematica for this task.
  • A later reply recommends using the FindInstance function in Mathematica, advising the original poster to consult the documentation for further guidance.

Areas of Agreement / Disagreement

Participants do not appear to reach a consensus on the best approach, as there are multiple suggestions and clarifications regarding the method and tools to use.

Contextual Notes

Participants express uncertainty about the clarity of their mathematical expressions and the effectiveness of different programming tools for the task at hand.

michael71828
Messages
4
Reaction score
0
Hi and thank you for reading this.

I'm learning to use mathematica and among those things I'm trying to do, is to define a function that can count for me, say, the number of positive zeros less than a given number Z of a familly of function.

For exemple, let f_n(x) = sin(x/n) for any natural number n. I want mathematica (or any other program you may suggest) to compute the cardinality of {x \in ]0,Z[ = (0,Z) : \exists n \in N for which f_n(x)=0}. For Z = \pi + 1, I would expect that cardinality to be 1, in that case. For Z=2\pi +1, it'd be 2, and so on.

I want a general method, so I can apply it to my specific problem.

Just let you know that I've google'd it, I looked wolfram's forums, wolfram documentation, asked friends, and couldn't find it !

I hope I was clear, and that my english wasn't too bad.

Thank you !
 
Physics news on Phys.org
Maybe the 2\pi +1 and so on wasn't so clear.

I really meant ''x over n'' in sin(x/n), but I used LaTeX terminology for ''pi'' 2\pi is really 2*pi.

I don't think I fooled many of you, but just in case... :)
 
Or maybe MATLAB would be better ?
 
Hi michael71828, welcome to PF,

For future reference you can display LaTeX using tex tags. Also, you will get faster answers if you don't respond to your own OP since some people look for unanswered posts and respond to those first.

I would recommend the FindInstance function for your purpose. Look at the documentation and see if you have any questions on how to use it. Be sure to use the option which allows you to specify the maximum number of instances to return.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 19 ·
Replies
19
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K