main thread
היי, צריך לבדוק שהפייתון לא מגריל בטעות את אותו המספר פעמיים או שאפשר להזניח את זה?
אם אותו מספר מוגרל פעמיים זו אינה טעות. כמובן שאם המרחב ממנו מגרילים הוא גדול מאוד, ההסתברות לקבל אותו מספר פעמיים תהיה קטנה מאוד, אך עדין חיובית
שלום,
משפט המספרים הראשוניים נוגע לכל המספרים שקטנים ממספר מסויים (x).
כאן בתרגיל אנחנו מגרילים מספרים בטווח מסויים. איך אנו יכולים לקשר בין הטווח לבין כל המספרים הקטנים מ-x, ומלבד זאת איך בדיוק ההופכי של הצפיפות קשור לנושא? תודה!
This is incorrect. Take another look at the theorem.
Suppose your domain has N items (n bit numbers in our case), out of which M have some property (being primes in our case).
You sample t elements at random from the domain, and s out of them have this property. The observed density is s/t, and
its inverse is t/s.
The question is how well does t/s approximate N/M, which is a quantity whose order of magnitude was discussed in class.
To get the M you mentioned above i need to check all the numberes that have N bits ?
You could try that, if you really got plenty of time and access to extremely strong computers.
Maybe it would work for n=40 or even n=45 bits.
I'm sorry,
I'm not really getting the question.
1. should I check if t/s matches properties like linearity? or can i just say that generally it seems like it matches/does not match the theory?
2. in the explenation, why do we check if t/s approximates N/M, rather then N/1? (since the teory says density is 1/N)
Thanks a lot,
Noga
Take a look at this post
It may help you understand what you are supposed to check here.
היי,
האם אפשר לקבל הפנייה למשפט המספרים הראשוניים במצגת?
משום מה אני לא מוצאת.
תודה
האם אנחנו צריכים להחזיר תוך שימוש ב-return או שאפשר להשתמש ב-Print?
הערה:
כשכותבים פוסט בעברית יש לעקוב אחר ההוראות שמצויות בצד ימין למעלה.
ולשאלתך:
ערך מוחזר של פונקציה תמיד יחזור באמצעות return ולא ע"י print
שלום,
אפשר לקבל הסבר קצר מה הכוונה בהפכי בשאלה? כי דווקא יצא לי (שהצפיפות * (מספר ההגרלות)) של הראשוניים תואם לתוצאה של משפט הראשוניים אבל ההופכי ממש לא. להבהרה: אני פשוט עשיתי אחד חלקי התוצאה שהפונקציה מחזירה
Please see my response (27 Mar 2014, 23:18) to moshe (guest), above.
If your estimate of the density fits the theorem, then so should your estimate of 1 over the density.
Clarification: There is no hidden mystery in this question. We want you to understand what the prime number theorem says about density of n bit primes among n bit numbers, and to do some experiments that will verify (or contradict) it. While doing so, you will hopefully realize that each such experiment samples a random variable and thus the outcomes vary from one run to the next.
Hi,
By looking in Benny's answer, isn't it clear that N/M in the theorem is supposed to be n, the number of bits?
I take the N numbers (no matter what is N) and divide it by N/n (where n is the number of bits) so it is n.
Am I wrong?
Thanks
The number of positive n bit integers (denoted by N above) is $2^n$ and certainly not n.
We want to sample times=10000 of those at random, in order to get an estimate of the density of primes with that many bits.
איך מחשבים את ההופכי של הצפיפות? האם הוא מספר המספרים הלא ראשוניים חלקי 10000??
ומהו משפט המספרים הראשוניים?
תודה
These questions were already asked and answered - take a look at Benny's response to Moshe (Mar 27th).