|
|
Probability first ball is red: 24.9147% Probability second ball is red: 24.9983% Probability both balls are red: 5.0139% |
35 0 c:\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.6.1\include\c++\random In file included from c:\dev-cpp\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.6.1/include/c++/random 3 C:\Dev-Cpp\Programs\000000.cpp from C:\Dev-Cpp\Programs\000000.cpp 32 2 c:\dev-cpp\mingw64\lib\gcc\x86_64-w64-mingw32\4.6.1\include\c++\bits\c++0x_warning.h [Error] #error This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options. C:\Dev-Cpp\Programs\000000.cpp In function 'bag createBag(unsigned int, unsigned int)': 14 17 C:\Dev-Cpp\Programs\000000.cpp [Error] 'bag' has no member named 'emplace_back' 17 17 C:\Dev-Cpp\Programs\000000.cpp [Error] 'bag' has no member named 'emplace_back' C:\Dev-Cpp\Programs\000000.cpp In function 'void randomize(bag&)': 24 12 C:\Dev-Cpp\Programs\000000.cpp [Error] 'mt19937' in namespace 'std' does not name a type 25 5 C:\Dev-Cpp\Programs\000000.cpp [Error] 'shuffle' is not a member of 'std' 25 50 C:\Dev-Cpp\Programs\000000.cpp [Error] 'engine' was not declared in this scope C:\Dev-Cpp\Programs\000000.cpp In function 'int main()': 39 10 C:\Dev-Cpp\Programs\000000.cpp [Error] 'ballBag' does not name a type 43 19 C:\Dev-Cpp\Programs\000000.cpp [Error] 'ballBag' was not declared in this scope |
This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options. |
cire wrote: |
---|
Enable C++11 support. And maybe update to a newer version of your compiler. |
|
|
if 2 balls are pulled -what is the prob. 1 is red? not returning 1st ball or pulling both at same time |
could someone please show me the formula for this chances both red? |
And a 1/5 probability of getting red the second time. ((3/4)*(4/15)) |