I have no idea how to write in Python. Please help me with this! Best answer if you write the program! Central Limit Theorem I Goal Write a python program that will use your accept / reject Monte Carlo algorithm to demonstrate the central limit theorem. Recall: The central limit theorem states that if s = ∑j=1 N xj (ie. s is a sum of M random variables x1, ..., xM), then the distribution of s approaches a Gaussian distribution as M increases. Here the index j is being used to indicate different variables. Furthermore, the mean of the resulting …

Member Avatar
Member Avatar
-3 forum 5

Hello programmers! I have been working on STL algorithms for some time now as a beginner, and I started doing an exercise, among which is the task of `use the fill algorithm to fill the entire array of strings named items with "hello"`. My code for this is below: // Various statements in exercise in using STL Algorithms #include <iostream> #include <algorithm> #include <iterator> #include <array> using namespace std; int main() { //various statements in using STL algorithms ostream_iterator<int> output(cout," "); //iterator const size_t SIZE=10; array<string,SIZE> myStrings; //array of empty strings fill(myStrings.begin(),myStrings.end(),"hello"); //using the fill algorithm to fill the entire …

Member Avatar
Member Avatar
+0 forum 6

So I just finished up a way to solve Standard Form Quadratic Equations, Now I want to code a way to automatically Convert a given Standard Form equation to Vertex Form, or Vertex to Standard. Is it possible due to the fact that you have to get a perfect square binomial? Could you just use the Square Root of h in y = a(x-h)^2+k? I've searched google and elsewhere with no luck finding code for a converter. So I came here for a start. package com.github.geodox.quadraticconverter; import java.util.Scanner; public class QuadraticConverter { public static void main(String[] args) { Scanner s …

Member Avatar
Member Avatar
+0 forum 9

// 9-2. If we define the name function as a plain, nonconst member // function, what other functions in our system must change and why? based on the question, the answer would be // answer bool compare(const Student_info&, const Student_info&); // because this function uses the member function as it's parameter. // giving writing access on a read-only variable is forbidden. after removing the const on the type, the code doesn't compile and showed me these error which I assumed to be related with the standard library codes which may not allow const parameter on it's predicate function. No? http://s17.postimg.org/gpok3bczj/ehem1.png

Member Avatar
Member Avatar
+0 forum 1

Hey guys I'm having trouble figuring out how to calculate the standard divination of an array in Java. As you can see I have already calculated the mean, and I know that at the end I will have to divide by the sample size minus 1 (n-1) and square that number. The problem I'm having is how to take every number and calculate how far it is away from the mean, then square that number. I know I could do every number from the data set separately but there has to be an easier way. Any help would be appreciated, …

Member Avatar
Member Avatar
+0 forum 4

i was searching for a code to perform binary XOR addition. Exams coming up, and needed to a quick way to create and verify standard array tables. However, i didnt find anything substantial on the internet, so made my own version of it. can anyone take a look and tell me if there's some other(better) way to do this? thanks in advance for your time :) somjit. here's the code: #include<stdio.h> #include<string.h> int main(){ int *stop,decNum1=0,decNum2=0,result=0,ip_base=2,flag=0,i=0,binLength=0,temp=0,opResult[15]; char num1[15],num2[15]; puts("\n"); do{ printf("enter two binary numbers of same length(<15):\n"); printf(" enter 1st binary number: "); fgets(num1,15,stdin); binLength=strlen(num1); decNum1=strtol(num1,&stop,ip_base);// decNum1 is the dec …

Member Avatar
+0 forum 0

Hello, I'm fairly new to python and I've currently run into a road block in this problem. I set up this code: def average(the_list): return the average of the list def deltalist(the_list,a): return a list which is each of the element of the_list subtracted by a def squarelist(lst): return a list which is each of the element of the_list squared def variance(the_list,mean): return squarelist(deltalist(the_list,mean)) def stddev(l): a = average(l) l3 = variance(l,a) return math.sqrt(sum(l3)/(len(l3) - 1)) lst = [1,3,4,6,9,19] print(stddev(lst)) the `return` statements is the problem I've ran into. I want to implement the average, squarelist, and the delta list …

Member Avatar
Member Avatar
+0 forum 5

#include <stdio.h> #include <stdlib.h> #define MAXSIZE 6 int main(int argc, char** argv) { float stddeviation, deviation, sumsqr, variance, mean, x, t, m, sum=0, max, min; int numdatapts, k; FILE * inFile; inFile = fopen("Uniform93.data", "r"); if(inFile == NULL){ printf("\nError opening file. Abort program.\n"); exit(1); } for (k = 1; k <= MAXSIZE; k++){ fscanf(inFile, "%f", &m); if (k == 1) max = min = m; sum += m; if (m > max) max = m; if (m < min) min = m; if (k == 1) mean = sum / MAXSIZE; deviation = m - mean; sumsqr += deviation * …

Member Avatar
Member Avatar
+0 forum 1

This is my code so far: #include <iostream> #include <cmath> #include <cstdlib> using namespace std; int main() { float numbers[15]; float sum, lowest, highest; float min, max, range, stDev, mean, median; int indexOfMin; float above = 0, below = 0; sum = 0; for(int testNum = 0; testNum < 15; testNum++) { cout << "Please enter your 15 numbers: "; cin >> numbers[testNum]; sum = sum + numbers[testNum]; } mean = sum/15; for(int testNum = 0; testNum < 15; testNum++) { if(numbers[testNum] < mean) { below++; } else if(numbers[testNum] > mean) { above++; } } lowest = numbers[0]; for(int testNum …

Member Avatar
Member Avatar
+0 forum 2

I am getting ready to write a programming competition on Tuesday (the Canadian Computing Competition) and I remember that last year it said that only standard libraries can be used. I was having trouble deciding which libraries are standard. I ended up using windows.h and when I suddenly realized that it was likely not standard I quickly commented-out a bunch of windows specific code. My question is, is there a list somewhere of all of the libraries considered as 'standard' in c++?

Member Avatar
Member Avatar
+0 forum 3

What is the difference between Standard and Non-standard Wiener process?

Member Avatar
Member Avatar
+0 forum 6

This is something I've been slightly obsessing over recently. Say for example you were asked to create a two-column design, I would do this by floating the left column left, giving it a width, and giving the right column a left margin equal to the left column + about 20px. There's so many different ways this can be accomplished, how would you do it? Is there anything wrong with my technique? And if you were asked to create a header with say a logo on the left and login info on the right, I would do this by floating the …

Member Avatar
Member Avatar
+0 forum 1

I've been given a basic form of programming to do. And I simply cannot figure it out. I know this topic has been covered several times before. But each of them going around the one crucial step that I need to complete my programming. My instructor insists that the 24 hour clock is given in HH:MM time and not as two separate factors. If you want me to post the bits of coding I have in here I can, but it's not much and probably will not contribute much. I'm thankful for any bits of help I can get. If …

Member Avatar
Member Avatar
+0 forum 12

OK so I found an old server laying around our company that has win2k3 Standard x86 SP1 OEM channel. After a few days of tinkering and my boss remembering a few old passwords I regained access to the machine. However, we can't find any software or manuals for the machine. It has a valid license which I plan to extract and eventually use on faster hardware but I need the CD that matches the version that is installed. The exact version is: Windows Server 2003 Standard x86 SP1(or SP2) OEM Channel. Please if anyone can help me out I just …

Member Avatar
Member Avatar
+0 forum 1

Is there any way to inline just some selective calls to a particular function not all of them? by function I also mean class operators like assignment operator, constructors like copy constructor. The only form I know is declaring function as such at beginning and that's supposed to effect all calls to that function and it even doesn't work for copy constructor cause that's generated automatically by compiler. After all maybe it'd be good to know basically how much authority for making a function inline or not is there for the programmer under C++ standards.

Member Avatar
Member Avatar
+0 forum 1

I need help with converting standard time to military time through a button. Then being able to use another button to convert back.

Member Avatar
Member Avatar
+0 forum 2

Hi all of you, Iam creating a Inventory System on vb.net and I need some image for like new,search,delete copy cut edit etc can any Help me from I get all this Images, I try to search in google bt I did't get thanks In Advance

Member Avatar
Member Avatar
+0 forum 4

suppose we have following function: [CODE]void someFunction(int * araye){ for (int i=0;i<5;i++) cout <<araye[i]<<' '; cout <<'\n'; }[/CODE] can we pass an array to this function by following syntax, under upcoming c++0x standards? : [CODE]someFunction({1,2,3,4,5});[/CODE] if that's true, will we even be able to use this syntax in any case in which, array elements are from POD types like below : [CODE]class Test{ int adad1; int adad2; }; void someFunction(Test * araye){ for (int i=0;i<3;i++) cout <<araye[i].adad1<<'-'<<araye[i].adad2<<' '; cout <<'\n'; } someFunction({{1,2},{3,4},{5,6}});[/CODE]

Member Avatar
Member Avatar
+0 forum 2

was the idea of nested functions considered to be useless during the time of developing older c++ standard, because its usage is basically covered by another concept like object-oriented programming; or it wasn't implemented just as a matter of simplification?

Member Avatar
Member Avatar
+0 forum 8

so i have a little issue here. i have a program that creates a list of random numbers, for sake of example here it is: [CODE] public class RandomSeq { public static void main(String[] args) { int n = Integer.parseInt(args[0]); for (int i = 0; i < n; i++) System.out.println(Math.random()); } } [/CODE] now my textbook says that all i have to do to get the output of this program to go into a text file is to type "java RandomSeq 10 > data.txt". this should make a text file (data.txt) that has a list of ten random doubles between …

Member Avatar
Member Avatar
+0 forum 4

Suppose we have following two classes: [CODE=c++] class Temp{ public: char a; char b; }; class Final{ private: int a; char b; char c; public: Final(Temp in):b(in.a),c(in.b){} //rest of implementation };[/CODE] can we initialize an object of the Final class with following syntax in upcoming c++0x standard: [CODE=c++] Final obj(Temp{'a','b'});[/CODE]

Member Avatar
Member Avatar
+0 forum 1

Can anyone tell me what GUI to use? And is there a GUI similar or same like standard library? Thanks in advance.

Member Avatar
Member Avatar
+0 forum 3

Hello there, I am trying to figure out the advantages of C++ STL containers over C. Correct me if I am wrong. a)in C++ containers classes are standardized. C doesn't have any standardized libraries for data structures beyond the native array type. b)each of these containers in C++ has member functions which can manipulate the data stored in the containers. c)also there are global functions (algorithms) which can manipulate the data of the containers. Doesn't C has global functions as well? (reverse) d)They're type safe and relatively clean. C offers essentially two ways to create generic containers: pointers to void …

Member Avatar
Member Avatar
+0 forum 10

Hi everyone, can you help me please with then following?? a)The C++ Standard Template Library (STL) contains a number of container data types, explain with suitable examples the advantages these give to the programmer over a procedural language such as C. b)Demonstrate using suitable code the usage of the STL std::vector container. can you help me please with that?? thanks in advance

Member Avatar
Member Avatar
+0 forum 15

what is the best suitable LAN protocol/technology for a law budget school network connected to a WAN to which the LAN must provide streeming and real time video? will gigabit ethernet be as good idea? or is Wi-Fi suitable? or perhaps CAT5 or fibre optics?

Member Avatar
Member Avatar
+0 forum 2

"The great thing about standards is that every company gets to have one." The first time I heard that expression was around 1995. Proclaimed by Joel Shore, a former-boss-now-friend, it was one of the many truisms at the time. A good many standards bodies and arbiters have cropped up since the mid-1990s, the latest of which was today. The [URL=http://openwebfoundation.org/homepage.html]Open Web Foundation[/URL] "is an independent non-profit dedicated to the development and protection of open, non-proprietary specifications for Web technologies," according to a purpose statement on its Web site. The organization currently includes about two dozen individuals and companies the likes …

Member Avatar
+0 forum 0

The [URL=http://www.iso.org/iso/home.htm]International Organization for Standardization[/URL] today announced that Adobe’s Portable Document Format is now an ISO standard. Well it’s about time! The PDF has only [URL=http://www.adobe.com/pdf/about/history/] been around[/URL] for 15 years! This is great news for all areas of publishing, for Web developers and Web site admins, even operating system makers have reason to rejoice. While Adobe has been a great custodian of its portable format, starting with the introduction of PostScript in 1990, passing the torch to a standards body seems a logical next step toward its long-term preservation, which is chief among the ISO’s stated goals. The OSI …

Member Avatar
+0 forum 0

The battle between Sony’s Blu-Ray and Toshiba’s HD-DVD has been a drawn out one, with nary a sniff of resolution in sight, and has seen likely to plunge consumers back into a situation similar to the VHS v BetaMax videotape battles of the 1980s. But a recent move by HP seems likely to bring some pressure to bear which could quite well lead to a resolution of the matter. Until now expressing support for the Blu-Ray standard, HP [url=http://today.reuters.co.uk/news/NewsArticle.aspx?type=technologyNews&storyID=2005-10-20T003156Z_01_SCH001815_RTRIDST_0_TECH-MEDIA-HP-DC.XML]have now made it very clear[/url] that unless Sony incorporates Mandatory Managed Copy and iHD into Blu-Ray they’ll switch allegiances! Let’s face …

Member Avatar
+0 forum 0

The End.