Go Premium for a chance to win a PS4. Enter to Win


Math / Science

The Math / Science topic primarily includes discussions of mathematics, physics, statistics and economic analysis, but also biology, chemistry and other sciences.

Share tech news, updates, or what's on your mind.

Sign up to Post

I got the positive number multiplication right and I can kinda do negative numbers . but I cant do both at the same time
my try code
        STA A
        STA B
        LDA A
        BRZ END
        LDA B
        BRZ END
        LDA NUM
        SUB B
        BRP CHANGE
        SUB B
        STA B
        LDA NUM
        SUB A
        STA A
        BRZ END
        SUB ONE
        STA B
        LDA P
        ADD A
        STA P
        BRA LOOP
        SUB P
        STA P
A       DAT
B       DAT
P       DAT 0
ONE     DAT 1
NUM     DAT 0
Hire Technology Freelancers with Gigs
LVL 11
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

It's my math problem I'm struck
This could be an easy question and in fact, this is simple. But just wondering what's the proper algorithm for lucky draw chances?

Let's say in every new deposit amount of X get a no of chances of Y. Providing X = $1000, Y = 1

If there's a customer A credited $10000, he got 10 chances in this month.
If there's a customer B credited $2000, he got 2 chances in this month.
If there's a customer C credited $100, he got 0 chances in this month.
If there's a customer D credited $3500, he got 3 chances in this month.

By end of this month, how do I use a proper algorithm to pick a lucky draw winner? That's to pick a winner among this 15 chances.

One of the approaches is to create multiple chances in a temp table, and then random a position to pick the winner. But my question is what if the total no of chances is a very big number? Will the process of populating this temp table become slow?

Thank you.
A workshop table has an equilateral triangular top each side 900mm the legs are on the three corners . A load of 500N is placed on the table at point distant 325mm from one leg and 625mm from another . What is the load on each of the three legs
calculate the disk capacity transfer rate
given that no. of recording=10,no. of tracks per surface=256,no. of sector per track=32,no. of bytes per sector=128,disk rotation speed=2400 rpm
Generally, I will be given a set of X/Y points and their corresponding Z values. (Z = f(X, Y).
And those X/Y points are typically fall into a regular grid pattern so that a set of horizontal lines and vertical lines will capture all the points where those lines intersect. (Note: FYI - the distance between parallel lines do not have to be fixed to have regular grids.)

For the above, I can use bicubic spline interpolation algorithms to solve the problem. This approach requires solving for 16 coefficients of a cubic surface in every rectangle; and trying to keep the surface smooth at the end points by keeping the derivatives, fx, fy, and fxy, the same for neighboring rectangles.

a. Then there is a relaxation of this strict rule. It is that the horizontal lines (representing Y values) will be evenly spaced; but that the X values from one horizontal line to the next will not be regular (i.e., vertical lines intersecting the horizontal lines will not always have known X/Y points).

b. Then there is a more general case where the X/Y points are not quite regular. They aren't randomly placed, but they are not regular.

If you can help me understand how to interpolate with either case (a) or (b), I would appreciate the help. One thought I had was to consider a point and look at 4 quadrants, and take the closest point in each quadrant, and using those 4 irregularly place points, try to interpolate. If (a) is a lot …
In a previous question we're shopping for an ingredient which comes in standard pack sizes of either 100g, 250g or 500g, having prices $0.40, $0.75 and $1.00 respectively.


PackSize = {100; 250; 500}
PackPrice = {0.40; 0.75; 1.00}

QuantityNeeded = {0.... up in steps of GCD(PackSize)... MaxQuantity }

GCD = greatest common divisor, eg GCD({100; 250; 500}) = 50

We only need to define a table with intervals in these steps as in between there won't be any change in the cost. I think this logic is right, please correct me if wrong.

We then define f_mincost(QuantityNeeded ) as the set of packs that meets the QuantityNeeded at minimum cost, eg:

f_mincost(1050) gives 1 x 100g + 2 x 500g at a total cost of $2.40

This problem is solved in the previous question by using dynamic programming to create a lookup table of values:

a) Quantity needed, eg 1050
b) Minimum cost, eg $2.40
c) Pack selection, eg 100, 500, 500

1. What MaxQuantity do we need to tabulate upto before the pattern is repeating
    ie MaxQuantity = some function of Packsize
2. How can we define f_mincost(QuantityNeeded) as a function of this repeating pattern
   eg what is f_mincost(6400) as a function of f_mincost(some value <= MaxQuantity)

This is is probably straightforward but after the previous question my head has been frazzled!

Thanks again
A fair coin is tossed 200 times. Find the probability of getting a head an odd number of times
Sol: the number of cases favourable to E is 200C1 + 200C3 +200C5 +200C7 +200C9…. +200C199  = (2200/2)

Dear experts,

Can someone throw more light on the above binomial equation for counting odd number of items which results 2n-1.
Similar will the result change if were to add the even number of times.
What about for adding for all cases where r=prime number and less than ≤n

Kindly help.
Write a function called my_gcd() that takes parameters a and b and returns their greatest common divisor. Create your own implementation of the algorithm and test your code by comparing the output of your function to Python's gcd() function from math package.Test the code with the following inputs: (39, 91), (20, 30) and (40,40). Explain the logic of your function.
There are huge amount of different slot machines available online, like in the given list here bettingcasinoslots.com. All of them powered by own random generated algorithm. So I would like to know if there some strategies to play slots? I mean when you are playing for money and you want to make even a little profit and it would be great it the strategy does not include loosing money. Researches and publications are appreciated too.
Concerto Cloud for Software Providers & ISVs
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

1. Write the pseudocode and draw the flowchart for a hotel program to determine the cost a customer has to pay for a stay based on the following pricing policy of the choice of room:
>>>Room for 1 to 2 people: RM85
>>>Room for 3 to 4 people: RM90
>>>Room for 5 to 6 people: RM120
>>>Room for > 6 people, RM125 plus charge for additional people at RM25 per person

If the customer has a membership card, there is a 20% discount. If the customer wants to pay using credit card, there is a 15% discount. A customer cannot receive both discounts. If the customer wants to pay using credit card and has a membership card, the highest discount rate will be given.

Answer these questions before you start solving the problem.
What is the output?
→Cost of customer has to pay for a stay
How many input(s) is/are needed?
What is/are the input(s)?
→number of people, number of days, payment type,
What is the process (equation) to find the output?                                                                                                                    
→cost = number of days * 85
→cost = number of days * 90
→cost = number of days * 120
→additional people = number of people - 6
→cost = number of days * [125 + 25 (additional people)]
→membership card =  cost * 80/100
→credit card = cost * 85/100
How many different calculation(s) is/are needed?
What structure need to be used to select which is the correct calculation to use? Repetition or decision? →decision…
Can anyone help with regression using Stata ?
A school has been able to acquire a number of Smartboards for classroom use.  Math teachers and science teachers are the majority of the recipients.  Does anybody know of a good trainer that can show these teachers uses within a school setting?
It is for a science project we just don't have any weighing scales to test it ourselves
How much more will the cost be for a wager on V5 compared to V4 when adjusting for difference in probability, price per unit and track's deduction?:

For V5 (a type of wagering on harness racing where you should pick the winner in 5 races), the probability to pick the winners in the five races is 12 times more difficult compared to for V4 (1/248832 divided with 1/20736; (12x12x12x12x12)/(12x12x12x12)), which means you need to spend 12 times more units on V5 to achieve the same probability. However, this should be adjusted first for price per unit, which for V4 is 2 SEK and for V5 is 1 SEK, so the adjustment becomes 12 x 0.5 = 6.

The final adjustment is for the racing track's deduction, which for V4 is 25 % and for V5 is 35 %.

Is this correct?:

6 + (0.1/0.25) = 6.4

Which means in order to compensate for lower probability in V5 compared to V4, and for difference in price per unit (V4: 2 SEK; V5 1 SEK) and difference in track's deduction (V4: 25 %; V5 35 %), I need to spend 6.4 times more units/money on V5 compared to V4 so that I in the end have the same probability to win on my wager on both V4 and V5, provided that the payouts on both the wagers are the same.

Or do I get it wrong? Is it that the payout on V5 needs to be 6.4 times higher than on V4 in order to compensate for the difference in probability, price per unit and track's deduction?
We have 12 players, and we would like to set up a 6 team round-robin tournament for a few different backyard games. We'd like to play as many different backyard games as possible with these 12 players (6 teams of 2 players), while ensuring that no two players get matched up more than once across the different games.

Looking for a grid of as many of these unique matchups (round robins) as mathematically possible.


Players: 1 - 12
Teams of 2
As many combination of 6 teams as mathematically possible while ensuring no two people end up together on a team more than once
Imagine you have a dataset of rowers. You have X variables such as weight, benchpress, deadlift, squat, nutrition, etc. You also have each rower's lap time.

Now, let's say for a given rower, you want to optimize her lap time, but you can only train along ONE DIMENSION. How would you identify the best attribute to optimize?

I thought about a grid search, but that seems awful. Which family of machine learning algorithms would be best for this type of problem, and how would you attack it?

Thanks a million!
I am trying to rotate an object and get the following error message: 1119:access of possibly undefined property Math through a reference with a static type class. Thank you for your help

 here is the code

import flash.events.MouseEvent;

stage.addEventListener(MouseEvent.MOUSE_MOVE, FollowMouse);
function FollowMouse(event:MouseEvent):void
      var SideY:Number = mouseY-circle.Y;
      var SideX:Number = mouseY-circle.X;
      var Rad:Number = Math.atan2(SideY,SideX);
      var Deg:Number = Rad * 180/Math.PI;
      circle.rotation = Deg;
I have a client who has an issue getting the LINEST() function to work for them.  This is my first time using LINEST(), and what seemed, at first, to be straightforward has deepened considerably in levels of complexity.  I am an accomplished VBA programmer, and I feel the best way to give the client what they need is to duplicate the equation in VBA to calculate the slope (m) when there are multiple X Axes.  When only one X axis exists, I have validated LINEST against my own independent calculation, as shown by the equation below.

slope (m) calculation for single X Axis
I am looking for a similar equation I can apply, given 2 or more X Axes.  Reproducing the underlying query in VBA will make for a much more versatile function, capable of calculating LINEST in a more wide-ranging set of circumstances than Excel currently allows, thus meeting my client's requirements.  For those not familiar with LINEST(), I have included a couple of sites that have given me the best start on solving the problem.  The office support site provided the equation, as shown above, which gave me a reliable means to have an independent check against the Excel function on a single X axis.  Every site I've seen thus far provides the LINEST() equation for multiple X Axes, but nowhere have I seen a more nuanced formula that tells me what Excel is doing to derive that number.  That's my missing piece.

Thanks, in advance, for your support.  ~ Peter Ferber

[Webinar] Cloud Security
LVL 11
[Webinar] Cloud Security

In this webinar you will learn:

-Why existing firewall and DMZ architectures are not suited for securing cloud applications
-How to make your enterprise “Cloud Ready”, and fix your aging DMZ architecture
-How to transform your enterprise and become a Cloud Enabler

The following problem refers to strings in A, B, ..., Z.

How many four-letter strings are there that begin with O ?
I heard gastritis and heartburn can be solved by ingesting alkaline substances.
Alkaline plants supposedly containing alkaline substances can be ingested to lower the pH value in the stomach due to stomach acid.
I'm trying to extract alkaline substances from plants using simple boiling extraction.
Thus, I tried to extract alkaline substances from a alkaline plant, dandelion, in ethanol and ethyl acetate solvent for 10~15 minutes.
The solution was filtered with carbon black for decolourization, but it didn't show alkaline colour with universal indicator.

So... I've got some questions to ask

1. Is dandelion alkaline?
2. If it's alkaline, is it possible to extract alakline substances or alkaloids from the plant?
3. If dandelion is not alkaline enough, then could there be any othe ralternative plant or food that can be extracted alkaline substances?
4. Is alkaloid alkaline?
5. What are the alkaline substances coming from?
6. If the simple boiling extraction doesn't work , is there any other ways that I can extract alkaline substances from the plants?

Could you explain in high school level.
I hope this forum can also help regarding electricity science.
Need to purchase a few single cells of lipo and ni-mh battery types >> high drain >> for airsoft purpuse, and rc!

1. Would like to get anykind information to get them from any Europe dealers, wholesalers,distributors, etc?
2. Or, name of a few manufacturers companies?

Thanks in advance...
I wish to extract info from a land registry file - see info on this link.


I have a UK land registry .gml file downloaded from their site


I have installed QGIS and have managed using the menu item FILE / IMPORT VECOR DATA / COMMON IMPORT FORMATS browsed to the .gml file and opened it but all I see is View1 ( attached ). I can zoom to produce View2 & 3 ( also attached )  but I can't see how I can reveal the Polygons referred to by the Land Registry.
Due respect sir,
The we questions is that

(A×B.C)(a×b.c)=|A.a.      A.b.      A.c.  |
                           |B.a.        B.b.     B.c.  |
                           |C.a.       C.b.      C.c.   |

Sir as soon as possible plz send the solution my mail

                   Thank you
                  Your student
Scenario: bins are taken out once a week from a storage area to another location more than 20 meters away. I want to know if the bins have NOT been taken out at any given time each week.

eg if the bins are tagged and the storage area has a receiver, the receiver can tell me if the bins are in or out of storage.

I would like to tag around 4 bins only. What cheap and simple tagging solutions exist?  

I would like the receiver to connect to wifi so i can check the status remotely. The tag on the bins should be small and discrete, so as not to encourage vandalism or theft. They should also be very low power so that batteries, if the tag needs them, would need changing at most once a year. Perhaps a magnetic solution would avoid need for batteries on the bins.

The position of the bins in the storage area is not precise but would not vary by more than 2 meters.


Math / Science

The Math / Science topic primarily includes discussions of mathematics, physics, statistics and economic analysis, but also biology, chemistry and other sciences.