জ্যামিতিক বিতরণ (Geometric Distribution) হল n = 0, 1, 2, ... এর জন্য একটি ডিসক্রিট প্রোবাবিলিটি ডিস্ট্রিবিউশন যeno প্রোবাবিলিটি ডেন্সিটি ফাংশন রয়েছে।
$$P\lgroup n\rgroup=p\lgroup1-p\rgroup^{n}$$
ডিস্ট্রিবিউশন ফাংশন হল -
$$D\lgroup n\rgroup=\displaystyle\sum\limits_{i=0}^n P\lgroup i \rgroup=1-q^{n+1}$$
উদাহরণ
#include#include using namespace std; int main() { const int nrolls = 10000; // number of rolls const int nstars = 100; // maximum number of stars to distribute default_random_engine generator; geometric_distribution distribution(0.3); int p[10]={}; for (int i=0; i আউটপুট
0: ***************************** 1: ******************** 2: *************** 3: ********** 4: ******* 5: **** 6: *** 7: ** 8: * 9: *