Homework

Homework Questions? Ask a Tutor for Answers ASAP

Ask an Expert,
Get an Answer ASAP!

Homework
This answer was rated:

HELP Please! Need Pseudo code for array comparison in Python

Attachment: 2013-05-02_122655_pseudo_code_for_later_implementation_in_python.docx I have a list...

Attachment: 2013-05-02_122655_pseudo_code_for_later_implementation_in_python.docx

I have a list of data (array) from an experiment:


v1 = 23, -1, -3, ..., n


v2 = 12, 0, -26, ..., n


- - -


vn = -1, -1, 1, ..., n


 


and


 


p1 = 3, -11, 3, ..., n


p2 = 1, 0, 6, ..., n


- - -


pn = -1, 1, 1, ..., n


 


Have to normalize all values to 0 and 1 first:


if value is<=0 make value=0; if value>0 make value=1


 


After normalize, compare using Boolean logic, the vn lists with the pn list.


pn ALWAYS as result of vn boolean interactions, returning true or false as ouput.


I have to compare the whole list... not element by element...


Have to use only these booleans == (equal to), != (not equal to), and 'and'.


Final results should be something like:


v1 = pn; v2 is not pn; vn and v2 and ... = pn


 


Optional Information:
Language (or Software): Python
Browser (if necessary): Safari


 


Already did:



  1. # XXXXX data in array (list) format where vnj contains gene expression from DNA microarray for a vn gene at time j (t input), and pnj contains gene expression from DNA microarray for a vn gene at time j (t+1 output)

  2. Use variables: v1, v2, v3, ..., vn, p1, p2, p3, ..., pn

  3. # XXXXX normalization to an integer in binary format (0, 1).

  4. # XXXXX is the number of columns/genes (i), and k is the maximum number of rows (j).

  5. for i=1 to n

  6. for j=0 to k

  7. if vij<=0 then vij=0 otherwise make vij=1

  8. if pij<=0 then pij=0 otherwise make pij=1

  9. done


13. done


14.


15. # XXXXX Boolean logic compare all elements in vn with all elements in pn. Return vn "inhibits" or "activates" pn.


16.


17. for i=1 to n


18. for j=1 to n


19. if vi==pj then print vi,' activates ',pj


20. if vi!=pj then print vi,' inhibits ',pj


21. *** MISSING "AND" COMPARISON ***


22.


23. done


24. done

Show More
Show Less
Ask Your Own Homework Question
Answered in 14 hours by:
5/2/2013
Josie-Mod
Category: Homework
Satisfied Customers: 5
Verified
Hi, I'm a Moderator for this topic. I've been working hard to find a professional to assist you right away, but sometimes finding the right professional can take a little longer than expected.


I wonder whether you're ok with continuing to wait for an answer. If you are, please let me know and I will continue my search. If not, please let me know and I will cancel this question for you. Thank you!
Ask Your Own Homework Question
Customer reply replied 4 years ago
Thanks, XXXXX XXXXX wait.
It doesn't need be someone super expert... I just would like to have someone with python experience to give me some inputs.
I have no rush to have it finished.
Thanks
Thank you for your continued patience. We will continue the search for a professional for you.
Ask Your Own Homework Question
R.R. Jha
R.R. Jha, Tutor
Category: Homework
Satisfied Customers: 5,471
Experience: B.Tech
Verified
Hi,

I'd be glad to help with your question. Could you please explain with example, how should the AND comparison be? Are you ANDing all vi's and checking if it's equal to pj?
Ask Your Own Homework Question
Customer reply replied 4 years ago

Thank you RRJha,


I need is the relationship of pj (the output) from vi (the input)...


I am attaching a table to see it can be more explanatory...


I did some extra work too...


If you could have a look, it would be very helpful.


No rush...


 

Customer reply replied 4 years ago

I am trying to attach the table, but it gives me error...


 


Below it is what I did so far:


 



  1. start


  2. # XXXXX data in array (list) format where vnj contains gene expression from DNA microarray for a vn gene at time j (t input), and pnj contains gene expression from DNA microarray for a vn gene at time j (t+1 output)


  3. Use variables: v1, v2, v3, ..., vn, p1, p2, p3, ..., pn


  4. # XXXXX normalization to an integer in binary format (0, 1).

  5. # XXXXX is the number of columns/genes (i), and k is the maximum number of rows (j).


  6. for i=1 to n

  7. for j=0 to k

  8. if vij<=0 then vij=0 otherwise make vij=1

  9. if pij<=0 then pij=0 otherwise make pij=1

  10. done

  11. done


  12. # XXXXX Boolean logic to compare all vn lists with all pn lists. Return vn "inhibits" or "activates" pn.


  13. for i=1 to n

  14. for j=1 to n

  15. if vi==pj then print vi,' activates ',pj

  16. if vi!=pj then print vi,' inhibits ',pj

  17. done

  18. done


  19. for all vn, if (vn and vn) == pn print vn,' and ', vn,' activates ',pn

  20. for all vn, if (vn and vn) != pn print vn,' and ', vn,' inhibits ',pn


  21. end

Customer reply replied 4 years ago

The number of pns are equal to the number of vns.


You can think vns as v1(t), v2(t),..., vn(t)


and pns as v1(t+1), v2(t+1),...,vn(t+1)


 


Relationship Boolean:


 


NOT (pn is not true for vn):


v p


1 0


0 1


 


AND (example: vn and vn are true for pn)


vn vn pn


1 1 1


1 0 0


0 1 0


0 0 0


 


Let me know if you need more information.


 


Thanks again

Could you please clarify more about the AND relationship you're looking for? I know how AND works, but not sure what combination are you looking for. Do you want to check each pi against all possible ANDing combination of vi's?
Because == and != logic would compare only one vi against one pi, but AND can take multiple combination of vi's and compare it with one pi.

For example, checking

v1 AND v2 == p1
v1 AND v2 AND v3 == p1
v2 AND v5 == p2
v3 AND v5 AND v7 == p3

So, what AND combination are you looking to compare with a pi? I hope I'm making it clear what my question is.

Thanks
Ask Your Own Homework Question
Customer reply replied 4 years ago

Yes, you are right.


All combinations possibles for v... I got stuck on there...


 

Ok, I'll give it a try and let you know.
Ask Your Own Homework Question
Customer reply replied 4 years ago

Thanks for your help.

You're welcome
Ask Your Own Homework Question
THIS ANSWER IS LOCKED!
You can view this answer by clicking here to Register or Login and paying $3.
If you've already paid for this answer, simply Login.
R.R. Jha
R.R. Jha, Tutor
Category: Homework
Satisfied Customers: 5,471
Experience: B.Tech
Verified
R.R. Jha and 87 other Homework Specialists are ready to help you
Ask your own question now
Customer reply replied 4 years ago
Thank you!

Your work looks great. I will be implementing the python code during the fall semester. For sure I will need your help.

Thanks again.
Ask R.R. Jha Your Own Question
R.R. Jha
R.R. Jha
R.R. Jha, Tutor
Category: Homework
Satisfied Customers: 5,471
5,471 Satisfied Customers
Experience: B.Tech

R.R. Jha is online now

A new question is answered every 9 seconds

How JustAnswer works:

  • Ask an ExpertExperts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional AnswerVia email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction GuaranteeRate the answer you receive.

JustAnswer in the News:

Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.

What Customers are Saying:

Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help.

Mary C.Freshfield, Liverpool, UK

This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!!

AlexLos Angeles, CA

Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult.

GPHesperia, CA

I couldn't be more satisfied! This is the site I will always come to when I need a second opinion.

JustinKernersville, NC

Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around.

EstherWoodstock, NY

Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know.

RobinElkton, Maryland

He answered my question promptly and gave me accurate, detailed information. If all of your experts are half as good, you have a great thing going here.

DianeDallas, TX

< Previous | Next >

Meet the Experts:

LogicPro

LogicPro

Engineer

5,672 satisfied customers

Expert in Java C++ C C# VB Javascript Design SQL HTML

Manal Elkhoshkhany

Manal Elkhoshkhany

Tutor

4,549 satisfied customers

More than 5000 online tutoring sessions.

Linda_us

Linda_us

Finance, Accounts & Homework Tutor

3,138 satisfied customers

Post Graduate Diploma in Management (MBA)

Chris M.

Chris M.

M.S.W. Social Work

2,635 satisfied customers

Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)

F. Naz

F. Naz

Chartered Accountant

2,158 satisfied customers

Experience with chartered accountancy

Bizhelp

Bizhelp

CPA

1,887 satisfied customers

Bachelors Degree and CPA with Accounting work experience

Seanna

Seanna

Tutor

1,781 satisfied customers

3,000+ satisfied customers, all topics, A+ work

< Previous | Next >

Related Homework Questions
FOR Discussion Question 1 • Due Date: Day 2 [post to the
FOR ANGELA Discussion Question 1 • Due Date: Day 2 [post to the Main forum] • Post your response to this question: Consider the statement “psychology has a long past but a short history.” What do you … read more
Seanna
Seanna
Tutor
1,781 satisfied customers
When I open a word document it has a character string 20 and
When I open a word document it has a character string 20 and places that character after I type each line. This is just a recent problem and. How can have work not insert that character?… read more
F. Naz
F. Naz
Chartered Accountant
CA Finalist & Completed B.com
2,158 satisfied customers
I need help regarding javascript with custom objects and
I need help regarding javascript with custom objects and constructors. I am having trouble calling an onclick function in a form to an array.… read more
LogicPro
LogicPro
Engineer
Bachelor of Technology
5,672 satisfied customers
Fiscal restraint is defined as: a. Tax hikes or spending
Fiscal restraint is defined as: a. Tax hikes or spending cuts intended to reduce aggregate demand. b. Tax hikes or spending cuts intended to increase aggregate demand. c. Tax cuts or spending hikes in… read more
Chris M.
Chris M.
M.S.W. Social Work
Master's Degree
2,635 satisfied customers
Explain the types purpose and function of materials and
Explain the types purpose and function of materials and equipment needed for the administration of medication via the different routes … read more
Dr. Donna Kakonge
Dr. Donna Kakonge
Doctor of Education
189 satisfied customers
The Use case diagram for a tracking system using clusters of
The Use case diagram for a tracking system using clusters of sensors. I am now in phase 3 and I did all the documentation but I need to deeply understand the logic behind the IoT to proceed correctly … read more
Dr. Donna Kakonge
Dr. Donna Kakonge
Doctor of Education
189 satisfied customers
I have a couple of basic java questions i need answered.
I have a couple of basic java questions i need answered … read more
LogicPro
LogicPro
Engineer
Bachelor of Technology
5,672 satisfied customers
This week you'll be making the following refinements to the
This week you'll be making the following refinements to the class that you wrote in the last assignment. All the requirements from that class are still in force. For example, all MyStrings must always… read more
LogicPro
LogicPro
Engineer
Bachelor of Technology
5,672 satisfied customers
I asked a question and will pay but the site asks me to
hi i asked a question and will pay but the site asks me to verify an ammount below 200 usd which i want to but it does not give me the option to do so, please help… read more
GLENN
GLENN
Master of Mathematics
330 satisfied customers
Which if the following is not included unpaid-in capital?
which if the following is not included unpaid-in capital? common stock pain-in capital-donations stock dividend distributable appropriation per loan agreement … read more
F. Naz
F. Naz
Chartered Accountant
CA Finalist & Completed B.com
2,158 satisfied customers
A rifle with a longer barrel can fire bullets with a larger
A rifle with a longer barrel can fire bullets with a larger velocity than a rifle with a shorter barrel. A. Explain this using the impulse momentum theorem B. Explain this using the work energy theore… read more
GLENN
GLENN
Master of Mathematics
330 satisfied customers
On Excel contour map want to: 1) rotate series 180 degrees
On Excel contour map want to: 1) rotate series 180 degrees but not category 2) edit series name for all 3) edit legend 4) fill in colour boxes 5) change colour boxes to meet colorirmetric convention.… read more
Dr. Donna Kakonge
Dr. Donna Kakonge
Doctor of Education
189 satisfied customers
This question is just for Dr. Kakonge. This purpose is to
Hello. This question is just for Dr. Donna Kakonge.This purpose is to pay the payment to Dr. Donna Kakonge on 06/16/2017 again because of something wrong about payment on 06/16/2017.The question on 06… read more
Dr. Donna Kakonge
Dr. Donna Kakonge
Doctor of Education
189 satisfied customers
I need to get an answer of the case Conveyor Belt Project.
I need to get an answer of the case Conveyor Belt Project … read more
Dr. Donna Kakonge
Dr. Donna Kakonge
Doctor of Education
189 satisfied customers
Where is the status bar? Im so sorry to be in a rush but if
where is the status bar? Im so sorry to be in a rush but if i fail my exam i have to redo my year … read more
The-PC-Guy
The-PC-Guy
Bachelor\u0027s Degree
628 satisfied customers
A recent survey found that 73% of all adults over 50 wear
A recent survey found that 73% of all adults over 50 wear sunglasses for driving. In a random sample of 20 adults over 50, what is the mean and standard deviation of those that wear sunglasses?… read more
Dr. Donna Kakonge
Dr. Donna Kakonge
Doctor of Education
189 satisfied customers
Is anyone familiar with Excel??? The link below will take
Is anyone familiar with Excel??? The link below will take you to my question. It is due 02/14/10 Sunday night , but the sooner the better. You will see "1: Five-Year Sales Projections" that is what I … read more
Stephen, MBA
Stephen, MBA
Master's Degree
166 satisfied customers
160 Word min.: Consider the internal control process
160 Word min.: Consider the internal control process required by the Sarbanes-Oxley Act. Do you think the expenses of implementing better internal controls are offset by the benefits of having the con… read more
Jane T(LLC)
Jane T(LLC)
Master's Degree
18 satisfied customers
Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Show MoreShow Less

Ask Your Question

x