Formulas for Permutation and Combination??
Hi All,
I got a requirement to develop a Simulator for a chemical process.. In which ther will be some inputs given by the user for a process.. the output must be Optimus result or best result...
I need to know.. is ther any standard for using Permutation and Combinations..
Also is ther any feature to develop a simulation process??
Thanks and Regards
Aravindh Mani
hi,
_*FORMULA*_
Permutation = nPr = n! / (n-r)!
Combination = nCr = nPr / r!
where,
n, r are non negative integers and r<=n.
r is the size of each permutation.
n is the size of the set from which elements are permuted.
! is the factorial operator.
Example:
Example:Find the number of permutations and combinations: n=6; r=4.
Step 1: Find the factorial of 6.
6! = 6×5×4×3×2×1 = 720
Step 2: Find the factorial of 6-4.
(6-4)! = 2! = 2
Step 3: Divide 720 by 2.
Permutation = 720/2 = 360
Step 4: Find the factorial of 4.
4! = 4×3×2×1 = 24
Step 5:Divide 360 by 24.
Combination = 360/24 = 15
The above example will help you to find the Permutation and Combination manually.
hope this helps
Regards
RItesh J
Similar Messages
-
hi friends
i have a very urgent requirement.
we have company codes from 1000 to 9999. ok
these company codes are divided series wise according to different schemes
so for this we have planed to combine alphabets with this company codes so that i can divide series wise
like 100A 100B ..100z.......999a .....999z.
so my question is howmany combinations are possible and what are they
from 1000 to 9999 using alphabets (only unique plz)ABCDEFGHIJKLMNOPQRSTUVWXYZ.
PLEASE DO ME THE FAVOUR.
( *is there any function module)*
REGARDS
king solomonTaufiq wrote:
I need help with the following. I have an input character array of {'a', 'b'}. My output should be a string array of {"a", "b", "aa", "ab", "ba", "bb"). Is this factorial, permutation or combination? How should I approach this problem? Can anybody show me an efficient method to do so? Thank you.It's an interesting problem. If you replace 'a' and 'b' with the binary digits 0 and 1 you see that first you generate all numbers with one binary digit and then all possible numbers with 2 binary digits, like
0
1
00
01
10
11
If you had three symbols like say 'a', 'b' and 'c' this would correspond to a number system with 3 digits 0, 1 and 2 (I think its called terniary). Using the same procedure as before you obtain this result,
0
1
2
00
01
02
10
11
12
20
21
22
000
001
002
010
011
012
020
021
etcetera.
So to generalize. If you have N symbols you view those symbols as digits in an N-ary number system. You then generate all possible numbers in that number system first with 1 digit, then 2 digits, etcetera up to N digits. -
Caculation Formulas for water and Electricity consumption
Hi Experts
I want to include water consumption and electricity consumption as conditions to a lease out, which are apportionable and assignable to a settlement unit.
Now i want to assign calculation formulas to these conditions, apparently there is no caculation formula to which i can assign to these attributes.
Wat can i do to have the calculation formulas of these conditions . Should i implement the baldi implementation for this .
Your favourable response is greatly anticipated.
Regards
DavidHello Franz
I need to assign the calculation formula to the condtion advance payment , for water and advance payment for electricty. I need to define suitable calculation formulas for these attributes, for in the standard system i can not find any that can caluculate these attributes. For electricity kwh and water m3. How can i set up these within the system.
Thank You in advance
Regards
David -
Formula for MIN and MAX per range required in BW
Good day
Please assist with the following? I need to create a formula (CKF) in BW Query which will give me the same result as the following formula in Excel.
What I have is one Key Figure and want to calculate a Score on that key figure.
Score =Key figure/(MAX(range of ie. column B1 to B50 which contains data for the same KF)-MIN(range of ie. column B50 which contains data for the same KF).
In excel it's easy, ie" Score =TD completed/(MAX(B28:B130)-MIN(B28:B130)
If more information is required to assist, please let me know?
Always appreciated.
CorneliusThank U so much for responding so fast.
I did the MIN and MAX formula, but it is only taking the MIN or MAX from the single cell of the applicable key figure and not from a 'range' of cells. This is a further example of what I want to do:
Cell: B1 = 10
B2 = 12
B3 = 15
B4 = 0
I want to display the MIN as '0' and the MAX as '15' and then do the calculation per row.
We are in 3.2x. I want to stay away from structures as I have not done that before.
Any other assistance will be highly appreciated.
Cornelius -
Not getting data using FORMULA for GAIN and LOSS
Hi all,
I have made a code for my report in which i have to display GAIN or LOSS using formula as told by me is:
ANLCKANSW-ANLCKNAFA-ANLCNAFAG-ANEAERLBT
and for this purpose i have create an ITAB,the structure is that:
BEGIN OF GI_DETAIL OCCURS 0,
BUKRS LIKE ANEA-BUKRS,
ANLN1 LIKE ANEA-ANLN1,
ANLN2 LIKE ANEA-ANLN2,
GJAHR LIKE ANEA-GJAHR,
AFABE LIKE ANEA-AFABE,
KANSW LIKE ANLC-KANSW,"Asset Acquisation Value
KNAFA LIKE ANLC-KNAFA,"Accumalated Depreciation
NAFAG LIKE ANLC-NAFAG,"Ordinary Depreciation Posted
ERLBT LIKE ANEA-ERLBT,"Retirement Revenue
END OF GI_DETAIL.
This is my SELECTION criteria for FORM GET_DATA
SELECT kansw knafa nafag anea~ERLBT
INTO CORRESPONDING FIELDS OF TABLE gi_detail
FROM
ANLC
INNER JOIN ANEA ON
ANLC~BUKRS = ANEA~BUKRS AND
ANLC~ANLN1 = ANEA~ANLN1 AND
ANLC~ANLN2 = ANEA~ANLN2
WHERE ANLC~AFABE eq '01'.
and this is FORM Organize_Data
READ TABLE GI_DETAIL WITH KEY bukrs = gi_detail-bukrs
anln1 = gi_detail-anln1
anln2 = gi_detail-anln2.
gi_main-gain_loss = ( gi_detail-kansw - gi_detail-knafa ) - ( gi_detail-nafag - gi_detail-ERLBT ).
MOVE-CORRESPONDING gi_detail to gi_main.
Problem when i execute with debugger value are coming in my ITAB i-e GI_DETAIL but not displaying in my formula.I can't understand what is the problem in the code.
Thanks,
abapfkHI
before reading the table first check, it is balnk or not.
gi_main-gain_loss = ( gi_detail-kansw - gi_detail-knafa ) - ( gi_detail-nafag - gi_detail-ERLBT ).
MOVE-CORRESPONDING gi_detail to gi_main.
here you have appended the values in gi_main-gain_loss and after that you are moving the gi_detail table to gi_main so as per my knowledge it will overwrite the values in gi_main-gain_loss.
so you have to append the values from gi_detail to gi_main individually.
like:
gi_main-field1 = gi_detail-field1.
gi_main-field2 = gi_detail-field2.
and the append gi_main.
check in debugging whther the values coming correctly or not.
I hope this will work for you.
Thanks
Lalit Gupta -
When I store something in notes, it is emailed to me. I want it to stay there as it does on my. iPad. Both on ios6 but I am stumped.
Some Users have reported that a Restore as New has Resolved Issues after the Upgrade...
Backup and Set Up as New Device
http://support.apple.com/kb/HT4137 -
Formula for calculating aggregate percentage and percenatge of gender
hi all
i have a sp from which i get result columns gender,percentage,studentcount,year
my sp is like this..
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[usp_GetState]') AND type in (N'P'))
DROP PROCEDURE usp_GetState
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[usp_GetState]
( @ExamYear Smallint
,@ExamType Nvarchar(10)
AS
BEGIN
SET NOCOUNT ON;
WITH cte_Schools AS
SELECT
[Foreign]= CASE WHEN M.Zone ='F' THEN 'Y' ELSE 'N' END
,CASE WHEN M.Zone ='F' THEN UPPER(C.CountryName) ELSE UPPER(S.StateName) END StateName
,COUNT( DISTINCT M.SchoolCode) Schools
,SUM( M.Nos) Students
FROM rptFinalResultSummaryMaster M
LEFT OUTER JOIN State S ON M.StateCode=S.StateCode AND M.Zone=UPPER(LEFT(S.Zone,1))
LEFT OUTER JOIN Country C ON S.CountryId= C.CountryId
WHERE M.Year=@ExamYear AND M.CourseCode=@ExamType
GROUP BY CASE WHEN M.Zone ='F' THEN 'Y' ELSE 'N' END
,CASE WHEN M.Zone ='F' THEN UPPER(C.CountryName) ELSE UPPER(S.StateName) END
SELECT
SlNo=ROW_NUMBER() OVER(PARTITION BY [Foreign] ORDER BY StateName)
,[Foreign] ,StateName, Schools, Students
, Percentage = (Students/(SELECT SUM(Students)*1.000 FROM cte_Schools))*100
FROM cte_Schools
ORDER BY [Foreign],StateName
END
GO
now..i wrote formula for percentage and when i connected this sp to my rdl where i took tablixi gave percentage value to gender and total percentage column
gender(column group)
total
number percentage
passcategory
this is my tablix format
my output looks like
boys girls
total
number(percentage)
passcategory1 (percenatge) 21 (40.38) 43 (56.75)
64(48.56)
passcategory2 (percenatge) 11 (21.15) 10 (13.51) 31(17.33)
passcategory3 (percentage) 20 (38.46) 21 (28.37) 41(33.41)
total (percentage)
52(xxx) 74 (xxx) 136 (100%)
i'm not getting thegender percentage properly for girls and boys total percentage of boys and girls coming correctly but individual percentage is not properly coming...that's because in sp i gave calculation for only total percenatge ..how can i calculate
the individual percentage of girls and boys in single column...so that i can place in gender column in tablix..and i can retrieve individual percentgaes of girls and boys seperately as shown in output..
please reply..its urgent
thanks in advance..
luckyplease reply..its urgent
Here is a tip: if you want to tick off people from helping you, you should absolutely include "urgent" in your post. That's a good way to encourage people to move to the next post. I did see this one earlier today, but did not have the time.
Anyway, I cannot really make out heads or tails of your question. Your output takes about gender, but I cannot see it in the output from the query, which appears to group by "Foreign" and StateName. How does the boys and girls get into the picture?
And for that matter that "totals" column?
Erland Sommarskog, SQL Server MVP, [email protected] -
Measure Formulae for Uploadable and Data collection report
Hi,
I have query related to application of measure Formula for Uploadable and Data collection report.
Consider a scenario where i use a MDX query to create a data collection report and I map these columns from these reports to an rowsource using a loader file. Can I use measure formula feature like onchange to work with Uploadable and Data colection reports such that changes to any one column should take effect in another column.
Regrads,
WesleyWesley,
IOP uploadable reports are used for sending data to the server in batch. They are coupled to the IOP model via a rowsource. You have a lot of flexibility with the spreadsheet you build for staging the upload. It's really just a function of how crafty you are with vb. Cascading changes from one column to another can be easily accomplished this way.
Onchange formulas are for something else. They are part of the model definition and are used for describing how to cascade changes between IOP data blocks. -
We’re seeing the following issue: sql - Can Oracle be forced to use the spatial index for sdo_filter in combination with an or clause? - Stack Overflow (posted by a colleague of mine) and are curious to know if this behaviour is due to a difference between standard and enterprise, or could we doing something else wrong in our DB config.?
We have also reproduced the issue on the following stacks:
Oracle SE One 11.2.0.3 (with Spatial enabled)
Redhat Linux 2.6.32-358.6.2.el6.x86_64 #1 SMP Thu May 16 20:59:36 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
11.2.0.3.0 Standard Edition and 11.2.0.4.0 Standard Edition (both with Spatial enabled)
Microsoft Windows Server 2003R2 Standard x64 Edition
However, the SQL works fine if we try it on Oracle 11.2.0.3.0 *Enterprise* Edition.
Any help or advice would be much appreciated.
Kindest Regards,
KevinIn my experience sdo_filter ALWAYS uses the spatial index, so that's not the problem. Since you did not provide the explain plans, we can't say for sure but I think yhu is right: Standard Edition can't use the bitmap operations, and thus it'll take longer to combine the results of the two queries (because the optimizer will surely split this OR up in two parts, then combine them).
BTW: when asking questions about queries here, it would be nice if you posted the queries here as well, so that we do not have to check another website in order to see what you are doing. Plus it will probably get you more answers, because not everyone can be bothered to click on that link. It would also have been nice if you had posted your own answer on the other post here as well, because my recommendation would have been to use union all - but since you already found that out for yourself my recommendation would have been a little late. -
How do I get 2 decimal places when using a formula for a quotient? It only gives me whole integers. Most of the results will be less than 1 so I need 2 decimal places
the quotient function returns only whole number portion of the dividing two numbers. If you want the actual decimal value use the divide operator. you enter this as:
A/B
if the numerator is in A1 and the denominator is in B1 you can enter the formula like this:
=A1/B1 -
When do u go for elementary test and combined test(rsrv)
hi all,
Can anyone explain me with an realtime scenario ? when do we go for elementary test in rsrv trns code and combined test.
thanxs
harihi hari,
RSRV is used for analysis and repair of all BW objects.You can perform consistency checks on the data and metadata stored in BW System.RSRV tests the foriegn key relationships between the individual tables of the enhanced starschema of the BW system
There are 2 types of tests
1.Elementary Tests- these tests are related to master data,transaction data,ODS objects,Hierarchies.database(indices,parametres,statistics),aggregates,PSA tables and documents.
2.Combined Tests-This test determines which elementary tests are performed according to the parametres entered.
Hope this helps!
partha -
How can I sum up raws? the Sum function seems to work only on columns. Right now I have to create a separate formula for each raw
Hi dah,
"Thanks, but can I do one formula for all present and future raws? as raws are being added, I have to do the sum function again and again"
You do need a separate formula for each group of values to be summed.
If the values are in columns, you need a copy of the formula for each column.
If the values are in rows, you need a copy of the formula for for each row.
If you set up your formulas as SGIII did in his example (shown below), where every non-header row has the same formula, Numbers will automtically add the formula to new rows as you add them.
"Same formula" in this context means exactly the same as all the formulas above, with one exception: the row reference in each formula is incremented (by Numbers) to match the row containing the formula.
Here the formula looks like this in the three rows shown.
B2: =SUM(2)
B3: =SUM(3)
B4: =SUM(4)
That pattern will continue as rows are added to the table.
Also, because the row token (2) references all of the non-header cells in row 2, the formula will automatically include new columns as they are added to the table.
Regards,
Barry -
BAPI or FM for Material and ChapterID Combination(J1ID Transaction)
Dear All,
I need BAPI or FM for Creation of Material and ChapterID combination. I dont need for other options present in J1ID Transaction.
I cannot use Insert statement for Material and ChapterID Creation as it contains only few fields.
Please let me know regarding this.
Regards,
AnilkumarHello
The bapi BAPI_INSPECTIONPLAN_CREATE is used for creation. There you can assign several materials through structure MATERIALTASKALLOCATION (BAPI1191_MTK_C). There is no bapi for modifications so you can assign other materials using LSMW or BDC as Gururaj told you or in this special case populate table MAPL directly (better talk to your ABAP to decide it); I did it without issues and I checked and the function CZ_VB_MAPL_POST could update the information you need (talk to your ABAP to validate it).
Best regards
Carlos Díaz -
Tables for production order number for material and Batch combination
Dear Experts,
Please suggest the table names for finding the production order for material and batch combination .
Thanks in advance for your help...
Best regards
NitishjDear
Please check in AFPO-CHARG
AFPO Order Item Detail -Batch Number -CHARG
AFFW Confirmations -- Goods Movements w
AFRD Confirmations -- Defaults for Collective Confirmation
AFRH Confirmations -- Header Info for Confirmation
Regards
JH -
Setting in BEx formula for calculation of YTD and MAT
Hi,
I have to implement 2 formulae in BEx.
As I am trying to avoide ABAP coding, can anyone please suggest SETTINGS in BEx FORMULA to achieve these below mentioned 2 formulae -
1 ) Calculate YTD - Average of the sum of the reported quarter values from the start of the year until and including the selected quarter. But, if we enter Quarter 3 and there is no data for quarter 2 then the average should be equal to sum of data for Q1 and Q2 divided by 2 instead of 3 even though user entered Q3.
2) Calculate MAT - Average of the sum of the reported quarter values for the last 4 quarters. We need to check last 4 quarters. If data is present only for 3 quarters in the last four quarters then the MAT will be data for 3 quarters divided by 3.
Please suggest BEx formulae settings, if any for the above calculations.
Thanks a lot.
Regards,
PrernaHi
I am not sure requirement related YTD is possible without customer exits variable
But regarding your 2nd requirement
Calculate MAT
Create four restricted key figures by using offset (0, -1, -2, -3) and restriction characteristic will be quarter.
Create a calculated key figure "Count of Quaerter". This will consist of "Number of rows" key figure with exception aggr on the Quarter characteristic and aggr will be "Count for all not eq to 0".
Create a calculated key figure which will be sum of four restricted key figures divided by Count of Quarter.
Kindly let me know incase further details required
Best Regards
Rohit
Maybe you are looking for
-
Firefox never opens in normal or safe mode. How do I get it to work?
Just out of nowhere Firefox crashes which is usual for me. I try to open it and nothing happens. I open Task manager to check and firefox.exe goes to 16,oookb before dissapearing and never loads. I tried Safe mode and it always crashes and crash afte
-
How to read the message body in a mail
how can we read the message body of a mail. i am using pop3 server for reading the mails. my program is public class GetMessageExample { public static void main (String args[]) throws Exception { String host = args[0]; String username = args[1]; Stri
-
hi all, i;m trying to burn a dvd with my photos, it seemed to to be working but when i open the dvd its empty. i have copied all my photos from i photo to a folder on desktop, therfore i want to burn from desktop folder to dvd, please help
-
Resolve Exception Form Takes 20 minutes
Hi, If I have an exception on an order and try to resolve in the "Shipping Transaction Form' the form turns blank for about 20 minutes and then comes back. Is there anyway to speed this process up. Thank you A/A
-
Flash prospectus - best practice?
Hello all, I'm currently pitching to put together a 110 page Flash based prospectus for a local college. The finished result will be made available online, and also via CD-ROM. The layout of the pages will be very consistent in terms of what elements