414 views

Uploaded by api-328824013

- pragmatic code 1
- acsl 16-17 contest 1 notes - recursive functions cns wdtpd 1
- Acsl Basic
- ACSL-ShortProblems
- 4 - how acsl works
- 3 - general contest procedures
- Contest1_0203
- acsl 16-17 contest 4 notes - graph theory de assembly
- rnc acsl presentation
- Shorts
- acsl 16-17 contest 3 notes - boolean data structures regex prev boolean graph theory bit string
- American Computer Science League (ACSL) Rules and Handbook
- 2 - league organization
- ACSL Computer Science Leage Contest #2
- acslprogrammingcomponentinstructions
- Process Output Types Through Program
- Syntaxes & Statements in ABAP
- 08 QA
- !!Visualization and Calculation Trainer Int - Botkinsky, Vladimir
- explcit

You are on page 1of 22

H ow

ACSL

Contest #2

Contest 2 Topics

Intermediate and Senior:

Prefix/Infix/Postfix-2

Bit String Flicking-2

LISP-1

Prefix/Infix/Postfix

There are three ways to write an expression such as

Infix is the way you usually see it: A-B/(C+D).

To evaluate a function in infix, you must use order of

operations (PEMDAS) and look at parentheses

The other two formats are Prefix and Postfix

Prefix

The operands are written before the two terms they pertain to

A-B would be written as -AB.

Once two terms get an operator, think of them as a single term and apply the next

operator to that single term and the next term in line, so

/+ABC would be translated to (A+B)/C

is used for exponents, so AB would be A^B

It might help to put parentheses after two terms that have been operated on

Ex. To solve /-AB+CD

1. Apply the operand to the following two terms and put parentheses around

two terms /(A-B)(C+D)

2. Apply the remaining operator to the simplified terms to get (A-B) / (C+D)

Postfix

Follows all same rules except operator is after the two terms it

pertains to

AB+ would equal A+B

ABC-/ would equal A / (B-C)

AB-CD/+ would equal (A-B)+(C/D)

More Practice

The best way to approach simplifying a large prefix/infix/postfix

expression is apply 1 or 2 operands at a time and then keep

working from the simplified expression

Senior Division

Bit String Flicking

Bit String - a sequence of bits (0s and 1s)

e.g. 001001

operators, shifts, and circulates

If you see an * , it means the bit can be either 0 or 1

For ACSL, all bit strings in an equation will be the same length

Bit String Flicking

The four binary operators you need to know are:

else 0

OR | if either is 1, return 1 0 1 1

else 0

except 1 and 1 returns 0

Bit String Flicking

(L or R) SHIFT - (amount)

delete the number of digits specified (amount) from the specified side (L or R)

fill the empty space on opposite side with 0s

e.g., LSHIFT-2 11111 11110 11100

e.g., RSHIFT-1 11111 01111

(L or R) CIRC - (amount)

remove elements from specified side (L or R) and add them to the other side

e.g., LCIRC-2 10101 10110

e.g., RCIRC-3 10101 10110

CIRC Observations

If length of string is L, then LCIRC-x = RCIRC-(L-x)

If x > L, then CIRC-x = CIRC-(x mod L)

Bit String Flicking

From first priority to last, the order of operations is:

NOT

SHIFT and CIRC

AND

XOR

OR

There are two types of problems:

Evaluating the expression (easier)

Solving for a variable (annoying)

Bit String Flicking

Evaluate the following expression:

Bit String Flicking

Bit String Flicking

Bit String Flicking

and solve for as many as possible. The rest can be one of two

values, so we can just do 2 ^ the number of those.

LISP

A computer language which stands for LISt Processing Language

The basis of LISP is a list in which elements are enumerated

inside pairs of parentheses

(23 (this is easy) hello 821)

This is an example of a list with four elements and the second element is a list

There are many different statements (functions) to evaluate the

elements

LISP-Arithmetic Statements

LISP-Statements

SET sets the first argument to the second argument , like setting a variable to a value

If the second argument has an before, it is not evaluated (similar to putting quotes)

SETQ is same as SET except you dont need before first argument

LISP-Statements

ATOM checks if argument is an atom

If atom, return true

If list, return NIL

LISP-Statements

CDR returns the list without the first element

CONS adds the first element as the first term of the second elements list

LISP-DEF Statements

LISP also allows us to create our own functions using the DEF function. For example,

defines a new function called SECOND which operates on a single parameter named parms. SECOND will take

the CDR of the parameter and then the CAR of that result. So, for example:

(SECOND (a b c d e))

would first CDR the list (yielding (b c d e)) and then CAR the result. So the value would be the single character b.

LISP Practice

- pragmatic code 1Uploaded byapi-328824013
- acsl 16-17 contest 1 notes - recursive functions cns wdtpd 1Uploaded byapi-328824013
- Acsl BasicUploaded byavoidreading
- ACSL-ShortProblemsUploaded byaurona
- 4 - how acsl worksUploaded byapi-328824013
- 3 - general contest proceduresUploaded byapi-328824013
- Contest1_0203Uploaded byKyle Thompson
- acsl 16-17 contest 4 notes - graph theory de assemblyUploaded byapi-328824013
- rnc acsl presentationUploaded byapi-328824013
- ShortsUploaded bykepler1729
- acsl 16-17 contest 3 notes - boolean data structures regex prev boolean graph theory bit stringUploaded byapi-328824013
- American Computer Science League (ACSL) Rules and HandbookUploaded bybellataco
- 2 - league organizationUploaded byapi-328824013
- ACSL Computer Science Leage Contest #2Uploaded byJoanne Brown
- acslprogrammingcomponentinstructionsUploaded byapi-328824013
- Process Output Types Through ProgramUploaded byKarunGaur
- Syntaxes & Statements in ABAPUploaded byAbid Sheik
- 08 QAUploaded byCorey Scott
- !!Visualization and Calculation Trainer Int - Botkinsky, VladimirUploaded byeviludion
- explcitUploaded bySurya Reddy Lakshminarasimha
- h2o PackageUploaded bysai
- ProductForm.txtUploaded byshanu_agarwal89
- The Ring programming language version 1.5.1 book - Part 21 of 180Uploaded byMahmoud Samir Fayed
- The State of the DSL Art in RubyUploaded byBest Tech Videos
- Puzzle Interview QuestionsUploaded byBharath Desareddy
- c++questons niitUploaded byPeter
- Communicationlibrary.pdfUploaded bycrasyfrog
- report ipsig dc plmUploaded byapi-253050570
- zimplUploaded bywashere
- Sim u Link TutorialUploaded byJeff Robert

- general interest meeting 1718Uploaded byapi-328824013
- acsl 16-17 contest 4 notes - graph theory de assemblyUploaded byapi-328824013
- basic pythonUploaded byapi-328824013
- acsl 16-17 contest 3 notes - boolean data structures regex prev boolean graph theory bit stringUploaded byapi-328824013
- 3 - general contest proceduresUploaded byapi-328824013
- rnc acsl presentationUploaded byapi-328824013
- robotics coding clubUploaded byapi-328824013
- 2 - league organizationUploaded byapi-328824013
- acslprogrammingcomponentinstructionsUploaded byapi-328824013

- Christopher MacLeod An Introduction to Practical Neural Networks and Genetic Algorithms For Engineers and Scientists .pdfUploaded byayhanhameed
- lorenz_arduino.docxUploaded byYuliyanto Nugroho
- Aerohive Deployment Guide.pdfUploaded byaruninba
- Harrods ManualUploaded byDaniel Cabecera Garcia
- Fractions Pemdas Twosteps Positive AllUploaded bypepsico123
- CS F407 Course HandoutUploaded bynjanugani
- Development of Material Management System_Anton SaukkonenUploaded byGyogi Mitsuta
- Cc CheckerUploaded byMvpz Egå-MǚĦåmmãd
- IP DATABASE MANAGEMENT SYSTEMUploaded byMohammadAnees
- P54x TGUploaded byhudson
- Creo Parametric Basic Turning - Jouni AholaUploaded byMuhammed Usman
- bsformf2018.pdfUploaded byAhmed Shameel
- bestpracticesforbuilding-networkoperationscenter-161224160357Uploaded byRahul
- Arc Swat User GuideUploaded byJohn E Cutipa L
- Ewa Content Red AlertsUploaded bybijue
- Transmission Line ParametersUploaded byMohd Taufiq Ishak
- Bulletin - January 15, 2012Uploaded bypprancke
- User Needs and AnalysisUploaded byBrian Shim
- JavaScript programing statementsUploaded byMinnu Merin Abraham
- Generation Z consumers' expectations of interactions in smart retailing: A future agendaUploaded byAncuta Feier
- ec2-ugUploaded byAmit Kumar Sinsinwar
- BC DR QuestionnaireUploaded bykenng2086
- 96-5000 English TailstockUploaded bymanish
- how to make a specific text on TextView BOLD - Stack Overflow.pdfUploaded byShoaib Quraishi
- Detecting Malicious Social Networks Applications using FRAppEUploaded byIRJET Journal
- Haldex AbsUploaded bytest1234
- 2 Noise in amplifierUploaded byMuraleetharan Boopathi
- Filter Design SoftwareUploaded byTapas Sarkar
- Dtp34 Densitometer UGUploaded byondemandprint
- Getting StartedUploaded byhoseini_aut9859